xref: /minix/minix/include/minix/driver.h (revision 7f5f010b)
1 #ifndef _MINIX_DRIVER_H
2 #define _MINIX_DRIVER_H
3 
4 /* Types and constants shared between block and character drivers. */
5 
6 #define _POSIX_SOURCE	1	/* tell headers to include POSIX stuff */
7 #define _NETBSD_SOURCE	1	/* tell headers to include MINIX stuff */
8 #define _SYSTEM		1	/* get negative error number in <errno.h> */
9 
10 /* The following are so basic, all the *.c files get them automatically. */
11 #include <minix/config.h>	/* MUST be first */
12 #include <minix/type.h>
13 #include <minix/ipc.h>
14 #include <minix/com.h>
15 #include <minix/callnr.h>
16 #include <sys/types.h>
17 #include <minix/const.h>
18 #include <minix/syslib.h>
19 #include <minix/sysutil.h>
20 #include <minix/endpoint.h>
21 #include <string.h>
22 #include <limits.h>
23 #include <stddef.h>
24 #include <errno.h>
25 #include <sys/param.h>
26 #include <minix/u64.h>
27 #include <minix/partition.h>
28 
29 /* Base and size of a partition in bytes. */
30 struct device {
31 	u64_t dv_base;
32 	u64_t dv_size;
33 };
34 
35 /* Generic receive function for all drivers. */
36 #ifndef driver_receive
37 #define driver_receive sef_receive_status
38 #endif
39 
40 /* Maximum supported number of concurrently opened minor devices. */
41 #define MAX_NR_OPEN_DEVICES 256
42 
43 #endif /* _MINIX_DRIVER_H */
44