#ifndef _COMPAT_NETBSD32_NETBSD32_H_
#define _COMPAT_NETBSD32_NETBSD32_H_
#ifdef syscallargs
#undef syscallargs
#endif
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mount.h>
#include <sys/ptrace.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/syscallargs.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/ucontext.h>
#include <sys/ucred.h>
#include <sys/module_hook.h>
#include <compat/sys/ucontext.h>
#include <compat/sys/mount.h>
#include <compat/sys/signal.h>
#include <compat/sys/siginfo.h>
#include <compat/common/compat_util.h>
#include <nfs/rpcv2.h>
typedef int32_t netbsd32_long;
typedef uint32_t netbsd32_u_long;
typedef int64_t netbsd32_quad;
typedef uint32_t netbsd32_clock_t;
typedef uint32_t netbsd32_size_t;
typedef int32_t netbsd32_ssize_t;
typedef int32_t netbsd32_clockid_t;
typedef int32_t netbsd32_key_t;
typedef int32_t netbsd32_intptr_t;
typedef uint32_t netbsd32_uintptr_t;
#define NETBSD32_SSIZE_MAX INT32_MAX
#include <machine/netbsd32_machdep.h>
#define NETBSD32PTR64(p32) NETBSD32IPTR64((p32).i32)
#define NETBSD32PTR32(p32, p64) ((p32).i32 = NETBSD32PTR32I(p64))
#define NETBSD32PTR32PLUS(p32, incr) netbsd32_ptr32_incr(&p32, incr)
#define NETBSD32PTR32I(p32) netbsd32_ptr32i(p32)
#define NETBSD32IPTR64(p32) netbsd32_iptr64(p32)
static __inline NETBSD32_POINTER_TYPE
netbsd32_ptr32i(const void *p64)
{
uintptr_t u64 = (uintptr_t)p64;
KASSERTMSG(u64 == (uintptr_t)(NETBSD32_POINTER_TYPE)u64,
"u64 %jx != %jx", (uintmax_t)u64,
(uintmax_t)(NETBSD32_POINTER_TYPE)u64);
return u64;
}
static __inline void *
netbsd32_iptr64(NETBSD32_POINTER_TYPE p32)
{
return (void *)(intptr_t)p32;
}
static __inline netbsd32_pointer_t
netbsd32_ptr32_incr(netbsd32_pointer_t *p32, uint32_t incr)
{
netbsd32_pointer_t n32 = *p32;
n32.i32 += incr;
KASSERT(NETBSD32PTR64(n32) > NETBSD32PTR64(*p32));
return *p32 = n32;
}
#undef NETBSD32_POINTER_TYPE
typedef int64_t netbsd32_int64 NETBSD32_INT64_ALIGN;
typedef uint64_t netbsd32_uint64 NETBSD32_INT64_ALIGN;
#undef NETBSD32_INT64_ALIGN
CTASSERT(sizeof(netbsd32_uint64) == sizeof(netbsd32_siginfo_uint64));
CTASSERT(__alignof__(netbsd32_uint64) == __alignof__(netbsd32_siginfo_uint64));
typedef netbsd32_pointer_t netbsd32_voidp;
typedef netbsd32_pointer_t netbsd32_u_shortp;
typedef netbsd32_pointer_t netbsd32_charp;
typedef netbsd32_pointer_t netbsd32_u_charp;
typedef netbsd32_pointer_t netbsd32_charpp;
typedef netbsd32_pointer_t netbsd32_size_tp;
typedef netbsd32_pointer_t netbsd32_intp;
typedef netbsd32_pointer_t netbsd32_uintp;
typedef netbsd32_pointer_t netbsd32_longp;
typedef netbsd32_pointer_t netbsd32_caddrp;
typedef netbsd32_pointer_t netbsd32_caddr;
typedef netbsd32_pointer_t netbsd32_gid_tp;
typedef netbsd32_pointer_t netbsd32_fsid_tp_t;
typedef netbsd32_pointer_t netbsd32_lwpidp;
typedef netbsd32_pointer_t netbsd32_ucontextp;
typedef netbsd32_pointer_t netbsd32_caddr_t;
typedef netbsd32_pointer_t netbsd32_lwpctlp;
typedef netbsd32_pointer_t netbsd32_pid_tp;
typedef netbsd32_pointer_t netbsd32_psetidp_t;
typedef netbsd32_pointer_t netbsd32_aclp_t;
typedef netbsd32_pointer_t netbsd32_fd_setp_t;
typedef netbsd32_intptr_t netbsd32_semid_t;
typedef netbsd32_pointer_t netbsd32_semidp_t;
typedef netbsd32_uint64 netbsd32_dev_t;
typedef netbsd32_int64 netbsd32_off_t;
typedef netbsd32_uint64 netbsd32_ino_t;
typedef netbsd32_int64 netbsd32_blkcnt_t;
typedef netbsd32_uint64 netbsd32_epoll_data_t;
typedef netbsd32_pointer_t netbsd32_epoll_eventp_t;
struct netbsd32_epoll_event {
uint32_t events;
netbsd32_epoll_data_t data;
};
typedef netbsd32_pointer_t netbsd32_posix_spawn_file_actionsp;
typedef netbsd32_pointer_t netbsd32_posix_spawnattrp;
typedef netbsd32_pointer_t netbsd32_posix_spawn_file_actions_entryp;
typedef netbsd32_pointer_t netbsd32_iovecp_t;
struct netbsd32_iovec {
netbsd32_voidp iov_base;
netbsd32_size_t iov_len;
};
typedef int32_t netbsd32_timer_t;
typedef int32_t netbsd32_time50_t;
typedef netbsd32_int64 netbsd32_time_t;
typedef netbsd32_pointer_t netbsd32_timerp_t;
typedef netbsd32_pointer_t netbsd32_clockidp_t;
typedef netbsd32_pointer_t netbsd32_timespec50p_t;
struct netbsd32_timespec50 {
netbsd32_time50_t tv_sec;
netbsd32_long tv_nsec;
};
typedef netbsd32_pointer_t netbsd32_timespecp_t;
struct netbsd32_timespec {
netbsd32_time_t tv_sec;
netbsd32_long tv_nsec;
};
typedef netbsd32_pointer_t netbsd32_timeval50p_t;
struct netbsd32_timeval50 {
netbsd32_time50_t tv_sec;
netbsd32_long tv_usec;
};
typedef netbsd32_pointer_t netbsd32_timevalp_t;
struct netbsd32_timeval {
netbsd32_time_t tv_sec;
suseconds_t tv_usec;
};
typedef netbsd32_pointer_t netbsd32_timezonep_t;
struct netbsd32_timezone {
int tz_minuteswest;
int tz_dsttime;
};
typedef netbsd32_pointer_t netbsd32_itimerval50p_t;
struct netbsd32_itimerval50 {
struct netbsd32_timeval50 it_interval;
struct netbsd32_timeval50 it_value;
};
typedef netbsd32_pointer_t netbsd32_itimervalp_t;
struct netbsd32_itimerval {
struct netbsd32_timeval it_interval;
struct netbsd32_timeval it_value;
};
typedef netbsd32_pointer_t netbsd32_itimerspec50p_t;
struct netbsd32_itimerspec50 {
struct netbsd32_timespec50 it_interval;
struct netbsd32_timespec50 it_value;
};
typedef netbsd32_pointer_t netbsd32_itimerspecp_t;
struct netbsd32_itimerspec {
struct netbsd32_timespec it_interval;
struct netbsd32_timespec it_value;
};
typedef netbsd32_pointer_t netbsd32_fidp_t;
typedef netbsd32_pointer_t netbsd32_fhandlep_t;
typedef netbsd32_pointer_t netbsd32_compat_30_fhandlep_t;
typedef netbsd32_pointer_t netbsd32_statfsp_t;
struct netbsd32_statfs {
short f_type;
unsigned short f_flags;
netbsd32_long f_bsize;
netbsd32_long f_iosize;
netbsd32_long f_blocks;
netbsd32_long f_bfree;
netbsd32_long f_bavail;
netbsd32_long f_files;
netbsd32_long f_ffree;
fsid_t f_fsid;
uid_t f_owner;
netbsd32_long f_spare[4];
char f_fstypename[MFSNAMELEN];
char f_mntonname[MNAMELEN];
char f_mntfromname[MNAMELEN];
};
struct netbsd32_export_args30 {
int ex_flags;
uid_t ex_root;
struct uucred ex_anon;
netbsd32_pointer_t ex_addr;
int ex_addrlen;
netbsd32_pointer_t ex_mask;
int ex_masklen;
netbsd32_charp ex_indexfile;
};
typedef netbsd32_pointer_t netbsd32_pollfdp_t;
typedef netbsd32_pointer_t netbsd32_ptrace_io_descp_t;
struct netbsd32_ptrace_io_desc {
int piod_op;
netbsd32_voidp piod_offs;
netbsd32_voidp piod_addr;
netbsd32_size_t piod_len;
};
struct netbsd32_ptrace_siginfo {
siginfo32_t psi_siginfo;
lwpid_t psi_lwpid;
};
#define PL32_LNAMELEN 20
struct netbsd32_ptrace_lwpstatus {
lwpid_t pl_lwpid;
sigset_t pl_sigpend;
sigset_t pl_sigmask;
char pl_name[PL32_LNAMELEN];
netbsd32_voidp pl_private;
};
typedef netbsd32_pointer_t netbsd32_quotactlargsp_t;
struct netbsd32_quotactlargs {
unsigned qc_op;
union {
struct {
netbsd32_pointer_t qc_info;
} stat;
struct {
int qc_idtype;
netbsd32_pointer_t qc_info;
} idtypestat;
struct {
int qc_objtype;
netbsd32_pointer_t qc_info;
} objtypestat;
struct {
netbsd32_pointer_t qc_key;
netbsd32_pointer_t qc_val;
} get;
struct {
netbsd32_pointer_t qc_key;
netbsd32_pointer_t qc_val;
} put;
struct {
netbsd32_pointer_t qc_key;
} del;
struct {
netbsd32_pointer_t qc_cursor;
} cursoropen;
struct {
netbsd32_pointer_t qc_cursor;
} cursorclose;
struct {
netbsd32_pointer_t qc_cursor;
int qc_idtype;
} cursorskipidtype;
struct {
netbsd32_pointer_t qc_cursor;
netbsd32_pointer_t qc_keys;
netbsd32_pointer_t qc_vals;
unsigned qc_maxnum;
netbsd32_pointer_t qc_ret;
} cursorget;
struct {
netbsd32_pointer_t qc_cursor;
netbsd32_pointer_t qc_ret;
} cursoratend;
struct {
netbsd32_pointer_t qc_cursor;
} cursorrewind;
struct {
int qc_idtype;
netbsd32_pointer_t qc_quotafile;
} quotaon;
struct {
int qc_idtype;
} quotaoff;
} u;
};
typedef netbsd32_pointer_t netbsd32_rusage50p_t;
struct netbsd32_rusage50 {
struct netbsd32_timeval50 ru_utime;
struct netbsd32_timeval50 ru_stime;
netbsd32_long ru_maxrss;
netbsd32_long ru_ixrss;
netbsd32_long ru_idrss;
netbsd32_long ru_isrss;
netbsd32_long ru_minflt;
netbsd32_long ru_majflt;
netbsd32_long ru_nswap;
netbsd32_long ru_inblock;
netbsd32_long ru_oublock;
netbsd32_long ru_msgsnd;
netbsd32_long ru_msgrcv;
netbsd32_long ru_nsignals;
netbsd32_long ru_nvcsw;
netbsd32_long ru_nivcsw;
};
typedef netbsd32_pointer_t netbsd32_rusagep_t;
struct netbsd32_rusage {
struct netbsd32_timeval ru_utime;
struct netbsd32_timeval ru_stime;
netbsd32_long ru_maxrss;
netbsd32_long ru_ixrss;
netbsd32_long ru_idrss;
netbsd32_long ru_isrss;
netbsd32_long ru_minflt;
netbsd32_long ru_majflt;
netbsd32_long ru_nswap;
netbsd32_long ru_inblock;
netbsd32_long ru_oublock;
netbsd32_long ru_msgsnd;
netbsd32_long ru_msgrcv;
netbsd32_long ru_nsignals;
netbsd32_long ru_nvcsw;
netbsd32_long ru_nivcsw;
};
typedef netbsd32_pointer_t netbsd32_wrusagep_t;
struct netbsd32_wrusage {
struct netbsd32_rusage wru_self;
struct netbsd32_rusage wru_children;
};
typedef netbsd32_pointer_t netbsd32_orlimitp_t;
typedef netbsd32_pointer_t netbsd32_rlimitp_t;
struct netbsd32_loadavg {
fixpt_t ldavg[3];
netbsd32_long fscale;
};
struct netbsd32_swapent {
netbsd32_dev_t se_dev;
int se_flags;
int se_nblks;
int se_inuse;
int se_priority;
char se_path[PATH_MAX+1];
};
typedef netbsd32_pointer_t netbsd32_ipc_permp_t;
struct netbsd32_ipc_perm {
uid_t cuid;
gid_t cgid;
uid_t uid;
gid_t gid;
mode_t mode;
unsigned short _seq;
netbsd32_key_t _key;
};
struct netbsd32_ipc_perm14 {
unsigned short cuid;
unsigned short cgid;
unsigned short uid;
unsigned short gid;
unsigned short mode;
unsigned short seq;
netbsd32_key_t key;
};
typedef netbsd32_pointer_t netbsd32_msgp_t;
struct netbsd32_msg {
netbsd32_msgp_t msg_next;
netbsd32_long msg_type;
unsigned short msg_ts;
short msg_spot;
};
typedef uint32_t netbsd32_msgqnum_t;
typedef netbsd32_size_t netbsd32_msglen_t;
typedef netbsd32_pointer_t netbsd32_msqid_dsp_t;
struct netbsd32_msqid_ds {
struct netbsd32_ipc_perm msg_perm;
netbsd32_msgqnum_t msg_qnum;
netbsd32_msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
netbsd32_time_t msg_stime;
netbsd32_time_t msg_rtime;
netbsd32_time_t msg_ctime;
netbsd32_msgp_t _msg_first;
netbsd32_msgp_t _msg_last;
netbsd32_msglen_t _msg_cbytes;
};
typedef netbsd32_pointer_t netbsd32_msqid_ds50p_t;
struct netbsd32_msqid_ds50 {
struct netbsd32_ipc_perm msg_perm;
netbsd32_msgqnum_t msg_qnum;
netbsd32_msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
int32_t msg_stime;
int32_t msg_rtime;
int32_t msg_ctime;
netbsd32_msgp_t _msg_first;
netbsd32_msgp_t _msg_last;
netbsd32_msglen_t _msg_cbytes;
};
typedef netbsd32_pointer_t netbsd32_msqid_ds14p_t;
struct netbsd32_msqid_ds14 {
struct netbsd32_ipc_perm14 msg_perm;
netbsd32_msgp_t msg_first;
netbsd32_msgp_t msg_last;
netbsd32_u_long msg_cbytes;
netbsd32_u_long msg_qnum;
netbsd32_u_long msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
int32_t msg_stime;
netbsd32_long msg_pad1;
int32_t msg_rtime;
netbsd32_long msg_pad2;
int32_t msg_ctime;
netbsd32_long msg_pad3;
netbsd32_long msg_pad4[4];
};
typedef netbsd32_pointer_t netbsd32_semp_t;
typedef netbsd32_pointer_t netbsd32_semid_dsp_t;
struct netbsd32_semid_ds {
struct netbsd32_ipc_perm sem_perm;
unsigned short sem_nsems;
netbsd32_time_t sem_otime;
netbsd32_time_t sem_ctime;
netbsd32_semp_t _sem_base;
};
typedef netbsd32_pointer_t netbsd32_semid_ds50p_t;
struct netbsd32_semid_ds50 {
struct netbsd32_ipc_perm sem_perm;
unsigned short sem_nsems;
int32_t sem_otime;
int32_t sem_ctime;
netbsd32_semp_t _sem_base;
};
typedef netbsd32_pointer_t netbsd32_semid_ds14p_t;
struct netbsd32_semid_ds14 {
struct netbsd32_ipc_perm14 sem_perm;
netbsd32_semp_t sem_base;
unsigned short sem_nsems;
netbsd32_time_t sem_otime;
netbsd32_long sem_pad1;
netbsd32_time_t sem_ctime;
int32_t sem_pad2;
int32_t sem_pad3[4];
};
typedef uint32_t netbsd32_semunu_t;
typedef netbsd32_pointer_t netbsd32_semunp_t;
union netbsd32_semun {
int val;
netbsd32_semid_dsp_t buf;
netbsd32_u_shortp array;
};
typedef netbsd32_pointer_t netbsd32_semun50p_t;
union netbsd32_semun50 {
int val;
netbsd32_semid_ds50p_t buf;
netbsd32_u_shortp array;
};
typedef netbsd32_pointer_t netbsd32_sembufp_t;
struct netbsd32_sembuf {
unsigned short sem_num;
short sem_op;
short sem_flg;
};
typedef netbsd32_pointer_t netbsd32_shmid_dsp_t;
struct netbsd32_shmid_ds {
struct netbsd32_ipc_perm shm_perm;
netbsd32_size_t shm_segsz;
pid_t shm_lpid;
pid_t shm_cpid;
shmatt_t shm_nattch;
netbsd32_time_t shm_atime;
netbsd32_time_t shm_dtime;
netbsd32_time_t shm_ctime;
netbsd32_voidp _shm_internal;
};
typedef netbsd32_pointer_t netbsd32_shmid_ds50p_t;
struct netbsd32_shmid_ds50 {
struct netbsd32_ipc_perm shm_perm;
netbsd32_size_t shm_segsz;
pid_t shm_lpid;
pid_t shm_cpid;
shmatt_t shm_nattch;
int32_t shm_atime;
int32_t shm_dtime;
int32_t shm_ctime;
netbsd32_voidp _shm_internal;
};
typedef netbsd32_pointer_t netbsd32_shmid_ds14p_t;
struct netbsd32_shmid_ds14 {
struct netbsd32_ipc_perm14 shm_perm;
int shm_segsz;
pid_t shm_lpid;
pid_t shm_cpid;
short shm_nattch;
int32_t shm_atime;
int32_t shm_dtime;
int32_t shm_ctime;
netbsd32_voidp _shm_internal;
};
typedef netbsd32_pointer_t netbsd32_sigsetp_t;
typedef netbsd32_pointer_t netbsd32_sigactionp_t;
struct netbsd32_sigaction13 {
netbsd32_voidp netbsd32_sa_handler;
sigset13_t netbsd32_sa_mask;
int netbsd32_sa_flags;
};
struct netbsd32_sigaction {
netbsd32_voidp netbsd32_sa_handler;
sigset_t netbsd32_sa_mask;
int netbsd32_sa_flags;
};
typedef netbsd32_pointer_t netbsd32_sigaltstack13p_t;
struct netbsd32_sigaltstack13 {
netbsd32_charp ss_sp;
int ss_size;
int ss_flags;
};
typedef netbsd32_pointer_t netbsd32_sigaltstackp_t;
struct netbsd32_sigaltstack {
netbsd32_voidp ss_sp;
netbsd32_size_t ss_size;
int ss_flags;
};
typedef netbsd32_pointer_t netbsd32_sigstackp_t;
struct netbsd32_sigstack {
netbsd32_voidp ss_sp;
int ss_onstack;
};
typedef netbsd32_pointer_t netbsd32_sigvecp_t;
struct netbsd32_sigvec {
netbsd32_voidp sv_handler;
int sv_mask;
int sv_flags;
};
typedef netbsd32_pointer_t netbsd32_siginfop_t;
union netbsd32_sigval {
int sival_int;
netbsd32_voidp sival_ptr;
};
typedef netbsd32_pointer_t netbsd32_sigeventp_t;
struct netbsd32_sigevent {
int sigev_notify;
int sigev_signo;
union netbsd32_sigval sigev_value;
netbsd32_voidp sigev_notify_function;
netbsd32_voidp sigev_notify_attributes;
};
typedef netbsd32_pointer_t netbsd32_stackp_t;
typedef netbsd32_pointer_t netbsd32_sockaddrp_t;
typedef netbsd32_pointer_t netbsd32_osockaddrp_t;
typedef netbsd32_pointer_t netbsd32_socklenp_t;
typedef netbsd32_pointer_t netbsd32_msghdrp_t;
struct netbsd32_msghdr {
netbsd32_caddr_t msg_name;
unsigned int msg_namelen;
netbsd32_iovecp_t msg_iov;
unsigned int msg_iovlen;
netbsd32_caddr_t msg_control;
unsigned int msg_controllen;
int msg_flags;
};
typedef netbsd32_pointer_t netbsd32_omsghdrp_t;
struct netbsd32_omsghdr {
netbsd32_caddr_t msg_name;
int msg_namelen;
netbsd32_iovecp_t msg_iov;
int msg_iovlen;
netbsd32_caddr_t msg_accrights;
u_int msg_accrightslen;
};
typedef netbsd32_pointer_t netbsd32_mmsghdrp_t;
struct netbsd32_mmsghdr {
struct netbsd32_msghdr msg_hdr;
unsigned int msg_len;
};
typedef netbsd32_pointer_t netbsd32_stat12p_t;
struct netbsd32_stat12 {
uint32_t st_dev;
uint32_t st_ino;
uint16_t st_mode;
uint16_t st_nlink;
uid_t st_uid;
gid_t st_gid;
uint32_t st_rdev;
struct netbsd32_timespec50 st_atimespec;
struct netbsd32_timespec50 st_mtimespec;
struct netbsd32_timespec50 st_ctimespec;
netbsd32_int64 st_size;
netbsd32_int64 st_blocks;
uint32_t st_blksize;
uint32_t st_flags;
uint32_t st_gen;
int32_t st_lspare;
netbsd32_int64 st_qspare[2];
};
typedef netbsd32_pointer_t netbsd32_stat43p_t;
struct netbsd32_stat43 {
uint16_t st_dev;
uint32_t st_ino;
uint16_t st_mode;
uint16_t st_nlink;
uint16_t st_uid;
uint16_t st_gid;
uint16_t st_rdev;
int32_t st_size;
struct netbsd32_timespec50 st_atimespec;
struct netbsd32_timespec50 st_mtimespec;
struct netbsd32_timespec50 st_ctimespec;
int32_t st_blksize;
int32_t st_blocks;
uint32_t st_flags;
uint32_t st_gen;
};
typedef netbsd32_pointer_t netbsd32_stat13p_t;
struct netbsd32_stat13 {
uint32_t st_dev;
uint32_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
uint32_t st_rdev;
struct netbsd32_timespec50 st_atimespec;
struct netbsd32_timespec50 st_mtimespec;
struct netbsd32_timespec50 st_ctimespec;
netbsd32_int64 st_size;
netbsd32_uint64 st_blocks;
blksize_t st_blksize;
uint32_t st_flags;
uint32_t st_gen;
uint32_t st_spare;
struct netbsd32_timespec50 st_birthtimespec;
uint32_t st_spare2;
};
typedef netbsd32_pointer_t netbsd32_stat50p_t;
struct netbsd32_stat50 {
uint32_t st_dev;
mode_t st_mode;
netbsd32_uint64 st_ino;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
uint32_t st_rdev;
struct netbsd32_timespec50 st_atimespec;
struct netbsd32_timespec50 st_mtimespec;
struct netbsd32_timespec50 st_ctimespec;
struct netbsd32_timespec50 st_birthtimespec;
netbsd32_int64 st_size;
netbsd32_uint64 st_blocks;
blksize_t st_blksize;
uint32_t st_flags;
uint32_t st_gen;
uint32_t st_spare[2];
};
typedef netbsd32_pointer_t netbsd32_statp_t;
struct netbsd32_stat {
netbsd32_dev_t st_dev;
mode_t st_mode;
netbsd32_uint64 st_ino;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
netbsd32_dev_t st_rdev;
struct netbsd32_timespec st_atimespec;
struct netbsd32_timespec st_mtimespec;
struct netbsd32_timespec st_ctimespec;
struct netbsd32_timespec st_birthtimespec;
netbsd32_int64 st_size;
netbsd32_uint64 st_blocks;
blksize_t st_blksize;
uint32_t st_flags;
uint32_t st_gen;
uint32_t st_spare[2];
};
typedef netbsd32_pointer_t netbsd32_statvfs90p_t;
struct netbsd32_statvfs90 {
netbsd32_u_long f_flag;
netbsd32_u_long f_bsize;
netbsd32_u_long f_frsize;
netbsd32_u_long f_iosize;
netbsd32_uint64 f_blocks;
netbsd32_uint64 f_bfree;
netbsd32_uint64 f_bavail;
netbsd32_uint64 f_bresvd;
netbsd32_uint64 f_files;
netbsd32_uint64 f_ffree;
netbsd32_uint64 f_favail;
netbsd32_uint64 f_fresvd;
netbsd32_uint64 f_syncreads;
netbsd32_uint64 f_syncwrites;
netbsd32_uint64 f_asyncreads;
netbsd32_uint64 f_asyncwrites;
fsid_t f_fsidx;
netbsd32_u_long f_fsid;
netbsd32_u_long f_namemax;
uid_t f_owner;
uint32_t f_spare[4];
char f_fstypename[_VFS_NAMELEN];
char f_mntonname[_VFS_MNAMELEN];
char f_mntfromname[_VFS_MNAMELEN];
};
typedef netbsd32_pointer_t netbsd32_statvfsp_t;
struct netbsd32_statvfs {
netbsd32_u_long f_flag;
netbsd32_u_long f_bsize;
netbsd32_u_long f_frsize;
netbsd32_u_long f_iosize;
netbsd32_uint64 f_blocks;
netbsd32_uint64 f_bfree;
netbsd32_uint64 f_bavail;
netbsd32_uint64 f_bresvd;
netbsd32_uint64 f_files;
netbsd32_uint64 f_ffree;
netbsd32_uint64 f_favail;
netbsd32_uint64 f_fresvd;
netbsd32_uint64 f_syncreads;
netbsd32_uint64 f_syncwrites;
netbsd32_uint64 f_asyncreads;
netbsd32_uint64 f_asyncwrites;
fsid_t f_fsidx;
netbsd32_u_long f_fsid;
netbsd32_u_long f_namemax;
uid_t f_owner;
netbsd32_uint64 f_spare[4];
char f_fstypename[_VFS_NAMELEN];
char f_mntonname[_VFS_MNAMELEN];
char f_mntfromname[_VFS_MNAMELEN];
char f_mntfromlabel[_VFS_MNAMELEN];
};
typedef netbsd32_pointer_t netbsd32_ntptimevalp_t;
typedef netbsd32_pointer_t netbsd32_ntptimeval30p_t;
typedef netbsd32_pointer_t netbsd32_ntptimeval50p_t;
struct netbsd32_ntptimeval30 {
struct netbsd32_timeval50 time;
netbsd32_long maxerror;
netbsd32_long esterror;
};
struct netbsd32_ntptimeval50 {
struct netbsd32_timespec50 time;
netbsd32_long maxerror;
netbsd32_long esterror;
netbsd32_long tai;
int time_state;
};
struct netbsd32_ntptimeval {
struct netbsd32_timespec time;
netbsd32_long maxerror;
netbsd32_long esterror;
netbsd32_long tai;
int time_state;
};
typedef netbsd32_pointer_t netbsd32_timexp_t;
struct netbsd32_timex {
unsigned int modes;
netbsd32_long offset;
netbsd32_long freq;
netbsd32_long maxerror;
netbsd32_long esterror;
int status;
netbsd32_long constant;
netbsd32_long precision;
netbsd32_long tolerance;
netbsd32_long ppsfreq;
netbsd32_long jitter;
int shift;
netbsd32_long stabil;
netbsd32_long jitcnt;
netbsd32_long calcnt;
netbsd32_long errcnt;
netbsd32_long stbcnt;
};
struct netbsd32_plistref {
netbsd32_pointer_t pref_plist;
netbsd32_size_t pref_len;
};
typedef struct {
netbsd32_pointer_t buf;
netbsd32_size_t len;
int flags;
} netbsd32_nvlist_ref_t;
typedef netbsd32_pointer_t netbsd32_block_infop_t;
typedef netbsd32_pointer_t netbsd32_utsnamep_t;
typedef netbsd32_pointer_t netbsd32_outsnamep_t;
typedef struct firm_event32 {
unsigned short id;
unsigned short pad;
int value;
struct netbsd32_timeval time;
} Firm_event32;
typedef netbsd32_pointer_t netbsd32_uuidp_t;
typedef netbsd32_pointer_t netbsd32_keventp_t;
struct netbsd32_kevent {
netbsd32_uintptr_t ident;
uint32_t filter;
uint32_t flags;
uint32_t fflags;
netbsd32_int64 data;
netbsd32_pointer_t udata;
netbsd32_uint64 ext[4];
};
typedef netbsd32_pointer_t netbsd32_kevent100p_t;
struct netbsd32_kevent100 {
netbsd32_uintptr_t ident;
uint32_t filter;
uint32_t flags;
uint32_t fflags;
netbsd32_int64 data;
netbsd32_pointer_t udata;
};
typedef netbsd32_pointer_t netbsd32_sched_paramp_t;
typedef netbsd32_pointer_t netbsd32_cpusetp_t;
struct netbsd32_tmpfs_args {
int ta_version;
netbsd32_ino_t ta_nodes_max;
netbsd32_off_t ta_size_max;
uid_t ta_root_uid;
gid_t ta_root_gid;
mode_t ta_root_mode;
};
struct netbsd32_iso_args {
netbsd32_charp fspec;
struct netbsd32_export_args30 _pad1;
int flags;
};
struct netbsd32_ufs_args {
netbsd32_charp fspec;
};
struct netbsd32_mfs_args {
netbsd32_charp fspec;
struct netbsd32_export_args30 _pad1;
netbsd32_voidp base;
netbsd32_u_long size;
};
struct netbsd32_nfsd_args {
int sock;
netbsd32_voidp name;
int namelen;
};
typedef netbsd32_pointer_t netbsd32_nfsdp;
struct netbsd32_nfsd_srvargs {
netbsd32_nfsdp nsd_nfsd;
uid_t nsd_uid;
uint32_t nsd_haddr;
struct uucred nsd_cr;
int nsd_authlen;
netbsd32_u_charp nsd_authstr;
int nsd_verflen;
netbsd32_u_charp nsd_verfstr;
struct netbsd32_timeval nsd_timestamp;
uint32_t nsd_ttl;
NFSKERBKEY_T nsd_key;
};
typedef netbsd32_pointer_t netbsd32_export_argsp;
struct netbsd32_export_args {
int ex_flags;
uid_t ex_root;
struct uucred ex_anon;
netbsd32_sockaddrp_t ex_addr;
int ex_addrlen;
netbsd32_sockaddrp_t ex_mask;
int ex_masklen;
netbsd32_charp ex_indexfile;
};
struct netbsd32_mountd_exports_list {
const netbsd32_charp mel_path;
netbsd32_size_t mel_nexports;
netbsd32_export_argsp mel_exports;
};
struct netbsd32_nfs_args {
int32_t version;
netbsd32_sockaddrp_t addr;
int32_t addrlen;
int32_t sotype;
int32_t proto;
netbsd32_u_charp fh;
int32_t fhsize;
int32_t flags;
int32_t wsize;
int32_t rsize;
int32_t readdirsize;
int32_t timeo;
int32_t retrans;
int32_t maxgrouplist;
int32_t readahead;
int32_t leaseterm;
int32_t deadthresh;
netbsd32_charp hostname;
};
struct netbsd32_msdosfs_args {
netbsd32_charp fspec;
struct netbsd32_export_args30 _pad1;
uid_t uid;
gid_t gid;
mode_t mask;
int flags;
int version;
mode_t dirmask;
int gmtoff;
};
struct netbsd32_udf_args {
uint32_t version;
netbsd32_charp fspec;
int32_t sessionnr;
uint32_t udfmflags;
int32_t gmtoff;
uid_t anon_uid;
gid_t anon_gid;
uid_t nobody_uid;
gid_t nobody_gid;
uint32_t sector_size;
uint8_t reserved[32];
};
struct netbsd32_layer_args {
netbsd32_charp target;
struct netbsd32_export_args30 _pad1;
};
struct netbsd32_null_args {
struct netbsd32_layer_args la;
};
struct netbsd32_posix_spawn_file_actions_entry {
enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE,
FAE32_CHDIR, FAE32_FCHDIR } fae_action;
int fae_fildes;
union {
struct {
netbsd32_charp path;
int oflag;
mode_t mode;
} open;
struct {
int newfildes;
} dup2;
struct {
netbsd32_charp path;
} chdir;
} fae_data;
};
struct netbsd32_posix_spawn_file_actions {
unsigned int size;
unsigned int len;
netbsd32_posix_spawn_file_actions_entryp fae;
};
struct netbsd32_modctl_load {
netbsd32_charp ml_filename;
int ml_flags;
netbsd32_charp ml_props;
netbsd32_size_t ml_propslen;
};
struct netbsd32_mq_attr {
netbsd32_long mq_flags;
netbsd32_long mq_maxmsg;
netbsd32_long mq_msgsize;
netbsd32_long mq_curmsgs;
};
typedef netbsd32_pointer_t netbsd32_mq_attrp_t;
#if 0
int netbsd32_kevent(struct lwp *, void *, register_t *);
#endif
#define NETBSD32TO64(s32uap, uap, name) \
SCARG(uap, name) = SCARG(s32uap, name)
#define NETBSD32TOP(s32uap, uap, name, type) \
SCARG(uap, name) = SCARG_P32(s32uap, name)
#define NETBSD32TOX(s32uap, uap, name, type) \
SCARG(uap, name) = (type)SCARG(s32uap, name)
#define NETBSD32TOX64(s32uap, uap, name, type) \
SCARG(uap, name) = (type)(long)SCARG(s32uap, name)
#define NETBSD32TO64_UAP(name) NETBSD32TO64(uap, &ua, name)
#define NETBSD32TOP_UAP(name, type) NETBSD32TOP(uap, &ua, name, type)
#define NETBSD32TOX_UAP(name, type) NETBSD32TOX(uap, &ua, name, type)
#define NETBSD32TOX64_UAP(name, type) NETBSD32TOX64(uap, &ua, name, type)
#define SCARG_P32(uap, name) NETBSD32PTR64(SCARG(uap, name))
struct coredump_iostate;
int coredump_netbsd32(struct lwp *, struct coredump_iostate *);
int real_coredump_netbsd32(struct lwp *, struct coredump_iostate *);
vaddr_t netbsd32_vm_default_addr(struct proc *, vaddr_t, vsize_t, int);
void netbsd32_adjust_limits(struct proc *);
void netbsd32_si_to_si32(siginfo32_t *, const siginfo_t *);
void netbsd32_si32_to_si(siginfo_t *, const siginfo32_t *);
void netbsd32_ksi32_to_ksi(struct _ksiginfo *si, const struct __ksiginfo32 *si32);
void netbsd32_read_lwpstatus(struct lwp *, struct netbsd32_ptrace_lwpstatus *);
#ifdef KTRACE
void netbsd32_ktrpsig(int, sig_t, const sigset_t *, const ksiginfo_t *);
#else
#define netbsd32_ktrpsig NULL
#endif
void startlwp32(void *);
struct compat_50_netbsd32___semctl14_args;
int do_netbsd32___semctl14(struct lwp *, const struct compat_50_netbsd32___semctl14_args *, register_t *, void *);
struct iovec *netbsd32_get_iov(struct netbsd32_iovec *, int, struct iovec *,
int);
#ifdef SYSCTL_SETUP_PROTO
SYSCTL_SETUP_PROTO(netbsd32_sysctl_emul_setup);
#endif
#ifdef __HAVE_STRUCT_SIGCONTEXT
MODULE_HOOK(netbsd32_sendsig_sigcontext_16_hook, void,
(const struct ksiginfo *, const sigset_t *));
#endif
extern struct sysent netbsd32_sysent[];
extern const uint32_t netbsd32_sysent_nomodbits[];
#ifdef SYSCALL_DEBUG
extern const char * const netbsd32_syscallnames[];
#endif
extern struct sysctlnode netbsd32_sysctl_root;
struct netbsd32_modctl_args;
MODULE_HOOK(compat32_80_modctl_hook, int,
(struct lwp *, const struct netbsd32_modctl_args *, register_t *));
extern struct emul emul_netbsd32;
extern char netbsd32_sigcode[], netbsd32_esigcode[];
void netbsd32_machdep_md_init(void);
void netbsd32_machdep_md_fini(void);
void netbsd32_machdep_md_13_init(void);
void netbsd32_machdep_md_13_fini(void);
void netbsd32_machdep_md_16_init(void);
void netbsd32_machdep_md_16_fini(void);
#endif