Home | History | Annotate | Line # | Download | only in netbsd32
netbsd32_netbsd.c revision 1.70
      1  1.70   thorpej /*	$NetBSD: netbsd32_netbsd.c,v 1.70 2003/01/18 08:28:26 thorpej Exp $	*/
      2   1.1       mrg 
      3   1.1       mrg /*
      4  1.57       mrg  * Copyright (c) 1998, 2001 Matthew R. Green
      5   1.1       mrg  * All rights reserved.
      6   1.1       mrg  *
      7   1.1       mrg  * Redistribution and use in source and binary forms, with or without
      8   1.1       mrg  * modification, are permitted provided that the following conditions
      9   1.1       mrg  * are met:
     10   1.1       mrg  * 1. Redistributions of source code must retain the above copyright
     11   1.1       mrg  *    notice, this list of conditions and the following disclaimer.
     12   1.1       mrg  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.1       mrg  *    notice, this list of conditions and the following disclaimer in the
     14   1.1       mrg  *    documentation and/or other materials provided with the distribution.
     15   1.1       mrg  * 3. The name of the author may not be used to endorse or promote products
     16   1.1       mrg  *    derived from this software without specific prior written permission.
     17   1.1       mrg  *
     18   1.1       mrg  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19   1.1       mrg  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20   1.1       mrg  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21   1.1       mrg  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22   1.1       mrg  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     23   1.1       mrg  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     24   1.1       mrg  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     25   1.1       mrg  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     26   1.1       mrg  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     27   1.1       mrg  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     28   1.1       mrg  * SUCH DAMAGE.
     29   1.1       mrg  */
     30  1.62     lukem 
     31  1.62     lukem #include <sys/cdefs.h>
     32  1.70   thorpej __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.70 2003/01/18 08:28:26 thorpej Exp $");
     33   1.1       mrg 
     34  1.58       mrg #if defined(_KERNEL_OPT)
     35  1.28       eeh #include "opt_ddb.h"
     36   1.4       eeh #include "opt_ktrace.h"
     37   1.6       eeh #include "opt_ntp.h"
     38  1.20       eeh #include "opt_compat_netbsd.h"
     39   1.7  drochner #include "opt_compat_43.h"
     40  1.20       eeh #include "opt_sysv.h"
     41   1.7  drochner 
     42   1.6       eeh #include "fs_lfs.h"
     43   1.6       eeh #include "fs_nfs.h"
     44  1.42  jdolecek #endif
     45  1.42  jdolecek 
     46  1.42  jdolecek /*
     47  1.42  jdolecek  * Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
     48  1.42  jdolecek  * HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that
     49  1.42  jdolecek  * this would be LKM-safe.
     50  1.42  jdolecek  */
     51  1.42  jdolecek #define COMPAT_OLDSOCK /* used by <sys/socket.h> */
     52   1.4       eeh 
     53   1.1       mrg #include <sys/param.h>
     54   1.1       mrg #include <sys/systm.h>
     55   1.6       eeh #include <sys/kernel.h>
     56  1.57       mrg //#define msg __msg /* Don't ask me! */
     57   1.1       mrg #include <sys/malloc.h>
     58   1.1       mrg #include <sys/mount.h>
     59   1.1       mrg #include <sys/socket.h>
     60   1.1       mrg #include <sys/sockio.h>
     61   1.6       eeh #include <sys/socketvar.h>
     62   1.6       eeh #include <sys/mbuf.h>
     63   1.1       mrg #include <sys/stat.h>
     64   1.1       mrg #include <sys/time.h>
     65   1.4       eeh #include <sys/signalvar.h>
     66   1.6       eeh #include <sys/ptrace.h>
     67   1.6       eeh #include <sys/ktrace.h>
     68   1.6       eeh #include <sys/trace.h>
     69   1.6       eeh #include <sys/resourcevar.h>
     70   1.6       eeh #include <sys/pool.h>
     71   1.6       eeh #include <sys/vnode.h>
     72   1.6       eeh #include <sys/file.h>
     73   1.6       eeh #include <sys/filedesc.h>
     74   1.6       eeh #include <sys/namei.h>
     75  1.29       mrg 
     76  1.29       mrg #include <uvm/uvm_extern.h>
     77  1.29       mrg 
     78  1.70   thorpej #include <sys/sa.h>
     79   1.1       mrg #include <sys/syscallargs.h>
     80   1.6       eeh #include <sys/proc.h>
     81  1.20       eeh #include <sys/acct.h>
     82  1.20       eeh #include <sys/exec.h>
     83   1.1       mrg 
     84   1.1       mrg #include <net/if.h>
     85   1.1       mrg 
     86  1.10       mrg #include <compat/netbsd32/netbsd32.h>
     87  1.42  jdolecek #include <compat/netbsd32/netbsd32_syscall.h>
     88  1.10       mrg #include <compat/netbsd32/netbsd32_syscallargs.h>
     89  1.56       mrg #include <compat/netbsd32/netbsd32_conv.h>
     90   1.1       mrg 
     91   1.4       eeh #include <machine/frame.h>
     92  1.28       eeh 
     93  1.28       eeh #if defined(DDB)
     94  1.28       eeh #include <ddb/ddbvar.h>
     95  1.28       eeh #endif
     96   1.4       eeh 
     97  1.42  jdolecek extern char netbsd32_sigcode[], netbsd32_esigcode[];
     98  1.42  jdolecek extern struct sysent netbsd32_sysent[];
     99  1.42  jdolecek #ifdef SYSCALL_DEBUG
    100  1.42  jdolecek extern const char * const netbsd32_syscallnames[];
    101  1.42  jdolecek #endif
    102  1.46   mycroft #ifdef __HAVE_SYSCALL_INTERN
    103  1.60      fvdl void netbsd32_syscall_intern __P((struct proc *));
    104  1.46   mycroft #else
    105  1.45  jdolecek void syscall __P((void));
    106  1.46   mycroft #endif
    107  1.42  jdolecek 
    108  1.42  jdolecek const struct emul emul_netbsd32 = {
    109  1.42  jdolecek 	"netbsd32",
    110  1.42  jdolecek 	"/emul/netbsd32",
    111  1.46   mycroft #ifndef __HAVE_MINIMAL_EMUL
    112  1.46   mycroft 	0,
    113  1.42  jdolecek 	NULL,
    114  1.42  jdolecek 	netbsd32_SYS_syscall,
    115  1.67  jdolecek 	netbsd32_SYS_NSYSENT,
    116  1.46   mycroft #endif
    117  1.42  jdolecek 	netbsd32_sysent,
    118  1.42  jdolecek #ifdef SYSCALL_DEBUG
    119  1.42  jdolecek 	netbsd32_syscallnames,
    120  1.42  jdolecek #else
    121  1.42  jdolecek 	NULL,
    122  1.42  jdolecek #endif
    123  1.46   mycroft 	netbsd32_sendsig,
    124  1.59  christos 	trapsignal,
    125  1.42  jdolecek 	netbsd32_sigcode,
    126  1.42  jdolecek 	netbsd32_esigcode,
    127  1.61  jdolecek 	netbsd32_setregs,
    128  1.45  jdolecek 	NULL,
    129  1.45  jdolecek 	NULL,
    130  1.45  jdolecek 	NULL,
    131  1.46   mycroft #ifdef __HAVE_SYSCALL_INTERN
    132  1.60      fvdl 	netbsd32_syscall_intern,
    133  1.46   mycroft #else
    134  1.46   mycroft 	syscall,
    135  1.46   mycroft #endif
    136  1.65      manu 	NULL,
    137  1.65      manu 	NULL,
    138  1.42  jdolecek };
    139  1.42  jdolecek 
    140   1.1       mrg /*
    141   1.1       mrg  * below are all the standard NetBSD system calls, in the 32bit
    142  1.32       mrg  * environment, with the necessary conversions to 64bit before
    143  1.57       mrg  * calling the real syscall.  anything that needs special
    144  1.57       mrg  * attention is handled elsewhere.
    145   1.1       mrg  */
    146   1.1       mrg 
    147   1.6       eeh int
    148  1.70   thorpej netbsd32_exit(l, v, retval)
    149  1.70   thorpej 	struct lwp *l;
    150   1.6       eeh 	void *v;
    151   1.6       eeh 	register_t *retval;
    152   1.6       eeh {
    153  1.19       eeh 	struct netbsd32_exit_args /* {
    154   1.6       eeh 		syscallarg(int) rval;
    155   1.6       eeh 	} */ *uap = v;
    156   1.6       eeh 	struct sys_exit_args ua;
    157   1.6       eeh 
    158  1.11       mrg 	NETBSD32TO64_UAP(rval);
    159  1.70   thorpej 	return sys_exit(l, &ua, retval);
    160   1.6       eeh }
    161   1.6       eeh 
    162   1.1       mrg int
    163  1.70   thorpej netbsd32_read(l, v, retval)
    164  1.70   thorpej 	struct lwp *l;
    165   1.1       mrg 	void *v;
    166   1.1       mrg 	register_t *retval;
    167   1.1       mrg {
    168  1.19       eeh 	struct netbsd32_read_args /* {
    169   1.1       mrg 		syscallarg(int) fd;
    170  1.10       mrg 		syscallarg(netbsd32_voidp) buf;
    171  1.10       mrg 		syscallarg(netbsd32_size_t) nbyte;
    172   1.1       mrg 	} */ *uap = v;
    173   1.1       mrg 	struct sys_read_args ua;
    174   1.1       mrg 
    175  1.11       mrg 	NETBSD32TO64_UAP(fd);
    176  1.11       mrg 	NETBSD32TOP_UAP(buf, void *);
    177  1.11       mrg 	NETBSD32TOX_UAP(nbyte, size_t);
    178  1.70   thorpej 	return sys_read(l, &ua, retval);
    179   1.1       mrg }
    180   1.1       mrg 
    181   1.1       mrg int
    182  1.70   thorpej netbsd32_write(l, v, retval)
    183  1.70   thorpej 	struct lwp *l;
    184   1.1       mrg 	void *v;
    185   1.1       mrg 	register_t *retval;
    186   1.1       mrg {
    187  1.19       eeh 	struct netbsd32_write_args /* {
    188   1.1       mrg 		syscallarg(int) fd;
    189  1.10       mrg 		syscallarg(const netbsd32_voidp) buf;
    190  1.10       mrg 		syscallarg(netbsd32_size_t) nbyte;
    191   1.1       mrg 	} */ *uap = v;
    192   1.1       mrg 	struct sys_write_args ua;
    193   1.1       mrg 
    194  1.11       mrg 	NETBSD32TO64_UAP(fd);
    195  1.11       mrg 	NETBSD32TOP_UAP(buf, void *);
    196  1.11       mrg 	NETBSD32TOX_UAP(nbyte, size_t);
    197  1.70   thorpej 	return sys_write(l, &ua, retval);
    198   1.6       eeh }
    199   1.6       eeh 
    200   1.6       eeh int
    201  1.70   thorpej netbsd32_close(l, v, retval)
    202  1.70   thorpej 	struct lwp *l;
    203   1.6       eeh 	void *v;
    204   1.6       eeh 	register_t *retval;
    205   1.6       eeh {
    206  1.19       eeh 	struct netbsd32_close_args /* {
    207   1.6       eeh 		syscallarg(int) fd;
    208   1.6       eeh 	} */ *uap = v;
    209   1.6       eeh 	struct sys_close_args ua;
    210   1.1       mrg 
    211  1.11       mrg 	NETBSD32TO64_UAP(fd);
    212  1.70   thorpej 	return sys_close(l, &ua, retval);
    213   1.1       mrg }
    214   1.1       mrg 
    215   1.1       mrg int
    216  1.70   thorpej netbsd32_open(l, v, retval)
    217  1.70   thorpej 	struct lwp *l;
    218   1.1       mrg 	void *v;
    219   1.1       mrg 	register_t *retval;
    220   1.1       mrg {
    221  1.19       eeh 	struct netbsd32_open_args /* {
    222  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    223   1.1       mrg 		syscallarg(int) flags;
    224   1.1       mrg 		syscallarg(mode_t) mode;
    225   1.1       mrg 	} */ *uap = v;
    226   1.1       mrg 	struct sys_open_args ua;
    227   1.1       mrg 	caddr_t sg;
    228   1.1       mrg 
    229  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    230  1.11       mrg 	NETBSD32TO64_UAP(flags);
    231  1.11       mrg 	NETBSD32TO64_UAP(mode);
    232  1.70   thorpej 	sg = stackgap_init(l->l_proc, 0);
    233  1.70   thorpej 	CHECK_ALT_EXIST(l->l_proc, &sg, SCARG(&ua, path));
    234   1.1       mrg 
    235  1.70   thorpej 	return (sys_open(l, &ua, retval));
    236   1.1       mrg }
    237   1.1       mrg 
    238   1.1       mrg int
    239  1.70   thorpej netbsd32_link(l, v, retval)
    240  1.70   thorpej 	struct lwp *l;
    241   1.1       mrg 	void *v;
    242   1.1       mrg 	register_t *retval;
    243   1.1       mrg {
    244  1.19       eeh 	struct netbsd32_link_args /* {
    245  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    246  1.10       mrg 		syscallarg(const netbsd32_charp) link;
    247   1.1       mrg 	} */ *uap = v;
    248   1.1       mrg 	struct sys_link_args ua;
    249   1.1       mrg 
    250  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    251  1.11       mrg 	NETBSD32TOP_UAP(link, const char);
    252  1.70   thorpej 	return (sys_link(l, &ua, retval));
    253   1.1       mrg }
    254   1.1       mrg 
    255   1.1       mrg int
    256  1.70   thorpej netbsd32_unlink(l, v, retval)
    257  1.70   thorpej 	struct lwp *l;
    258   1.1       mrg 	void *v;
    259   1.1       mrg 	register_t *retval;
    260   1.1       mrg {
    261  1.19       eeh 	struct netbsd32_unlink_args /* {
    262  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    263   1.1       mrg 	} */ *uap = v;
    264   1.1       mrg 	struct sys_unlink_args ua;
    265   1.1       mrg 
    266  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    267   1.1       mrg 
    268  1.70   thorpej 	return (sys_unlink(l, &ua, retval));
    269   1.1       mrg }
    270   1.1       mrg 
    271   1.1       mrg int
    272  1.70   thorpej netbsd32_chdir(l, v, retval)
    273  1.70   thorpej 	struct lwp *l;
    274   1.1       mrg 	void *v;
    275   1.1       mrg 	register_t *retval;
    276   1.1       mrg {
    277  1.19       eeh 	struct netbsd32_chdir_args /* {
    278  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    279   1.1       mrg 	} */ *uap = v;
    280   1.1       mrg 	struct sys_chdir_args ua;
    281   1.1       mrg 
    282  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    283   1.1       mrg 
    284  1.70   thorpej 	return (sys_chdir(l, &ua, retval));
    285   1.1       mrg }
    286   1.1       mrg 
    287   1.1       mrg int
    288  1.70   thorpej netbsd32_fchdir(l, v, retval)
    289  1.70   thorpej 	struct lwp *l;
    290   1.6       eeh 	void *v;
    291   1.6       eeh 	register_t *retval;
    292   1.6       eeh {
    293  1.19       eeh 	struct netbsd32_fchdir_args /* {
    294   1.6       eeh 		syscallarg(int) fd;
    295   1.6       eeh 	} */ *uap = v;
    296   1.6       eeh 	struct sys_fchdir_args ua;
    297   1.6       eeh 
    298  1.11       mrg 	NETBSD32TO64_UAP(fd);
    299   1.6       eeh 
    300  1.70   thorpej 	return (sys_fchdir(l, &ua, retval));
    301   1.6       eeh }
    302   1.6       eeh 
    303   1.6       eeh int
    304  1.70   thorpej netbsd32_mknod(l, v, retval)
    305  1.70   thorpej 	struct lwp *l;
    306   1.1       mrg 	void *v;
    307   1.1       mrg 	register_t *retval;
    308   1.1       mrg {
    309  1.19       eeh 	struct netbsd32_mknod_args /* {
    310  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    311   1.1       mrg 		syscallarg(mode_t) mode;
    312   1.1       mrg 		syscallarg(dev_t) dev;
    313   1.1       mrg 	} */ *uap = v;
    314   1.1       mrg 	struct sys_mknod_args ua;
    315   1.1       mrg 
    316  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    317  1.11       mrg 	NETBSD32TO64_UAP(dev);
    318  1.11       mrg 	NETBSD32TO64_UAP(mode);
    319   1.1       mrg 
    320  1.70   thorpej 	return (sys_mknod(l, &ua, retval));
    321   1.1       mrg }
    322   1.1       mrg 
    323   1.1       mrg int
    324  1.70   thorpej netbsd32_chmod(l, v, retval)
    325  1.70   thorpej 	struct lwp *l;
    326   1.1       mrg 	void *v;
    327   1.1       mrg 	register_t *retval;
    328   1.1       mrg {
    329  1.19       eeh 	struct netbsd32_chmod_args /* {
    330  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    331   1.1       mrg 		syscallarg(mode_t) mode;
    332   1.1       mrg 	} */ *uap = v;
    333   1.1       mrg 	struct sys_chmod_args ua;
    334   1.1       mrg 
    335  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    336  1.11       mrg 	NETBSD32TO64_UAP(mode);
    337   1.1       mrg 
    338  1.70   thorpej 	return (sys_chmod(l, &ua, retval));
    339   1.1       mrg }
    340   1.1       mrg 
    341   1.1       mrg int
    342  1.70   thorpej netbsd32_chown(l, v, retval)
    343  1.70   thorpej 	struct lwp *l;
    344   1.1       mrg 	void *v;
    345   1.1       mrg 	register_t *retval;
    346   1.1       mrg {
    347  1.19       eeh 	struct netbsd32_chown_args /* {
    348  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    349   1.1       mrg 		syscallarg(uid_t) uid;
    350   1.1       mrg 		syscallarg(gid_t) gid;
    351   1.1       mrg 	} */ *uap = v;
    352   1.1       mrg 	struct sys_chown_args ua;
    353   1.1       mrg 
    354  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    355  1.11       mrg 	NETBSD32TO64_UAP(uid);
    356  1.11       mrg 	NETBSD32TO64_UAP(gid);
    357   1.1       mrg 
    358  1.70   thorpej 	return (sys_chown(l, &ua, retval));
    359   1.1       mrg }
    360   1.1       mrg 
    361   1.1       mrg int
    362  1.70   thorpej netbsd32_break(l, v, retval)
    363  1.70   thorpej 	struct lwp *l;
    364   1.1       mrg 	void *v;
    365   1.1       mrg 	register_t *retval;
    366   1.1       mrg {
    367  1.19       eeh 	struct netbsd32_break_args /* {
    368  1.10       mrg 		syscallarg(netbsd32_charp) nsize;
    369   1.1       mrg 	} */ *uap = v;
    370   1.1       mrg 	struct sys_obreak_args ua;
    371   1.1       mrg 
    372  1.66       scw 	SCARG(&ua, nsize) = (char *)NETBSD32PTR64(SCARG(uap, nsize));
    373  1.11       mrg 	NETBSD32TOP_UAP(nsize, char);
    374  1.70   thorpej 	return (sys_obreak(l, &ua, retval));
    375   1.1       mrg }
    376   1.1       mrg 
    377   1.1       mrg int
    378  1.70   thorpej netbsd32_mount(l, v, retval)
    379  1.70   thorpej 	struct lwp *l;
    380   1.1       mrg 	void *v;
    381   1.1       mrg 	register_t *retval;
    382   1.1       mrg {
    383  1.19       eeh 	struct netbsd32_mount_args /* {
    384  1.10       mrg 		syscallarg(const netbsd32_charp) type;
    385  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    386   1.1       mrg 		syscallarg(int) flags;
    387  1.10       mrg 		syscallarg(netbsd32_voidp) data;
    388   1.1       mrg 	} */ *uap = v;
    389   1.1       mrg 	struct sys_mount_args ua;
    390   1.1       mrg 
    391  1.11       mrg 	NETBSD32TOP_UAP(type, const char);
    392  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    393  1.11       mrg 	NETBSD32TO64_UAP(flags);
    394  1.11       mrg 	NETBSD32TOP_UAP(data, void);
    395  1.70   thorpej 	return (sys_mount(l, &ua, retval));
    396   1.1       mrg }
    397   1.1       mrg 
    398   1.1       mrg int
    399  1.70   thorpej netbsd32_unmount(l, v, retval)
    400  1.70   thorpej 	struct lwp *l;
    401   1.1       mrg 	void *v;
    402   1.1       mrg 	register_t *retval;
    403   1.1       mrg {
    404  1.19       eeh 	struct netbsd32_unmount_args /* {
    405  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    406   1.1       mrg 		syscallarg(int) flags;
    407   1.1       mrg 	} */ *uap = v;
    408   1.1       mrg 	struct sys_unmount_args ua;
    409   1.1       mrg 
    410  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    411  1.11       mrg 	NETBSD32TO64_UAP(flags);
    412  1.70   thorpej 	return (sys_unmount(l, &ua, retval));
    413   1.1       mrg }
    414   1.1       mrg 
    415   1.1       mrg int
    416  1.70   thorpej netbsd32_setuid(l, v, retval)
    417  1.70   thorpej 	struct lwp *l;
    418   1.6       eeh 	void *v;
    419   1.6       eeh 	register_t *retval;
    420   1.6       eeh {
    421  1.19       eeh 	struct netbsd32_setuid_args /* {
    422   1.6       eeh 		syscallarg(uid_t) uid;
    423   1.6       eeh 	} */ *uap = v;
    424   1.6       eeh 	struct sys_setuid_args ua;
    425   1.6       eeh 
    426  1.11       mrg 	NETBSD32TO64_UAP(uid);
    427  1.70   thorpej 	return (sys_setuid(l, &ua, retval));
    428   1.6       eeh }
    429   1.6       eeh 
    430   1.6       eeh int
    431  1.70   thorpej netbsd32_ptrace(l, v, retval)
    432  1.70   thorpej 	struct lwp *l;
    433   1.1       mrg 	void *v;
    434   1.1       mrg 	register_t *retval;
    435   1.1       mrg {
    436  1.19       eeh 	struct netbsd32_ptrace_args /* {
    437   1.1       mrg 		syscallarg(int) req;
    438   1.1       mrg 		syscallarg(pid_t) pid;
    439  1.10       mrg 		syscallarg(netbsd32_caddr_t) addr;
    440   1.1       mrg 		syscallarg(int) data;
    441   1.1       mrg 	} */ *uap = v;
    442   1.1       mrg 	struct sys_ptrace_args ua;
    443   1.1       mrg 
    444  1.11       mrg 	NETBSD32TO64_UAP(req);
    445  1.11       mrg 	NETBSD32TO64_UAP(pid);
    446  1.11       mrg 	NETBSD32TOX64_UAP(addr, caddr_t);
    447  1.11       mrg 	NETBSD32TO64_UAP(data);
    448  1.70   thorpej 	return (sys_ptrace(l, &ua, retval));
    449   1.1       mrg }
    450   1.1       mrg 
    451   1.1       mrg int
    452  1.70   thorpej netbsd32_accept(l, v, retval)
    453  1.70   thorpej 	struct lwp *l;
    454   1.1       mrg 	void *v;
    455   1.1       mrg 	register_t *retval;
    456   1.1       mrg {
    457  1.19       eeh 	struct netbsd32_accept_args /* {
    458   1.1       mrg 		syscallarg(int) s;
    459  1.10       mrg 		syscallarg(netbsd32_sockaddrp_t) name;
    460  1.10       mrg 		syscallarg(netbsd32_intp) anamelen;
    461   1.1       mrg 	} */ *uap = v;
    462   1.1       mrg 	struct sys_accept_args ua;
    463   1.1       mrg 
    464  1.11       mrg 	NETBSD32TO64_UAP(s);
    465  1.11       mrg 	NETBSD32TOP_UAP(name, struct sockaddr);
    466  1.11       mrg 	NETBSD32TOP_UAP(anamelen, int);
    467  1.70   thorpej 	return (sys_accept(l, &ua, retval));
    468   1.1       mrg }
    469   1.1       mrg 
    470   1.1       mrg int
    471  1.70   thorpej netbsd32_getpeername(l, v, retval)
    472  1.70   thorpej 	struct lwp *l;
    473   1.1       mrg 	void *v;
    474   1.1       mrg 	register_t *retval;
    475   1.1       mrg {
    476  1.19       eeh 	struct netbsd32_getpeername_args /* {
    477   1.1       mrg 		syscallarg(int) fdes;
    478  1.10       mrg 		syscallarg(netbsd32_sockaddrp_t) asa;
    479  1.10       mrg 		syscallarg(netbsd32_intp) alen;
    480   1.1       mrg 	} */ *uap = v;
    481   1.1       mrg 	struct sys_getpeername_args ua;
    482   1.1       mrg 
    483  1.11       mrg 	NETBSD32TO64_UAP(fdes);
    484  1.11       mrg 	NETBSD32TOP_UAP(asa, struct sockaddr);
    485  1.11       mrg 	NETBSD32TOP_UAP(alen, int);
    486   1.6       eeh /* NB: do the protocol specific sockaddrs need to be converted? */
    487  1.70   thorpej 	return (sys_getpeername(l, &ua, retval));
    488   1.1       mrg }
    489   1.1       mrg 
    490   1.1       mrg int
    491  1.70   thorpej netbsd32_getsockname(l, v, retval)
    492  1.70   thorpej 	struct lwp *l;
    493   1.1       mrg 	void *v;
    494   1.1       mrg 	register_t *retval;
    495   1.1       mrg {
    496  1.19       eeh 	struct netbsd32_getsockname_args /* {
    497   1.1       mrg 		syscallarg(int) fdes;
    498  1.10       mrg 		syscallarg(netbsd32_sockaddrp_t) asa;
    499  1.10       mrg 		syscallarg(netbsd32_intp) alen;
    500   1.1       mrg 	} */ *uap = v;
    501   1.1       mrg 	struct sys_getsockname_args ua;
    502   1.1       mrg 
    503  1.11       mrg 	NETBSD32TO64_UAP(fdes);
    504  1.11       mrg 	NETBSD32TOP_UAP(asa, struct sockaddr);
    505  1.11       mrg 	NETBSD32TOP_UAP(alen, int);
    506  1.70   thorpej 	return (sys_getsockname(l, &ua, retval));
    507   1.1       mrg }
    508   1.1       mrg 
    509   1.1       mrg int
    510  1.70   thorpej netbsd32_access(l, v, retval)
    511  1.70   thorpej 	struct lwp *l;
    512   1.1       mrg 	void *v;
    513   1.1       mrg 	register_t *retval;
    514   1.1       mrg {
    515  1.19       eeh 	struct netbsd32_access_args /* {
    516  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    517   1.1       mrg 		syscallarg(int) flags;
    518   1.1       mrg 	} */ *uap = v;
    519   1.1       mrg 	struct sys_access_args ua;
    520   1.1       mrg 	caddr_t sg;
    521   1.1       mrg 
    522  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    523  1.11       mrg 	NETBSD32TO64_UAP(flags);
    524  1.70   thorpej 	sg = stackgap_init(l->l_proc, 0);
    525  1.70   thorpej 	CHECK_ALT_EXIST(l->l_proc, &sg, SCARG(&ua, path));
    526   1.1       mrg 
    527  1.70   thorpej 	return (sys_access(l, &ua, retval));
    528   1.1       mrg }
    529   1.1       mrg 
    530   1.1       mrg int
    531  1.70   thorpej netbsd32_chflags(l, v, retval)
    532  1.70   thorpej 	struct lwp *l;
    533   1.1       mrg 	void *v;
    534   1.1       mrg 	register_t *retval;
    535   1.1       mrg {
    536  1.19       eeh 	struct netbsd32_chflags_args /* {
    537  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    538  1.10       mrg 		syscallarg(netbsd32_u_long) flags;
    539   1.1       mrg 	} */ *uap = v;
    540   1.1       mrg 	struct sys_chflags_args ua;
    541   1.1       mrg 
    542  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    543  1.11       mrg 	NETBSD32TO64_UAP(flags);
    544   1.1       mrg 
    545  1.70   thorpej 	return (sys_chflags(l, &ua, retval));
    546   1.1       mrg }
    547   1.1       mrg 
    548   1.1       mrg int
    549  1.70   thorpej netbsd32_fchflags(l, v, retval)
    550  1.70   thorpej 	struct lwp *l;
    551   1.1       mrg 	void *v;
    552   1.1       mrg 	register_t *retval;
    553   1.1       mrg {
    554  1.19       eeh 	struct netbsd32_fchflags_args /* {
    555   1.1       mrg 		syscallarg(int) fd;
    556  1.10       mrg 		syscallarg(netbsd32_u_long) flags;
    557   1.1       mrg 	} */ *uap = v;
    558   1.1       mrg 	struct sys_fchflags_args ua;
    559   1.1       mrg 
    560  1.11       mrg 	NETBSD32TO64_UAP(fd);
    561  1.11       mrg 	NETBSD32TO64_UAP(flags);
    562   1.1       mrg 
    563  1.70   thorpej 	return (sys_fchflags(l, &ua, retval));
    564   1.1       mrg }
    565   1.1       mrg 
    566   1.1       mrg int
    567  1.70   thorpej netbsd32_lchflags(l, v, retval)
    568  1.70   thorpej 	struct lwp *l;
    569  1.50       mrg 	void *v;
    570  1.50       mrg 	register_t *retval;
    571  1.50       mrg {
    572  1.50       mrg 	struct netbsd32_lchflags_args /* {
    573  1.50       mrg 		syscallarg(int) fd;
    574  1.50       mrg 		syscallarg(netbsd32_u_long) flags;
    575  1.50       mrg 	} */ *uap = v;
    576  1.50       mrg 	struct sys_lchflags_args ua;
    577  1.50       mrg 
    578  1.50       mrg 	NETBSD32TOP_UAP(path, const char);
    579  1.50       mrg 	NETBSD32TO64_UAP(flags);
    580  1.50       mrg 
    581  1.70   thorpej 	return (sys_lchflags(l, &ua, retval));
    582  1.50       mrg }
    583  1.50       mrg 
    584  1.50       mrg int
    585  1.70   thorpej netbsd32_kill(l, v, retval)
    586  1.70   thorpej 	struct lwp *l;
    587   1.6       eeh 	void *v;
    588   1.6       eeh 	register_t *retval;
    589   1.6       eeh {
    590  1.19       eeh 	struct netbsd32_kill_args /* {
    591   1.6       eeh 		syscallarg(int) pid;
    592   1.6       eeh 		syscallarg(int) signum;
    593   1.6       eeh 	} */ *uap = v;
    594   1.6       eeh 	struct sys_kill_args ua;
    595   1.6       eeh 
    596  1.11       mrg 	NETBSD32TO64_UAP(pid);
    597  1.11       mrg 	NETBSD32TO64_UAP(signum);
    598   1.6       eeh 
    599  1.70   thorpej 	return (sys_kill(l, &ua, retval));
    600   1.6       eeh }
    601   1.6       eeh 
    602   1.6       eeh int
    603  1.70   thorpej netbsd32_dup(l, v, retval)
    604  1.70   thorpej 	struct lwp *l;
    605   1.6       eeh 	void *v;
    606   1.6       eeh 	register_t *retval;
    607   1.6       eeh {
    608  1.19       eeh 	struct netbsd32_dup_args /* {
    609   1.6       eeh 		syscallarg(int) fd;
    610   1.6       eeh 	} */ *uap = v;
    611   1.6       eeh 	struct sys_dup_args ua;
    612   1.6       eeh 
    613  1.11       mrg 	NETBSD32TO64_UAP(fd);
    614   1.6       eeh 
    615  1.70   thorpej 	return (sys_dup(l, &ua, retval));
    616   1.6       eeh }
    617   1.6       eeh 
    618   1.6       eeh int
    619  1.70   thorpej netbsd32_profil(l, v, retval)
    620  1.70   thorpej 	struct lwp *l;
    621   1.1       mrg 	void *v;
    622   1.1       mrg 	register_t *retval;
    623   1.1       mrg {
    624  1.19       eeh 	struct netbsd32_profil_args /* {
    625  1.10       mrg 		syscallarg(netbsd32_caddr_t) samples;
    626  1.10       mrg 		syscallarg(netbsd32_size_t) size;
    627  1.10       mrg 		syscallarg(netbsd32_u_long) offset;
    628   1.1       mrg 		syscallarg(u_int) scale;
    629   1.1       mrg 	} */ *uap = v;
    630   1.1       mrg 	struct sys_profil_args ua;
    631   1.1       mrg 
    632  1.11       mrg 	NETBSD32TOX64_UAP(samples, caddr_t);
    633  1.11       mrg 	NETBSD32TOX_UAP(size, size_t);
    634  1.11       mrg 	NETBSD32TOX_UAP(offset, u_long);
    635  1.11       mrg 	NETBSD32TO64_UAP(scale);
    636  1.70   thorpej 	return (sys_profil(l, &ua, retval));
    637   1.1       mrg }
    638   1.1       mrg 
    639  1.42  jdolecek #ifdef KTRACE
    640   1.1       mrg int
    641  1.70   thorpej netbsd32_ktrace(l, v, retval)
    642  1.70   thorpej 	struct lwp *l;
    643   1.1       mrg 	void *v;
    644   1.1       mrg 	register_t *retval;
    645   1.1       mrg {
    646  1.19       eeh 	struct netbsd32_ktrace_args /* {
    647  1.10       mrg 		syscallarg(const netbsd32_charp) fname;
    648   1.1       mrg 		syscallarg(int) ops;
    649   1.1       mrg 		syscallarg(int) facs;
    650   1.1       mrg 		syscallarg(int) pid;
    651   1.1       mrg 	} */ *uap = v;
    652   1.1       mrg 	struct sys_ktrace_args ua;
    653   1.1       mrg 
    654  1.11       mrg 	NETBSD32TOP_UAP(fname, const char);
    655  1.11       mrg 	NETBSD32TO64_UAP(ops);
    656  1.11       mrg 	NETBSD32TO64_UAP(facs);
    657  1.11       mrg 	NETBSD32TO64_UAP(pid);
    658  1.70   thorpej 	return (sys_ktrace(l, &ua, retval));
    659   1.1       mrg }
    660  1.42  jdolecek #endif /* KTRACE */
    661  1.50       mrg 
    662  1.50       mrg int
    663  1.70   thorpej netbsd32_utrace(l, v, retval)
    664  1.70   thorpej 	struct lwp *l;
    665  1.50       mrg 	void *v;
    666  1.50       mrg 	register_t *retval;
    667  1.50       mrg {
    668  1.50       mrg 	struct netbsd32_utrace_args /* {
    669  1.50       mrg 		syscallarg(const netbsd32_charp) label;
    670  1.50       mrg 		syscallarg(netbsd32_voidp) addr;
    671  1.50       mrg 		syscallarg(netbsd32_size_t) len;
    672  1.50       mrg 	} */ *uap = v;
    673  1.50       mrg 	struct sys_utrace_args ua;
    674  1.50       mrg 
    675  1.50       mrg 	NETBSD32TOP_UAP(label, const char);
    676  1.50       mrg 	NETBSD32TOP_UAP(addr, void);
    677  1.50       mrg 	NETBSD32TO64_UAP(len);
    678  1.70   thorpej 	return (sys_utrace(l, &ua, retval));
    679  1.50       mrg }
    680   1.1       mrg 
    681   1.1       mrg int
    682  1.70   thorpej netbsd32___getlogin(l, v, retval)
    683  1.70   thorpej 	struct lwp *l;
    684   1.1       mrg 	void *v;
    685   1.1       mrg 	register_t *retval;
    686   1.1       mrg {
    687  1.19       eeh 	struct netbsd32___getlogin_args /* {
    688  1.10       mrg 		syscallarg(netbsd32_charp) namebuf;
    689   1.1       mrg 		syscallarg(u_int) namelen;
    690   1.1       mrg 	} */ *uap = v;
    691   1.1       mrg 	struct sys___getlogin_args ua;
    692   1.1       mrg 
    693  1.11       mrg 	NETBSD32TOP_UAP(namebuf, char);
    694  1.11       mrg 	NETBSD32TO64_UAP(namelen);
    695  1.70   thorpej 	return (sys___getlogin(l, &ua, retval));
    696   1.1       mrg }
    697   1.1       mrg 
    698   1.1       mrg int
    699  1.70   thorpej netbsd32_setlogin(l, v, retval)
    700  1.70   thorpej 	struct lwp *l;
    701   1.1       mrg 	void *v;
    702   1.1       mrg 	register_t *retval;
    703   1.1       mrg {
    704  1.19       eeh 	struct netbsd32_setlogin_args /* {
    705  1.10       mrg 		syscallarg(const netbsd32_charp) namebuf;
    706   1.1       mrg 	} */ *uap = v;
    707  1.70   thorpej 	struct sys___setlogin_args ua;
    708   1.1       mrg 
    709  1.11       mrg 	NETBSD32TOP_UAP(namebuf, char);
    710  1.70   thorpej 	return (sys___setlogin(l, &ua, retval));
    711   1.1       mrg }
    712   1.1       mrg 
    713   1.1       mrg int
    714  1.70   thorpej netbsd32_acct(l, v, retval)
    715  1.70   thorpej 	struct lwp *l;
    716   1.1       mrg 	void *v;
    717   1.1       mrg 	register_t *retval;
    718   1.1       mrg {
    719  1.19       eeh 	struct netbsd32_acct_args /* {
    720  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    721   1.1       mrg 	} */ *uap = v;
    722   1.1       mrg 	struct sys_acct_args ua;
    723   1.1       mrg 
    724  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    725  1.70   thorpej 	return (sys_acct(l, &ua, retval));
    726   1.1       mrg }
    727   1.1       mrg 
    728   1.1       mrg int
    729  1.70   thorpej netbsd32_revoke(l, v, retval)
    730  1.70   thorpej 	struct lwp *l;
    731   1.1       mrg 	void *v;
    732   1.1       mrg 	register_t *retval;
    733   1.1       mrg {
    734  1.19       eeh 	struct netbsd32_revoke_args /* {
    735  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    736   1.1       mrg 	} */ *uap = v;
    737   1.1       mrg 	struct sys_revoke_args ua;
    738   1.1       mrg 	caddr_t sg;
    739   1.1       mrg 
    740  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    741  1.70   thorpej 	sg = stackgap_init(l->l_proc, 0);
    742  1.70   thorpej 	CHECK_ALT_EXIST(l->l_proc, &sg, SCARG(&ua, path));
    743   1.1       mrg 
    744  1.70   thorpej 	return (sys_revoke(l, &ua, retval));
    745   1.1       mrg }
    746   1.1       mrg 
    747   1.1       mrg int
    748  1.70   thorpej netbsd32_symlink(l, v, retval)
    749  1.70   thorpej 	struct lwp *l;
    750   1.1       mrg 	void *v;
    751   1.1       mrg 	register_t *retval;
    752   1.1       mrg {
    753  1.19       eeh 	struct netbsd32_symlink_args /* {
    754  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    755  1.10       mrg 		syscallarg(const netbsd32_charp) link;
    756   1.1       mrg 	} */ *uap = v;
    757   1.1       mrg 	struct sys_symlink_args ua;
    758   1.1       mrg 
    759  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    760  1.11       mrg 	NETBSD32TOP_UAP(link, const char);
    761   1.1       mrg 
    762  1.70   thorpej 	return (sys_symlink(l, &ua, retval));
    763   1.1       mrg }
    764   1.1       mrg 
    765   1.1       mrg int
    766  1.70   thorpej netbsd32_readlink(l, v, retval)
    767  1.70   thorpej 	struct lwp *l;
    768   1.1       mrg 	void *v;
    769   1.1       mrg 	register_t *retval;
    770   1.1       mrg {
    771  1.19       eeh 	struct netbsd32_readlink_args /* {
    772  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    773  1.10       mrg 		syscallarg(netbsd32_charp) buf;
    774  1.10       mrg 		syscallarg(netbsd32_size_t) count;
    775   1.1       mrg 	} */ *uap = v;
    776   1.1       mrg 	struct sys_readlink_args ua;
    777   1.1       mrg 	caddr_t sg;
    778   1.1       mrg 
    779  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    780  1.11       mrg 	NETBSD32TOP_UAP(buf, char);
    781  1.11       mrg 	NETBSD32TOX_UAP(count, size_t);
    782  1.70   thorpej 	sg = stackgap_init(l->l_proc, 0);
    783  1.70   thorpej 	CHECK_ALT_SYMLINK(l->l_proc, &sg, SCARG(&ua, path));
    784   1.1       mrg 
    785  1.70   thorpej 	return (sys_readlink(l, &ua, retval));
    786   1.1       mrg }
    787   1.1       mrg 
    788   1.1       mrg int
    789  1.70   thorpej netbsd32_umask(l, v, retval)
    790  1.70   thorpej 	struct lwp *l;
    791   1.6       eeh 	void *v;
    792   1.6       eeh 	register_t *retval;
    793   1.6       eeh {
    794  1.19       eeh 	struct netbsd32_umask_args /* {
    795   1.6       eeh 		syscallarg(mode_t) newmask;
    796   1.6       eeh 	} */ *uap = v;
    797   1.6       eeh 	struct sys_umask_args ua;
    798   1.6       eeh 
    799  1.11       mrg 	NETBSD32TO64_UAP(newmask);
    800  1.70   thorpej 	return (sys_umask(l, &ua, retval));
    801   1.6       eeh }
    802   1.6       eeh 
    803   1.6       eeh int
    804  1.70   thorpej netbsd32_chroot(l, v, retval)
    805  1.70   thorpej 	struct lwp *l;
    806   1.1       mrg 	void *v;
    807   1.1       mrg 	register_t *retval;
    808   1.1       mrg {
    809  1.19       eeh 	struct netbsd32_chroot_args /* {
    810  1.10       mrg 		syscallarg(const netbsd32_charp) path;
    811   1.1       mrg 	} */ *uap = v;
    812   1.1       mrg 	struct sys_chroot_args ua;
    813   1.1       mrg 
    814  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
    815  1.70   thorpej 	return (sys_chroot(l, &ua, retval));
    816   1.1       mrg }
    817   1.1       mrg 
    818   1.1       mrg int
    819  1.70   thorpej netbsd32_sbrk(l, v, retval)
    820  1.70   thorpej 	struct lwp *l;
    821   1.6       eeh 	void *v;
    822   1.6       eeh 	register_t *retval;
    823   1.6       eeh {
    824  1.19       eeh 	struct netbsd32_sbrk_args /* {
    825   1.6       eeh 		syscallarg(int) incr;
    826   1.6       eeh 	} */ *uap = v;
    827   1.6       eeh 	struct sys_sbrk_args ua;
    828   1.6       eeh 
    829  1.11       mrg 	NETBSD32TO64_UAP(incr);
    830  1.70   thorpej 	return (sys_sbrk(l, &ua, retval));
    831   1.6       eeh }
    832   1.6       eeh 
    833   1.6       eeh int
    834  1.70   thorpej netbsd32_sstk(l, v, retval)
    835  1.70   thorpej 	struct lwp *l;
    836   1.6       eeh 	void *v;
    837   1.6       eeh 	register_t *retval;
    838   1.6       eeh {
    839  1.19       eeh 	struct netbsd32_sstk_args /* {
    840   1.6       eeh 		syscallarg(int) incr;
    841   1.6       eeh 	} */ *uap = v;
    842   1.6       eeh 	struct sys_sstk_args ua;
    843   1.6       eeh 
    844  1.11       mrg 	NETBSD32TO64_UAP(incr);
    845  1.70   thorpej 	return (sys_sstk(l, &ua, retval));
    846   1.6       eeh }
    847   1.6       eeh 
    848   1.6       eeh int
    849  1.70   thorpej netbsd32_munmap(l, v, retval)
    850  1.70   thorpej 	struct lwp *l;
    851   1.1       mrg 	void *v;
    852   1.1       mrg 	register_t *retval;
    853   1.1       mrg {
    854  1.19       eeh 	struct netbsd32_munmap_args /* {
    855  1.10       mrg 		syscallarg(netbsd32_voidp) addr;
    856  1.10       mrg 		syscallarg(netbsd32_size_t) len;
    857   1.1       mrg 	} */ *uap = v;
    858   1.1       mrg 	struct sys_munmap_args ua;
    859   1.1       mrg 
    860  1.11       mrg 	NETBSD32TOP_UAP(addr, void);
    861  1.11       mrg 	NETBSD32TOX_UAP(len, size_t);
    862  1.70   thorpej 	return (sys_munmap(l, &ua, retval));
    863   1.1       mrg }
    864   1.1       mrg 
    865   1.1       mrg int
    866  1.70   thorpej netbsd32_mprotect(l, v, retval)
    867  1.70   thorpej 	struct lwp *l;
    868   1.1       mrg 	void *v;
    869   1.1       mrg 	register_t *retval;
    870   1.1       mrg {
    871  1.19       eeh 	struct netbsd32_mprotect_args /* {
    872  1.10       mrg 		syscallarg(netbsd32_voidp) addr;
    873  1.10       mrg 		syscallarg(netbsd32_size_t) len;
    874   1.1       mrg 		syscallarg(int) prot;
    875   1.1       mrg 	} */ *uap = v;
    876   1.1       mrg 	struct sys_mprotect_args ua;
    877   1.1       mrg 
    878  1.11       mrg 	NETBSD32TOP_UAP(addr, void);
    879  1.11       mrg 	NETBSD32TOX_UAP(len, size_t);
    880  1.11       mrg 	NETBSD32TO64_UAP(prot);
    881  1.70   thorpej 	return (sys_mprotect(l, &ua, retval));
    882   1.1       mrg }
    883   1.1       mrg 
    884   1.1       mrg int
    885  1.70   thorpej netbsd32_madvise(l, v, retval)
    886  1.70   thorpej 	struct lwp *l;
    887   1.1       mrg 	void *v;
    888   1.1       mrg 	register_t *retval;
    889   1.1       mrg {
    890  1.19       eeh 	struct netbsd32_madvise_args /* {
    891  1.10       mrg 		syscallarg(netbsd32_voidp) addr;
    892  1.10       mrg 		syscallarg(netbsd32_size_t) len;
    893   1.1       mrg 		syscallarg(int) behav;
    894   1.1       mrg 	} */ *uap = v;
    895   1.1       mrg 	struct sys_madvise_args ua;
    896   1.1       mrg 
    897  1.11       mrg 	NETBSD32TOP_UAP(addr, void);
    898  1.11       mrg 	NETBSD32TOX_UAP(len, size_t);
    899  1.11       mrg 	NETBSD32TO64_UAP(behav);
    900  1.70   thorpej 	return (sys_madvise(l, &ua, retval));
    901   1.1       mrg }
    902   1.1       mrg 
    903   1.1       mrg int
    904  1.70   thorpej netbsd32_mincore(l, v, retval)
    905  1.70   thorpej 	struct lwp *l;
    906   1.1       mrg 	void *v;
    907   1.1       mrg 	register_t *retval;
    908   1.1       mrg {
    909  1.19       eeh 	struct netbsd32_mincore_args /* {
    910  1.10       mrg 		syscallarg(netbsd32_caddr_t) addr;
    911  1.10       mrg 		syscallarg(netbsd32_size_t) len;
    912  1.10       mrg 		syscallarg(netbsd32_charp) vec;
    913   1.1       mrg 	} */ *uap = v;
    914   1.1       mrg 	struct sys_mincore_args ua;
    915   1.1       mrg 
    916  1.11       mrg 	NETBSD32TOX64_UAP(addr, caddr_t);
    917  1.11       mrg 	NETBSD32TOX_UAP(len, size_t);
    918  1.11       mrg 	NETBSD32TOP_UAP(vec, char);
    919  1.70   thorpej 	return (sys_mincore(l, &ua, retval));
    920   1.1       mrg }
    921   1.1       mrg 
    922  1.57       mrg /* XXX MOVE ME XXX ? */
    923   1.1       mrg int
    924  1.70   thorpej netbsd32_getgroups(l, v, retval)
    925  1.70   thorpej 	struct lwp *l;
    926   1.1       mrg 	void *v;
    927   1.1       mrg 	register_t *retval;
    928   1.1       mrg {
    929  1.19       eeh 	struct netbsd32_getgroups_args /* {
    930   1.1       mrg 		syscallarg(int) gidsetsize;
    931  1.10       mrg 		syscallarg(netbsd32_gid_tp) gidset;
    932   1.1       mrg 	} */ *uap = v;
    933  1.70   thorpej 	struct pcred *pc = l->l_proc->p_cred;
    934  1.25  augustss 	int ngrp;
    935   1.6       eeh 	int error;
    936   1.1       mrg 
    937   1.6       eeh 	ngrp = SCARG(uap, gidsetsize);
    938   1.6       eeh 	if (ngrp == 0) {
    939   1.6       eeh 		*retval = pc->pc_ucred->cr_ngroups;
    940   1.6       eeh 		return (0);
    941   1.6       eeh 	}
    942   1.6       eeh 	if (ngrp < pc->pc_ucred->cr_ngroups)
    943   1.6       eeh 		return (EINVAL);
    944   1.6       eeh 	ngrp = pc->pc_ucred->cr_ngroups;
    945  1.10       mrg 	/* Should convert gid_t to netbsd32_gid_t, but they're the same */
    946   1.6       eeh 	error = copyout((caddr_t)pc->pc_ucred->cr_groups,
    947  1.66       scw 	    (caddr_t)NETBSD32PTR64(SCARG(uap, gidset)), ngrp * sizeof(gid_t));
    948   1.6       eeh 	if (error)
    949   1.6       eeh 		return (error);
    950   1.6       eeh 	*retval = ngrp;
    951   1.6       eeh 	return (0);
    952   1.1       mrg }
    953   1.1       mrg 
    954   1.1       mrg int
    955  1.70   thorpej netbsd32_setgroups(l, v, retval)
    956  1.70   thorpej 	struct lwp *l;
    957   1.1       mrg 	void *v;
    958   1.1       mrg 	register_t *retval;
    959   1.1       mrg {
    960  1.19       eeh 	struct netbsd32_setgroups_args /* {
    961   1.1       mrg 		syscallarg(int) gidsetsize;
    962  1.10       mrg 		syscallarg(const netbsd32_gid_tp) gidset;
    963   1.1       mrg 	} */ *uap = v;
    964   1.1       mrg 	struct sys_setgroups_args ua;
    965   1.1       mrg 
    966  1.11       mrg 	NETBSD32TO64_UAP(gidsetsize);
    967  1.11       mrg 	NETBSD32TOP_UAP(gidset, gid_t);
    968  1.70   thorpej 	return (sys_setgroups(l, &ua, retval));
    969   1.1       mrg }
    970   1.1       mrg 
    971   1.1       mrg int
    972  1.70   thorpej netbsd32_setpgid(l, v, retval)
    973  1.70   thorpej 	struct lwp *l;
    974   1.6       eeh 	void *v;
    975   1.6       eeh 	register_t *retval;
    976   1.6       eeh {
    977  1.19       eeh 	struct netbsd32_setpgid_args /* {
    978   1.6       eeh 		syscallarg(int) pid;
    979   1.6       eeh 		syscallarg(int) pgid;
    980   1.6       eeh 	} */ *uap = v;
    981   1.6       eeh 	struct sys_setpgid_args ua;
    982   1.6       eeh 
    983  1.11       mrg 	NETBSD32TO64_UAP(pid);
    984  1.11       mrg 	NETBSD32TO64_UAP(pgid);
    985  1.70   thorpej 	return (sys_setpgid(l, &ua, retval));
    986   1.6       eeh }
    987   1.6       eeh 
    988   1.1       mrg int
    989  1.70   thorpej netbsd32_fcntl(l, v, retval)
    990  1.70   thorpej 	struct lwp *l;
    991   1.1       mrg 	void *v;
    992   1.1       mrg 	register_t *retval;
    993   1.1       mrg {
    994  1.19       eeh 	struct netbsd32_fcntl_args /* {
    995   1.1       mrg 		syscallarg(int) fd;
    996   1.1       mrg 		syscallarg(int) cmd;
    997  1.10       mrg 		syscallarg(netbsd32_voidp) arg;
    998   1.1       mrg 	} */ *uap = v;
    999   1.1       mrg 	struct sys_fcntl_args ua;
   1000   1.1       mrg 
   1001  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1002  1.11       mrg 	NETBSD32TO64_UAP(cmd);
   1003  1.11       mrg 	NETBSD32TOP_UAP(arg, void);
   1004  1.54       mrg 	/* we can do this because `struct flock' doesn't change */
   1005  1.70   thorpej 	return (sys_fcntl(l, &ua, retval));
   1006   1.1       mrg }
   1007   1.1       mrg 
   1008   1.1       mrg int
   1009  1.70   thorpej netbsd32_dup2(l, v, retval)
   1010  1.70   thorpej 	struct lwp *l;
   1011   1.6       eeh 	void *v;
   1012   1.6       eeh 	register_t *retval;
   1013   1.6       eeh {
   1014  1.19       eeh 	struct netbsd32_dup2_args /* {
   1015   1.6       eeh 		syscallarg(int) from;
   1016   1.6       eeh 		syscallarg(int) to;
   1017   1.6       eeh 	} */ *uap = v;
   1018   1.6       eeh 	struct sys_dup2_args ua;
   1019   1.6       eeh 
   1020  1.11       mrg 	NETBSD32TO64_UAP(from);
   1021  1.11       mrg 	NETBSD32TO64_UAP(to);
   1022  1.70   thorpej 	return (sys_dup2(l, &ua, retval));
   1023   1.6       eeh }
   1024   1.6       eeh 
   1025   1.6       eeh int
   1026  1.70   thorpej netbsd32_fsync(l, v, retval)
   1027  1.70   thorpej 	struct lwp *l;
   1028   1.6       eeh 	void *v;
   1029   1.6       eeh 	register_t *retval;
   1030   1.6       eeh {
   1031  1.19       eeh 	struct netbsd32_fsync_args /* {
   1032   1.6       eeh 		syscallarg(int) fd;
   1033   1.6       eeh 	} */ *uap = v;
   1034   1.6       eeh 	struct sys_fsync_args ua;
   1035   1.1       mrg 
   1036  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1037  1.70   thorpej 	return (sys_fsync(l, &ua, retval));
   1038   1.6       eeh }
   1039   1.6       eeh 
   1040   1.6       eeh int
   1041  1.70   thorpej netbsd32_setpriority(l, v, retval)
   1042  1.70   thorpej 	struct lwp *l;
   1043   1.6       eeh 	void *v;
   1044   1.6       eeh 	register_t *retval;
   1045   1.6       eeh {
   1046  1.19       eeh 	struct netbsd32_setpriority_args /* {
   1047   1.6       eeh 		syscallarg(int) which;
   1048   1.6       eeh 		syscallarg(int) who;
   1049   1.6       eeh 		syscallarg(int) prio;
   1050   1.6       eeh 	} */ *uap = v;
   1051   1.6       eeh 	struct sys_setpriority_args ua;
   1052   1.6       eeh 
   1053  1.11       mrg 	NETBSD32TO64_UAP(which);
   1054  1.11       mrg 	NETBSD32TO64_UAP(who);
   1055  1.11       mrg 	NETBSD32TO64_UAP(prio);
   1056  1.70   thorpej 	return (sys_setpriority(l, &ua, retval));
   1057   1.6       eeh }
   1058   1.6       eeh 
   1059   1.6       eeh int
   1060  1.70   thorpej netbsd32_socket(l, v, retval)
   1061  1.70   thorpej 	struct lwp *l;
   1062   1.6       eeh 	void *v;
   1063   1.6       eeh 	register_t *retval;
   1064   1.6       eeh {
   1065  1.19       eeh 	struct netbsd32_socket_args /* {
   1066   1.6       eeh 		syscallarg(int) domain;
   1067   1.6       eeh 		syscallarg(int) type;
   1068   1.6       eeh 		syscallarg(int) protocol;
   1069   1.6       eeh 	} */ *uap = v;
   1070   1.6       eeh 	struct sys_socket_args ua;
   1071   1.6       eeh 
   1072  1.11       mrg 	NETBSD32TO64_UAP(domain);
   1073  1.11       mrg 	NETBSD32TO64_UAP(type);
   1074  1.11       mrg 	NETBSD32TO64_UAP(protocol);
   1075  1.70   thorpej 	return (sys_socket(l, &ua, retval));
   1076   1.1       mrg }
   1077   1.1       mrg 
   1078   1.1       mrg int
   1079  1.70   thorpej netbsd32_connect(l, v, retval)
   1080  1.70   thorpej 	struct lwp *l;
   1081   1.1       mrg 	void *v;
   1082   1.1       mrg 	register_t *retval;
   1083   1.1       mrg {
   1084  1.19       eeh 	struct netbsd32_connect_args /* {
   1085   1.1       mrg 		syscallarg(int) s;
   1086  1.10       mrg 		syscallarg(const netbsd32_sockaddrp_t) name;
   1087   1.1       mrg 		syscallarg(int) namelen;
   1088   1.1       mrg 	} */ *uap = v;
   1089   1.1       mrg 	struct sys_connect_args ua;
   1090   1.1       mrg 
   1091  1.11       mrg 	NETBSD32TO64_UAP(s);
   1092  1.11       mrg 	NETBSD32TOP_UAP(name, struct sockaddr);
   1093  1.11       mrg 	NETBSD32TO64_UAP(namelen);
   1094  1.70   thorpej 	return (sys_connect(l, &ua, retval));
   1095   1.1       mrg }
   1096   1.1       mrg 
   1097   1.6       eeh int
   1098  1.70   thorpej netbsd32_getpriority(l, v, retval)
   1099  1.70   thorpej 	struct lwp *l;
   1100   1.6       eeh 	void *v;
   1101   1.6       eeh 	register_t *retval;
   1102   1.6       eeh {
   1103  1.19       eeh 	struct netbsd32_getpriority_args /* {
   1104   1.6       eeh 		syscallarg(int) which;
   1105   1.6       eeh 		syscallarg(int) who;
   1106   1.6       eeh 	} */ *uap = v;
   1107   1.6       eeh 	struct sys_getpriority_args ua;
   1108   1.6       eeh 
   1109  1.11       mrg 	NETBSD32TO64_UAP(which);
   1110  1.11       mrg 	NETBSD32TO64_UAP(who);
   1111  1.70   thorpej 	return (sys_getpriority(l, &ua, retval));
   1112   1.6       eeh }
   1113   1.6       eeh 
   1114   1.1       mrg int
   1115  1.70   thorpej netbsd32_bind(l, v, retval)
   1116  1.70   thorpej 	struct lwp *l;
   1117   1.1       mrg 	void *v;
   1118   1.1       mrg 	register_t *retval;
   1119   1.1       mrg {
   1120  1.19       eeh 	struct netbsd32_bind_args /* {
   1121   1.1       mrg 		syscallarg(int) s;
   1122  1.10       mrg 		syscallarg(const netbsd32_sockaddrp_t) name;
   1123   1.1       mrg 		syscallarg(int) namelen;
   1124   1.1       mrg 	} */ *uap = v;
   1125   1.6       eeh 	struct sys_bind_args ua;
   1126   1.1       mrg 
   1127  1.11       mrg 	NETBSD32TO64_UAP(s);
   1128  1.11       mrg 	NETBSD32TOP_UAP(name, struct sockaddr);
   1129  1.11       mrg 	NETBSD32TO64_UAP(namelen);
   1130  1.70   thorpej 	return (sys_bind(l, &ua, retval));
   1131   1.1       mrg }
   1132   1.1       mrg 
   1133   1.1       mrg int
   1134  1.70   thorpej netbsd32_setsockopt(l, v, retval)
   1135  1.70   thorpej 	struct lwp *l;
   1136   1.1       mrg 	void *v;
   1137   1.1       mrg 	register_t *retval;
   1138   1.1       mrg {
   1139  1.19       eeh 	struct netbsd32_setsockopt_args /* {
   1140   1.1       mrg 		syscallarg(int) s;
   1141   1.1       mrg 		syscallarg(int) level;
   1142   1.1       mrg 		syscallarg(int) name;
   1143  1.10       mrg 		syscallarg(const netbsd32_voidp) val;
   1144   1.1       mrg 		syscallarg(int) valsize;
   1145   1.1       mrg 	} */ *uap = v;
   1146   1.1       mrg 	struct sys_setsockopt_args ua;
   1147   1.1       mrg 
   1148  1.11       mrg 	NETBSD32TO64_UAP(s);
   1149  1.11       mrg 	NETBSD32TO64_UAP(level);
   1150  1.11       mrg 	NETBSD32TO64_UAP(name);
   1151  1.11       mrg 	NETBSD32TOP_UAP(val, void);
   1152  1.11       mrg 	NETBSD32TO64_UAP(valsize);
   1153   1.6       eeh 	/* may be more efficient to do this inline. */
   1154  1.70   thorpej 	return (sys_setsockopt(l, &ua, retval));
   1155   1.1       mrg }
   1156   1.1       mrg 
   1157   1.1       mrg int
   1158  1.70   thorpej netbsd32_listen(l, v, retval)
   1159  1.70   thorpej 	struct lwp *l;
   1160   1.6       eeh 	void *v;
   1161   1.6       eeh 	register_t *retval;
   1162   1.6       eeh {
   1163  1.19       eeh 	struct netbsd32_listen_args /* {
   1164   1.6       eeh 		syscallarg(int) s;
   1165   1.6       eeh 		syscallarg(int) backlog;
   1166   1.6       eeh 	} */ *uap = v;
   1167   1.6       eeh 	struct sys_listen_args ua;
   1168   1.6       eeh 
   1169  1.11       mrg 	NETBSD32TO64_UAP(s);
   1170  1.11       mrg 	NETBSD32TO64_UAP(backlog);
   1171  1.70   thorpej 	return (sys_listen(l, &ua, retval));
   1172   1.6       eeh }
   1173   1.6       eeh 
   1174   1.6       eeh int
   1175  1.70   thorpej netbsd32_fchown(l, v, retval)
   1176  1.70   thorpej 	struct lwp *l;
   1177   1.1       mrg 	void *v;
   1178   1.1       mrg 	register_t *retval;
   1179   1.1       mrg {
   1180  1.57       mrg 	struct netbsd32_fchown_args /* {
   1181  1.57       mrg 		syscallarg(int) fd;
   1182  1.57       mrg 		syscallarg(uid_t) uid;
   1183  1.57       mrg 		syscallarg(gid_t) gid;
   1184   1.1       mrg 	} */ *uap = v;
   1185  1.57       mrg 	struct sys_fchown_args ua;
   1186   1.6       eeh 
   1187  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1188  1.11       mrg 	NETBSD32TO64_UAP(uid);
   1189  1.11       mrg 	NETBSD32TO64_UAP(gid);
   1190  1.70   thorpej 	return (sys_fchown(l, &ua, retval));
   1191   1.6       eeh }
   1192   1.6       eeh 
   1193   1.6       eeh int
   1194  1.70   thorpej netbsd32_fchmod(l, v, retval)
   1195  1.70   thorpej 	struct lwp *l;
   1196   1.6       eeh 	void *v;
   1197   1.6       eeh 	register_t *retval;
   1198   1.6       eeh {
   1199  1.19       eeh 	struct netbsd32_fchmod_args /* {
   1200   1.6       eeh 		syscallarg(int) fd;
   1201   1.6       eeh 		syscallarg(mode_t) mode;
   1202   1.6       eeh 	} */ *uap = v;
   1203   1.6       eeh 	struct sys_fchmod_args ua;
   1204   1.6       eeh 
   1205  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1206  1.11       mrg 	NETBSD32TO64_UAP(mode);
   1207  1.70   thorpej 	return (sys_fchmod(l, &ua, retval));
   1208   1.6       eeh }
   1209   1.6       eeh 
   1210   1.6       eeh int
   1211  1.70   thorpej netbsd32_setreuid(l, v, retval)
   1212  1.70   thorpej 	struct lwp *l;
   1213   1.6       eeh 	void *v;
   1214   1.6       eeh 	register_t *retval;
   1215   1.6       eeh {
   1216  1.19       eeh 	struct netbsd32_setreuid_args /* {
   1217   1.6       eeh 		syscallarg(uid_t) ruid;
   1218   1.6       eeh 		syscallarg(uid_t) euid;
   1219   1.6       eeh 	} */ *uap = v;
   1220   1.6       eeh 	struct sys_setreuid_args ua;
   1221   1.6       eeh 
   1222  1.11       mrg 	NETBSD32TO64_UAP(ruid);
   1223  1.11       mrg 	NETBSD32TO64_UAP(euid);
   1224  1.70   thorpej 	return (sys_setreuid(l, &ua, retval));
   1225   1.6       eeh }
   1226   1.1       mrg 
   1227   1.6       eeh int
   1228  1.70   thorpej netbsd32_setregid(l, v, retval)
   1229  1.70   thorpej 	struct lwp *l;
   1230   1.6       eeh 	void *v;
   1231   1.6       eeh 	register_t *retval;
   1232   1.6       eeh {
   1233  1.19       eeh 	struct netbsd32_setregid_args /* {
   1234   1.6       eeh 		syscallarg(gid_t) rgid;
   1235   1.6       eeh 		syscallarg(gid_t) egid;
   1236   1.6       eeh 	} */ *uap = v;
   1237   1.6       eeh 	struct sys_setregid_args ua;
   1238   1.6       eeh 
   1239  1.11       mrg 	NETBSD32TO64_UAP(rgid);
   1240  1.11       mrg 	NETBSD32TO64_UAP(egid);
   1241  1.70   thorpej 	return (sys_setregid(l, &ua, retval));
   1242   1.1       mrg }
   1243   1.1       mrg 
   1244   1.1       mrg int
   1245  1.70   thorpej netbsd32_getsockopt(l, v, retval)
   1246  1.70   thorpej 	struct lwp *l;
   1247   1.1       mrg 	void *v;
   1248   1.1       mrg 	register_t *retval;
   1249   1.1       mrg {
   1250  1.19       eeh 	struct netbsd32_getsockopt_args /* {
   1251   1.1       mrg 		syscallarg(int) s;
   1252   1.1       mrg 		syscallarg(int) level;
   1253   1.1       mrg 		syscallarg(int) name;
   1254  1.10       mrg 		syscallarg(netbsd32_voidp) val;
   1255  1.10       mrg 		syscallarg(netbsd32_intp) avalsize;
   1256   1.1       mrg 	} */ *uap = v;
   1257   1.1       mrg 	struct sys_getsockopt_args ua;
   1258   1.1       mrg 
   1259  1.11       mrg 	NETBSD32TO64_UAP(s);
   1260  1.11       mrg 	NETBSD32TO64_UAP(level);
   1261  1.11       mrg 	NETBSD32TO64_UAP(name);
   1262  1.11       mrg 	NETBSD32TOP_UAP(val, void);
   1263  1.11       mrg 	NETBSD32TOP_UAP(avalsize, int);
   1264  1.70   thorpej 	return (sys_getsockopt(l, &ua, retval));
   1265   1.1       mrg }
   1266   1.1       mrg 
   1267   1.1       mrg int
   1268  1.70   thorpej netbsd32_rename(l, v, retval)
   1269  1.70   thorpej 	struct lwp *l;
   1270   1.1       mrg 	void *v;
   1271   1.1       mrg 	register_t *retval;
   1272   1.1       mrg {
   1273  1.19       eeh 	struct netbsd32_rename_args /* {
   1274  1.10       mrg 		syscallarg(const netbsd32_charp) from;
   1275  1.10       mrg 		syscallarg(const netbsd32_charp) to;
   1276   1.1       mrg 	} */ *uap = v;
   1277   1.1       mrg 	struct sys_rename_args ua;
   1278   1.1       mrg 
   1279  1.20       eeh 	NETBSD32TOP_UAP(from, const char);
   1280  1.20       eeh 	NETBSD32TOP_UAP(to, const char)
   1281   1.6       eeh 
   1282  1.70   thorpej 	return (sys_rename(l, &ua, retval));
   1283   1.1       mrg }
   1284   1.1       mrg 
   1285   1.1       mrg int
   1286  1.70   thorpej netbsd32_flock(l, v, retval)
   1287  1.70   thorpej 	struct lwp *l;
   1288   1.6       eeh 	void *v;
   1289   1.6       eeh 	register_t *retval;
   1290   1.6       eeh {
   1291  1.19       eeh 	struct netbsd32_flock_args /* {
   1292   1.6       eeh 		syscallarg(int) fd;
   1293   1.6       eeh 		syscallarg(int) how;
   1294   1.6       eeh 	} */ *uap = v;
   1295   1.6       eeh 	struct sys_flock_args ua;
   1296   1.6       eeh 
   1297  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1298  1.11       mrg 	NETBSD32TO64_UAP(how)
   1299   1.6       eeh 
   1300  1.70   thorpej 	return (sys_flock(l, &ua, retval));
   1301   1.6       eeh }
   1302   1.6       eeh 
   1303   1.6       eeh int
   1304  1.70   thorpej netbsd32_mkfifo(l, v, retval)
   1305  1.70   thorpej 	struct lwp *l;
   1306   1.1       mrg 	void *v;
   1307   1.1       mrg 	register_t *retval;
   1308   1.1       mrg {
   1309  1.19       eeh 	struct netbsd32_mkfifo_args /* {
   1310  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   1311   1.1       mrg 		syscallarg(mode_t) mode;
   1312   1.1       mrg 	} */ *uap = v;
   1313   1.1       mrg 	struct sys_mkfifo_args ua;
   1314   1.1       mrg 
   1315  1.11       mrg 	NETBSD32TOP_UAP(path, const char)
   1316  1.11       mrg 	NETBSD32TO64_UAP(mode);
   1317  1.70   thorpej 	return (sys_mkfifo(l, &ua, retval));
   1318   1.1       mrg }
   1319   1.1       mrg 
   1320   1.1       mrg int
   1321  1.70   thorpej netbsd32_shutdown(l, v, retval)
   1322  1.70   thorpej 	struct lwp *l;
   1323   1.6       eeh 	void *v;
   1324   1.6       eeh 	register_t *retval;
   1325   1.6       eeh {
   1326  1.19       eeh 	struct netbsd32_shutdown_args /* {
   1327   1.6       eeh 		syscallarg(int) s;
   1328   1.6       eeh 		syscallarg(int) how;
   1329   1.6       eeh 	} */ *uap = v;
   1330   1.6       eeh 	struct sys_shutdown_args ua;
   1331   1.6       eeh 
   1332  1.11       mrg 	NETBSD32TO64_UAP(s)
   1333  1.11       mrg 	NETBSD32TO64_UAP(how);
   1334  1.70   thorpej 	return (sys_shutdown(l, &ua, retval));
   1335   1.6       eeh }
   1336   1.6       eeh 
   1337   1.6       eeh int
   1338  1.70   thorpej netbsd32_socketpair(l, v, retval)
   1339  1.70   thorpej 	struct lwp *l;
   1340   1.6       eeh 	void *v;
   1341   1.6       eeh 	register_t *retval;
   1342   1.6       eeh {
   1343  1.19       eeh 	struct netbsd32_socketpair_args /* {
   1344   1.6       eeh 		syscallarg(int) domain;
   1345   1.6       eeh 		syscallarg(int) type;
   1346   1.6       eeh 		syscallarg(int) protocol;
   1347  1.10       mrg 		syscallarg(netbsd32_intp) rsv;
   1348   1.6       eeh 	} */ *uap = v;
   1349   1.6       eeh 	struct sys_socketpair_args ua;
   1350   1.6       eeh 
   1351  1.11       mrg 	NETBSD32TO64_UAP(domain);
   1352  1.11       mrg 	NETBSD32TO64_UAP(type);
   1353  1.11       mrg 	NETBSD32TO64_UAP(protocol);
   1354  1.11       mrg 	NETBSD32TOP_UAP(rsv, int);
   1355   1.6       eeh 	/* Since we're just copying out two `int's we can do this */
   1356  1.70   thorpej 	return (sys_socketpair(l, &ua, retval));
   1357   1.6       eeh }
   1358   1.6       eeh 
   1359   1.6       eeh int
   1360  1.70   thorpej netbsd32_mkdir(l, v, retval)
   1361  1.70   thorpej 	struct lwp *l;
   1362   1.1       mrg 	void *v;
   1363   1.1       mrg 	register_t *retval;
   1364   1.1       mrg {
   1365  1.19       eeh 	struct netbsd32_mkdir_args /* {
   1366  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   1367   1.1       mrg 		syscallarg(mode_t) mode;
   1368   1.1       mrg 	} */ *uap = v;
   1369   1.1       mrg 	struct sys_mkdir_args ua;
   1370   1.1       mrg 
   1371  1.11       mrg 	NETBSD32TOP_UAP(path, const char)
   1372  1.11       mrg 	NETBSD32TO64_UAP(mode);
   1373  1.70   thorpej 	return (sys_mkdir(l, &ua, retval));
   1374   1.1       mrg }
   1375   1.1       mrg 
   1376   1.1       mrg int
   1377  1.70   thorpej netbsd32_rmdir(l, v, retval)
   1378  1.70   thorpej 	struct lwp *l;
   1379   1.1       mrg 	void *v;
   1380   1.1       mrg 	register_t *retval;
   1381   1.1       mrg {
   1382  1.19       eeh 	struct netbsd32_rmdir_args /* {
   1383  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   1384   1.1       mrg 	} */ *uap = v;
   1385   1.1       mrg 	struct sys_rmdir_args ua;
   1386   1.1       mrg 
   1387  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   1388  1.70   thorpej 	return (sys_rmdir(l, &ua, retval));
   1389   1.1       mrg }
   1390   1.1       mrg 
   1391   1.1       mrg int
   1392  1.70   thorpej netbsd32_quotactl(l, v, retval)
   1393  1.70   thorpej 	struct lwp *l;
   1394   1.1       mrg 	void *v;
   1395   1.1       mrg 	register_t *retval;
   1396   1.1       mrg {
   1397  1.19       eeh 	struct netbsd32_quotactl_args /* {
   1398  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   1399   1.1       mrg 		syscallarg(int) cmd;
   1400   1.1       mrg 		syscallarg(int) uid;
   1401  1.10       mrg 		syscallarg(netbsd32_caddr_t) arg;
   1402   1.1       mrg 	} */ *uap = v;
   1403   1.1       mrg 	struct sys_quotactl_args ua;
   1404   1.1       mrg 
   1405  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   1406  1.11       mrg 	NETBSD32TO64_UAP(cmd);
   1407  1.11       mrg 	NETBSD32TO64_UAP(uid);
   1408  1.11       mrg 	NETBSD32TOX64_UAP(arg, caddr_t);
   1409  1.70   thorpej 	return (sys_quotactl(l, &ua, retval));
   1410   1.1       mrg }
   1411   1.1       mrg 
   1412   1.6       eeh #if defined(NFS) || defined(NFSSERVER)
   1413   1.1       mrg int
   1414  1.70   thorpej netbsd32_nfssvc(l, v, retval)
   1415  1.70   thorpej 	struct lwp *l;
   1416   1.1       mrg 	void *v;
   1417   1.1       mrg 	register_t *retval;
   1418   1.1       mrg {
   1419   1.6       eeh #if 0
   1420  1.19       eeh 	struct netbsd32_nfssvc_args /* {
   1421   1.1       mrg 		syscallarg(int) flag;
   1422  1.10       mrg 		syscallarg(netbsd32_voidp) argp;
   1423   1.1       mrg 	} */ *uap = v;
   1424   1.1       mrg 	struct sys_nfssvc_args ua;
   1425   1.1       mrg 
   1426  1.11       mrg 	NETBSD32TO64_UAP(flag);
   1427  1.11       mrg 	NETBSD32TOP_UAP(argp, void);
   1428  1.70   thorpej 	return (sys_nfssvc(l, &ua, retval));
   1429   1.6       eeh #else
   1430   1.6       eeh 	/* Why would we want to support a 32-bit nfsd? */
   1431   1.6       eeh 	return (ENOSYS);
   1432   1.6       eeh #endif
   1433   1.1       mrg }
   1434   1.6       eeh #endif
   1435   1.1       mrg 
   1436   1.6       eeh #if defined(NFS) || defined(NFSSERVER)
   1437   1.1       mrg int
   1438  1.70   thorpej netbsd32_getfh(l, v, retval)
   1439  1.70   thorpej 	struct lwp *l;
   1440   1.1       mrg 	void *v;
   1441   1.1       mrg 	register_t *retval;
   1442   1.1       mrg {
   1443  1.19       eeh 	struct netbsd32_getfh_args /* {
   1444  1.10       mrg 		syscallarg(const netbsd32_charp) fname;
   1445  1.10       mrg 		syscallarg(netbsd32_fhandlep_t) fhp;
   1446   1.1       mrg 	} */ *uap = v;
   1447   1.1       mrg 	struct sys_getfh_args ua;
   1448   1.1       mrg 
   1449  1.11       mrg 	NETBSD32TOP_UAP(fname, const char);
   1450  1.11       mrg 	NETBSD32TOP_UAP(fhp, struct fhandle);
   1451   1.6       eeh 	/* Lucky for us a fhandlep_t doesn't change sizes */
   1452  1.70   thorpej 	return (sys_getfh(l, &ua, retval));
   1453   1.1       mrg }
   1454   1.6       eeh #endif
   1455   1.1       mrg 
   1456   1.1       mrg int
   1457  1.70   thorpej netbsd32_pread(l, v, retval)
   1458  1.70   thorpej 	struct lwp *l;
   1459   1.1       mrg 	void *v;
   1460   1.1       mrg 	register_t *retval;
   1461   1.1       mrg {
   1462  1.19       eeh 	struct netbsd32_pread_args /* {
   1463   1.1       mrg 		syscallarg(int) fd;
   1464  1.10       mrg 		syscallarg(netbsd32_voidp) buf;
   1465  1.10       mrg 		syscallarg(netbsd32_size_t) nbyte;
   1466   1.1       mrg 		syscallarg(int) pad;
   1467   1.1       mrg 		syscallarg(off_t) offset;
   1468   1.1       mrg 	} */ *uap = v;
   1469   1.1       mrg 	struct sys_pread_args ua;
   1470   1.1       mrg 	ssize_t rt;
   1471   1.1       mrg 	int error;
   1472   1.1       mrg 
   1473  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1474  1.11       mrg 	NETBSD32TOP_UAP(buf, void);
   1475  1.11       mrg 	NETBSD32TOX_UAP(nbyte, size_t);
   1476  1.11       mrg 	NETBSD32TO64_UAP(pad);
   1477  1.11       mrg 	NETBSD32TO64_UAP(offset);
   1478  1.70   thorpej 	error = sys_pread(l, &ua, (register_t *)&rt);
   1479  1.32       mrg 	*retval = rt;
   1480   1.1       mrg 	return (error);
   1481   1.1       mrg }
   1482   1.1       mrg 
   1483   1.1       mrg int
   1484  1.70   thorpej netbsd32_pwrite(l, v, retval)
   1485  1.70   thorpej 	struct lwp *l;
   1486   1.1       mrg 	void *v;
   1487   1.1       mrg 	register_t *retval;
   1488   1.1       mrg {
   1489  1.19       eeh 	struct netbsd32_pwrite_args /* {
   1490   1.1       mrg 		syscallarg(int) fd;
   1491  1.10       mrg 		syscallarg(const netbsd32_voidp) buf;
   1492  1.10       mrg 		syscallarg(netbsd32_size_t) nbyte;
   1493   1.1       mrg 		syscallarg(int) pad;
   1494   1.1       mrg 		syscallarg(off_t) offset;
   1495   1.1       mrg 	} */ *uap = v;
   1496   1.1       mrg 	struct sys_pwrite_args ua;
   1497   1.1       mrg 	ssize_t rt;
   1498   1.1       mrg 	int error;
   1499   1.1       mrg 
   1500  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1501  1.11       mrg 	NETBSD32TOP_UAP(buf, void);
   1502  1.11       mrg 	NETBSD32TOX_UAP(nbyte, size_t);
   1503  1.11       mrg 	NETBSD32TO64_UAP(pad);
   1504  1.11       mrg 	NETBSD32TO64_UAP(offset);
   1505  1.70   thorpej 	error = sys_pwrite(l, &ua, (register_t *)&rt);
   1506  1.32       mrg 	*retval = rt;
   1507   1.1       mrg 	return (error);
   1508   1.1       mrg }
   1509   1.1       mrg 
   1510   1.6       eeh int
   1511  1.70   thorpej netbsd32_setgid(l, v, retval)
   1512  1.70   thorpej 	struct lwp *l;
   1513   1.6       eeh 	void *v;
   1514   1.6       eeh 	register_t *retval;
   1515   1.6       eeh {
   1516  1.19       eeh 	struct netbsd32_setgid_args /* {
   1517   1.6       eeh 		syscallarg(gid_t) gid;
   1518   1.6       eeh 	} */ *uap = v;
   1519   1.6       eeh 	struct sys_setgid_args ua;
   1520   1.6       eeh 
   1521  1.11       mrg 	NETBSD32TO64_UAP(gid);
   1522  1.70   thorpej 	return (sys_setgid(l, v, retval));
   1523   1.6       eeh }
   1524   1.6       eeh 
   1525   1.6       eeh int
   1526  1.70   thorpej netbsd32_setegid(l, v, retval)
   1527  1.70   thorpej 	struct lwp *l;
   1528   1.6       eeh 	void *v;
   1529   1.6       eeh 	register_t *retval;
   1530   1.6       eeh {
   1531  1.19       eeh 	struct netbsd32_setegid_args /* {
   1532   1.6       eeh 		syscallarg(gid_t) egid;
   1533   1.6       eeh 	} */ *uap = v;
   1534   1.6       eeh 	struct sys_setegid_args ua;
   1535   1.6       eeh 
   1536  1.11       mrg 	NETBSD32TO64_UAP(egid);
   1537  1.70   thorpej 	return (sys_setegid(l, v, retval));
   1538   1.6       eeh }
   1539   1.6       eeh 
   1540   1.6       eeh int
   1541  1.70   thorpej netbsd32_seteuid(l, v, retval)
   1542  1.70   thorpej 	struct lwp *l;
   1543   1.6       eeh 	void *v;
   1544   1.6       eeh 	register_t *retval;
   1545   1.6       eeh {
   1546  1.19       eeh 	struct netbsd32_seteuid_args /* {
   1547   1.6       eeh 		syscallarg(gid_t) euid;
   1548   1.6       eeh 	} */ *uap = v;
   1549   1.6       eeh 	struct sys_seteuid_args ua;
   1550   1.6       eeh 
   1551  1.11       mrg 	NETBSD32TO64_UAP(euid);
   1552  1.70   thorpej 	return (sys_seteuid(l, v, retval));
   1553   1.1       mrg }
   1554   1.1       mrg 
   1555   1.6       eeh #ifdef LFS
   1556   1.1       mrg int
   1557  1.70   thorpej netbsd32_sys_lfs_bmapv(l, v, retval)
   1558  1.70   thorpej 	struct lwp *l;
   1559   1.1       mrg 	void *v;
   1560   1.1       mrg 	register_t *retval;
   1561   1.1       mrg {
   1562   1.1       mrg 
   1563   1.1       mrg 	return (ENOSYS);	/* XXX */
   1564   1.1       mrg }
   1565   1.1       mrg 
   1566   1.1       mrg int
   1567  1.70   thorpej netbsd32_sys_lfs_markv(l, v, retval)
   1568  1.70   thorpej 	struct lwp *l;
   1569   1.1       mrg 	void *v;
   1570   1.1       mrg 	register_t *retval;
   1571   1.1       mrg {
   1572   1.1       mrg 
   1573   1.1       mrg 	return (ENOSYS);	/* XXX */
   1574   1.1       mrg }
   1575   1.1       mrg 
   1576   1.1       mrg int
   1577  1.70   thorpej netbsd32_sys_lfs_segclean(l, v, retval)
   1578  1.70   thorpej 	struct lwp *l;
   1579   1.1       mrg 	void *v;
   1580   1.1       mrg 	register_t *retval;
   1581   1.1       mrg {
   1582  1.20       eeh 
   1583   1.1       mrg 	return (ENOSYS);	/* XXX */
   1584   1.1       mrg }
   1585   1.1       mrg 
   1586   1.1       mrg int
   1587  1.70   thorpej netbsd32_sys_lfs_segwait(l, v, retval)
   1588  1.70   thorpej 	struct lwp *l;
   1589   1.1       mrg 	void *v;
   1590   1.1       mrg 	register_t *retval;
   1591   1.1       mrg {
   1592  1.20       eeh 
   1593   1.1       mrg 	return (ENOSYS);	/* XXX */
   1594   1.1       mrg }
   1595   1.6       eeh #endif
   1596   1.1       mrg 
   1597   1.1       mrg int
   1598  1.70   thorpej netbsd32_pathconf(l, v, retval)
   1599  1.70   thorpej 	struct lwp *l;
   1600   1.1       mrg 	void *v;
   1601   1.1       mrg 	register_t *retval;
   1602   1.1       mrg {
   1603  1.19       eeh 	struct netbsd32_pathconf_args /* {
   1604   1.1       mrg 		syscallarg(int) fd;
   1605   1.1       mrg 		syscallarg(int) name;
   1606   1.1       mrg 	} */ *uap = v;
   1607   1.1       mrg 	struct sys_pathconf_args ua;
   1608   1.1       mrg 	long rt;
   1609   1.1       mrg 	int error;
   1610   1.1       mrg 
   1611  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   1612  1.11       mrg 	NETBSD32TO64_UAP(name);
   1613  1.70   thorpej 	error = sys_pathconf(l, &ua, (register_t *)&rt);
   1614  1.32       mrg 	*retval = rt;
   1615   1.1       mrg 	return (error);
   1616   1.1       mrg }
   1617   1.1       mrg 
   1618   1.1       mrg int
   1619  1.70   thorpej netbsd32_fpathconf(l, v, retval)
   1620  1.70   thorpej 	struct lwp *l;
   1621   1.1       mrg 	void *v;
   1622   1.1       mrg 	register_t *retval;
   1623   1.1       mrg {
   1624  1.19       eeh 	struct netbsd32_fpathconf_args /* {
   1625   1.1       mrg 		syscallarg(int) fd;
   1626   1.1       mrg 		syscallarg(int) name;
   1627   1.1       mrg 	} */ *uap = v;
   1628   1.1       mrg 	struct sys_fpathconf_args ua;
   1629   1.1       mrg 	long rt;
   1630   1.1       mrg 	int error;
   1631   1.1       mrg 
   1632  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1633  1.11       mrg 	NETBSD32TO64_UAP(name);
   1634  1.70   thorpej 	error = sys_fpathconf(l, &ua, (register_t *)&rt);
   1635  1.32       mrg 	*retval = rt;
   1636   1.1       mrg 	return (error);
   1637   1.1       mrg }
   1638   1.1       mrg 
   1639   1.1       mrg int
   1640  1.70   thorpej netbsd32_getrlimit(l, v, retval)
   1641  1.70   thorpej 	struct lwp *l;
   1642   1.1       mrg 	void *v;
   1643   1.1       mrg 	register_t *retval;
   1644   1.1       mrg {
   1645  1.19       eeh 	struct netbsd32_getrlimit_args /* {
   1646   1.1       mrg 		syscallarg(int) which;
   1647  1.10       mrg 		syscallarg(netbsd32_rlimitp_t) rlp;
   1648   1.1       mrg 	} */ *uap = v;
   1649   1.6       eeh 	int which = SCARG(uap, which);
   1650   1.1       mrg 
   1651   1.6       eeh 	if ((u_int)which >= RLIM_NLIMITS)
   1652   1.6       eeh 		return (EINVAL);
   1653  1.70   thorpej 	return (copyout(&l->l_proc->p_rlimit[which],
   1654  1.66       scw 	    (caddr_t)NETBSD32PTR64(SCARG(uap, rlp)), sizeof(struct rlimit)));
   1655   1.1       mrg }
   1656   1.1       mrg 
   1657   1.1       mrg int
   1658  1.70   thorpej netbsd32_setrlimit(l, v, retval)
   1659  1.70   thorpej 	struct lwp *l;
   1660   1.1       mrg 	void *v;
   1661   1.1       mrg 	register_t *retval;
   1662   1.1       mrg {
   1663  1.19       eeh 	struct netbsd32_setrlimit_args /* {
   1664   1.1       mrg 		syscallarg(int) which;
   1665  1.10       mrg 		syscallarg(const netbsd32_rlimitp_t) rlp;
   1666   1.1       mrg 	} */ *uap = v;
   1667   1.6       eeh 		int which = SCARG(uap, which);
   1668   1.6       eeh 	struct rlimit alim;
   1669   1.6       eeh 	int error;
   1670  1.70   thorpej 	struct proc *p = l->l_proc;
   1671   1.1       mrg 
   1672  1.66       scw 	error = copyin((caddr_t)NETBSD32PTR64(SCARG(uap, rlp)), &alim,
   1673  1.66       scw 	    sizeof(struct rlimit));
   1674   1.6       eeh 	if (error)
   1675   1.6       eeh 		return (error);
   1676  1.18    bouyer 	return (dosetrlimit(p, p->p_cred, which, &alim));
   1677   1.1       mrg }
   1678   1.1       mrg 
   1679   1.1       mrg int
   1680  1.70   thorpej netbsd32_mmap(l, v, retval)
   1681  1.70   thorpej 	struct lwp *l;
   1682   1.1       mrg 	void *v;
   1683   1.1       mrg 	register_t *retval;
   1684   1.1       mrg {
   1685  1.19       eeh 	struct netbsd32_mmap_args /* {
   1686  1.10       mrg 		syscallarg(netbsd32_voidp) addr;
   1687  1.10       mrg 		syscallarg(netbsd32_size_t) len;
   1688   1.1       mrg 		syscallarg(int) prot;
   1689   1.1       mrg 		syscallarg(int) flags;
   1690   1.1       mrg 		syscallarg(int) fd;
   1691  1.10       mrg 		syscallarg(netbsd32_long) pad;
   1692   1.1       mrg 		syscallarg(off_t) pos;
   1693   1.1       mrg 	} */ *uap = v;
   1694   1.1       mrg 	struct sys_mmap_args ua;
   1695   1.1       mrg 	int error;
   1696   1.1       mrg 
   1697  1.11       mrg 	NETBSD32TOP_UAP(addr, void);
   1698  1.11       mrg 	NETBSD32TOX_UAP(len, size_t);
   1699  1.11       mrg 	NETBSD32TO64_UAP(prot);
   1700  1.11       mrg 	NETBSD32TO64_UAP(flags);
   1701  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1702  1.11       mrg 	NETBSD32TOX_UAP(pad, long);
   1703  1.11       mrg 	NETBSD32TOX_UAP(pos, off_t);
   1704  1.70   thorpej 	error = sys_mmap(l, &ua, retval);
   1705  1.69       scw 	if ((u_long)*retval > (u_long)UINT_MAX) {
   1706  1.69       scw 		printf("netbsd32_mmap: retval out of range: 0x%lx",
   1707  1.69       scw 		    (u_long)*retval);
   1708  1.55       eeh 		/* Should try to recover and return an error here. */
   1709  1.55       eeh 	}
   1710   1.1       mrg 	return (error);
   1711   1.1       mrg }
   1712   1.1       mrg 
   1713   1.1       mrg int
   1714  1.70   thorpej netbsd32_lseek(l, v, retval)
   1715  1.70   thorpej 	struct lwp *l;
   1716   1.6       eeh 	void *v;
   1717   1.6       eeh 	register_t *retval;
   1718   1.6       eeh {
   1719  1.19       eeh 	struct netbsd32_lseek_args /* {
   1720   1.6       eeh 		syscallarg(int) fd;
   1721   1.6       eeh 		syscallarg(int) pad;
   1722   1.6       eeh 		syscallarg(off_t) offset;
   1723   1.6       eeh 		syscallarg(int) whence;
   1724   1.6       eeh 	} */ *uap = v;
   1725   1.6       eeh 	struct sys_lseek_args ua;
   1726   1.6       eeh 
   1727  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1728  1.11       mrg 	NETBSD32TO64_UAP(pad);
   1729  1.11       mrg 	NETBSD32TO64_UAP(offset);
   1730  1.11       mrg 	NETBSD32TO64_UAP(whence);
   1731  1.70   thorpej 	return (sys_lseek(l, &ua, retval));
   1732   1.6       eeh }
   1733   1.6       eeh 
   1734   1.6       eeh int
   1735  1.70   thorpej netbsd32_truncate(l, v, retval)
   1736  1.70   thorpej 	struct lwp *l;
   1737   1.1       mrg 	void *v;
   1738   1.1       mrg 	register_t *retval;
   1739   1.1       mrg {
   1740  1.19       eeh 	struct netbsd32_truncate_args /* {
   1741  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   1742   1.1       mrg 		syscallarg(int) pad;
   1743   1.1       mrg 		syscallarg(off_t) length;
   1744   1.1       mrg 	} */ *uap = v;
   1745   1.1       mrg 	struct sys_truncate_args ua;
   1746   1.1       mrg 
   1747  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   1748  1.11       mrg 	NETBSD32TO64_UAP(pad);
   1749  1.11       mrg 	NETBSD32TO64_UAP(length);
   1750  1.70   thorpej 	return (sys_truncate(l, &ua, retval));
   1751   1.1       mrg }
   1752   1.1       mrg 
   1753   1.1       mrg int
   1754  1.70   thorpej netbsd32_ftruncate(l, v, retval)
   1755  1.70   thorpej 	struct lwp *l;
   1756   1.6       eeh 	void *v;
   1757   1.6       eeh 	register_t *retval;
   1758   1.6       eeh {
   1759  1.19       eeh 	struct netbsd32_ftruncate_args /* {
   1760   1.6       eeh 		syscallarg(int) fd;
   1761   1.6       eeh 		syscallarg(int) pad;
   1762   1.6       eeh 		syscallarg(off_t) length;
   1763   1.6       eeh 	} */ *uap = v;
   1764   1.6       eeh 	struct sys_ftruncate_args ua;
   1765   1.6       eeh 
   1766  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1767  1.11       mrg 	NETBSD32TO64_UAP(pad);
   1768  1.11       mrg 	NETBSD32TO64_UAP(length);
   1769  1.70   thorpej 	return (sys_ftruncate(l, &ua, retval));
   1770   1.6       eeh }
   1771   1.6       eeh 
   1772  1.53       mrg int
   1773  1.70   thorpej netbsd32_mlock(l, v, retval)
   1774  1.70   thorpej 	struct lwp *l;
   1775  1.57       mrg 	void *v;
   1776  1.57       mrg 	register_t *retval;
   1777  1.53       mrg {
   1778  1.57       mrg 	struct netbsd32_mlock_args /* {
   1779  1.57       mrg 		syscallarg(const netbsd32_voidp) addr;
   1780  1.57       mrg 		syscallarg(netbsd32_size_t) len;
   1781  1.57       mrg 	} */ *uap = v;
   1782  1.57       mrg 	struct sys_mlock_args ua;
   1783  1.53       mrg 
   1784  1.57       mrg 	NETBSD32TOP_UAP(addr, const void);
   1785  1.57       mrg 	NETBSD32TO64_UAP(len);
   1786  1.70   thorpej 	return (sys_mlock(l, &ua, retval));
   1787  1.53       mrg }
   1788  1.53       mrg 
   1789   1.6       eeh int
   1790  1.70   thorpej netbsd32_munlock(l, v, retval)
   1791  1.70   thorpej 	struct lwp *l;
   1792   1.1       mrg 	void *v;
   1793   1.1       mrg 	register_t *retval;
   1794   1.1       mrg {
   1795  1.57       mrg 	struct netbsd32_munlock_args /* {
   1796  1.57       mrg 		syscallarg(const netbsd32_voidp) addr;
   1797  1.57       mrg 		syscallarg(netbsd32_size_t) len;
   1798   1.1       mrg 	} */ *uap = v;
   1799   1.1       mrg 	struct sys_munlock_args ua;
   1800   1.1       mrg 
   1801  1.11       mrg 	NETBSD32TOP_UAP(addr, const void);
   1802  1.11       mrg 	NETBSD32TO64_UAP(len);
   1803  1.70   thorpej 	return (sys_munlock(l, &ua, retval));
   1804   1.1       mrg }
   1805   1.1       mrg 
   1806   1.1       mrg int
   1807  1.70   thorpej netbsd32_undelete(l, v, retval)
   1808  1.70   thorpej 	struct lwp *l;
   1809   1.1       mrg 	void *v;
   1810   1.1       mrg 	register_t *retval;
   1811   1.1       mrg {
   1812  1.19       eeh 	struct netbsd32_undelete_args /* {
   1813  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   1814   1.1       mrg 	} */ *uap = v;
   1815   1.1       mrg 	struct sys_undelete_args ua;
   1816   1.1       mrg 
   1817  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   1818  1.70   thorpej 	return (sys_undelete(l, &ua, retval));
   1819   1.1       mrg }
   1820   1.1       mrg 
   1821   1.6       eeh int
   1822  1.70   thorpej netbsd32_getpgid(l, v, retval)
   1823  1.70   thorpej 	struct lwp *l;
   1824   1.6       eeh 	void *v;
   1825   1.6       eeh 	register_t *retval;
   1826   1.6       eeh {
   1827  1.19       eeh 	struct netbsd32_getpgid_args /* {
   1828   1.6       eeh 		syscallarg(pid_t) pid;
   1829   1.6       eeh 	} */ *uap = v;
   1830   1.6       eeh 	struct sys_getpgid_args ua;
   1831   1.1       mrg 
   1832  1.11       mrg 	NETBSD32TO64_UAP(pid);
   1833  1.70   thorpej 	return (sys_getpgid(l, &ua, retval));
   1834   1.1       mrg }
   1835   1.1       mrg 
   1836   1.1       mrg int
   1837  1.70   thorpej netbsd32_reboot(l, v, retval)
   1838  1.70   thorpej 	struct lwp *l;
   1839   1.1       mrg 	void *v;
   1840   1.1       mrg 	register_t *retval;
   1841   1.1       mrg {
   1842  1.19       eeh 	struct netbsd32_reboot_args /* {
   1843   1.1       mrg 		syscallarg(int) opt;
   1844  1.10       mrg 		syscallarg(netbsd32_charp) bootstr;
   1845   1.1       mrg 	} */ *uap = v;
   1846   1.1       mrg 	struct sys_reboot_args ua;
   1847   1.1       mrg 
   1848  1.11       mrg 	NETBSD32TO64_UAP(opt);
   1849  1.11       mrg 	NETBSD32TOP_UAP(bootstr, char);
   1850  1.70   thorpej 	return (sys_reboot(l, &ua, retval));
   1851   1.1       mrg }
   1852   1.1       mrg 
   1853   1.1       mrg int
   1854  1.70   thorpej netbsd32_poll(l, v, retval)
   1855  1.70   thorpej 	struct lwp *l;
   1856   1.1       mrg 	void *v;
   1857   1.1       mrg 	register_t *retval;
   1858   1.1       mrg {
   1859  1.19       eeh 	struct netbsd32_poll_args /* {
   1860  1.10       mrg 		syscallarg(netbsd32_pollfdp_t) fds;
   1861   1.1       mrg 		syscallarg(u_int) nfds;
   1862   1.1       mrg 		syscallarg(int) timeout;
   1863   1.1       mrg 	} */ *uap = v;
   1864   1.1       mrg 	struct sys_poll_args ua;
   1865   1.1       mrg 
   1866  1.11       mrg 	NETBSD32TOP_UAP(fds, struct pollfd);
   1867  1.11       mrg 	NETBSD32TO64_UAP(nfds);
   1868  1.11       mrg 	NETBSD32TO64_UAP(timeout);
   1869  1.70   thorpej 	return (sys_poll(l, &ua, retval));
   1870   1.1       mrg }
   1871   1.1       mrg 
   1872   1.6       eeh int
   1873  1.70   thorpej netbsd32_fdatasync(l, v, retval)
   1874  1.70   thorpej 	struct lwp *l;
   1875   1.6       eeh 	void *v;
   1876   1.6       eeh 	register_t *retval;
   1877   1.6       eeh {
   1878  1.19       eeh 	struct netbsd32_fdatasync_args /* {
   1879   1.6       eeh 		syscallarg(int) fd;
   1880   1.6       eeh 	} */ *uap = v;
   1881   1.6       eeh 	struct sys_fdatasync_args ua;
   1882   1.6       eeh 
   1883  1.11       mrg 	NETBSD32TO64_UAP(fd);
   1884  1.70   thorpej 	return (sys_fdatasync(l, &ua, retval));
   1885   1.1       mrg }
   1886   1.1       mrg 
   1887   1.1       mrg int
   1888  1.70   thorpej netbsd32___posix_rename(l, v, retval)
   1889  1.70   thorpej 	struct lwp *l;
   1890   1.1       mrg 	void *v;
   1891   1.1       mrg 	register_t *retval;
   1892   1.1       mrg {
   1893  1.19       eeh 	struct netbsd32___posix_rename_args /* {
   1894  1.10       mrg 		syscallarg(const netbsd32_charp) from;
   1895  1.10       mrg 		syscallarg(const netbsd32_charp) to;
   1896   1.1       mrg 	} */ *uap = v;
   1897   1.1       mrg 	struct sys___posix_rename_args ua;
   1898   1.1       mrg 
   1899  1.20       eeh 	NETBSD32TOP_UAP(from, const char);
   1900  1.20       eeh 	NETBSD32TOP_UAP(to, const char);
   1901  1.70   thorpej 	return (sys___posix_rename(l, &ua, retval));
   1902   1.1       mrg }
   1903   1.1       mrg 
   1904   1.1       mrg int
   1905  1.70   thorpej netbsd32_swapctl(l, v, retval)
   1906  1.70   thorpej 	struct lwp *l;
   1907   1.1       mrg 	void *v;
   1908   1.1       mrg 	register_t *retval;
   1909   1.1       mrg {
   1910  1.19       eeh 	struct netbsd32_swapctl_args /* {
   1911   1.1       mrg 		syscallarg(int) cmd;
   1912  1.10       mrg 		syscallarg(const netbsd32_voidp) arg;
   1913   1.1       mrg 		syscallarg(int) misc;
   1914   1.1       mrg 	} */ *uap = v;
   1915   1.1       mrg 	struct sys_swapctl_args ua;
   1916   1.1       mrg 
   1917  1.11       mrg 	NETBSD32TO64_UAP(cmd);
   1918  1.11       mrg 	NETBSD32TOP_UAP(arg, const void);
   1919  1.11       mrg 	NETBSD32TO64_UAP(misc);
   1920  1.70   thorpej 	return (sys_swapctl(l, &ua, retval));
   1921   1.1       mrg }
   1922   1.1       mrg 
   1923   1.1       mrg int
   1924  1.70   thorpej netbsd32_minherit(l, v, retval)
   1925  1.70   thorpej 	struct lwp *l;
   1926   1.1       mrg 	void *v;
   1927   1.1       mrg 	register_t *retval;
   1928   1.1       mrg {
   1929  1.19       eeh 	struct netbsd32_minherit_args /* {
   1930  1.10       mrg 		syscallarg(netbsd32_voidp) addr;
   1931  1.10       mrg 		syscallarg(netbsd32_size_t) len;
   1932   1.1       mrg 		syscallarg(int) inherit;
   1933   1.1       mrg 	} */ *uap = v;
   1934   1.1       mrg 	struct sys_minherit_args ua;
   1935   1.1       mrg 
   1936  1.11       mrg 	NETBSD32TOP_UAP(addr, void);
   1937  1.11       mrg 	NETBSD32TOX_UAP(len, size_t);
   1938  1.11       mrg 	NETBSD32TO64_UAP(inherit);
   1939  1.70   thorpej 	return (sys_minherit(l, &ua, retval));
   1940   1.1       mrg }
   1941   1.1       mrg 
   1942   1.1       mrg int
   1943  1.70   thorpej netbsd32_lchmod(l, v, retval)
   1944  1.70   thorpej 	struct lwp *l;
   1945   1.1       mrg 	void *v;
   1946   1.1       mrg 	register_t *retval;
   1947   1.1       mrg {
   1948  1.19       eeh 	struct netbsd32_lchmod_args /* {
   1949  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   1950   1.1       mrg 		syscallarg(mode_t) mode;
   1951   1.1       mrg 	} */ *uap = v;
   1952   1.1       mrg 	struct sys_lchmod_args ua;
   1953   1.1       mrg 
   1954  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   1955  1.11       mrg 	NETBSD32TO64_UAP(mode);
   1956  1.70   thorpej 	return (sys_lchmod(l, &ua, retval));
   1957   1.1       mrg }
   1958   1.1       mrg 
   1959   1.1       mrg int
   1960  1.70   thorpej netbsd32_lchown(l, v, retval)
   1961  1.70   thorpej 	struct lwp *l;
   1962   1.1       mrg 	void *v;
   1963   1.1       mrg 	register_t *retval;
   1964   1.1       mrg {
   1965  1.19       eeh 	struct netbsd32_lchown_args /* {
   1966  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   1967   1.1       mrg 		syscallarg(uid_t) uid;
   1968   1.1       mrg 		syscallarg(gid_t) gid;
   1969   1.1       mrg 	} */ *uap = v;
   1970   1.1       mrg 	struct sys_lchown_args ua;
   1971   1.1       mrg 
   1972  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   1973  1.11       mrg 	NETBSD32TO64_UAP(uid);
   1974  1.11       mrg 	NETBSD32TO64_UAP(gid);
   1975  1.70   thorpej 	return (sys_lchown(l, &ua, retval));
   1976   1.1       mrg }
   1977   1.1       mrg 
   1978   1.1       mrg int
   1979  1.70   thorpej netbsd32___msync13(l, v, retval)
   1980  1.70   thorpej 	struct lwp *l;
   1981   1.1       mrg 	void *v;
   1982   1.1       mrg 	register_t *retval;
   1983   1.1       mrg {
   1984  1.19       eeh 	struct netbsd32___msync13_args /* {
   1985  1.10       mrg 		syscallarg(netbsd32_voidp) addr;
   1986  1.10       mrg 		syscallarg(netbsd32_size_t) len;
   1987   1.1       mrg 		syscallarg(int) flags;
   1988   1.1       mrg 	} */ *uap = v;
   1989   1.1       mrg 	struct sys___msync13_args ua;
   1990   1.1       mrg 
   1991  1.11       mrg 	NETBSD32TOP_UAP(addr, void);
   1992  1.11       mrg 	NETBSD32TOX_UAP(len, size_t);
   1993  1.11       mrg 	NETBSD32TO64_UAP(flags);
   1994  1.70   thorpej 	return (sys___msync13(l, &ua, retval));
   1995   1.1       mrg }
   1996   1.1       mrg 
   1997   1.1       mrg int
   1998  1.70   thorpej netbsd32___posix_chown(l, v, retval)
   1999  1.70   thorpej 	struct lwp *l;
   2000   1.1       mrg 	void *v;
   2001   1.1       mrg 	register_t *retval;
   2002   1.1       mrg {
   2003  1.19       eeh 	struct netbsd32___posix_chown_args /* {
   2004  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   2005   1.1       mrg 		syscallarg(uid_t) uid;
   2006   1.1       mrg 		syscallarg(gid_t) gid;
   2007   1.1       mrg 	} */ *uap = v;
   2008   1.1       mrg 	struct sys___posix_chown_args ua;
   2009   1.1       mrg 
   2010  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   2011  1.11       mrg 	NETBSD32TO64_UAP(uid);
   2012  1.11       mrg 	NETBSD32TO64_UAP(gid);
   2013  1.70   thorpej 	return (sys___posix_chown(l, &ua, retval));
   2014   1.1       mrg }
   2015   1.1       mrg 
   2016   1.1       mrg int
   2017  1.70   thorpej netbsd32___posix_fchown(l, v, retval)
   2018  1.70   thorpej 	struct lwp *l;
   2019   1.6       eeh 	void *v;
   2020   1.6       eeh 	register_t *retval;
   2021   1.6       eeh {
   2022  1.19       eeh 	struct netbsd32___posix_fchown_args /* {
   2023   1.6       eeh 		syscallarg(int) fd;
   2024   1.6       eeh 		syscallarg(uid_t) uid;
   2025   1.6       eeh 		syscallarg(gid_t) gid;
   2026   1.6       eeh 	} */ *uap = v;
   2027   1.6       eeh 	struct sys___posix_fchown_args ua;
   2028   1.6       eeh 
   2029  1.11       mrg 	NETBSD32TO64_UAP(fd);
   2030  1.11       mrg 	NETBSD32TO64_UAP(uid);
   2031  1.11       mrg 	NETBSD32TO64_UAP(gid);
   2032  1.70   thorpej 	return (sys___posix_fchown(l, &ua, retval));
   2033   1.6       eeh }
   2034   1.6       eeh 
   2035   1.6       eeh int
   2036  1.70   thorpej netbsd32___posix_lchown(l, v, retval)
   2037  1.70   thorpej 	struct lwp *l;
   2038   1.1       mrg 	void *v;
   2039   1.1       mrg 	register_t *retval;
   2040   1.1       mrg {
   2041  1.19       eeh 	struct netbsd32___posix_lchown_args /* {
   2042  1.10       mrg 		syscallarg(const netbsd32_charp) path;
   2043   1.1       mrg 		syscallarg(uid_t) uid;
   2044   1.1       mrg 		syscallarg(gid_t) gid;
   2045   1.1       mrg 	} */ *uap = v;
   2046   1.1       mrg 	struct sys___posix_lchown_args ua;
   2047   1.1       mrg 
   2048  1.11       mrg 	NETBSD32TOP_UAP(path, const char);
   2049  1.11       mrg 	NETBSD32TO64_UAP(uid);
   2050  1.11       mrg 	NETBSD32TO64_UAP(gid);
   2051  1.70   thorpej 	return (sys___posix_lchown(l, &ua, retval));
   2052   1.1       mrg }
   2053   1.1       mrg 
   2054   1.1       mrg int
   2055  1.70   thorpej netbsd32_getsid(l, v, retval)
   2056  1.70   thorpej 	struct lwp *l;
   2057   1.6       eeh 	void *v;
   2058   1.6       eeh 	register_t *retval;
   2059   1.6       eeh {
   2060  1.19       eeh 	struct netbsd32_getsid_args /* {
   2061   1.6       eeh 		syscallarg(pid_t) pid;
   2062   1.6       eeh 	} */ *uap = v;
   2063   1.6       eeh 	struct sys_getsid_args ua;
   2064   1.6       eeh 
   2065  1.11       mrg 	NETBSD32TO64_UAP(pid);
   2066  1.70   thorpej 	return (sys_getsid(l, &ua, retval));
   2067   1.6       eeh }
   2068   1.6       eeh 
   2069  1.42  jdolecek #ifdef KTRACE
   2070   1.6       eeh int
   2071  1.70   thorpej netbsd32_fktrace(l, v, retval)
   2072  1.70   thorpej 	struct lwp *l;
   2073   1.6       eeh 	void *v;
   2074   1.6       eeh 	register_t *retval;
   2075   1.6       eeh {
   2076  1.19       eeh 	struct netbsd32_fktrace_args /* {
   2077   1.6       eeh 		syscallarg(const int) fd;
   2078   1.6       eeh 		syscallarg(int) ops;
   2079   1.6       eeh 		syscallarg(int) facs;
   2080   1.6       eeh 		syscallarg(int) pid;
   2081   1.6       eeh 	} */ *uap = v;
   2082  1.43      fvdl #if 0
   2083   1.6       eeh 	struct sys_fktrace_args ua;
   2084  1.43      fvdl #else
   2085  1.43      fvdl 	/* XXXX */
   2086  1.43      fvdl 	struct sys_fktrace_noconst_args {
   2087  1.43      fvdl 		syscallarg(int) fd;
   2088  1.43      fvdl 		syscallarg(int) ops;
   2089  1.43      fvdl 		syscallarg(int) facs;
   2090  1.43      fvdl 		syscallarg(int) pid;
   2091  1.43      fvdl 	} ua;
   2092  1.43      fvdl #endif
   2093   1.6       eeh 
   2094  1.32       mrg 	NETBSD32TOX_UAP(fd, int);
   2095  1.11       mrg 	NETBSD32TO64_UAP(ops);
   2096  1.11       mrg 	NETBSD32TO64_UAP(facs);
   2097  1.11       mrg 	NETBSD32TO64_UAP(pid);
   2098  1.70   thorpej 	return (sys_fktrace(l, &ua, retval));
   2099   1.6       eeh }
   2100  1.42  jdolecek #endif /* KTRACE */
   2101   1.6       eeh 
   2102  1.70   thorpej int netbsd32___sigpending14(l, v, retval)
   2103  1.70   thorpej 	struct lwp *l;
   2104  1.20       eeh 	void   *v;
   2105  1.20       eeh 	register_t *retval;
   2106  1.20       eeh {
   2107  1.25  augustss 	struct netbsd32___sigpending14_args /* {
   2108  1.20       eeh 		syscallarg(sigset_t *) set;
   2109  1.20       eeh 	} */ *uap = v;
   2110  1.20       eeh 	struct sys___sigpending14_args ua;
   2111  1.20       eeh 
   2112  1.20       eeh 	NETBSD32TOP_UAP(set, sigset_t);
   2113  1.70   thorpej 	return (sys___sigpending14(l, &ua, retval));
   2114  1.20       eeh }
   2115  1.20       eeh 
   2116  1.70   thorpej int netbsd32___sigprocmask14(l, v, retval)
   2117  1.70   thorpej 	struct lwp *l;
   2118  1.20       eeh 	void   *v;
   2119  1.20       eeh 	register_t *retval;
   2120  1.20       eeh {
   2121  1.25  augustss 	struct netbsd32___sigprocmask14_args /* {
   2122  1.20       eeh 		syscallarg(int) how;
   2123  1.20       eeh 		syscallarg(const sigset_t *) set;
   2124  1.20       eeh 		syscallarg(sigset_t *) oset;
   2125  1.20       eeh 	} */ *uap = v;
   2126  1.20       eeh 	struct sys___sigprocmask14_args ua;
   2127  1.20       eeh 
   2128  1.20       eeh 	NETBSD32TO64_UAP(how);
   2129  1.20       eeh 	NETBSD32TOP_UAP(set, sigset_t);
   2130  1.20       eeh 	NETBSD32TOP_UAP(oset, sigset_t);
   2131  1.70   thorpej 	return (sys___sigprocmask14(l, &ua, retval));
   2132  1.20       eeh }
   2133  1.20       eeh 
   2134  1.70   thorpej int netbsd32___sigsuspend14(l, v, retval)
   2135  1.70   thorpej 	struct lwp *l;
   2136  1.20       eeh 	void   *v;
   2137  1.20       eeh 	register_t *retval;
   2138  1.20       eeh {
   2139  1.20       eeh 	struct netbsd32___sigsuspend14_args /* {
   2140  1.20       eeh 		syscallarg(const sigset_t *) set;
   2141  1.20       eeh 	} */ *uap = v;
   2142  1.20       eeh 	struct sys___sigsuspend14_args ua;
   2143  1.20       eeh 
   2144  1.20       eeh 	NETBSD32TOP_UAP(set, sigset_t);
   2145  1.70   thorpej 	return (sys___sigsuspend14(l, &ua, retval));
   2146  1.20       eeh };
   2147  1.20       eeh 
   2148  1.70   thorpej int netbsd32_fchroot(l, v, retval)
   2149  1.70   thorpej 	struct lwp *l;
   2150  1.20       eeh 	void *v;
   2151  1.20       eeh 	register_t *retval;
   2152  1.20       eeh {
   2153  1.25  augustss 	struct netbsd32_fchroot_args /* {
   2154  1.20       eeh 		syscallarg(int) fd;
   2155  1.20       eeh 	} */ *uap = v;
   2156  1.20       eeh 	struct sys_fchroot_args ua;
   2157  1.20       eeh 
   2158  1.20       eeh 	NETBSD32TO64_UAP(fd);
   2159  1.70   thorpej 	return (sys_fchroot(l, &ua, retval));
   2160  1.20       eeh }
   2161  1.20       eeh 
   2162  1.20       eeh /*
   2163  1.20       eeh  * Open a file given a file handle.
   2164  1.20       eeh  *
   2165  1.20       eeh  * Check permissions, allocate an open file structure,
   2166  1.20       eeh  * and call the device open routine if any.
   2167  1.20       eeh  */
   2168   1.6       eeh int
   2169  1.70   thorpej netbsd32_fhopen(l, v, retval)
   2170  1.70   thorpej 	struct lwp *l;
   2171  1.20       eeh 	void *v;
   2172  1.20       eeh 	register_t *retval;
   2173  1.20       eeh {
   2174  1.25  augustss 	struct netbsd32_fhopen_args /* {
   2175  1.20       eeh 		syscallarg(const fhandle_t *) fhp;
   2176  1.20       eeh 		syscallarg(int) flags;
   2177  1.20       eeh 	} */ *uap = v;
   2178  1.20       eeh 	struct sys_fhopen_args ua;
   2179  1.20       eeh 
   2180  1.20       eeh 	NETBSD32TOP_UAP(fhp, fhandle_t);
   2181  1.20       eeh 	NETBSD32TO64_UAP(flags);
   2182  1.70   thorpej 	return (sys_fhopen(l, &ua, retval));
   2183  1.20       eeh }
   2184  1.20       eeh 
   2185  1.70   thorpej int netbsd32_fhstat(l, v, retval)
   2186  1.70   thorpej 	struct lwp *l;
   2187  1.20       eeh 	void *v;
   2188  1.20       eeh 	register_t *retval;
   2189  1.20       eeh {
   2190  1.25  augustss 	struct netbsd32_fhstat_args /* {
   2191  1.20       eeh 		syscallarg(const netbsd32_fhandlep_t) fhp;
   2192  1.20       eeh 		syscallarg(struct stat *) sb;
   2193  1.20       eeh 	} */ *uap = v;
   2194  1.20       eeh 	struct sys_fhstat_args ua;
   2195  1.20       eeh 
   2196  1.20       eeh 	NETBSD32TOP_UAP(fhp, const fhandle_t);
   2197  1.20       eeh 	NETBSD32TOP_UAP(sb, struct stat);
   2198  1.70   thorpej 	return (sys_fhstat(l, &ua, retval));
   2199  1.20       eeh }
   2200  1.20       eeh 
   2201  1.70   thorpej int netbsd32_fhstatfs(l, v, retval)
   2202  1.70   thorpej 	struct lwp *l;
   2203   1.6       eeh 	void *v;
   2204   1.6       eeh 	register_t *retval;
   2205   1.6       eeh {
   2206  1.25  augustss 	struct netbsd32_fhstatfs_args /* {
   2207  1.20       eeh 		syscallarg(const netbsd32_fhandlep_t) fhp;
   2208  1.20       eeh 		syscallarg(struct statfs *) buf;
   2209   1.6       eeh 	} */ *uap = v;
   2210  1.20       eeh 	struct sys_fhstatfs_args ua;
   2211   1.1       mrg 
   2212  1.20       eeh 	NETBSD32TOP_UAP(fhp, const fhandle_t);
   2213  1.20       eeh 	NETBSD32TOP_UAP(buf, struct statfs);
   2214  1.70   thorpej 	return (sys_fhstatfs(l, &ua, retval));
   2215   1.1       mrg }
   2216  1.37    martin 
   2217  1.37    martin /* virtual memory syscalls */
   2218  1.37    martin int
   2219  1.70   thorpej netbsd32_ovadvise(l, v, retval)
   2220  1.70   thorpej 	struct lwp *l;
   2221  1.37    martin 	void *v;
   2222  1.37    martin 	register_t *retval;
   2223  1.37    martin {
   2224  1.37    martin 	struct netbsd32_ovadvise_args /* {
   2225  1.37    martin 		syscallarg(int) anom;
   2226  1.37    martin 	} */ *uap = v;
   2227  1.37    martin 	struct sys_ovadvise_args ua;
   2228  1.37    martin 
   2229  1.37    martin 	NETBSD32TO64_UAP(anom);
   2230  1.70   thorpej 	return (sys_ovadvise(l, &ua, retval));
   2231  1.37    martin }
   2232  1.37    martin 
   2233