Sun Jul 30 05:10:48 2023 UTC ()
netbsd32_netbsd: Sort headers. No binary changes.


(rin)
diff -r1.233 -r1.234 src/sys/compat/netbsd32/netbsd32_netbsd.c

cvs diff -r1.233 -r1.234 src/sys/compat/netbsd32/netbsd32_netbsd.c (switch to unified diff)

--- src/sys/compat/netbsd32/netbsd32_netbsd.c 2021/09/20 01:07:45 1.233
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c 2023/07/30 05:10:47 1.234
@@ -1,1097 +1,1096 @@ @@ -1,1097 +1,1096 @@
1/* $NetBSD: netbsd32_netbsd.c,v 1.233 2021/09/20 01:07:45 thorpej Exp $ */ 1/* $NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green 4 * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.233 2021/09/20 01:07:45 thorpej Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $");
31 31
32/* 32/*
33 * below are all the standard NetBSD system calls, in the 32bit 33 * below are all the standard NetBSD system calls, in the 32bit
34 * environment, with the necessary conversions to 64bit before calling 34 * environment, with the necessary conversions to 64bit before calling
35 * the real syscall. anything that needs special attention is handled 35 * the real syscall. anything that needs special attention is handled
36 * elsewhere - this file should only contain structure assignment and 36 * elsewhere - this file should only contain structure assignment and
37 * calls to the original function. 37 * calls to the original function.
38 */ 38 */
39 39
40/* 40/*
41 * below are all the standard NetBSD system calls, in the 32bit 41 * below are all the standard NetBSD system calls, in the 32bit
42 * environment, with the necessary conversions to 64bit before calling 42 * environment, with the necessary conversions to 64bit before calling
43 * the real syscall. anything that needs special attention is handled 43 * the real syscall. anything that needs special attention is handled
44 * elsewhere - this file should only contain structure assignment and 44 * elsewhere - this file should only contain structure assignment and
45 * calls to the original function. 45 * calls to the original function.
46 */ 46 */
47 47
48#if defined(_KERNEL_OPT) 48#if defined(_KERNEL_OPT)
49#include "opt_compat_43.h" 49#include "opt_compat_43.h"
50#include "opt_compat_netbsd.h" 50#include "opt_compat_netbsd.h"
51#include "opt_ddb.h" 51#include "opt_ddb.h"
52#include "opt_ktrace.h" 52#include "opt_ktrace.h"
53#include "opt_ntp.h" 53#include "opt_ntp.h"
54#include "opt_quota.h" 54#include "opt_quota.h"
55#include "opt_syscall_debug.h" 55#include "opt_syscall_debug.h"
56#include "opt_sysv.h" 56#include "opt_sysv.h"
57#endif 57#endif
58 58
59#include <sys/param.h> 59#include <sys/param.h>
60#include <sys/systm.h> 60#include <sys/acct.h>
 61#include <sys/dirent.h>
 62#include <sys/exec.h>
 63#include <sys/file.h>
 64#include <sys/filedesc.h>
61#include <sys/kernel.h> 65#include <sys/kernel.h>
 66#include <sys/ktrace.h>
 67#include <sys/mbuf.h>
 68#include <sys/mman.h>
62#include <sys/mount.h> 69#include <sys/mount.h>
 70#include <sys/namei.h>
 71#include <sys/pool.h>
 72#include <sys/proc.h>
 73#include <sys/ptrace.h>
 74#include <sys/quotactl.h>
 75#include <sys/resourcevar.h>
 76#include <sys/signalvar.h>
63#include <sys/socket.h> 77#include <sys/socket.h>
64#include <sys/sockio.h> 
65#include <sys/socketvar.h> 78#include <sys/socketvar.h>
66#include <sys/mbuf.h> 79#include <sys/sockio.h>
67#include <sys/mman.h> 
68#include <sys/stat.h> 80#include <sys/stat.h>
69#include <sys/swap.h> 81#include <sys/swap.h>
 82#include <sys/syscallargs.h>
 83#include <sys/systm.h>
70#include <sys/time.h> 84#include <sys/time.h>
71#include <sys/signalvar.h> 
72#include <sys/ptrace.h> 
73#include <sys/ktrace.h> 
74#include <sys/trace.h> 85#include <sys/trace.h>
75#include <sys/resourcevar.h> 
76#include <sys/pool.h> 
77#include <sys/file.h> 
78#include <sys/filedesc.h> 
79#include <sys/namei.h> 
80#include <sys/dirent.h> 
81#include <sys/quotactl.h> 
82#include <sys/vfs_syscalls.h> 86#include <sys/vfs_syscalls.h>
83 87
84#include <uvm/uvm_extern.h> 88#include <uvm/uvm_extern.h>
85#include <uvm/uvm_swap.h> 89#include <uvm/uvm_swap.h>
86 90
87#include <sys/syscallargs.h> 
88#include <sys/proc.h> 
89#include <sys/acct.h> 
90#include <sys/exec.h> 
91 
92#include <net/if.h> 91#include <net/if.h>
93 92
94#include <compat/netbsd32/netbsd32.h> 93#include <compat/netbsd32/netbsd32.h>
 94#include <compat/netbsd32/netbsd32_conv.h>
95#include <compat/netbsd32/netbsd32_exec.h> 95#include <compat/netbsd32/netbsd32_exec.h>
96#include <compat/netbsd32/netbsd32_syscall.h> 96#include <compat/netbsd32/netbsd32_syscall.h>
97#include <compat/netbsd32/netbsd32_syscallargs.h> 97#include <compat/netbsd32/netbsd32_syscallargs.h>
98#include <compat/netbsd32/netbsd32_conv.h> 
99 98
100#include <compat/sys/mman.h> 99#include <compat/sys/mman.h>
101 100
102#if defined(DDB) 101#if defined(DDB)
103#include <ddb/ddbvar.h> 102#include <ddb/ddbvar.h>
104#endif 103#endif
105 104
106#ifdef __HAVE_SYSCALL_INTERN 105#ifdef __HAVE_SYSCALL_INTERN
107void netbsd32_syscall_intern(struct proc *); 106void netbsd32_syscall_intern(struct proc *);
108#else 107#else
109void syscall(void); 108void syscall(void);
110#endif 109#endif
111 110
112#ifdef MODULAR 111#ifdef MODULAR
113#include <compat/netbsd32/netbsd32_syscalls_autoload.c> 112#include <compat/netbsd32/netbsd32_syscalls_autoload.c>
114#endif 113#endif
115 114
116struct emul emul_netbsd32 = { 115struct emul emul_netbsd32 = {
117 .e_name = "netbsd32", 116 .e_name = "netbsd32",
118 .e_path = "/emul/netbsd32", 117 .e_path = "/emul/netbsd32",
119#ifndef __HAVE_MINIMAL_EMUL 118#ifndef __HAVE_MINIMAL_EMUL
120 .e_flags = 0, 119 .e_flags = 0,
121 .e_errno = NULL, 120 .e_errno = NULL,
122 .e_nosys = NETBSD32_SYS_netbsd32_syscall, 121 .e_nosys = NETBSD32_SYS_netbsd32_syscall,
123 .e_nsysent = NETBSD32_SYS_NSYSENT, 122 .e_nsysent = NETBSD32_SYS_NSYSENT,
124#endif 123#endif
125 .e_sysent = netbsd32_sysent, 124 .e_sysent = netbsd32_sysent,
126 .e_nomodbits = netbsd32_sysent_nomodbits, 125 .e_nomodbits = netbsd32_sysent_nomodbits,
127#ifdef SYSCALL_DEBUG 126#ifdef SYSCALL_DEBUG
128 .e_syscallnames = netbsd32_syscallnames, 127 .e_syscallnames = netbsd32_syscallnames,
129#else 128#else
130 .e_syscallnames = NULL, 129 .e_syscallnames = NULL,
131#endif 130#endif
132#ifdef MODULAR 131#ifdef MODULAR
133 .e_sc_autoload = netbsd32_syscalls_autoload, 132 .e_sc_autoload = netbsd32_syscalls_autoload,
134#endif 133#endif
135 .e_sendsig = netbsd32_sendsig, 134 .e_sendsig = netbsd32_sendsig,
136 .e_trapsignal = trapsignal, 135 .e_trapsignal = trapsignal,
137 .e_sigcode = NULL, 136 .e_sigcode = NULL,
138 .e_esigcode = NULL, 137 .e_esigcode = NULL,
139 .e_sigobject = NULL, 138 .e_sigobject = NULL,
140 .e_setregs = netbsd32_setregs, 139 .e_setregs = netbsd32_setregs,
141 .e_proc_exec = NULL, 140 .e_proc_exec = NULL,
142 .e_proc_fork = NULL, 141 .e_proc_fork = NULL,
143 .e_proc_exit = NULL, 142 .e_proc_exit = NULL,
144 .e_lwp_fork = NULL, 143 .e_lwp_fork = NULL,
145 .e_lwp_exit = NULL, 144 .e_lwp_exit = NULL,
146#ifdef __HAVE_SYSCALL_INTERN 145#ifdef __HAVE_SYSCALL_INTERN
147 .e_syscall_intern = netbsd32_syscall_intern, 146 .e_syscall_intern = netbsd32_syscall_intern,
148#else 147#else
149 .e_syscall = syscall, 148 .e_syscall = syscall,
150#endif 149#endif
151 .e_sysctlovly = &netbsd32_sysctl_root, 150 .e_sysctlovly = &netbsd32_sysctl_root,
152 .e_vm_default_addr = netbsd32_vm_default_addr, 151 .e_vm_default_addr = netbsd32_vm_default_addr,
153 .e_usertrap = NULL, 152 .e_usertrap = NULL,
154 .e_ucsize = sizeof(ucontext32_t), 153 .e_ucsize = sizeof(ucontext32_t),
155 .e_startlwp = startlwp32, 154 .e_startlwp = startlwp32,
156#ifdef notyet 155#ifdef notyet
157 .e_ktrpsig = netbsd32_ktrpsig, 156 .e_ktrpsig = netbsd32_ktrpsig,
158#else 157#else
159 .e_ktrpsig = NULL, 158 .e_ktrpsig = NULL,
160#endif 159#endif
161}; 160};
162 161
163int 162int
164netbsd32_exit(struct lwp *l, const struct netbsd32_exit_args *uap, register_t *retval) 163netbsd32_exit(struct lwp *l, const struct netbsd32_exit_args *uap, register_t *retval)
165{ 164{
166 /* { 165 /* {
167 syscallarg(int) rval; 166 syscallarg(int) rval;
168 } */ 167 } */
169 struct sys_exit_args ua; 168 struct sys_exit_args ua;
170 169
171 NETBSD32TO64_UAP(rval); 170 NETBSD32TO64_UAP(rval);
172 return sys_exit(l, &ua, retval); 171 return sys_exit(l, &ua, retval);
173} 172}
174 173
175int 174int
176netbsd32_read(struct lwp *l, const struct netbsd32_read_args *uap, register_t *retval) 175netbsd32_read(struct lwp *l, const struct netbsd32_read_args *uap, register_t *retval)
177{ 176{
178 /* { 177 /* {
179 syscallarg(int) fd; 178 syscallarg(int) fd;
180 syscallarg(netbsd32_voidp) buf; 179 syscallarg(netbsd32_voidp) buf;
181 syscallarg(netbsd32_size_t) nbyte; 180 syscallarg(netbsd32_size_t) nbyte;
182 } */ 181 } */
183 struct sys_read_args ua; 182 struct sys_read_args ua;
184 183
185 if (SCARG(uap, nbyte) > NETBSD32_SSIZE_MAX) 184 if (SCARG(uap, nbyte) > NETBSD32_SSIZE_MAX)
186 return EINVAL; 185 return EINVAL;
187 186
188 NETBSD32TO64_UAP(fd); 187 NETBSD32TO64_UAP(fd);
189 NETBSD32TOP_UAP(buf, void *); 188 NETBSD32TOP_UAP(buf, void *);
190 NETBSD32TOX_UAP(nbyte, size_t); 189 NETBSD32TOX_UAP(nbyte, size_t);
191 return sys_read(l, &ua, retval); 190 return sys_read(l, &ua, retval);
192} 191}
193 192
194int 193int
195netbsd32_write(struct lwp *l, const struct netbsd32_write_args *uap, register_t *retval) 194netbsd32_write(struct lwp *l, const struct netbsd32_write_args *uap, register_t *retval)
196{ 195{
197 /* { 196 /* {
198 syscallarg(int) fd; 197 syscallarg(int) fd;
199 syscallarg(const netbsd32_voidp) buf; 198 syscallarg(const netbsd32_voidp) buf;
200 syscallarg(netbsd32_size_t) nbyte; 199 syscallarg(netbsd32_size_t) nbyte;
201 } */ 200 } */
202 struct sys_write_args ua; 201 struct sys_write_args ua;
203 202
204 if (SCARG(uap, nbyte) > NETBSD32_SSIZE_MAX) 203 if (SCARG(uap, nbyte) > NETBSD32_SSIZE_MAX)
205 return EINVAL; 204 return EINVAL;
206 205
207 NETBSD32TO64_UAP(fd); 206 NETBSD32TO64_UAP(fd);
208 NETBSD32TOP_UAP(buf, void *); 207 NETBSD32TOP_UAP(buf, void *);
209 NETBSD32TOX_UAP(nbyte, size_t); 208 NETBSD32TOX_UAP(nbyte, size_t);
210 return sys_write(l, &ua, retval); 209 return sys_write(l, &ua, retval);
211} 210}
212 211
213int 212int
214netbsd32_close(struct lwp *l, const struct netbsd32_close_args *uap, register_t *retval) 213netbsd32_close(struct lwp *l, const struct netbsd32_close_args *uap, register_t *retval)
215{ 214{
216 /* { 215 /* {
217 syscallarg(int) fd; 216 syscallarg(int) fd;
218 } */ 217 } */
219 struct sys_close_args ua; 218 struct sys_close_args ua;
220 219
221 NETBSD32TO64_UAP(fd); 220 NETBSD32TO64_UAP(fd);
222 return sys_close(l, &ua, retval); 221 return sys_close(l, &ua, retval);
223} 222}
224 223
225int 224int
226netbsd32_open(struct lwp *l, const struct netbsd32_open_args *uap, register_t *retval) 225netbsd32_open(struct lwp *l, const struct netbsd32_open_args *uap, register_t *retval)
227{ 226{
228 /* { 227 /* {
229 syscallarg(const netbsd32_charp) path; 228 syscallarg(const netbsd32_charp) path;
230 syscallarg(int) flags; 229 syscallarg(int) flags;
231 syscallarg(mode_t) mode; 230 syscallarg(mode_t) mode;
232 } */ 231 } */
233 struct sys_open_args ua; 232 struct sys_open_args ua;
234 233
235 NETBSD32TOP_UAP(path, const char); 234 NETBSD32TOP_UAP(path, const char);
236 NETBSD32TO64_UAP(flags); 235 NETBSD32TO64_UAP(flags);
237 NETBSD32TO64_UAP(mode); 236 NETBSD32TO64_UAP(mode);
238 237
239 return sys_open(l, &ua, retval); 238 return sys_open(l, &ua, retval);
240} 239}
241 240
242int 241int
243netbsd32_link(struct lwp *l, const struct netbsd32_link_args *uap, register_t *retval) 242netbsd32_link(struct lwp *l, const struct netbsd32_link_args *uap, register_t *retval)
244{ 243{
245 /* { 244 /* {
246 syscallarg(const netbsd32_charp) path; 245 syscallarg(const netbsd32_charp) path;
247 syscallarg(const netbsd32_charp) link; 246 syscallarg(const netbsd32_charp) link;
248 } */ 247 } */
249 struct sys_link_args ua; 248 struct sys_link_args ua;
250 249
251 NETBSD32TOP_UAP(path, const char); 250 NETBSD32TOP_UAP(path, const char);
252 NETBSD32TOP_UAP(link, const char); 251 NETBSD32TOP_UAP(link, const char);
253 return sys_link(l, &ua, retval); 252 return sys_link(l, &ua, retval);
254} 253}
255 254
256int 255int
257netbsd32_unlink(struct lwp *l, const struct netbsd32_unlink_args *uap, register_t *retval) 256netbsd32_unlink(struct lwp *l, const struct netbsd32_unlink_args *uap, register_t *retval)
258{ 257{
259 /* { 258 /* {
260 syscallarg(const netbsd32_charp) path; 259 syscallarg(const netbsd32_charp) path;
261 } */ 260 } */
262 struct sys_unlink_args ua; 261 struct sys_unlink_args ua;
263 262
264 NETBSD32TOP_UAP(path, const char); 263 NETBSD32TOP_UAP(path, const char);
265 264
266 return sys_unlink(l, &ua, retval); 265 return sys_unlink(l, &ua, retval);
267} 266}
268 267
269int 268int
270netbsd32_chdir(struct lwp *l, const struct netbsd32_chdir_args *uap, register_t *retval) 269netbsd32_chdir(struct lwp *l, const struct netbsd32_chdir_args *uap, register_t *retval)
271{ 270{
272 /* { 271 /* {
273 syscallarg(const netbsd32_charp) path; 272 syscallarg(const netbsd32_charp) path;
274 } */ 273 } */
275 struct sys_chdir_args ua; 274 struct sys_chdir_args ua;
276 275
277 NETBSD32TOP_UAP(path, const char); 276 NETBSD32TOP_UAP(path, const char);
278 277
279 return sys_chdir(l, &ua, retval); 278 return sys_chdir(l, &ua, retval);
280} 279}
281 280
282int 281int
283netbsd32_fchdir(struct lwp *l, const struct netbsd32_fchdir_args *uap, register_t *retval) 282netbsd32_fchdir(struct lwp *l, const struct netbsd32_fchdir_args *uap, register_t *retval)
284{ 283{
285 /* { 284 /* {
286 syscallarg(int) fd; 285 syscallarg(int) fd;
287 } */ 286 } */
288 struct sys_fchdir_args ua; 287 struct sys_fchdir_args ua;
289 288
290 NETBSD32TO64_UAP(fd); 289 NETBSD32TO64_UAP(fd);
291 290
292 return sys_fchdir(l, &ua, retval); 291 return sys_fchdir(l, &ua, retval);
293} 292}
294 293
295int 294int
296netbsd32___mknod50(struct lwp *l, const struct netbsd32___mknod50_args *uap, register_t *retval) 295netbsd32___mknod50(struct lwp *l, const struct netbsd32___mknod50_args *uap, register_t *retval)
297{ 296{
298 /* { 297 /* {
299 syscallarg(const netbsd32_charp) path; 298 syscallarg(const netbsd32_charp) path;
300 syscallarg(mode_t) mode; 299 syscallarg(mode_t) mode;
301 syscallarg(netbsd32_dev_t) dev; 300 syscallarg(netbsd32_dev_t) dev;
302 } */ 301 } */
303 302
304 return do_posix_mknodat(l, AT_FDCWD, SCARG_P32(uap, path), 303 return do_posix_mknodat(l, AT_FDCWD, SCARG_P32(uap, path),
305 SCARG(uap, mode), SCARG(uap, dev)); 304 SCARG(uap, mode), SCARG(uap, dev));
306} 305}
307 306
308int 307int
309netbsd32_chmod(struct lwp *l, const struct netbsd32_chmod_args *uap, register_t *retval) 308netbsd32_chmod(struct lwp *l, const struct netbsd32_chmod_args *uap, register_t *retval)
310{ 309{
311 /* { 310 /* {
312 syscallarg(const netbsd32_charp) path; 311 syscallarg(const netbsd32_charp) path;
313 syscallarg(mode_t) mode; 312 syscallarg(mode_t) mode;
314 } */ 313 } */
315 struct sys_chmod_args ua; 314 struct sys_chmod_args ua;
316 315
317 NETBSD32TOP_UAP(path, const char); 316 NETBSD32TOP_UAP(path, const char);
318 NETBSD32TO64_UAP(mode); 317 NETBSD32TO64_UAP(mode);
319 318
320 return sys_chmod(l, &ua, retval); 319 return sys_chmod(l, &ua, retval);
321} 320}
322 321
323int 322int
324netbsd32_chown(struct lwp *l, const struct netbsd32_chown_args *uap, register_t *retval) 323netbsd32_chown(struct lwp *l, const struct netbsd32_chown_args *uap, register_t *retval)
325{ 324{
326 /* { 325 /* {
327 syscallarg(const netbsd32_charp) path; 326 syscallarg(const netbsd32_charp) path;
328 syscallarg(uid_t) uid; 327 syscallarg(uid_t) uid;
329 syscallarg(gid_t) gid; 328 syscallarg(gid_t) gid;
330 } */ 329 } */
331 struct sys_chown_args ua; 330 struct sys_chown_args ua;
332 331
333 NETBSD32TOP_UAP(path, const char); 332 NETBSD32TOP_UAP(path, const char);
334 NETBSD32TO64_UAP(uid); 333 NETBSD32TO64_UAP(uid);
335 NETBSD32TO64_UAP(gid); 334 NETBSD32TO64_UAP(gid);
336 335
337 return sys_chown(l, &ua, retval); 336 return sys_chown(l, &ua, retval);
338} 337}
339 338
340int 339int
341netbsd32_break(struct lwp *l, const struct netbsd32_break_args *uap, register_t *retval) 340netbsd32_break(struct lwp *l, const struct netbsd32_break_args *uap, register_t *retval)
342{ 341{
343 /* { 342 /* {
344 syscallarg(netbsd32_charp) nsize; 343 syscallarg(netbsd32_charp) nsize;
345 } */ 344 } */
346 struct sys_obreak_args ua; 345 struct sys_obreak_args ua;
347 346
348 NETBSD32TOP_UAP(nsize, char); 347 NETBSD32TOP_UAP(nsize, char);
349 348
350 return sys_obreak(l, &ua, retval); 349 return sys_obreak(l, &ua, retval);
351} 350}
352 351
353int 352int
354netbsd32_unmount(struct lwp *l, const struct netbsd32_unmount_args *uap, register_t *retval) 353netbsd32_unmount(struct lwp *l, const struct netbsd32_unmount_args *uap, register_t *retval)
355{ 354{
356 /* { 355 /* {
357 syscallarg(const netbsd32_charp) path; 356 syscallarg(const netbsd32_charp) path;
358 syscallarg(int) flags; 357 syscallarg(int) flags;
359 } */ 358 } */
360 struct sys_unmount_args ua; 359 struct sys_unmount_args ua;
361 360
362 NETBSD32TOP_UAP(path, const char); 361 NETBSD32TOP_UAP(path, const char);
363 NETBSD32TO64_UAP(flags); 362 NETBSD32TO64_UAP(flags);
364 363
365 return sys_unmount(l, &ua, retval); 364 return sys_unmount(l, &ua, retval);
366} 365}
367 366
368int 367int
369netbsd32_setuid(struct lwp *l, const struct netbsd32_setuid_args *uap, register_t *retval) 368netbsd32_setuid(struct lwp *l, const struct netbsd32_setuid_args *uap, register_t *retval)
370{ 369{
371 /* { 370 /* {
372 syscallarg(uid_t) uid; 371 syscallarg(uid_t) uid;
373 } */ 372 } */
374 struct sys_setuid_args ua; 373 struct sys_setuid_args ua;
375 374
376 NETBSD32TO64_UAP(uid); 375 NETBSD32TO64_UAP(uid);
377 376
378 return sys_setuid(l, &ua, retval); 377 return sys_setuid(l, &ua, retval);
379} 378}
380 379
381int 380int
382netbsd32_accept(struct lwp *l, const struct netbsd32_accept_args *uap, register_t *retval) 381netbsd32_accept(struct lwp *l, const struct netbsd32_accept_args *uap, register_t *retval)
383{ 382{
384 /* { 383 /* {
385 syscallarg(int) s; 384 syscallarg(int) s;
386 syscallarg(netbsd32_sockaddrp_t) name; 385 syscallarg(netbsd32_sockaddrp_t) name;
387 syscallarg(netbsd32_intp) anamelen; 386 syscallarg(netbsd32_intp) anamelen;
388 } */ 387 } */
389 struct sys_accept_args ua; 388 struct sys_accept_args ua;
390 389
391 NETBSD32TO64_UAP(s); 390 NETBSD32TO64_UAP(s);
392 NETBSD32TOP_UAP(name, struct sockaddr); 391 NETBSD32TOP_UAP(name, struct sockaddr);
393 NETBSD32TOP_UAP(anamelen, socklen_t); 392 NETBSD32TOP_UAP(anamelen, socklen_t);
394 393
395 return sys_accept(l, &ua, retval); 394 return sys_accept(l, &ua, retval);
396} 395}
397 396
398int 397int
399netbsd32_getpeername(struct lwp *l, const struct netbsd32_getpeername_args *uap, register_t *retval) 398netbsd32_getpeername(struct lwp *l, const struct netbsd32_getpeername_args *uap, register_t *retval)
400{ 399{
401 /* { 400 /* {
402 syscallarg(int) fdes; 401 syscallarg(int) fdes;
403 syscallarg(netbsd32_sockaddrp_t) asa; 402 syscallarg(netbsd32_sockaddrp_t) asa;
404 syscallarg(netbsd32_intp) alen; 403 syscallarg(netbsd32_intp) alen;
405 } */ 404 } */
406 struct sys_getpeername_args ua; 405 struct sys_getpeername_args ua;
407 406
408 NETBSD32TO64_UAP(fdes); 407 NETBSD32TO64_UAP(fdes);
409 NETBSD32TOP_UAP(asa, struct sockaddr); 408 NETBSD32TOP_UAP(asa, struct sockaddr);
410 NETBSD32TOP_UAP(alen, socklen_t); 409 NETBSD32TOP_UAP(alen, socklen_t);
411/* NB: do the protocol specific sockaddrs need to be converted? */ 410/* NB: do the protocol specific sockaddrs need to be converted? */
412 411
413 return sys_getpeername(l, &ua, retval); 412 return sys_getpeername(l, &ua, retval);
414} 413}
415 414
416int 415int
417netbsd32_getsockname(struct lwp *l, const struct netbsd32_getsockname_args *uap, register_t *retval) 416netbsd32_getsockname(struct lwp *l, const struct netbsd32_getsockname_args *uap, register_t *retval)
418{ 417{
419 /* { 418 /* {
420 syscallarg(int) fdes; 419 syscallarg(int) fdes;
421 syscallarg(netbsd32_sockaddrp_t) asa; 420 syscallarg(netbsd32_sockaddrp_t) asa;
422 syscallarg(netbsd32_intp) alen; 421 syscallarg(netbsd32_intp) alen;
423 } */ 422 } */
424 struct sys_getsockname_args ua; 423 struct sys_getsockname_args ua;
425 424
426 NETBSD32TO64_UAP(fdes); 425 NETBSD32TO64_UAP(fdes);
427 NETBSD32TOP_UAP(asa, struct sockaddr); 426 NETBSD32TOP_UAP(asa, struct sockaddr);
428 NETBSD32TOP_UAP(alen, socklen_t); 427 NETBSD32TOP_UAP(alen, socklen_t);
429 428
430 return sys_getsockname(l, &ua, retval); 429 return sys_getsockname(l, &ua, retval);
431} 430}
432 431
433int 432int
434netbsd32_access(struct lwp *l, const struct netbsd32_access_args *uap, register_t *retval) 433netbsd32_access(struct lwp *l, const struct netbsd32_access_args *uap, register_t *retval)
435{ 434{
436 /* { 435 /* {
437 syscallarg(const netbsd32_charp) path; 436 syscallarg(const netbsd32_charp) path;
438 syscallarg(int) flags; 437 syscallarg(int) flags;
439 } */ 438 } */
440 struct sys_access_args ua; 439 struct sys_access_args ua;
441 440
442 NETBSD32TOP_UAP(path, const char); 441 NETBSD32TOP_UAP(path, const char);
443 NETBSD32TO64_UAP(flags); 442 NETBSD32TO64_UAP(flags);
444 443
445 return sys_access(l, &ua, retval); 444 return sys_access(l, &ua, retval);
446} 445}
447 446
448int 447int
449netbsd32_chflags(struct lwp *l, const struct netbsd32_chflags_args *uap, register_t *retval) 448netbsd32_chflags(struct lwp *l, const struct netbsd32_chflags_args *uap, register_t *retval)
450{ 449{
451 /* { 450 /* {
452 syscallarg(const netbsd32_charp) path; 451 syscallarg(const netbsd32_charp) path;
453 syscallarg(netbsd32_u_long) flags; 452 syscallarg(netbsd32_u_long) flags;
454 } */ 453 } */
455 struct sys_chflags_args ua; 454 struct sys_chflags_args ua;
456 455
457 NETBSD32TOP_UAP(path, const char); 456 NETBSD32TOP_UAP(path, const char);
458 NETBSD32TO64_UAP(flags); 457 NETBSD32TO64_UAP(flags);
459 458
460 return sys_chflags(l, &ua, retval); 459 return sys_chflags(l, &ua, retval);
461} 460}
462 461
463int 462int
464netbsd32_fchflags(struct lwp *l, const struct netbsd32_fchflags_args *uap, register_t *retval) 463netbsd32_fchflags(struct lwp *l, const struct netbsd32_fchflags_args *uap, register_t *retval)
465{ 464{
466 /* { 465 /* {
467 syscallarg(int) fd; 466 syscallarg(int) fd;
468 syscallarg(netbsd32_u_long) flags; 467 syscallarg(netbsd32_u_long) flags;
469 } */ 468 } */
470 struct sys_fchflags_args ua; 469 struct sys_fchflags_args ua;
471 470
472 NETBSD32TO64_UAP(fd); 471 NETBSD32TO64_UAP(fd);
473 NETBSD32TO64_UAP(flags); 472 NETBSD32TO64_UAP(flags);
474 473
475 return sys_fchflags(l, &ua, retval); 474 return sys_fchflags(l, &ua, retval);
476} 475}
477 476
478int 477int
479netbsd32_lchflags(struct lwp *l, const struct netbsd32_lchflags_args *uap, register_t *retval) 478netbsd32_lchflags(struct lwp *l, const struct netbsd32_lchflags_args *uap, register_t *retval)
480{ 479{
481 /* { 480 /* {
482 syscallarg(const char *) path; 481 syscallarg(const char *) path;
483 syscallarg(netbsd32_u_long) flags; 482 syscallarg(netbsd32_u_long) flags;
484 } */ 483 } */
485 struct sys_lchflags_args ua; 484 struct sys_lchflags_args ua;
486 485
487 NETBSD32TOP_UAP(path, const char); 486 NETBSD32TOP_UAP(path, const char);
488 NETBSD32TO64_UAP(flags); 487 NETBSD32TO64_UAP(flags);
489 488
490 return sys_lchflags(l, &ua, retval); 489 return sys_lchflags(l, &ua, retval);
491} 490}
492 491
493int 492int
494netbsd32_kill(struct lwp *l, const struct netbsd32_kill_args *uap, register_t *retval) 493netbsd32_kill(struct lwp *l, const struct netbsd32_kill_args *uap, register_t *retval)
495{ 494{
496 /* { 495 /* {
497 syscallarg(int) pid; 496 syscallarg(int) pid;
498 syscallarg(int) signum; 497 syscallarg(int) signum;
499 } */ 498 } */
500 struct sys_kill_args ua; 499 struct sys_kill_args ua;
501 500
502 NETBSD32TO64_UAP(pid); 501 NETBSD32TO64_UAP(pid);
503 NETBSD32TO64_UAP(signum); 502 NETBSD32TO64_UAP(signum);
504 503
505 return sys_kill(l, &ua, retval); 504 return sys_kill(l, &ua, retval);
506} 505}
507 506
508int 507int
509netbsd32_dup(struct lwp *l, const struct netbsd32_dup_args *uap, register_t *retval) 508netbsd32_dup(struct lwp *l, const struct netbsd32_dup_args *uap, register_t *retval)
510{ 509{
511 /* { 510 /* {
512 syscallarg(int) fd; 511 syscallarg(int) fd;
513 } */ 512 } */
514 struct sys_dup_args ua; 513 struct sys_dup_args ua;
515 514
516 NETBSD32TO64_UAP(fd); 515 NETBSD32TO64_UAP(fd);
517 516
518 return sys_dup(l, &ua, retval); 517 return sys_dup(l, &ua, retval);
519} 518}
520 519
521int 520int
522netbsd32_profil(struct lwp *l, const struct netbsd32_profil_args *uap, register_t *retval) 521netbsd32_profil(struct lwp *l, const struct netbsd32_profil_args *uap, register_t *retval)
523{ 522{
524 /* { 523 /* {
525 syscallarg(netbsd32_voidp) samples; 524 syscallarg(netbsd32_voidp) samples;
526 syscallarg(netbsd32_size_t) size; 525 syscallarg(netbsd32_size_t) size;
527 syscallarg(netbsd32_u_long) offset; 526 syscallarg(netbsd32_u_long) offset;
528 syscallarg(u_int) scale; 527 syscallarg(u_int) scale;
529 } */ 528 } */
530 struct sys_profil_args ua; 529 struct sys_profil_args ua;
531 530
532 NETBSD32TOP_UAP(samples, void *); 531 NETBSD32TOP_UAP(samples, void *);
533 NETBSD32TOX_UAP(size, size_t); 532 NETBSD32TOX_UAP(size, size_t);
534 NETBSD32TOX_UAP(offset, u_long); 533 NETBSD32TOX_UAP(offset, u_long);
535 NETBSD32TO64_UAP(scale); 534 NETBSD32TO64_UAP(scale);
536 535
537 return sys_profil(l, &ua, retval); 536 return sys_profil(l, &ua, retval);
538} 537}
539 538
540int 539int
541netbsd32_ktrace(struct lwp *l, const struct netbsd32_ktrace_args *uap, register_t *retval) 540netbsd32_ktrace(struct lwp *l, const struct netbsd32_ktrace_args *uap, register_t *retval)
542{ 541{
543 /* { 542 /* {
544 syscallarg(const netbsd32_charp) fname; 543 syscallarg(const netbsd32_charp) fname;
545 syscallarg(int) ops; 544 syscallarg(int) ops;
546 syscallarg(int) facs; 545 syscallarg(int) facs;
547 syscallarg(int) pid; 546 syscallarg(int) pid;
548 } */ 547 } */
549 struct sys_ktrace_args ua; 548 struct sys_ktrace_args ua;
550 549
551 NETBSD32TOP_UAP(fname, const char); 550 NETBSD32TOP_UAP(fname, const char);
552 NETBSD32TO64_UAP(ops); 551 NETBSD32TO64_UAP(ops);
553 NETBSD32TO64_UAP(facs); 552 NETBSD32TO64_UAP(facs);
554 NETBSD32TO64_UAP(pid); 553 NETBSD32TO64_UAP(pid);
555 554
556 return sys_ktrace(l, &ua, retval); 555 return sys_ktrace(l, &ua, retval);
557} 556}
558 557
559int 558int
560netbsd32_utrace(struct lwp *l, const struct netbsd32_utrace_args *uap, register_t *retval) 559netbsd32_utrace(struct lwp *l, const struct netbsd32_utrace_args *uap, register_t *retval)
561{ 560{
562 /* { 561 /* {
563 syscallarg(const netbsd32_charp) label; 562 syscallarg(const netbsd32_charp) label;
564 syscallarg(netbsd32_voidp) addr; 563 syscallarg(netbsd32_voidp) addr;
565 syscallarg(netbsd32_size_t) len; 564 syscallarg(netbsd32_size_t) len;
566 } */ 565 } */
567 struct sys_utrace_args ua; 566 struct sys_utrace_args ua;
568 567
569 NETBSD32TOP_UAP(label, const char); 568 NETBSD32TOP_UAP(label, const char);
570 NETBSD32TOP_UAP(addr, void); 569 NETBSD32TOP_UAP(addr, void);
571 NETBSD32TO64_UAP(len); 570 NETBSD32TO64_UAP(len);
572 571
573 return sys_utrace(l, &ua, retval); 572 return sys_utrace(l, &ua, retval);
574} 573}
575 574
576int 575int
577netbsd32___getlogin(struct lwp *l, const struct netbsd32___getlogin_args *uap, register_t *retval) 576netbsd32___getlogin(struct lwp *l, const struct netbsd32___getlogin_args *uap, register_t *retval)
578{ 577{
579 /* { 578 /* {
580 syscallarg(netbsd32_charp) namebuf; 579 syscallarg(netbsd32_charp) namebuf;
581 syscallarg(u_int) namelen; 580 syscallarg(u_int) namelen;
582 } */ 581 } */
583 struct sys___getlogin_args ua; 582 struct sys___getlogin_args ua;
584 583
585 NETBSD32TOP_UAP(namebuf, char); 584 NETBSD32TOP_UAP(namebuf, char);
586 NETBSD32TO64_UAP(namelen); 585 NETBSD32TO64_UAP(namelen);
587 586
588 return sys___getlogin(l, &ua, retval); 587 return sys___getlogin(l, &ua, retval);
589} 588}
590 589
591int 590int
592netbsd32_setlogin(struct lwp *l, const struct netbsd32_setlogin_args *uap, register_t *retval) 591netbsd32_setlogin(struct lwp *l, const struct netbsd32_setlogin_args *uap, register_t *retval)
593{ 592{
594 /* { 593 /* {
595 syscallarg(const netbsd32_charp) namebuf; 594 syscallarg(const netbsd32_charp) namebuf;
596 } */ 595 } */
597 struct sys___setlogin_args ua; 596 struct sys___setlogin_args ua;
598 597
599 NETBSD32TOP_UAP(namebuf, char); 598 NETBSD32TOP_UAP(namebuf, char);
600 599
601 return sys___setlogin(l, &ua, retval); 600 return sys___setlogin(l, &ua, retval);
602} 601}
603 602
604int 603int
605netbsd32_acct(struct lwp *l, const struct netbsd32_acct_args *uap, register_t *retval) 604netbsd32_acct(struct lwp *l, const struct netbsd32_acct_args *uap, register_t *retval)
606{ 605{
607 /* { 606 /* {
608 syscallarg(const netbsd32_charp) path; 607 syscallarg(const netbsd32_charp) path;
609 } */ 608 } */
610 struct sys_acct_args ua; 609 struct sys_acct_args ua;
611 610
612 NETBSD32TOP_UAP(path, const char); 611 NETBSD32TOP_UAP(path, const char);
613 612
614 return sys_acct(l, &ua, retval); 613 return sys_acct(l, &ua, retval);
615} 614}
616 615
617int 616int
618netbsd32_revoke(struct lwp *l, const struct netbsd32_revoke_args *uap, register_t *retval) 617netbsd32_revoke(struct lwp *l, const struct netbsd32_revoke_args *uap, register_t *retval)
619{ 618{
620 /* { 619 /* {
621 syscallarg(const netbsd32_charp) path; 620 syscallarg(const netbsd32_charp) path;
622 } */ 621 } */
623 struct sys_revoke_args ua; 622 struct sys_revoke_args ua;
624 623
625 NETBSD32TOP_UAP(path, const char); 624 NETBSD32TOP_UAP(path, const char);
626 625
627 return sys_revoke(l, &ua, retval); 626 return sys_revoke(l, &ua, retval);
628} 627}
629 628
630int 629int
631netbsd32_symlink(struct lwp *l, const struct netbsd32_symlink_args *uap, register_t *retval) 630netbsd32_symlink(struct lwp *l, const struct netbsd32_symlink_args *uap, register_t *retval)
632{ 631{
633 /* { 632 /* {
634 syscallarg(const netbsd32_charp) path; 633 syscallarg(const netbsd32_charp) path;
635 syscallarg(const netbsd32_charp) link; 634 syscallarg(const netbsd32_charp) link;
636 } */ 635 } */
637 struct sys_symlink_args ua; 636 struct sys_symlink_args ua;
638 637
639 NETBSD32TOP_UAP(path, const char); 638 NETBSD32TOP_UAP(path, const char);
640 NETBSD32TOP_UAP(link, const char); 639 NETBSD32TOP_UAP(link, const char);
641 640
642 return sys_symlink(l, &ua, retval); 641 return sys_symlink(l, &ua, retval);
643} 642}
644 643
645int 644int
646netbsd32_readlink(struct lwp *l, const struct netbsd32_readlink_args *uap, register_t *retval) 645netbsd32_readlink(struct lwp *l, const struct netbsd32_readlink_args *uap, register_t *retval)
647{ 646{
648 /* { 647 /* {
649 syscallarg(const netbsd32_charp) path; 648 syscallarg(const netbsd32_charp) path;
650 syscallarg(netbsd32_charp) buf; 649 syscallarg(netbsd32_charp) buf;
651 syscallarg(netbsd32_size_t) count; 650 syscallarg(netbsd32_size_t) count;
652 } */ 651 } */
653 struct sys_readlink_args ua; 652 struct sys_readlink_args ua;
654 653
655 NETBSD32TOP_UAP(path, const char); 654 NETBSD32TOP_UAP(path, const char);
656 NETBSD32TOP_UAP(buf, char); 655 NETBSD32TOP_UAP(buf, char);
657 NETBSD32TOX_UAP(count, size_t); 656 NETBSD32TOX_UAP(count, size_t);
658 657
659 return sys_readlink(l, &ua, retval); 658 return sys_readlink(l, &ua, retval);
660} 659}
661 660
662int 661int
663netbsd32_umask(struct lwp *l, const struct netbsd32_umask_args *uap, register_t *retval) 662netbsd32_umask(struct lwp *l, const struct netbsd32_umask_args *uap, register_t *retval)
664{ 663{
665 /* { 664 /* {
666 syscallarg(mode_t) newmask; 665 syscallarg(mode_t) newmask;
667 } */ 666 } */
668 struct sys_umask_args ua; 667 struct sys_umask_args ua;
669 668
670 NETBSD32TO64_UAP(newmask); 669 NETBSD32TO64_UAP(newmask);
671 670
672 return sys_umask(l, &ua, retval); 671 return sys_umask(l, &ua, retval);
673} 672}
674 673
675int 674int
676netbsd32_chroot(struct lwp *l, const struct netbsd32_chroot_args *uap, register_t *retval) 675netbsd32_chroot(struct lwp *l, const struct netbsd32_chroot_args *uap, register_t *retval)
677{ 676{
678 /* { 677 /* {
679 syscallarg(const netbsd32_charp) path; 678 syscallarg(const netbsd32_charp) path;
680 } */ 679 } */
681 struct sys_chroot_args ua; 680 struct sys_chroot_args ua;
682 681
683 NETBSD32TOP_UAP(path, const char); 682 NETBSD32TOP_UAP(path, const char);
684 683
685 return sys_chroot(l, &ua, retval); 684 return sys_chroot(l, &ua, retval);
686} 685}
687 686
688int 687int
689netbsd32_munmap(struct lwp *l, const struct netbsd32_munmap_args *uap, register_t *retval) 688netbsd32_munmap(struct lwp *l, const struct netbsd32_munmap_args *uap, register_t *retval)
690{ 689{
691 /* { 690 /* {
692 syscallarg(netbsd32_voidp) addr; 691 syscallarg(netbsd32_voidp) addr;
693 syscallarg(netbsd32_size_t) len; 692 syscallarg(netbsd32_size_t) len;
694 } */ 693 } */
695 struct sys_munmap_args ua; 694 struct sys_munmap_args ua;
696 695
697 NETBSD32TOP_UAP(addr, void); 696 NETBSD32TOP_UAP(addr, void);
698 NETBSD32TOX_UAP(len, size_t); 697 NETBSD32TOX_UAP(len, size_t);
699 698
700 return sys_munmap(l, &ua, retval); 699 return sys_munmap(l, &ua, retval);
701} 700}
702 701
703int 702int
704netbsd32_mprotect(struct lwp *l, const struct netbsd32_mprotect_args *uap, register_t *retval) 703netbsd32_mprotect(struct lwp *l, const struct netbsd32_mprotect_args *uap, register_t *retval)
705{ 704{
706 /* { 705 /* {
707 syscallarg(netbsd32_voidp) addr; 706 syscallarg(netbsd32_voidp) addr;
708 syscallarg(netbsd32_size_t) len; 707 syscallarg(netbsd32_size_t) len;
709 syscallarg(int) prot; 708 syscallarg(int) prot;
710 } */ 709 } */
711 struct sys_mprotect_args ua; 710 struct sys_mprotect_args ua;
712 711
713 NETBSD32TOP_UAP(addr, void); 712 NETBSD32TOP_UAP(addr, void);
714 NETBSD32TOX_UAP(len, size_t); 713 NETBSD32TOX_UAP(len, size_t);
715 NETBSD32TO64_UAP(prot); 714 NETBSD32TO64_UAP(prot);
716 715
717 return sys_mprotect(l, &ua, retval); 716 return sys_mprotect(l, &ua, retval);
718} 717}
719 718
720int 719int
721netbsd32_madvise(struct lwp *l, const struct netbsd32_madvise_args *uap, register_t *retval) 720netbsd32_madvise(struct lwp *l, const struct netbsd32_madvise_args *uap, register_t *retval)
722{ 721{
723 /* { 722 /* {
724 syscallarg(netbsd32_voidp) addr; 723 syscallarg(netbsd32_voidp) addr;
725 syscallarg(netbsd32_size_t) len; 724 syscallarg(netbsd32_size_t) len;
726 syscallarg(int) behav; 725 syscallarg(int) behav;
727 } */ 726 } */
728 struct sys_madvise_args ua; 727 struct sys_madvise_args ua;
729 728
730 NETBSD32TOP_UAP(addr, void); 729 NETBSD32TOP_UAP(addr, void);
731 NETBSD32TOX_UAP(len, size_t); 730 NETBSD32TOX_UAP(len, size_t);
732 NETBSD32TO64_UAP(behav); 731 NETBSD32TO64_UAP(behav);
733 732
734 return sys_madvise(l, &ua, retval); 733 return sys_madvise(l, &ua, retval);
735} 734}
736 735
737int 736int
738netbsd32_mincore(struct lwp *l, const struct netbsd32_mincore_args *uap, register_t *retval) 737netbsd32_mincore(struct lwp *l, const struct netbsd32_mincore_args *uap, register_t *retval)
739{ 738{
740 /* { 739 /* {
741 syscallarg(netbsd32_voidp) addr; 740 syscallarg(netbsd32_voidp) addr;
742 syscallarg(netbsd32_size_t) len; 741 syscallarg(netbsd32_size_t) len;
743 syscallarg(netbsd32_charp) vec; 742 syscallarg(netbsd32_charp) vec;
744 } */ 743 } */
745 struct sys_mincore_args ua; 744 struct sys_mincore_args ua;
746 745
747 NETBSD32TOP_UAP(addr, void *); 746 NETBSD32TOP_UAP(addr, void *);
748 NETBSD32TOX_UAP(len, size_t); 747 NETBSD32TOX_UAP(len, size_t);
749 NETBSD32TOP_UAP(vec, char); 748 NETBSD32TOP_UAP(vec, char);
750 749
751 return sys_mincore(l, &ua, retval); 750 return sys_mincore(l, &ua, retval);
752} 751}
753 752
754int 753int
755netbsd32_getgroups(struct lwp *l, const struct netbsd32_getgroups_args *uap, register_t *retval) 754netbsd32_getgroups(struct lwp *l, const struct netbsd32_getgroups_args *uap, register_t *retval)
756{ 755{
757 /* { 756 /* {
758 syscallarg(int) gidsetsize; 757 syscallarg(int) gidsetsize;
759 syscallarg(netbsd32_gid_tp) gidset; 758 syscallarg(netbsd32_gid_tp) gidset;
760 } */ 759 } */
761 struct sys_getgroups_args ua; 760 struct sys_getgroups_args ua;
762 761
763 /* Since sizeof (gid_t) == sizeof (netbsd32_gid_t) ... */ 762 /* Since sizeof (gid_t) == sizeof (netbsd32_gid_t) ... */
764 763
765 NETBSD32TO64_UAP(gidsetsize); 764 NETBSD32TO64_UAP(gidsetsize);
766 NETBSD32TOP_UAP(gidset, gid_t); 765 NETBSD32TOP_UAP(gidset, gid_t);
767 766
768 return sys_getgroups(l, &ua, retval); 767 return sys_getgroups(l, &ua, retval);
769} 768}
770 769
771int 770int
772netbsd32_setgroups(struct lwp *l, const struct netbsd32_setgroups_args *uap, register_t *retval) 771netbsd32_setgroups(struct lwp *l, const struct netbsd32_setgroups_args *uap, register_t *retval)
773{ 772{
774 /* { 773 /* {
775 syscallarg(int) gidsetsize; 774 syscallarg(int) gidsetsize;
776 syscallarg(const netbsd32_gid_tp) gidset; 775 syscallarg(const netbsd32_gid_tp) gidset;
777 } */ 776 } */
778 struct sys_setgroups_args ua; 777 struct sys_setgroups_args ua;
779 778
780 NETBSD32TO64_UAP(gidsetsize); 779 NETBSD32TO64_UAP(gidsetsize);
781 NETBSD32TOP_UAP(gidset, gid_t); 780 NETBSD32TOP_UAP(gidset, gid_t);
782 781
783 return sys_setgroups(l, &ua, retval); 782 return sys_setgroups(l, &ua, retval);
784} 783}
785 784
786int 785int
787netbsd32_setpgid(struct lwp *l, const struct netbsd32_setpgid_args *uap, register_t *retval) 786netbsd32_setpgid(struct lwp *l, const struct netbsd32_setpgid_args *uap, register_t *retval)
788{ 787{
789 /* { 788 /* {
790 syscallarg(int) pid; 789 syscallarg(int) pid;
791 syscallarg(int) pgid; 790 syscallarg(int) pgid;
792 } */ 791 } */
793 struct sys_setpgid_args ua; 792 struct sys_setpgid_args ua;
794 793
795 NETBSD32TO64_UAP(pid); 794 NETBSD32TO64_UAP(pid);
796 NETBSD32TO64_UAP(pgid); 795 NETBSD32TO64_UAP(pgid);
797 796
798 return sys_setpgid(l, &ua, retval); 797 return sys_setpgid(l, &ua, retval);
799} 798}
800 799
801int 800int
802netbsd32_fcntl(struct lwp *l, const struct netbsd32_fcntl_args *uap, register_t *retval) 801netbsd32_fcntl(struct lwp *l, const struct netbsd32_fcntl_args *uap, register_t *retval)
803{ 802{
804 /* { 803 /* {
805 syscallarg(int) fd; 804 syscallarg(int) fd;
806 syscallarg(int) cmd; 805 syscallarg(int) cmd;
807 syscallarg(netbsd32_voidp) arg; 806 syscallarg(netbsd32_voidp) arg;
808 } */ 807 } */
809 struct sys_fcntl_args ua; 808 struct sys_fcntl_args ua;
810 809
811 NETBSD32TO64_UAP(fd); 810 NETBSD32TO64_UAP(fd);
812 NETBSD32TO64_UAP(cmd); 811 NETBSD32TO64_UAP(cmd);
813 /* we can do this because `struct flock' doesn't change */ 812 /* we can do this because `struct flock' doesn't change */
814 NETBSD32TOP_UAP(arg, void); 813 NETBSD32TOP_UAP(arg, void);
815 814
816 return sys_fcntl(l, &ua, retval); 815 return sys_fcntl(l, &ua, retval);
817} 816}
818 817
819int 818int
820netbsd32_dup2(struct lwp *l, const struct netbsd32_dup2_args *uap, register_t *retval) 819netbsd32_dup2(struct lwp *l, const struct netbsd32_dup2_args *uap, register_t *retval)
821{ 820{
822 /* { 821 /* {
823 syscallarg(int) from; 822 syscallarg(int) from;
824 syscallarg(int) to; 823 syscallarg(int) to;
825 } */ 824 } */
826 struct sys_dup2_args ua; 825 struct sys_dup2_args ua;
827 826
828 NETBSD32TO64_UAP(from); 827 NETBSD32TO64_UAP(from);
829 NETBSD32TO64_UAP(to); 828 NETBSD32TO64_UAP(to);
830 829
831 return sys_dup2(l, &ua, retval); 830 return sys_dup2(l, &ua, retval);
832} 831}
833 832
834int 833int
835netbsd32_fsync(struct lwp *l, const struct netbsd32_fsync_args *uap, register_t *retval) 834netbsd32_fsync(struct lwp *l, const struct netbsd32_fsync_args *uap, register_t *retval)
836{ 835{
837 /* { 836 /* {
838 syscallarg(int) fd; 837 syscallarg(int) fd;
839 } */ 838 } */
840 struct sys_fsync_args ua; 839 struct sys_fsync_args ua;
841 840
842 NETBSD32TO64_UAP(fd); 841 NETBSD32TO64_UAP(fd);
843 842
844 return sys_fsync(l, &ua, retval); 843 return sys_fsync(l, &ua, retval);
845} 844}
846 845
847int 846int
848netbsd32_setpriority(struct lwp *l, const struct netbsd32_setpriority_args *uap, register_t *retval) 847netbsd32_setpriority(struct lwp *l, const struct netbsd32_setpriority_args *uap, register_t *retval)
849{ 848{
850 /* { 849 /* {
851 syscallarg(int) which; 850 syscallarg(int) which;
852 syscallarg(int) who; 851 syscallarg(int) who;
853 syscallarg(int) prio; 852 syscallarg(int) prio;
854 } */ 853 } */
855 struct sys_setpriority_args ua; 854 struct sys_setpriority_args ua;
856 855
857 NETBSD32TO64_UAP(which); 856 NETBSD32TO64_UAP(which);
858 NETBSD32TO64_UAP(who); 857 NETBSD32TO64_UAP(who);
859 NETBSD32TO64_UAP(prio); 858 NETBSD32TO64_UAP(prio);
860 859
861 return sys_setpriority(l, &ua, retval); 860 return sys_setpriority(l, &ua, retval);
862} 861}
863 862
864int 863int
865netbsd32___socket30(struct lwp *l, const struct netbsd32___socket30_args *uap, register_t *retval) 864netbsd32___socket30(struct lwp *l, const struct netbsd32___socket30_args *uap, register_t *retval)
866{ 865{
867 /* { 866 /* {
868 syscallarg(int) domain; 867 syscallarg(int) domain;
869 syscallarg(int) type; 868 syscallarg(int) type;
870 syscallarg(int) protocol; 869 syscallarg(int) protocol;
871 } */ 870 } */
872 struct sys___socket30_args ua; 871 struct sys___socket30_args ua;
873 872
874 NETBSD32TO64_UAP(domain); 873 NETBSD32TO64_UAP(domain);
875 NETBSD32TO64_UAP(type); 874 NETBSD32TO64_UAP(type);
876 NETBSD32TO64_UAP(protocol); 875 NETBSD32TO64_UAP(protocol);
877 876
878 return sys___socket30(l, &ua, retval); 877 return sys___socket30(l, &ua, retval);
879} 878}
880 879
881int 880int
882netbsd32_connect(struct lwp *l, const struct netbsd32_connect_args *uap, register_t *retval) 881netbsd32_connect(struct lwp *l, const struct netbsd32_connect_args *uap, register_t *retval)
883{ 882{
884 /* { 883 /* {
885 syscallarg(int) s; 884 syscallarg(int) s;
886 syscallarg(const netbsd32_sockaddrp_t) name; 885 syscallarg(const netbsd32_sockaddrp_t) name;
887 syscallarg(int) namelen; 886 syscallarg(int) namelen;
888 } */ 887 } */
889 struct sys_connect_args ua; 888 struct sys_connect_args ua;
890 889
891 NETBSD32TO64_UAP(s); 890 NETBSD32TO64_UAP(s);
892 NETBSD32TOP_UAP(name, struct sockaddr); 891 NETBSD32TOP_UAP(name, struct sockaddr);
893 NETBSD32TO64_UAP(namelen); 892 NETBSD32TO64_UAP(namelen);
894 893
895 return sys_connect(l, &ua, retval); 894 return sys_connect(l, &ua, retval);
896} 895}
897 896
898int 897int
899netbsd32_getpriority(struct lwp *l, const struct netbsd32_getpriority_args *uap, register_t *retval) 898netbsd32_getpriority(struct lwp *l, const struct netbsd32_getpriority_args *uap, register_t *retval)
900{ 899{
901 /* { 900 /* {
902 syscallarg(int) which; 901 syscallarg(int) which;
903 syscallarg(int) who; 902 syscallarg(int) who;
904 } */ 903 } */
905 struct sys_getpriority_args ua; 904 struct sys_getpriority_args ua;
906 905
907 NETBSD32TO64_UAP(which); 906 NETBSD32TO64_UAP(which);
908 NETBSD32TO64_UAP(who); 907 NETBSD32TO64_UAP(who);
909 908
910 return sys_getpriority(l, &ua, retval); 909 return sys_getpriority(l, &ua, retval);
911} 910}
912 911
913int 912int
914netbsd32_bind(struct lwp *l, const struct netbsd32_bind_args *uap, register_t *retval) 913netbsd32_bind(struct lwp *l, const struct netbsd32_bind_args *uap, register_t *retval)
915{ 914{
916 /* { 915 /* {
917 syscallarg(int) s; 916 syscallarg(int) s;
918 syscallarg(const netbsd32_sockaddrp_t) name; 917 syscallarg(const netbsd32_sockaddrp_t) name;
919 syscallarg(int) namelen; 918 syscallarg(int) namelen;
920 } */ 919 } */
921 struct sys_bind_args ua; 920 struct sys_bind_args ua;
922 921
923 NETBSD32TO64_UAP(s); 922 NETBSD32TO64_UAP(s);
924 NETBSD32TOP_UAP(name, struct sockaddr); 923 NETBSD32TOP_UAP(name, struct sockaddr);
925 NETBSD32TO64_UAP(namelen); 924 NETBSD32TO64_UAP(namelen);
926 925
927 return sys_bind(l, &ua, retval); 926 return sys_bind(l, &ua, retval);
928} 927}
929 928
930int 929int
931netbsd32_setsockopt(struct lwp *l, const struct netbsd32_setsockopt_args *uap, register_t *retval) 930netbsd32_setsockopt(struct lwp *l, const struct netbsd32_setsockopt_args *uap, register_t *retval)
932{ 931{
933 /* { 932 /* {
934 syscallarg(int) s; 933 syscallarg(int) s;
935 syscallarg(int) level; 934 syscallarg(int) level;
936 syscallarg(int) name; 935 syscallarg(int) name;
937 syscallarg(const netbsd32_voidp) val; 936 syscallarg(const netbsd32_voidp) val;
938 syscallarg(int) valsize; 937 syscallarg(int) valsize;
939 } */ 938 } */
940 struct sys_setsockopt_args ua; 939 struct sys_setsockopt_args ua;
941 940
942 NETBSD32TO64_UAP(s); 941 NETBSD32TO64_UAP(s);
943 NETBSD32TO64_UAP(level); 942 NETBSD32TO64_UAP(level);
944 NETBSD32TO64_UAP(name); 943 NETBSD32TO64_UAP(name);
945 NETBSD32TOP_UAP(val, void); 944 NETBSD32TOP_UAP(val, void);
946 NETBSD32TO64_UAP(valsize); 945 NETBSD32TO64_UAP(valsize);
947 /* may be more efficient to do this inline. */ 946 /* may be more efficient to do this inline. */
948 947
949 return sys_setsockopt(l, &ua, retval); 948 return sys_setsockopt(l, &ua, retval);
950} 949}
951 950
952int 951int
953netbsd32_listen(struct lwp *l, const struct netbsd32_listen_args *uap, register_t *retval) 952netbsd32_listen(struct lwp *l, const struct netbsd32_listen_args *uap, register_t *retval)
954{ 953{
955 /* { 954 /* {
956 syscallarg(int) s; 955 syscallarg(int) s;
957 syscallarg(int) backlog; 956 syscallarg(int) backlog;
958 } */ 957 } */
959 struct sys_listen_args ua; 958 struct sys_listen_args ua;
960 959
961 NETBSD32TO64_UAP(s); 960 NETBSD32TO64_UAP(s);
962 NETBSD32TO64_UAP(backlog); 961 NETBSD32TO64_UAP(backlog);
963 962
964 return sys_listen(l, &ua, retval); 963 return sys_listen(l, &ua, retval);
965} 964}
966 965
967int 966int
968netbsd32_fchown(struct lwp *l, const struct netbsd32_fchown_args *uap, register_t *retval) 967netbsd32_fchown(struct lwp *l, const struct netbsd32_fchown_args *uap, register_t *retval)
969{ 968{
970 /* { 969 /* {
971 syscallarg(int) fd; 970 syscallarg(int) fd;
972 syscallarg(uid_t) uid; 971 syscallarg(uid_t) uid;
973 syscallarg(gid_t) gid; 972 syscallarg(gid_t) gid;
974 } */ 973 } */
975 struct sys_fchown_args ua; 974 struct sys_fchown_args ua;
976 975
977 NETBSD32TO64_UAP(fd); 976 NETBSD32TO64_UAP(fd);
978 NETBSD32TO64_UAP(uid); 977 NETBSD32TO64_UAP(uid);
979 NETBSD32TO64_UAP(gid); 978 NETBSD32TO64_UAP(gid);
980 979
981 return sys_fchown(l, &ua, retval); 980 return sys_fchown(l, &ua, retval);
982} 981}
983 982
984int 983int
985netbsd32_fchmod(struct lwp *l, const struct netbsd32_fchmod_args *uap, register_t *retval) 984netbsd32_fchmod(struct lwp *l, const struct netbsd32_fchmod_args *uap, register_t *retval)
986{ 985{
987 /* { 986 /* {
988 syscallarg(int) fd; 987 syscallarg(int) fd;
989 syscallarg(mode_t) mode; 988 syscallarg(mode_t) mode;
990 } */ 989 } */
991 struct sys_fchmod_args ua; 990 struct sys_fchmod_args ua;
992 991
993 NETBSD32TO64_UAP(fd); 992 NETBSD32TO64_UAP(fd);
994 NETBSD32TO64_UAP(mode); 993 NETBSD32TO64_UAP(mode);
995 994
996 return sys_fchmod(l, &ua, retval); 995 return sys_fchmod(l, &ua, retval);
997} 996}
998 997
999int 998int
1000netbsd32_setreuid(struct lwp *l, const struct netbsd32_setreuid_args *uap, register_t *retval) 999netbsd32_setreuid(struct lwp *l, const struct netbsd32_setreuid_args *uap, register_t *retval)
1001{ 1000{
1002 /* { 1001 /* {
1003 syscallarg(uid_t) ruid; 1002 syscallarg(uid_t) ruid;
1004 syscallarg(uid_t) euid; 1003 syscallarg(uid_t) euid;
1005 } */ 1004 } */
1006 struct sys_setreuid_args ua; 1005 struct sys_setreuid_args ua;
1007 1006
1008 NETBSD32TO64_UAP(ruid); 1007 NETBSD32TO64_UAP(ruid);
1009 NETBSD32TO64_UAP(euid); 1008 NETBSD32TO64_UAP(euid);
1010 return sys_setreuid(l, &ua, retval); 1009 return sys_setreuid(l, &ua, retval);
1011} 1010}
1012 1011
1013int 1012int
1014netbsd32_setregid(struct lwp *l, const struct netbsd32_setregid_args *uap, register_t *retval) 1013netbsd32_setregid(struct lwp *l, const struct netbsd32_setregid_args *uap, register_t *retval)
1015{ 1014{
1016 /* { 1015 /* {
1017 syscallarg(gid_t) rgid; 1016 syscallarg(gid_t) rgid;
1018 syscallarg(gid_t) egid; 1017 syscallarg(gid_t) egid;
1019 } */ 1018 } */
1020 struct sys_setregid_args ua; 1019 struct sys_setregid_args ua;
1021 1020
1022 NETBSD32TO64_UAP(rgid); 1021 NETBSD32TO64_UAP(rgid);
1023 NETBSD32TO64_UAP(egid); 1022 NETBSD32TO64_UAP(egid);
1024 1023
1025 return sys_setregid(l, &ua, retval); 1024 return sys_setregid(l, &ua, retval);
1026} 1025}
1027 1026
1028int 1027int
1029netbsd32_getsockopt(struct lwp *l, const struct netbsd32_getsockopt_args *uap, register_t *retval) 1028netbsd32_getsockopt(struct lwp *l, const struct netbsd32_getsockopt_args *uap, register_t *retval)
1030{ 1029{
1031 /* { 1030 /* {
1032 syscallarg(int) s; 1031 syscallarg(int) s;
1033 syscallarg(int) level; 1032 syscallarg(int) level;
1034 syscallarg(int) name; 1033 syscallarg(int) name;
1035 syscallarg(netbsd32_voidp) val; 1034 syscallarg(netbsd32_voidp) val;
1036 syscallarg(netbsd32_intp) avalsize; 1035 syscallarg(netbsd32_intp) avalsize;
1037 } */ 1036 } */
1038 struct sys_getsockopt_args ua; 1037 struct sys_getsockopt_args ua;
1039 1038
1040 NETBSD32TO64_UAP(s); 1039 NETBSD32TO64_UAP(s);
1041 NETBSD32TO64_UAP(level); 1040 NETBSD32TO64_UAP(level);
1042 NETBSD32TO64_UAP(name); 1041 NETBSD32TO64_UAP(name);
1043 NETBSD32TOP_UAP(val, void); 1042 NETBSD32TOP_UAP(val, void);
1044 NETBSD32TOP_UAP(avalsize, socklen_t); 1043 NETBSD32TOP_UAP(avalsize, socklen_t);
1045 1044
1046 return sys_getsockopt(l, &ua, retval); 1045 return sys_getsockopt(l, &ua, retval);
1047} 1046}
1048 1047
1049int 1048int
1050netbsd32_getsockopt2(struct lwp *l, const struct netbsd32_getsockopt2_args *uap, register_t *retval) 1049netbsd32_getsockopt2(struct lwp *l, const struct netbsd32_getsockopt2_args *uap, register_t *retval)
1051{ 1050{
1052 /* { 1051 /* {
1053 syscallarg(int) s; 1052 syscallarg(int) s;
1054 syscallarg(int) level; 1053 syscallarg(int) level;
1055 syscallarg(int) name; 1054 syscallarg(int) name;
1056 syscallarg(netbsd32_voidp) val; 1055 syscallarg(netbsd32_voidp) val;
1057 syscallarg(netbsd32_intp) avalsize; 1056 syscallarg(netbsd32_intp) avalsize;
1058 } */ 1057 } */
1059 struct sys_getsockopt2_args ua; 1058 struct sys_getsockopt2_args ua;
1060 1059
1061 NETBSD32TO64_UAP(s); 1060 NETBSD32TO64_UAP(s);
1062 NETBSD32TO64_UAP(level); 1061 NETBSD32TO64_UAP(level);
1063 NETBSD32TO64_UAP(name); 1062 NETBSD32TO64_UAP(name);
1064 NETBSD32TOP_UAP(val, void); 1063 NETBSD32TOP_UAP(val, void);
1065 NETBSD32TOP_UAP(avalsize, socklen_t); 1064 NETBSD32TOP_UAP(avalsize, socklen_t);
1066 1065
1067 return sys_getsockopt2(l, &ua, retval); 1066 return sys_getsockopt2(l, &ua, retval);
1068} 1067}
1069 1068
1070int 1069int
1071netbsd32_rename(struct lwp *l, const struct netbsd32_rename_args *uap, register_t *retval) 1070netbsd32_rename(struct lwp *l, const struct netbsd32_rename_args *uap, register_t *retval)
1072{ 1071{
1073 /* { 1072 /* {
1074 syscallarg(const netbsd32_charp) from; 1073 syscallarg(const netbsd32_charp) from;
1075 syscallarg(const netbsd32_charp) to; 1074 syscallarg(const netbsd32_charp) to;
1076 } */ 1075 } */
1077 struct sys_rename_args ua; 1076 struct sys_rename_args ua;
1078 1077
1079 NETBSD32TOP_UAP(from, const char); 1078 NETBSD32TOP_UAP(from, const char);
1080 NETBSD32TOP_UAP(to, const char); 1079 NETBSD32TOP_UAP(to, const char);
1081 1080
1082 return sys_rename(l, &ua, retval); 1081 return sys_rename(l, &ua, retval);
1083} 1082}
1084 1083
1085int 1084int
1086netbsd32_flock(struct lwp *l, const struct netbsd32_flock_args *uap, register_t *retval) 1085netbsd32_flock(struct lwp *l, const struct netbsd32_flock_args *uap, register_t *retval)
1087{ 1086{
1088 /* { 1087 /* {
1089 syscallarg(int) fd; 1088 syscallarg(int) fd;
1090 syscallarg(int) how; 1089 syscallarg(int) how;
1091 } */ 1090 } */
1092 struct sys_flock_args ua; 1091 struct sys_flock_args ua;
1093 1092
1094 NETBSD32TO64_UAP(fd); 1093 NETBSD32TO64_UAP(fd);
1095 NETBSD32TO64_UAP(how); 1094 NETBSD32TO64_UAP(how);
1096 1095
1097 return sys_flock(l, &ua, retval); 1096 return sys_flock(l, &ua, retval);