2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2001 Doug Rabson
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #ifndef _COMPAT_FREEBSD32_FREEBSD32_H_
32 #define _COMPAT_FREEBSD32_FREEBSD32_H_
34 #include <sys/abi_compat.h>
35 #include <sys/procfs.h>
36 #include <sys/socket.h>
40 * i386 is the only arch with a 32-bit time_t
43 typedef int32_t time32_t;
45 typedef int64_t time32_t;
59 struct timespec32 it_interval;
60 struct timespec32 it_value;
69 struct timeval32 ru_utime;
70 struct timeval32 ru_stime;
88 struct rusage32 wru_self;
89 struct rusage32 wru_children;
93 struct timeval32 it_interval;
94 struct timeval32 it_value;
98 struct timespec32 _timeout;
103 struct umtx_robust_lists_params_compat32 {
104 uint32_t robust_list_offset;
105 uint32_t robust_priv_list_offset;
106 uint32_t robust_inact_offset;
110 volatile __lwpid_t m_owner; /* Owner of the mutex */
111 __uint32_t m_flags; /* Flags of the mutex */
112 __uint32_t m_ceilings[2]; /* Priority protect ceiling */
113 __uint32_t m_rb_lnk; /* Robust linkage */
115 __uint32_t m_spare[2];
118 #define FREEBSD4_MFSNAMELEN 16
119 #define FREEBSD4_MNAMELEN (88 - 2 * sizeof(int32_t))
135 int32_t f_syncwrites;
136 int32_t f_asyncwrites;
137 char f_fstypename[FREEBSD4_MFSNAMELEN];
138 char f_mntonname[FREEBSD4_MNAMELEN];
140 int32_t f_asyncreads;
142 char f_mntfromname[FREEBSD4_MNAMELEN];
143 int16_t f_spares2 __packed;
154 socklen_t msg_namelen;
157 u_int32_t msg_control;
158 socklen_t msg_controllen;
162 #if defined(__amd64__)
163 #define __STAT32_TIME_T_EXT 1
171 u_int16_t st_padding0;
174 u_int32_t st_padding1;
176 #ifdef __STAT32_TIME_T_EXT
177 __int32_t st_atim_ext;
179 struct timespec32 st_atim;
180 #ifdef __STAT32_TIME_T_EXT
181 __int32_t st_mtim_ext;
183 struct timespec32 st_mtim;
184 #ifdef __STAT32_TIME_T_EXT
185 __int32_t st_ctim_ext;
187 struct timespec32 st_ctim;
188 #ifdef __STAT32_TIME_T_EXT
189 __int32_t st_btim_ext;
191 struct timespec32 st_birthtim;
194 u_int32_t st_blksize;
197 u_int64_t st_spare[10];
199 struct freebsd11_stat32 {
207 struct timespec32 st_atim;
208 struct timespec32 st_mtim;
209 struct timespec32 st_ctim;
212 u_int32_t st_blksize;
216 struct timespec32 st_birthtim;
217 unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
218 unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
230 struct timespec32 st_atim;
231 struct timespec32 st_mtim;
232 struct timespec32 st_ctim;
233 __int32_t st_blksize;
277 struct i386_ldt_args32 {
291 struct kinfo_proc32 {
309 short ki_spare_short1;
310 uint32_t ki_tdev_freebsd11;
313 sigset_t ki_sigignore;
314 sigset_t ki_sigcatch;
321 short ki_spare_short2;
322 gid_t ki_groups[KI_NGROUPS];
336 u_int64_t ki_runtime;
337 struct timeval32 ki_start;
338 struct timeval32 ki_childtime;
347 u_char ki_lastcpu_old;
348 char ki_tdname[TDNAMLEN+1];
349 char ki_wmesg[WMESGLEN+1];
350 char ki_login[LOGNAMELEN+1];
351 char ki_lockname[LOCKNAMELEN+1];
352 char ki_comm[COMMLEN+1];
353 char ki_emul[KI_EMULNAMELEN+1];
354 char ki_loginclass[LOGINCLASSLEN+1];
355 char ki_moretdname[MAXCOMLEN-TDNAMLEN+1];
356 char ki_sparestrings[46];
357 int ki_spareints[KI_NSPARE_INT];
368 struct priority ki_pri;
369 struct rusage32 ki_rusage;
370 struct rusage32 ki_rusage_ch;
375 uint32_t ki_spareptrs[KI_NSPARE_PTR]; /* spare room for growth */
376 int ki_sparelongs[KI_NSPARE_LONG];
381 struct kinfo_sigtramp32 {
382 uint32_t ksigtramp_start;
383 uint32_t ksigtramp_end;
384 uint32_t ksigtramp_spare[4];
387 struct kld32_file_stat_1 {
388 int version; /* set to sizeof(struct kld_file_stat_1) */
389 char name[MAXPATHLEN];
392 uint32_t address; /* load address */
393 uint32_t size; /* size in bytes */
396 struct kld32_file_stat {
397 int version; /* set to sizeof(struct kld_file_stat) */
398 char name[MAXPATHLEN];
401 uint32_t address; /* load address */
402 uint32_t size; /* size in bytes */
403 char pathname[MAXPATHLEN];
406 struct procctl_reaper_pids32 {
432 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */