AMD64 - Refactor uio_resid and size_t assumptions.
[dragonfly.git] / sys / sys / sysmsg.h
CommitLineData
c7114eea
MD
1/*
2 * SYS/SYSMSG.H
3 *
a1293322 4 * $DragonFly: src/sys/sys/sysmsg.h,v 1.12 2008/08/25 23:35:47 dillon Exp $
c7114eea
MD
5 */
6
7#ifndef _SYS_SYSMSG_H_
8#define _SYS_SYSMSG_H_
9
03d6a592
MD
10#ifdef _KERNEL
11
f9a13fc4
MD
12#ifndef _SYS_TYPES_H_
13#include <sys/types.h>
c7114eea
MD
14#endif
15
16/*
f9a13fc4
MD
17 * The sysmsg holds the kernelland version of a system call's arguments
18 * and return value. It typically preceeds the syscall arguments in sysunion
19 * (see sys/sysunion.h).
a1293322
MD
20 *
21 * WARNING: fds must be long so it translates to two 64 bit registers
22 * on 64 bit architectures.
c7114eea 23 */
df2244e3
MD
24union sysunion;
25
26struct sysmsg {
df2244e3 27 union {
e54488bb
MD
28 void *resultp; /* misc pointer data or result */
29 int result; /* DEPRECATED - AUDIT -> iresult */
30 int iresult; /* standard 'int'eger result */
31 long lresult; /* long result */
32 size_t szresult; /* size_t result */
33 long fds[2]; /* double result */
34 __int32_t result32; /* 32 bit result */
35 __int64_t result64; /* 64 bit result */
36 __off_t offset; /* off_t result */
a385a915 37 register_t reg;
f9a13fc4 38 } sm_result;
4a22e893
MD
39 struct trapframe *sm_frame; /* trapframe - saved user context */
40 void *sm_unused;
c7114eea
MD
41};
42
81eea9f4 43struct lwp;
7062f5b4 44union sysunion;
1fa2b4b4 45
245e4f17
MD
46#endif
47
245e4f17 48#ifdef _KERNEL
f9a13fc4 49#define sysmsg_result sysmsg.sm_result.result
e54488bb 50#define sysmsg_iresult sysmsg.sm_result.iresult
f9a13fc4 51#define sysmsg_lresult sysmsg.sm_result.lresult
e54488bb 52#define sysmsg_szresult sysmsg.sm_result.szresult
f9a13fc4
MD
53#define sysmsg_resultp sysmsg.sm_result.resultp
54#define sysmsg_fds sysmsg.sm_result.fds
55#define sysmsg_offset sysmsg.sm_result.offset
56#define sysmsg_result32 sysmsg.sm_result.result32
57#define sysmsg_result64 sysmsg.sm_result.result64
a385a915 58#define sysmsg_reg sysmsg.sm_result.reg
4a22e893 59#define sysmsg_frame sysmsg.sm_frame
245e4f17
MD
60#endif
61
c7114eea
MD
62#endif
63