Add buffer bounds checking during check pointing since it is possible for
[dragonfly.git] / sys / sys / sysmsg.h
1 /*
2  * SYS/SYSMSG.H
3  *
4  * $DragonFly: src/sys/sys/sysmsg.h,v 1.3 2003/08/12 04:58:23 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 sysmsg {
25         struct lwkt_msg lmsg;
26         struct sysmsg_sleep {
27             struct lwkt_msg lmsg;
28             struct timespec rmt;
29             struct timespec rqt;
30             struct callout  timer;
31         } sm_sleep;
32 };
33
34 #endif
35
36 /*
37  * The usrmsg holds the userland version of the system call message which
38  * typically preceeds the original user arguments.  This message structure
39  * is typically loaded by the copyin() and adjusted prior to copyout(), but
40  * not used in the nominal running of the system call.
41  */
42 union usrmsg {
43         struct lwkt_msg umsg;
44 };
45
46 #ifdef _KERNEL
47 typedef union sysmsg *sysmsg_t;
48 #define sysmsg_result   sysmsg.lmsg.u.ms_result
49 #define sysmsg_lresult  sysmsg.lmsg.u.ms_lresult
50 #define sysmsg_resultp  sysmsg.lmsg.u.ms_resultp
51 #define sysmsg_fds      sysmsg.lmsg.u.ms_fds
52 #define sysmsg_offset   sysmsg.lmsg.u.ms_offset
53 #define sysmsg_result32 sysmsg.lmsg.u.ms_result32
54 #define sysmsg_result64 sysmsg.lmsg.u.ms_result64
55 #endif
56
57 typedef union usrmsg *usrmsg_t;
58 #define usrmsg_result   usrmsg.umsg.u.ms_result
59 #define usrmsg_lresult  usrmsg.umsg.u.ms_lresult
60 #define usrmsg_resultp  usrmsg.umsg.u.ms_resultp
61 #define usrmsg_fds      usrmsg.umsg.u.ms_fds
62 #define usrmsg_offset   usrmsg.umsg.u.ms_offset
63 #define usrmsg_result32 usrmsg.umsg.u.ms_result32
64 #define usrmsg_result64 usrmsg.umsg.u.ms_result64
65
66 #endif
67