xref: /minix3/minix/include/minix/ipcconst.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 #ifndef _IPC_CONST_H
2 #define _IPC_CONST_H
3 
4 #include <machine/ipcconst.h>
5 
6  /* System call numbers that are passed when trapping to the kernel. */
7 #define SEND		   1	/* blocking send */
8 #define RECEIVE		   2	/* blocking receive */
9 #define SENDREC	 	   3  	/* SEND + RECEIVE */
10 #define NOTIFY		   4	/* asynchronous notify */
11 #define SENDNB             5    /* nonblocking send */
12 #define MINIX_KERNINFO     6    /* request kernel info structure */
13 #define SENDA		   16	/* asynchronous send */
14 #define IPCNO_HIGHEST	SENDA
15 /* Check that the message payload type doesn't grow past the maximum IPC payload size.
16  * This is a compile time check. */
17 #define _ASSERT_MSG_SIZE(msg_type) \
18     typedef int _ASSERT_##msg_type[/* CONSTCOND */sizeof(msg_type) == 56 ? 1 : -1]
19 
20 /* Macros for IPC status code manipulation. */
21 #define IPC_STATUS_CALL_SHIFT	0
22 #define IPC_STATUS_CALL_MASK	0x3F
23 #define IPC_STATUS_CALL(status)	\
24 	(((status) >> IPC_STATUS_CALL_SHIFT) & IPC_STATUS_CALL_MASK)
25 #define IPC_STATUS_CALL_TO(call) \
26 	(((call) & IPC_STATUS_CALL_MASK) << IPC_STATUS_CALL_SHIFT)
27 
28 #define IPC_FLG_MSG_FROM_KERNEL	1 /* this message originated in the kernel on
29 				     behalf of a process, this is a trusted
30 				     message, never reply to the sender
31 				 */
32 #define IPC_STATUS_FLAGS_SHIFT	16
33 #define IPC_STATUS_FLAGS(flgs)	((flgs) << IPC_STATUS_FLAGS_SHIFT)
34 #define IPC_STATUS_FLAGS_TEST(status, flgs)	\
35 		(((status) >> IPC_STATUS_FLAGS_SHIFT) & (flgs))
36 #endif /* IPC_CONST_H */
37