Syscall messaging 4: Further expand the kernel-version of the syscall message.
[dragonfly.git] / sys / sys / sysmsg.h
1 /*
2  * SYS/SYSMSG.H
3  *
4  * $DragonFly: src/sys/sys/sysmsg.h,v 1.2 2003/08/12 02:36:15 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>
14 #endif
15
16 /*
17  * The sysmsg holds the kernelland version of a system call.
18  * It typically preceeds the usrmsg and syscall arguments in sysunion
19  * (see sys/sysunion.h)
20  */
21 union sysmsg {
22         struct lwkt_msg lmsg;
23         struct sysmsg_sleep {
24             struct lwkt_msg lmsg;
25             struct timespec rmt;
26             struct timespec rqt;
27             struct callout  timer;
28         } sm_sleep;
29 };
30
31 #endif
32
33 /*
34  * The usrmsg holds the userland version of the system call message which
35  * typically preceeds the original user arguments.  This message structure
36  * is typically loaded by the copyin() and adjusted prior to copyout(), but
37  * not used in the nominal running of the system call.
38  */
39 union usrmsg {
40         struct lwkt_msg umsg;
41 };
42
43 #ifdef _KERNEL
44 typedef union sysmsg *sysmsg_t;
45 #define sysmsg_result   sysmsg.lmsg.u.ms_result
46 #define sysmsg_lresult  sysmsg.lmsg.u.ms_lresult
47 #define sysmsg_resultp  sysmsg.lmsg.u.ms_resultp
48 #define sysmsg_fds      sysmsg.lmsg.u.ms_fds
49 #define sysmsg_offset   sysmsg.lmsg.u.ms_offset
50 #define sysmsg_result32 sysmsg.lmsg.u.ms_result32
51 #define sysmsg_result64 sysmsg.lmsg.u.ms_result64
52 #endif
53
54 typedef union usrmsg *usrmsg_t;
55 #define usrmsg_result   usrmsg.umsg.u.ms_result
56 #define usrmsg_lresult  usrmsg.umsg.u.ms_lresult
57 #define usrmsg_resultp  usrmsg.umsg.u.ms_resultp
58 #define usrmsg_fds      usrmsg.umsg.u.ms_fds
59 #define usrmsg_offset   usrmsg.umsg.u.ms_offset
60 #define usrmsg_result32 usrmsg.umsg.u.ms_result32
61 #define usrmsg_result64 usrmsg.umsg.u.ms_result64
62
63 #endif
64