2 * Copyright (c) 2001 Doug Rabson
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
30 #define _COMPAT_FREEBSD32_FREEBSD32_H_
32 #include <sys/procfs.h>
33 #include <sys/socket.h>
36 #define PTRIN(v) (void *)(uintptr_t) (v)
37 #define PTROUT(v) (u_int32_t)(uintptr_t) (v)
39 #define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
40 #define PTRIN_CP(src,dst,fld) \
41 do { (dst).fld = PTRIN((src).fld); } while (0)
42 #define PTROUT_CP(src,dst,fld) \
43 do { (dst).fld = PTROUT((src).fld); } while (0)
49 #define TV_CP(src,dst,fld) do { \
50 CP((src).fld,(dst).fld,tv_sec); \
51 CP((src).fld,(dst).fld,tv_usec); \
58 #define TS_CP(src,dst,fld) do { \
59 CP((src).fld,(dst).fld,tv_sec); \
60 CP((src).fld,(dst).fld,tv_nsec); \
64 struct timespec32 it_interval;
65 struct timespec32 it_value;
67 #define ITS_CP(src, dst) do { \
68 TS_CP((src), (dst), it_interval); \
69 TS_CP((src), (dst), it_value); \
73 struct timeval32 ru_utime;
74 struct timeval32 ru_stime;
92 struct rusage32 wru_self;
93 struct rusage32 wru_children;
97 struct timeval32 it_interval;
98 struct timeval32 it_value;
101 #define FREEBSD4_MNAMELEN (88 - 2 * sizeof(int32_t)) /* size of on/from name bufs */
117 int32_t f_syncwrites;
118 int32_t f_asyncwrites;
119 char f_fstypename[MFSNAMELEN];
120 char f_mntonname[FREEBSD4_MNAMELEN];
122 int32_t f_asyncreads;
124 char f_mntfromname[FREEBSD4_MNAMELEN];
125 int16_t f_spares2 __packed;
130 u_int32_t ident; /* identifier for this event */
131 short filter; /* filter for event */
135 u_int32_t udata; /* opaque user data identifier */
145 socklen_t msg_namelen;
148 u_int32_t msg_control;
149 socklen_t msg_controllen;
161 struct timespec32 st_atim;
162 struct timespec32 st_mtim;
163 struct timespec32 st_ctim;
166 u_int32_t st_blksize;
170 struct timespec32 st_birthtim;
171 unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
172 unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
184 struct timespec32 st_atim;
185 struct timespec32 st_mtim;
186 struct timespec32 st_ctim;
187 __int32_t st_blksize;
231 struct i386_ldt_args32 {
238 * Alternative layouts for <sys/procfs.h>
254 char pr_fname[PRFNAMESZ+1];
255 char pr_psargs[PRARGSZ+1];
259 char pr_tname[MAXCOMLEN+1];
271 struct kinfo_proc32 {
289 short ki_spare_short1;
293 sigset_t ki_sigignore;
294 sigset_t ki_sigcatch;
301 short ki_spare_short2;
302 gid_t ki_groups[KI_NGROUPS];
316 u_int64_t ki_runtime;
317 struct timeval32 ki_start;
318 struct timeval32 ki_childtime;
328 char ki_tdname[TDNAMLEN+1];
329 char ki_wmesg[WMESGLEN+1];
330 char ki_login[LOGNAMELEN+1];
331 char ki_lockname[LOCKNAMELEN+1];
332 char ki_comm[COMMLEN+1];
333 char ki_emul[KI_EMULNAMELEN+1];
334 char ki_loginclass[LOGINCLASSLEN+1];
335 char ki_sparestrings[50];
336 int ki_spareints[KI_NSPARE_INT];
343 struct priority ki_pri;
344 struct rusage32 ki_rusage;
345 struct rusage32 ki_rusage_ch;
350 uint32_t ki_spareptrs[KI_NSPARE_PTR]; /* spare room for growth */
351 int ki_sparelongs[KI_NSPARE_LONG];
356 struct kinfo_sigtramp32 {
357 uint32_t ksigtramp_start;
358 uint32_t ksigtramp_end;
359 uint32_t ksigtramp_spare[4];
362 struct kld32_file_stat_1 {
363 int version; /* set to sizeof(struct kld_file_stat_1) */
364 char name[MAXPATHLEN];
367 uint32_t address; /* load address */
368 uint32_t size; /* size in bytes */
371 struct kld32_file_stat {
372 int version; /* set to sizeof(struct kld_file_stat) */
373 char name[MAXPATHLEN];
376 uint32_t address; /* load address */
377 uint32_t size; /* size in bytes */
378 char pathname[MAXPATHLEN];
381 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */