Clean up more #include files. Create an internal __boolean_t so two or
[dragonfly.git] / sys / sys / sysmsg.h
CommitLineData
c7114eea
MD
1/*
2 * SYS/SYSMSG.H
3 *
03d6a592 4 * $DragonFly: src/sys/sys/sysmsg.h,v 1.9 2006/05/21 03:43:47 dillon Exp $
c7114eea
MD
5 */
6
7#ifndef _SYS_SYSMSG_H_
8#define _SYS_SYSMSG_H_
9
1bd40720
MD
10#ifndef _SYS_MSGPORT_H_
11#include <sys/msgport.h>
12#endif
03d6a592
MD
13
14#ifdef _KERNEL
15
c7114eea 16#ifndef _SYS_CALLOUT_H_
a75a2a96
MD
17#include <sys/callout.h> /* for struct callout */
18#endif
19#ifndef _SYS_TIME_H_
20#include <sys/time.h> /* for struct timespec */
c7114eea
MD
21#endif
22
23/*
245e4f17
MD
24 * The sysmsg holds the kernelland version of a system call.
25 * It typically preceeds the usrmsg and syscall arguments in sysunion
1fa2b4b4
MD
26 * (see sys/sysunion.h). Note that msgq field is used by the governing
27 * process to record a system call that returns EASYNC in order to be able
28 * to properly abort and/or wait on it in exit1(). This is different from
29 * any localized queueing of the LWKT message that the syscall itself might
30 * do.
c7114eea 31 */
df2244e3
MD
32union sysunion;
33
34struct sysmsg {
245e4f17 35 struct lwkt_msg lmsg;
df2244e3 36 void (*copyout)(union sysunion *sysun);
1fa2b4b4 37 TAILQ_ENTRY(sysmsg) msgq;
df2244e3
MD
38 union {
39 struct sysmsg_sleep {
40 struct lwkt_msg lmsg;
41 struct timespec rmt;
42 struct timespec rqt;
43 struct callout timer;
44 } sleep;
45 } sm;
c7114eea
MD
46};
47
81eea9f4 48struct lwp;
7062f5b4 49union sysunion;
1fa2b4b4 50
81eea9f4
SS
51struct sysmsg *sysmsg_wait(struct lwp *lp, struct sysmsg *sysmsg, int nonblock);
52void sysmsg_rundown(struct lwp *lp, int doabort);
1fa2b4b4 53
245e4f17
MD
54#endif
55
56/*
57 * The usrmsg holds the userland version of the system call message which
58 * typically preceeds the original user arguments. This message structure
59 * is typically loaded by the copyin() and adjusted prior to copyout(), but
60 * not used in the nominal running of the system call.
61 */
62union usrmsg {
63 struct lwkt_msg umsg;
64};
c7114eea 65
245e4f17 66#ifdef _KERNEL
df2244e3
MD
67typedef struct sysmsg *sysmsg_t;
68#define sysmsg_copyout sysmsg.copyout
69#define sysmsg_lmsg sysmsg.lmsg
245e4f17
MD
70#define sysmsg_result sysmsg.lmsg.u.ms_result
71#define sysmsg_lresult sysmsg.lmsg.u.ms_lresult
72#define sysmsg_resultp sysmsg.lmsg.u.ms_resultp
73#define sysmsg_fds sysmsg.lmsg.u.ms_fds
74#define sysmsg_offset sysmsg.lmsg.u.ms_offset
75#define sysmsg_result32 sysmsg.lmsg.u.ms_result32
76#define sysmsg_result64 sysmsg.lmsg.u.ms_result64
77#endif
78
79typedef union usrmsg *usrmsg_t;
80#define usrmsg_result usrmsg.umsg.u.ms_result
81#define usrmsg_lresult usrmsg.umsg.u.ms_lresult
82#define usrmsg_resultp usrmsg.umsg.u.ms_resultp
83#define usrmsg_fds usrmsg.umsg.u.ms_fds
84#define usrmsg_offset usrmsg.umsg.u.ms_offset
85#define usrmsg_result32 usrmsg.umsg.u.ms_result32
86#define usrmsg_result64 usrmsg.umsg.u.ms_result64
c7114eea
MD
87
88#endif
89