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)
46 * i386 is the only arch with a 32-bit time_t
49 typedef int32_t time32_t;
51 typedef int64_t time32_t;
58 #define TV_CP(src,dst,fld) do { \
59 CP((src).fld,(dst).fld,tv_sec); \
60 CP((src).fld,(dst).fld,tv_usec); \
67 #define TS_CP(src,dst,fld) do { \
68 CP((src).fld,(dst).fld,tv_sec); \
69 CP((src).fld,(dst).fld,tv_nsec); \
73 struct timespec32 it_interval;
74 struct timespec32 it_value;
76 #define ITS_CP(src, dst) do { \
77 TS_CP((src), (dst), it_interval); \
78 TS_CP((src), (dst), it_value); \
85 #define BT_CP(src, dst, fld) do { \
86 CP((src).fld, (dst).fld, sec); \
87 *(uint64_t *)&(dst).fld.frac[0] = (src).fld.frac; \
91 struct timeval32 ru_utime;
92 struct timeval32 ru_stime;
110 struct rusage32 wru_self;
111 struct rusage32 wru_children;
115 struct timeval32 it_interval;
116 struct timeval32 it_value;
119 #define FREEBSD4_MFSNAMELEN 16
120 #define FREEBSD4_MNAMELEN (88 - 2 * sizeof(int32_t))
136 int32_t f_syncwrites;
137 int32_t f_asyncwrites;
138 char f_fstypename[FREEBSD4_MFSNAMELEN];
139 char f_mntonname[FREEBSD4_MNAMELEN];
141 int32_t f_asyncreads;
143 char f_mntfromname[FREEBSD4_MNAMELEN];
144 int16_t f_spares2 __packed;
149 uint32_t ident; /* identifier for this event */
150 short filter; /* filter for event */
156 int32_t data1, data2;
157 uint32_t udata; /* opaque user data identifier */
171 socklen_t msg_namelen;
174 u_int32_t msg_control;
175 socklen_t msg_controllen;
179 #if defined(__amd64__)
180 #define __STAT32_TIME_T_EXT 1
188 u_int16_t st_padding0;
191 u_int32_t st_padding1;
193 #ifdef __STAT32_TIME_T_EXT
194 __int32_t st_atim_ext;
196 struct timespec32 st_atim;
197 #ifdef __STAT32_TIME_T_EXT
198 __int32_t st_mtim_ext;
200 struct timespec32 st_mtim;
201 #ifdef __STAT32_TIME_T_EXT
202 __int32_t st_ctim_ext;
204 struct timespec32 st_ctim;
205 #ifdef __STAT32_TIME_T_EXT
206 __int32_t st_btim_ext;
208 struct timespec32 st_birthtim;
211 u_int32_t st_blksize;
214 u_int64_t st_spare[10];
216 struct freebsd11_stat32 {
224 struct timespec32 st_atim;
225 struct timespec32 st_mtim;
226 struct timespec32 st_ctim;
229 u_int32_t st_blksize;
233 struct timespec32 st_birthtim;
234 unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
235 unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
247 struct timespec32 st_atim;
248 struct timespec32 st_mtim;
249 struct timespec32 st_ctim;
250 __int32_t st_blksize;
294 struct i386_ldt_args32 {
308 struct kinfo_proc32 {
326 short ki_spare_short1;
327 uint32_t ki_tdev_freebsd11;
330 sigset_t ki_sigignore;
331 sigset_t ki_sigcatch;
338 short ki_spare_short2;
339 gid_t ki_groups[KI_NGROUPS];
353 u_int64_t ki_runtime;
354 struct timeval32 ki_start;
355 struct timeval32 ki_childtime;
364 u_char ki_lastcpu_old;
365 char ki_tdname[TDNAMLEN+1];
366 char ki_wmesg[WMESGLEN+1];
367 char ki_login[LOGNAMELEN+1];
368 char ki_lockname[LOCKNAMELEN+1];
369 char ki_comm[COMMLEN+1];
370 char ki_emul[KI_EMULNAMELEN+1];
371 char ki_loginclass[LOGINCLASSLEN+1];
372 char ki_moretdname[MAXCOMLEN-TDNAMLEN+1];
373 char ki_sparestrings[46];
374 int ki_spareints[KI_NSPARE_INT];
385 struct priority ki_pri;
386 struct rusage32 ki_rusage;
387 struct rusage32 ki_rusage_ch;
392 uint32_t ki_spareptrs[KI_NSPARE_PTR]; /* spare room for growth */
393 int ki_sparelongs[KI_NSPARE_LONG];
398 struct kinfo_sigtramp32 {
399 uint32_t ksigtramp_start;
400 uint32_t ksigtramp_end;
401 uint32_t ksigtramp_spare[4];
404 struct kld32_file_stat_1 {
405 int version; /* set to sizeof(struct kld_file_stat_1) */
406 char name[MAXPATHLEN];
409 uint32_t address; /* load address */
410 uint32_t size; /* size in bytes */
413 struct kld32_file_stat {
414 int version; /* set to sizeof(struct kld_file_stat) */
415 char name[MAXPATHLEN];
418 uint32_t address; /* load address */
419 uint32_t size; /* size in bytes */
420 char pathname[MAXPATHLEN];
423 struct procctl_reaper_pids32 {
429 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */