xref: /haiku/headers/private/file_systems/ram_disk/ram_disk.h (revision 25a83d13b95b7ef244ecff48dc1b0e027dcad340)
1 /*
2  * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _PRIVATE_FILE_SYSTEMS_RAM_DISK_RAM_DISK_H
6 #define _PRIVATE_FILE_SYSTEMS_RAM_DISK_RAM_DISK_H
7 
8 
9 #include <Drivers.h>
10 #include <StorageDefs.h>
11 
12 
13 #define RAM_DISK_CONTROL_DEVICE_NAME	"disk/virtual/ram/control"
14 #define RAM_DISK_RAW_DEVICE_BASE_NAME	"disk/virtual/ram"
15 
16 
17 enum {
18 	RAM_DISK_IOCTL_REGISTER		= B_DEVICE_OP_CODES_END + 1,
19 	RAM_DISK_IOCTL_UNREGISTER,
20 	RAM_DISK_IOCTL_FLUSH,
21 	RAM_DISK_IOCTL_INFO
22 };
23 
24 
25 struct ram_disk_ioctl_register {
26 	uint64	size;
27 	char	path[B_PATH_NAME_LENGTH];
28 
29 	// return value
30 	int32	id;
31 };
32 
33 
34 struct ram_disk_ioctl_unregister {
35 	int32	id;
36 };
37 
38 
39 struct ram_disk_ioctl_info {
40 	// return values
41 	int32	id;
42 	uint64	size;
43 	char	path[B_PATH_NAME_LENGTH];
44 };
45 
46 
47 #endif	// _PRIVATE_FILE_SYSTEMS_RAM_DISK_RAM_DISK_H
48