xref: /dragonfly/sys/sys/sysmsg.h (revision 1ab20d67)
1 /*
2  * SYS/SYSMSG.H
3  *
4  * $DragonFly: src/sys/sys/sysmsg.h,v 1.4 2003/11/20 06:05:31 dillon Exp $
5  */
6 
7 #ifndef _SYS_SYSMSG_H_
8 #define _SYS_SYSMSG_H_
9 
10 #ifdef _KERNEL
11 
12 #ifndef _SYS_CALLOUT_H_
13 #include <sys/callout.h>	/* for struct callout */
14 #endif
15 #ifndef _SYS_TIME_H_
16 #include <sys/time.h>		/* for struct timespec */
17 #endif
18 
19 /*
20  * The sysmsg holds the kernelland version of a system call.
21  * It typically preceeds the usrmsg and syscall arguments in sysunion
22  * (see sys/sysunion.h)
23  */
24 union sysunion;
25 
26 struct sysmsg {
27 	struct lwkt_msg	lmsg;
28 	void 		(*copyout)(union sysunion *sysun);
29 	union {
30 	    struct sysmsg_sleep {
31 		struct lwkt_msg lmsg;
32 		struct timespec rmt;
33 		struct timespec rqt;
34 		struct callout  timer;
35 	    } sleep;
36 	} sm;
37 };
38 
39 #endif
40 
41 /*
42  * The usrmsg holds the userland version of the system call message which
43  * typically preceeds the original user arguments.  This message structure
44  * is typically loaded by the copyin() and adjusted prior to copyout(), but
45  * not used in the nominal running of the system call.
46  */
47 union usrmsg {
48 	struct lwkt_msg umsg;
49 };
50 
51 #ifdef _KERNEL
52 typedef struct sysmsg *sysmsg_t;
53 #define sysmsg_copyout	sysmsg.copyout
54 #define sysmsg_lmsg	sysmsg.lmsg
55 #define sysmsg_result	sysmsg.lmsg.u.ms_result
56 #define sysmsg_lresult	sysmsg.lmsg.u.ms_lresult
57 #define sysmsg_resultp	sysmsg.lmsg.u.ms_resultp
58 #define sysmsg_fds	sysmsg.lmsg.u.ms_fds
59 #define sysmsg_offset	sysmsg.lmsg.u.ms_offset
60 #define sysmsg_result32	sysmsg.lmsg.u.ms_result32
61 #define sysmsg_result64	sysmsg.lmsg.u.ms_result64
62 #endif
63 
64 typedef union usrmsg *usrmsg_t;
65 #define usrmsg_result	usrmsg.umsg.u.ms_result
66 #define usrmsg_lresult	usrmsg.umsg.u.ms_lresult
67 #define usrmsg_resultp	usrmsg.umsg.u.ms_resultp
68 #define usrmsg_fds	usrmsg.umsg.u.ms_fds
69 #define usrmsg_offset	usrmsg.umsg.u.ms_offset
70 #define usrmsg_result32	usrmsg.umsg.u.ms_result32
71 #define usrmsg_result64	usrmsg.umsg.u.ms_result64
72 
73 #endif
74 
75