2004-01-21 14:28:30 +03:00
|
|
|
/* $NetBSD: netbsd32.h,v 1.27 2004/01/21 11:28:30 mrg Exp $ */
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/*
|
2001-08-25 19:06:02 +04:00
|
|
|
* Copyright (c) 1998, 2001 Matthew R. Green
|
1998-08-26 14:20:33 +04:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
#ifndef _COMPAT_NETBSD32_NETBSD32_H_
|
|
|
|
#define _COMPAT_NETBSD32_NETBSD32_H_
|
1998-10-01 18:27:56 +04:00
|
|
|
/* We need to change the size of register_t */
|
|
|
|
#ifdef syscallargs
|
|
|
|
#undef syscallargs
|
|
|
|
#endif
|
1998-08-26 14:20:33 +04:00
|
|
|
/*
|
1999-03-25 19:58:39 +03:00
|
|
|
* NetBSD 32-bit compatibility module.
|
1998-08-26 14:20:33 +04:00
|
|
|
*/
|
|
|
|
|
2000-12-03 16:15:38 +03:00
|
|
|
#include <sys/systm.h>
|
1998-08-26 14:20:33 +04:00
|
|
|
#include <sys/mount.h>
|
2001-02-02 10:08:17 +03:00
|
|
|
#include <sys/stat.h>
|
2003-01-18 11:28:25 +03:00
|
|
|
#include <sys/sa.h>
|
2001-02-02 10:08:17 +03:00
|
|
|
#include <sys/syscallargs.h>
|
2000-07-09 17:39:31 +04:00
|
|
|
#include <sys/ipc.h>
|
|
|
|
#include <sys/shm.h>
|
2003-10-13 22:55:30 +04:00
|
|
|
#include <sys/ucontext.h>
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/*
|
2002-10-23 17:16:38 +04:00
|
|
|
* first, define the basic types we need.
|
1998-08-26 14:20:33 +04:00
|
|
|
*/
|
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
typedef int32_t netbsd32_long;
|
|
|
|
typedef u_int32_t netbsd32_u_long;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
typedef u_int32_t netbsd32_clock_t;
|
|
|
|
typedef u_int32_t netbsd32_size_t;
|
|
|
|
typedef int32_t netbsd32_ssize_t;
|
|
|
|
typedef int32_t netbsd32_clockid_t;
|
|
|
|
typedef u_int32_t netbsd32_caddr_t;
|
|
|
|
typedef int32_t netbsd32_key_t;
|
1999-07-13 01:55:19 +04:00
|
|
|
typedef int32_t netbsd32_intptr_t;
|
|
|
|
typedef u_int32_t netbsd32_uintptr_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
/*
|
|
|
|
* machine depedant section; must define:
|
|
|
|
* netbsd32_pointer_t
|
|
|
|
* - 32-bit pointer type, normally u_int32_t but can be int32_t
|
|
|
|
* for platforms which rely on sign-extension of pointers
|
|
|
|
* such as SH-5.
|
|
|
|
* NETBSD32PTR64(p32)
|
|
|
|
* - Translate a 32-bit pointer into something valid in a
|
|
|
|
* 64-bit context.
|
|
|
|
* struct netbsd32_sigcontext
|
|
|
|
* - 32bit compatibility sigcontext structure for this arch.
|
|
|
|
* netbsd32_sigcontextp_t
|
|
|
|
* - type of pointer to above, normally u_int32_t
|
|
|
|
* void netbsd32_setregs(struct proc *p, struct exec_package *pack,
|
|
|
|
* u_long stack);
|
|
|
|
* int netbsd32_sigreturn(struct proc *p, void *v,
|
|
|
|
* register_t *retval);
|
|
|
|
* void netbsd32_sendsig(sig_t catcher, int sig, int mask, u_long code);
|
|
|
|
* char netbsd32_esigcode[], netbsd32_sigcode[]
|
|
|
|
* - the above are abvious
|
|
|
|
*
|
|
|
|
* pull in the netbsd32 machine dependant header, that may help with the
|
|
|
|
* above, or it may be provided via the MD layer itself.
|
|
|
|
*/
|
|
|
|
#include <machine/netbsd32_machdep.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* all pointers are netbsd32_pointer_t (defined in <machine/netbsd32_machdep.h>)
|
|
|
|
*/
|
|
|
|
|
|
|
|
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_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;
|
2003-10-13 22:55:30 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_lwpidp;
|
|
|
|
typedef netbsd32_pointer_t netbsd32_ucontextp;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* now, the compatibility structures and their fake pointer types.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* from <sys/types.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_fd_setp_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/* from <sys/uio.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_iovecp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_iovec {
|
|
|
|
netbsd32_voidp iov_base; /* Base address. */
|
|
|
|
netbsd32_size_t iov_len; /* Length. */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/time.h> */
|
1999-03-25 19:22:49 +03:00
|
|
|
typedef int32_t netbsd32_timer_t;
|
1999-12-30 18:40:45 +03:00
|
|
|
typedef int32_t netbsd32_time_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_timespecp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_timespec {
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t tv_sec; /* seconds */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long tv_nsec; /* and nanoseconds */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_timevalp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_timeval {
|
|
|
|
netbsd32_long tv_sec; /* seconds */
|
|
|
|
netbsd32_long tv_usec; /* and microseconds */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_timezonep_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_timezone {
|
1998-08-26 14:20:33 +04:00
|
|
|
int tz_minuteswest; /* minutes west of Greenwich */
|
|
|
|
int tz_dsttime; /* type of dst correction */
|
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_itimervalp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_itimerval {
|
|
|
|
struct netbsd32_timeval it_interval; /* timer interval */
|
|
|
|
struct netbsd32_timeval it_value; /* current value */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/mount.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_fidp_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_fhandlep_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_statfsp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_statfs {
|
1998-08-26 14:20:33 +04:00
|
|
|
short f_type; /* type of file system */
|
|
|
|
u_short f_flags; /* copy of mount flags */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long f_bsize; /* fundamental file system block size */
|
|
|
|
netbsd32_long f_iosize; /* optimal transfer block size */
|
|
|
|
netbsd32_long f_blocks; /* total data blocks in file system */
|
|
|
|
netbsd32_long f_bfree; /* free blocks in fs */
|
|
|
|
netbsd32_long f_bavail; /* free blocks avail to non-superuser */
|
|
|
|
netbsd32_long f_files; /* total file nodes in file system */
|
|
|
|
netbsd32_long f_ffree; /* free file nodes in fs */
|
1998-08-26 14:20:33 +04:00
|
|
|
fsid_t f_fsid; /* file system id */
|
|
|
|
uid_t f_owner; /* user that mounted the file system */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long f_spare[4]; /* spare for later */
|
1998-08-26 14:20:33 +04:00
|
|
|
char f_fstypename[MFSNAMELEN]; /* fs type name */
|
|
|
|
char f_mntonname[MNAMELEN]; /* directory on which mounted */
|
|
|
|
char f_mntfromname[MNAMELEN]; /* mounted file system */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/poll.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_pollfdp_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/* from <sys/resource.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_rusagep_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_rusage {
|
|
|
|
struct netbsd32_timeval ru_utime;/* user time used */
|
|
|
|
struct netbsd32_timeval ru_stime;/* system time used */
|
|
|
|
netbsd32_long ru_maxrss; /* max resident set size */
|
|
|
|
netbsd32_long ru_ixrss; /* integral shared memory size */
|
|
|
|
netbsd32_long ru_idrss; /* integral unshared data " */
|
|
|
|
netbsd32_long ru_isrss; /* integral unshared stack " */
|
|
|
|
netbsd32_long ru_minflt; /* page reclaims */
|
|
|
|
netbsd32_long ru_majflt; /* page faults */
|
|
|
|
netbsd32_long ru_nswap; /* swaps */
|
|
|
|
netbsd32_long ru_inblock; /* block input operations */
|
|
|
|
netbsd32_long ru_oublock; /* block output operations */
|
|
|
|
netbsd32_long ru_msgsnd; /* messages sent */
|
|
|
|
netbsd32_long ru_msgrcv; /* messages received */
|
|
|
|
netbsd32_long ru_nsignals; /* signals received */
|
|
|
|
netbsd32_long ru_nvcsw; /* voluntary context switches */
|
|
|
|
netbsd32_long ru_nivcsw; /* involuntary " */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_orlimitp_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_rlimitp_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2001-02-04 09:35:07 +03:00
|
|
|
struct netbsd32_loadavg {
|
|
|
|
fixpt_t ldavg[3];
|
|
|
|
netbsd32_long fscale;
|
|
|
|
};
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
/* from <sys/ipc.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_ipc_permp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_ipc_perm {
|
1999-10-11 05:36:21 +04:00
|
|
|
ushort cuid; /* creator user id */
|
|
|
|
ushort cgid; /* creator group id */
|
|
|
|
ushort uid; /* user id */
|
|
|
|
ushort gid; /* group id */
|
|
|
|
ushort mode; /* r/w permission */
|
|
|
|
ushort _seq; /* sequence # (to generate unique msg/sem/shm id) */
|
|
|
|
netbsd32_key_t _key; /* user specified msg/sem/shm key */
|
|
|
|
};
|
|
|
|
struct netbsd32_ipc_perm14 {
|
1998-08-26 14:20:33 +04:00
|
|
|
ushort cuid; /* creator user id */
|
|
|
|
ushort cgid; /* creator group id */
|
|
|
|
ushort uid; /* user id */
|
|
|
|
ushort gid; /* group id */
|
|
|
|
ushort mode; /* r/w permission */
|
|
|
|
ushort seq; /* sequence # (to generate unique msg/sem/shm id) */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_key_t key; /* user specified msg/sem/shm key */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/msg.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_msgp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_msg {
|
|
|
|
netbsd32_msgp_t msg_next; /* next msg in the chain */
|
|
|
|
netbsd32_long msg_type; /* type of this message */
|
1998-08-26 14:20:33 +04:00
|
|
|
/* >0 -> type of this message */
|
|
|
|
/* 0 -> free header */
|
|
|
|
u_short msg_ts; /* size of this message */
|
|
|
|
short msg_spot; /* location of start of msg in buffer */
|
|
|
|
};
|
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
typedef u_int32_t netbsd32_msqid_dsp_t;
|
1999-10-11 05:36:21 +04:00
|
|
|
typedef u_int32_t netbsd32_msgqnum_t;
|
|
|
|
typedef netbsd32_size_t netbsd32_msglen_t;
|
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_msqid_ds {
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_ipc_perm msg_perm; /* operation permission strucure */
|
|
|
|
netbsd32_msgqnum_t msg_qnum; /* number of messages in the queue */
|
|
|
|
netbsd32_msglen_t msg_qbytes; /* max # of bytes in the queue */
|
|
|
|
pid_t msg_lspid; /* process ID of last msgsend() */
|
|
|
|
pid_t msg_lrpid; /* process ID of last msgrcv() */
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t msg_stime; /* time of last msgsend() */
|
|
|
|
netbsd32_time_t msg_rtime; /* time of last msgrcv() */
|
|
|
|
netbsd32_time_t msg_ctime; /* time of last change */
|
1999-10-11 05:36:21 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* These members are private and used only in the internal
|
|
|
|
* implementation of this interface.
|
|
|
|
*/
|
|
|
|
netbsd32_msgp_t _msg_first; /* first message in the queue */
|
|
|
|
netbsd32_msgp_t _msg_last; /* last message in the queue */
|
|
|
|
netbsd32_msglen_t _msg_cbytes; /* # of bytes currently in queue */
|
|
|
|
};
|
|
|
|
struct netbsd32_msqid_ds14 {
|
|
|
|
struct netbsd32_ipc_perm14 msg_perm; /* msg queue permission bits */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_msgp_t msg_first; /* first message in the queue */
|
|
|
|
netbsd32_msgp_t msg_last; /* last message in the queue */
|
|
|
|
netbsd32_u_long msg_cbytes; /* number of bytes in use on the queue */
|
|
|
|
netbsd32_u_long msg_qnum; /* number of msgs in the queue */
|
|
|
|
netbsd32_u_long msg_qbytes; /* max # of bytes on the queue */
|
1998-08-26 14:20:33 +04:00
|
|
|
pid_t msg_lspid; /* pid of last msgsnd() */
|
|
|
|
pid_t msg_lrpid; /* pid of last msgrcv() */
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t msg_stime; /* time of last msgsnd() */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long msg_pad1;
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t msg_rtime; /* time of last msgrcv() */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long msg_pad2;
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t msg_ctime; /* time of last msgctl() */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long msg_pad3;
|
|
|
|
netbsd32_long msg_pad4[4];
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/sem.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_semp_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
typedef u_int32_t netbsd32_semid_dsp_t;
|
|
|
|
struct netbsd32_semid_ds {
|
1999-10-11 05:36:21 +04:00
|
|
|
struct netbsd32_ipc_perm sem_perm;/* operation permission struct */
|
|
|
|
unsigned short sem_nsems; /* number of sems in set */
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t sem_otime; /* last operation time */
|
|
|
|
netbsd32_time_t sem_ctime; /* last change time */
|
1999-10-11 05:36:21 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* These members are private and used only in the internal
|
|
|
|
* implementation of this interface.
|
|
|
|
*/
|
|
|
|
netbsd32_semp_t _sem_base; /* pointer to first semaphore in set */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct netbsd32_semid_ds14 {
|
2000-11-18 05:00:50 +03:00
|
|
|
struct netbsd32_ipc_perm14 sem_perm;/* operation permission struct */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_semp_t sem_base; /* pointer to first semaphore in set */
|
1998-08-26 14:20:33 +04:00
|
|
|
unsigned short sem_nsems; /* number of sems in set */
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t sem_otime; /* last operation time */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long sem_pad1; /* SVABI/386 says I need this here */
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t sem_ctime; /* last change time */
|
1998-08-26 14:20:33 +04:00
|
|
|
/* Times measured in secs since */
|
|
|
|
/* 00:00:00 GMT, Jan. 1, 1970 */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long sem_pad2; /* SVABI/386 says I need this here */
|
|
|
|
netbsd32_long sem_pad3[4]; /* SVABI/386 says I need this here */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
1999-03-25 19:22:49 +03:00
|
|
|
typedef u_int32_t netbsd32_semunu_t;
|
|
|
|
union netbsd32_semun {
|
1998-08-26 14:20:33 +04:00
|
|
|
int val; /* value for SETVAL */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_semid_dsp_t buf; /* buffer for IPC_STAT & IPC_SET */
|
|
|
|
netbsd32_u_shortp array; /* array for GETALL & SETALL */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_sembufp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_sembuf {
|
1998-08-26 14:20:33 +04:00
|
|
|
unsigned short sem_num; /* semaphore # */
|
|
|
|
short sem_op; /* semaphore operation */
|
|
|
|
short sem_flg; /* operation flags */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/shm.h> */
|
1999-03-25 19:22:49 +03:00
|
|
|
typedef u_int32_t netbsd32_shmid_dsp_t;
|
|
|
|
struct netbsd32_shmid_ds {
|
|
|
|
struct netbsd32_ipc_perm shm_perm; /* operation permission structure */
|
2000-07-09 17:39:31 +04:00
|
|
|
size_t shm_segsz; /* size of segment in bytes */
|
|
|
|
pid_t shm_lpid; /* process ID of last shm op */
|
|
|
|
pid_t shm_cpid; /* process ID of creator */
|
|
|
|
shmatt_t shm_nattch; /* number of current attaches */
|
|
|
|
netbsd32_time_t shm_atime; /* time of last shmat() */
|
|
|
|
netbsd32_time_t shm_dtime; /* time of last shmdt() */
|
|
|
|
netbsd32_time_t shm_ctime; /* time of last change by shmctl() */
|
|
|
|
netbsd32_voidp _shm_internal; /* sysv stupidity */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct netbsd32_shmid_ds14 {
|
|
|
|
struct netbsd32_ipc_perm14 shm_perm; /* operation permission structure */
|
1998-08-26 14:20:33 +04:00
|
|
|
int shm_segsz; /* size of segment in bytes */
|
|
|
|
pid_t shm_lpid; /* process ID of last shm op */
|
|
|
|
pid_t shm_cpid; /* process ID of creator */
|
|
|
|
short shm_nattch; /* number of current attaches */
|
1999-12-30 18:40:45 +03:00
|
|
|
netbsd32_time_t shm_atime; /* time of last shmat() */
|
|
|
|
netbsd32_time_t shm_dtime; /* time of last shmdt() */
|
|
|
|
netbsd32_time_t shm_ctime; /* time of last change by shmctl() */
|
1999-10-11 05:36:21 +04:00
|
|
|
netbsd32_voidp _shm_internal; /* sysv stupidity */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/signal.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_sigsetp_t;
|
|
|
|
typedef netbsd32_pointer_t netbsd32_sigactionp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_sigaction {
|
2002-11-27 19:44:01 +03:00
|
|
|
netbsd32_voidp netbsd32_sa_handler; /* signal handler */
|
|
|
|
sigset_t netbsd32_sa_mask; /* signal mask to apply */
|
|
|
|
int netbsd32_sa_flags; /* see signal options below */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_sigaltstack13p_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_sigaltstack13 {
|
|
|
|
netbsd32_charp ss_sp; /* signal stack base */
|
1998-08-26 14:20:33 +04:00
|
|
|
int ss_size; /* signal stack length */
|
|
|
|
int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
|
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_sigaltstackp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_sigaltstack {
|
|
|
|
netbsd32_voidp ss_sp; /* signal stack base */
|
|
|
|
netbsd32_size_t ss_size; /* signal stack length */
|
1998-08-26 14:20:33 +04:00
|
|
|
int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
|
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_sigstackp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_sigstack {
|
|
|
|
netbsd32_voidp ss_sp; /* signal stack pointer */
|
1998-08-26 14:20:33 +04:00
|
|
|
int ss_onstack; /* current status */
|
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_sigvecp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_sigvec {
|
|
|
|
netbsd32_voidp sv_handler; /* signal handler */
|
1998-08-26 14:20:33 +04:00
|
|
|
int sv_mask; /* signal mask to apply */
|
|
|
|
int sv_flags; /* see signal options below */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/socket.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_sockaddrp_t;
|
|
|
|
typedef netbsd32_pointer_t netbsd32_osockaddrp_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_msghdrp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_msghdr {
|
|
|
|
netbsd32_caddr_t msg_name; /* optional address */
|
1998-08-26 14:20:33 +04:00
|
|
|
u_int msg_namelen; /* size of address */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_iovecp_t msg_iov; /* scatter/gather array */
|
1998-08-26 14:20:33 +04:00
|
|
|
u_int msg_iovlen; /* # elements in msg_iov */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_caddr_t msg_control; /* ancillary data, see below */
|
1998-08-26 14:20:33 +04:00
|
|
|
u_int msg_controllen; /* ancillary data buffer len */
|
|
|
|
int msg_flags; /* flags on received message */
|
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_omsghdrp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_omsghdr {
|
|
|
|
netbsd32_caddr_t msg_name; /* optional address */
|
1998-08-26 14:20:33 +04:00
|
|
|
int msg_namelen; /* size of address */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_iovecp_t msg_iov; /* scatter/gather array */
|
1998-08-26 14:20:33 +04:00
|
|
|
int msg_iovlen; /* # elements in msg_iov */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_caddr_t msg_accrights; /* access rights sent/received */
|
1998-08-26 14:20:33 +04:00
|
|
|
int msg_accrightslen;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* from <sys/stat.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_stat12p_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_stat12 { /* NetBSD-1.2 stat struct */
|
1998-08-26 14:20:33 +04:00
|
|
|
dev_t st_dev; /* inode's device */
|
|
|
|
ino_t st_ino; /* inode's number */
|
|
|
|
u_int16_t st_mode; /* inode protection mode */
|
|
|
|
u_int16_t st_nlink; /* number of hard links */
|
|
|
|
uid_t st_uid; /* user ID of the file's owner */
|
|
|
|
gid_t st_gid; /* group ID of the file's group */
|
|
|
|
dev_t st_rdev; /* device type */
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_timespec st_atimespec;/* time of last access */
|
|
|
|
struct netbsd32_timespec st_mtimespec;/* time of last data modification */
|
|
|
|
struct netbsd32_timespec st_ctimespec;/* time of last file status change */
|
1998-08-26 14:20:33 +04:00
|
|
|
off_t st_size; /* file size, in bytes */
|
|
|
|
int64_t st_blocks; /* blocks allocated for file */
|
|
|
|
u_int32_t st_blksize; /* optimal blocksize for I/O */
|
|
|
|
u_int32_t st_flags; /* user defined flags for file */
|
|
|
|
u_int32_t st_gen; /* file generation number */
|
|
|
|
int32_t st_lspare;
|
|
|
|
int64_t st_qspare[2];
|
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_stat43p_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_stat43 { /* BSD-4.3 stat struct */
|
1998-08-26 14:20:33 +04:00
|
|
|
u_int16_t st_dev; /* inode's device */
|
|
|
|
ino_t st_ino; /* inode's number */
|
|
|
|
u_int16_t st_mode; /* inode protection mode */
|
|
|
|
u_int16_t st_nlink; /* number of hard links */
|
|
|
|
u_int16_t st_uid; /* user ID of the file's owner */
|
|
|
|
u_int16_t st_gid; /* group ID of the file's group */
|
|
|
|
u_int16_t st_rdev; /* device type */
|
|
|
|
int32_t st_size; /* file size, in bytes */
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_timespec st_atimespec;/* time of last access */
|
|
|
|
struct netbsd32_timespec st_mtimespec;/* time of last data modification */
|
|
|
|
struct netbsd32_timespec st_ctimespec;/* time of last file status change */
|
1998-08-26 14:20:33 +04:00
|
|
|
int32_t st_blksize; /* optimal blocksize for I/O */
|
|
|
|
int32_t st_blocks; /* blocks allocated for file */
|
|
|
|
u_int32_t st_flags; /* user defined flags for file */
|
|
|
|
u_int32_t st_gen; /* file generation number */
|
|
|
|
};
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_statp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_stat {
|
1998-08-26 14:20:33 +04:00
|
|
|
dev_t st_dev; /* inode's device */
|
|
|
|
ino_t st_ino; /* inode's number */
|
|
|
|
mode_t st_mode; /* inode protection mode */
|
|
|
|
nlink_t st_nlink; /* number of hard links */
|
|
|
|
uid_t st_uid; /* user ID of the file's owner */
|
|
|
|
gid_t st_gid; /* group ID of the file's group */
|
|
|
|
dev_t st_rdev; /* device type */
|
1999-12-30 18:40:45 +03:00
|
|
|
struct netbsd32_timespec st_atimespec;/* time of last access */
|
|
|
|
struct netbsd32_timespec st_mtimespec;/* time of last data modification */
|
|
|
|
struct netbsd32_timespec st_ctimespec;/* time of last file status change */
|
1998-08-26 14:20:33 +04:00
|
|
|
off_t st_size; /* file size, in bytes */
|
|
|
|
blkcnt_t st_blocks; /* blocks allocated for file */
|
|
|
|
blksize_t st_blksize; /* optimal blocksize for I/O */
|
|
|
|
u_int32_t st_flags; /* user defined flags for file */
|
|
|
|
u_int32_t st_gen; /* file generation number */
|
|
|
|
int64_t st_qspare[2];
|
2001-06-19 04:36:21 +04:00
|
|
|
}
|
|
|
|
#ifdef __x86_64__
|
|
|
|
__attribute__((packed))
|
|
|
|
#endif
|
|
|
|
;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/* from <sys/timex.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_ntptimevalp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_ntptimeval {
|
|
|
|
struct netbsd32_timeval time; /* current time (ro) */
|
|
|
|
netbsd32_long maxerror; /* maximum error (us) (ro) */
|
|
|
|
netbsd32_long esterror; /* estimated error (us) (ro) */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_timexp_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
struct netbsd32_timex {
|
1998-08-26 14:20:33 +04:00
|
|
|
unsigned int modes; /* clock mode bits (wo) */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long offset; /* time offset (us) (rw) */
|
|
|
|
netbsd32_long freq; /* frequency offset (scaled ppm) (rw) */
|
|
|
|
netbsd32_long maxerror; /* maximum error (us) (rw) */
|
|
|
|
netbsd32_long esterror; /* estimated error (us) (rw) */
|
1998-08-26 14:20:33 +04:00
|
|
|
int status; /* clock status bits (rw) */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long constant; /* pll time constant (rw) */
|
|
|
|
netbsd32_long precision; /* clock precision (us) (ro) */
|
|
|
|
netbsd32_long tolerance; /* clock frequency tolerance (scaled
|
1998-08-26 14:20:33 +04:00
|
|
|
* ppm) (ro) */
|
|
|
|
/*
|
|
|
|
* The following read-only structure members are implemented
|
|
|
|
* only if the PPS signal discipline is configured in the
|
|
|
|
* kernel.
|
|
|
|
*/
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long ppsfreq; /* pps frequency (scaled ppm) (ro) */
|
|
|
|
netbsd32_long jitter; /* pps jitter (us) (ro) */
|
1998-08-26 14:20:33 +04:00
|
|
|
int shift; /* interval duration (s) (shift) (ro) */
|
1999-03-25 19:22:49 +03:00
|
|
|
netbsd32_long stabil; /* pps stability (scaled ppm) (ro) */
|
|
|
|
netbsd32_long jitcnt; /* jitter limit exceeded (ro) */
|
|
|
|
netbsd32_long calcnt; /* calibration intervals (ro) */
|
|
|
|
netbsd32_long errcnt; /* calibration errors (ro) */
|
|
|
|
netbsd32_long stbcnt; /* stability limit exceeded (ro) */
|
1998-08-26 14:20:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* from <ufs/lfs/lfs.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_block_infop_t; /* XXX broken */
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/* from <sys/utsname.h> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_utsnamep_t;
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/* from <compat/common/kern_info_09.c> */
|
2002-10-23 17:16:38 +04:00
|
|
|
typedef netbsd32_pointer_t netbsd32_outsnamep_t;
|
1999-03-25 19:22:49 +03:00
|
|
|
|
2000-08-22 07:35:14 +04:00
|
|
|
/* from <arch/sparc{,64}/include/vuid_event.h> */
|
|
|
|
typedef struct firm_event32 {
|
|
|
|
u_short id; /* key or MS_* or LOC_[XY]_DELTA */
|
|
|
|
u_short pad; /* unused, at least by X11 */
|
|
|
|
int value; /* VKEY_{UP,DOWN} or locator delta */
|
|
|
|
struct netbsd32_timeval time;
|
|
|
|
} Firm_event32;
|
|
|
|
|
2003-10-13 22:55:30 +04:00
|
|
|
void netbsd32_si_to_si32(siginfo32_t *, siginfo_t *);
|
|
|
|
void netbsd32_si32_to_si(siginfo_t *, siginfo32_t *);
|
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
/*
|
1999-03-25 19:22:49 +03:00
|
|
|
* here are some macros to convert between netbsd32 and sparc64 types.
|
1998-08-26 14:20:33 +04:00
|
|
|
* note that they do *NOT* act like good macros and put ()'s around all
|
|
|
|
* arguments cuz this _breaks_ SCARG().
|
|
|
|
*/
|
1999-03-25 19:58:39 +03:00
|
|
|
#define NETBSD32TO64(s32uap, uap, name) \
|
1998-08-26 14:20:33 +04:00
|
|
|
SCARG(uap, name) = SCARG(s32uap, name)
|
1999-03-25 19:58:39 +03:00
|
|
|
#define NETBSD32TOP(s32uap, uap, name, type) \
|
2002-10-23 17:16:38 +04:00
|
|
|
SCARG(uap, name) = (type *)NETBSD32PTR64(SCARG(s32uap, name))
|
1999-03-25 19:58:39 +03:00
|
|
|
#define NETBSD32TOX(s32uap, uap, name, type) \
|
1998-08-26 14:20:33 +04:00
|
|
|
SCARG(uap, name) = (type)SCARG(s32uap, name)
|
1999-03-25 19:58:39 +03:00
|
|
|
#define NETBSD32TOX64(s32uap, uap, name, type) \
|
2002-10-23 17:16:38 +04:00
|
|
|
SCARG(uap, name) = (type)(long)SCARG(s32uap, name)
|
1998-08-26 14:20:33 +04:00
|
|
|
|
|
|
|
/* and some standard versions */
|
1999-03-25 19:58:39 +03:00
|
|
|
#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);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
2003-01-18 11:28:25 +03:00
|
|
|
int coredump_netbsd32(struct lwp *, struct vnode *, struct ucred *);
|
2001-06-07 01:45:56 +04:00
|
|
|
|
1998-08-26 14:20:33 +04:00
|
|
|
/*
|
|
|
|
* random other stuff
|
|
|
|
*/
|
|
|
|
#include <compat/common/compat_util.h>
|
2001-02-02 10:08:17 +03:00
|
|
|
|
|
|
|
void netbsd32_from_stat43 __P((struct stat43 *, struct netbsd32_stat43 *));
|
2003-01-18 11:28:25 +03:00
|
|
|
int netbsd32_execve2(struct lwp *, struct sys_execve_args *, register_t *);
|
1998-08-26 14:20:33 +04:00
|
|
|
|
1999-03-25 19:58:39 +03:00
|
|
|
#endif /* _COMPAT_NETBSD32_NETBSD32_H_ */
|