Mon Dec 24 20:39:17 2018 UTC ()
fix style consistency.
remove obsolete comments or commented code.
NFC.


(mrg)
diff -r1.219 -r1.220 src/sys/compat/netbsd32/netbsd32_netbsd.c

cvs diff -r1.219 -r1.220 src/sys/compat/netbsd32/netbsd32_netbsd.c (expand / switch to unified diff)

--- src/sys/compat/netbsd32/netbsd32_netbsd.c 2018/12/24 20:27:57 1.219
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c 2018/12/24 20:39:17 1.220
@@ -1,58 +1,65 @@ @@ -1,58 +1,65 @@
1/* $NetBSD: netbsd32_netbsd.c,v 1.219 2018/12/24 20:27:57 mrg Exp $ */ 1/* $NetBSD: netbsd32_netbsd.c,v 1.220 2018/12/24 20:39:17 mrg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998, 2001, 2008 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.219 2018/12/24 20:27:57 mrg Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.220 2018/12/24 20:39:17 mrg Exp $");
 31
 32/*
 33 * below are all the standard NetBSD system calls, in the 32bit
 34 * environment, with the necessary conversions to 64bit before calling
 35 * the real syscall. anything that needs special attention is handled
 36 * elsewhere - this file should only contain structure assignment and
 37 * calls to the original function.
 38 */
31 39
32#if defined(_KERNEL_OPT) 40#if defined(_KERNEL_OPT)
33#include "opt_ddb.h" 41#include "opt_ddb.h"
34#include "opt_ntp.h" 42#include "opt_ntp.h"
35#include "opt_ktrace.h" 43#include "opt_ktrace.h"
36#include "opt_compat_netbsd.h" 44#include "opt_compat_netbsd.h"
37#include "opt_compat_43.h" 45#include "opt_compat_43.h"
38#include "opt_sysv.h" 46#include "opt_sysv.h"
39#include "opt_syscall_debug.h" 47#include "opt_syscall_debug.h"
40#endif 48#endif
41 49
42#include <sys/param.h> 50#include <sys/param.h>
43#include <sys/systm.h> 51#include <sys/systm.h>
44#include <sys/kernel.h> 52#include <sys/kernel.h>
45//#define msg __msg /* Don't ask me! */ 
46#include <sys/mount.h> 53#include <sys/mount.h>
47#include <sys/socket.h> 54#include <sys/socket.h>
48#include <sys/sockio.h> 55#include <sys/sockio.h>
49#include <sys/socketvar.h> 56#include <sys/socketvar.h>
50#include <sys/mbuf.h> 57#include <sys/mbuf.h>
51#include <sys/mman.h> 58#include <sys/mman.h>
52#include <sys/stat.h> 59#include <sys/stat.h>
53#include <sys/swap.h> 60#include <sys/swap.h>
54#include <sys/time.h> 61#include <sys/time.h>
55#include <sys/signalvar.h> 62#include <sys/signalvar.h>
56#include <sys/ptrace.h> 63#include <sys/ptrace.h>
57#include <sys/ktrace.h> 64#include <sys/ktrace.h>
58#include <sys/trace.h> 65#include <sys/trace.h>
@@ -156,33 +163,26 @@ struct emul emul_netbsd32 = { @@ -156,33 +163,26 @@ struct emul emul_netbsd32 = {
156#endif 163#endif
157 .e_sysctlovly = &netbsd32_sysctl_root, 164 .e_sysctlovly = &netbsd32_sysctl_root,
158 .e_vm_default_addr = netbsd32_vm_default_addr, 165 .e_vm_default_addr = netbsd32_vm_default_addr,
159 .e_usertrap = NULL, 166 .e_usertrap = NULL,
160 .e_ucsize = sizeof(ucontext32_t), 167 .e_ucsize = sizeof(ucontext32_t),
161 .e_startlwp = startlwp32, 168 .e_startlwp = startlwp32,
162#ifdef notyet 169#ifdef notyet
163 .e_ktrpsig = netbsd32_ktrpsig, 170 .e_ktrpsig = netbsd32_ktrpsig,
164#else 171#else
165 .e_ktrpsig = NULL, 172 .e_ktrpsig = NULL,
166#endif 173#endif
167}; 174};
168 175
169/* 
170 * below are all the standard NetBSD system calls, in the 32bit 
171 * environment, with the necessary conversions to 64bit before 
172 * calling the real syscall. anything that needs special 
173 * attention is handled elsewhere. 
174 */ 
175 
176int 176int
177netbsd32_exit(struct lwp *l, const struct netbsd32_exit_args *uap, register_t *retval) 177netbsd32_exit(struct lwp *l, const struct netbsd32_exit_args *uap, register_t *retval)
178{ 178{
179 /* { 179 /* {
180 syscallarg(int) rval; 180 syscallarg(int) rval;
181 } */ 181 } */
182 struct sys_exit_args ua; 182 struct sys_exit_args ua;
183 183
184 NETBSD32TO64_UAP(rval); 184 NETBSD32TO64_UAP(rval);
185 return sys_exit(l, &ua, retval); 185 return sys_exit(l, &ua, retval);
186} 186}
187 187
188int 188int
@@ -247,66 +247,66 @@ netbsd32_open(struct lwp *l, const struc @@ -247,66 +247,66 @@ netbsd32_open(struct lwp *l, const struc
247} 247}
248 248
249int 249int
250netbsd32_link(struct lwp *l, const struct netbsd32_link_args *uap, register_t *retval) 250netbsd32_link(struct lwp *l, const struct netbsd32_link_args *uap, register_t *retval)
251{ 251{
252 /* { 252 /* {
253 syscallarg(const netbsd32_charp) path; 253 syscallarg(const netbsd32_charp) path;
254 syscallarg(const netbsd32_charp) link; 254 syscallarg(const netbsd32_charp) link;
255 } */ 255 } */
256 struct sys_link_args ua; 256 struct sys_link_args ua;
257 257
258 NETBSD32TOP_UAP(path, const char); 258 NETBSD32TOP_UAP(path, const char);
259 NETBSD32TOP_UAP(link, const char); 259 NETBSD32TOP_UAP(link, const char);
260 return (sys_link(l, &ua, retval)); 260 return sys_link(l, &ua, retval);
261} 261}
262 262
263int 263int
264netbsd32_unlink(struct lwp *l, const struct netbsd32_unlink_args *uap, register_t *retval) 264netbsd32_unlink(struct lwp *l, const struct netbsd32_unlink_args *uap, register_t *retval)
265{ 265{
266 /* { 266 /* {
267 syscallarg(const netbsd32_charp) path; 267 syscallarg(const netbsd32_charp) path;
268 } */ 268 } */
269 struct sys_unlink_args ua; 269 struct sys_unlink_args ua;
270 270
271 NETBSD32TOP_UAP(path, const char); 271 NETBSD32TOP_UAP(path, const char);
272 272
273 return (sys_unlink(l, &ua, retval)); 273 return sys_unlink(l, &ua, retval);
274} 274}
275 275
276int 276int
277netbsd32_chdir(struct lwp *l, const struct netbsd32_chdir_args *uap, register_t *retval) 277netbsd32_chdir(struct lwp *l, const struct netbsd32_chdir_args *uap, register_t *retval)
278{ 278{
279 /* { 279 /* {
280 syscallarg(const netbsd32_charp) path; 280 syscallarg(const netbsd32_charp) path;
281 } */ 281 } */
282 struct sys_chdir_args ua; 282 struct sys_chdir_args ua;
283 283
284 NETBSD32TOP_UAP(path, const char); 284 NETBSD32TOP_UAP(path, const char);
285 285
286 return (sys_chdir(l, &ua, retval)); 286 return sys_chdir(l, &ua, retval);
287} 287}
288 288
289int 289int
290netbsd32_fchdir(struct lwp *l, const struct netbsd32_fchdir_args *uap, register_t *retval) 290netbsd32_fchdir(struct lwp *l, const struct netbsd32_fchdir_args *uap, register_t *retval)
291{ 291{
292 /* { 292 /* {
293 syscallarg(int) fd; 293 syscallarg(int) fd;
294 } */ 294 } */
295 struct sys_fchdir_args ua; 295 struct sys_fchdir_args ua;
296 296
297 NETBSD32TO64_UAP(fd); 297 NETBSD32TO64_UAP(fd);
298 298
299 return (sys_fchdir(l, &ua, retval)); 299 return sys_fchdir(l, &ua, retval);
300} 300}
301 301
302int 302int
303netbsd32___mknod50(struct lwp *l, const struct netbsd32___mknod50_args *uap, register_t *retval) 303netbsd32___mknod50(struct lwp *l, const struct netbsd32___mknod50_args *uap, register_t *retval)
304{ 304{
305 /* { 305 /* {
306 syscallarg(const netbsd32_charp) path; 306 syscallarg(const netbsd32_charp) path;
307 syscallarg(mode_t) mode; 307 syscallarg(mode_t) mode;
308 syscallarg(netbsd32_dev_t) dev; 308 syscallarg(netbsd32_dev_t) dev;
309 } */ 309 } */
310 310
311 return do_sys_mknod(l, SCARG_P32(uap, path), SCARG(uap, mode), 311 return do_sys_mknod(l, SCARG_P32(uap, path), SCARG(uap, mode),
312 SCARG(uap, dev), retval, UIO_USERSPACE); 312 SCARG(uap, dev), retval, UIO_USERSPACE);
@@ -314,153 +314,161 @@ netbsd32___mknod50(struct lwp *l, const  @@ -314,153 +314,161 @@ netbsd32___mknod50(struct lwp *l, const
314 314
315int 315int
316netbsd32_chmod(struct lwp *l, const struct netbsd32_chmod_args *uap, register_t *retval) 316netbsd32_chmod(struct lwp *l, const struct netbsd32_chmod_args *uap, register_t *retval)
317{ 317{
318 /* { 318 /* {
319 syscallarg(const netbsd32_charp) path; 319 syscallarg(const netbsd32_charp) path;
320 syscallarg(mode_t) mode; 320 syscallarg(mode_t) mode;
321 } */ 321 } */
322 struct sys_chmod_args ua; 322 struct sys_chmod_args ua;
323 323
324 NETBSD32TOP_UAP(path, const char); 324 NETBSD32TOP_UAP(path, const char);
325 NETBSD32TO64_UAP(mode); 325 NETBSD32TO64_UAP(mode);
326 326
327 return (sys_chmod(l, &ua, retval)); 327 return sys_chmod(l, &ua, retval);
328} 328}
329 329
330int 330int
331netbsd32_chown(struct lwp *l, const struct netbsd32_chown_args *uap, register_t *retval) 331netbsd32_chown(struct lwp *l, const struct netbsd32_chown_args *uap, register_t *retval)
332{ 332{
333 /* { 333 /* {
334 syscallarg(const netbsd32_charp) path; 334 syscallarg(const netbsd32_charp) path;
335 syscallarg(uid_t) uid; 335 syscallarg(uid_t) uid;
336 syscallarg(gid_t) gid; 336 syscallarg(gid_t) gid;
337 } */ 337 } */
338 struct sys_chown_args ua; 338 struct sys_chown_args ua;
339 339
340 NETBSD32TOP_UAP(path, const char); 340 NETBSD32TOP_UAP(path, const char);
341 NETBSD32TO64_UAP(uid); 341 NETBSD32TO64_UAP(uid);
342 NETBSD32TO64_UAP(gid); 342 NETBSD32TO64_UAP(gid);
343 343
344 return (sys_chown(l, &ua, retval)); 344 return sys_chown(l, &ua, retval);
345} 345}
346 346
347int 347int
348netbsd32_break(struct lwp *l, const struct netbsd32_break_args *uap, register_t *retval) 348netbsd32_break(struct lwp *l, const struct netbsd32_break_args *uap, register_t *retval)
349{ 349{
350 /* { 350 /* {
351 syscallarg(netbsd32_charp) nsize; 351 syscallarg(netbsd32_charp) nsize;
352 } */ 352 } */
353 struct sys_obreak_args ua; 353 struct sys_obreak_args ua;
354 354
355 NETBSD32TOP_UAP(nsize, char); 355 NETBSD32TOP_UAP(nsize, char);
356 return (sys_obreak(l, &ua, retval)); 356
 357 return sys_obreak(l, &ua, retval);
357} 358}
358 359
 360// XXX move into compat_40
359int 361int
360netbsd32_mount(struct lwp *l, const struct netbsd32_mount_args *uap, register_t *retval) 362netbsd32_mount(struct lwp *l, const struct netbsd32_mount_args *uap, register_t *retval)
361{ 363{
362#ifdef COMPAT_40 364#ifdef COMPAT_40
363 /* { 365 /* {
364 syscallarg(const netbsd32_charp) type; 366 syscallarg(const netbsd32_charp) type;
365 syscallarg(const netbsd32_charp) path; 367 syscallarg(const netbsd32_charp) path;
366 syscallarg(int) flags; 368 syscallarg(int) flags;
367 syscallarg(netbsd32_voidp) data; 369 syscallarg(netbsd32_voidp) data;
368 } */ 370 } */
369 struct compat_40_sys_mount_args ua; 371 struct compat_40_sys_mount_args ua;
370 372
371 NETBSD32TOP_UAP(type, const char); 373 NETBSD32TOP_UAP(type, const char);
372 NETBSD32TOP_UAP(path, const char); 374 NETBSD32TOP_UAP(path, const char);
373 NETBSD32TO64_UAP(flags); 375 NETBSD32TO64_UAP(flags);
374 NETBSD32TOP_UAP(data, void); 376 NETBSD32TOP_UAP(data, void);
375 return (compat_40_sys_mount(l, &ua, retval)); 377
 378 return compat_40_sys_mount(l, &ua, retval);
376#else 379#else
377 return ENOSYS; 380 return ENOSYS;
378#endif 381#endif
379} 382}
380 383
381int 384int
382netbsd32_unmount(struct lwp *l, const struct netbsd32_unmount_args *uap, register_t *retval) 385netbsd32_unmount(struct lwp *l, const struct netbsd32_unmount_args *uap, register_t *retval)
383{ 386{
384 /* { 387 /* {
385 syscallarg(const netbsd32_charp) path; 388 syscallarg(const netbsd32_charp) path;
386 syscallarg(int) flags; 389 syscallarg(int) flags;
387 } */ 390 } */
388 struct sys_unmount_args ua; 391 struct sys_unmount_args ua;
389 392
390 NETBSD32TOP_UAP(path, const char); 393 NETBSD32TOP_UAP(path, const char);
391 NETBSD32TO64_UAP(flags); 394 NETBSD32TO64_UAP(flags);
392 return (sys_unmount(l, &ua, retval)); 395
 396 return sys_unmount(l, &ua, retval);
393} 397}
394 398
395int 399int
396netbsd32_setuid(struct lwp *l, const struct netbsd32_setuid_args *uap, register_t *retval) 400netbsd32_setuid(struct lwp *l, const struct netbsd32_setuid_args *uap, register_t *retval)
397{ 401{
398 /* { 402 /* {
399 syscallarg(uid_t) uid; 403 syscallarg(uid_t) uid;
400 } */ 404 } */
401 struct sys_setuid_args ua; 405 struct sys_setuid_args ua;
402 406
403 NETBSD32TO64_UAP(uid); 407 NETBSD32TO64_UAP(uid);
404 return (sys_setuid(l, &ua, retval)); 408
 409 return sys_setuid(l, &ua, retval);
405} 410}
406 411
407int 412int
408netbsd32_accept(struct lwp *l, const struct netbsd32_accept_args *uap, register_t *retval) 413netbsd32_accept(struct lwp *l, const struct netbsd32_accept_args *uap, register_t *retval)
409{ 414{
410 /* { 415 /* {
411 syscallarg(int) s; 416 syscallarg(int) s;
412 syscallarg(netbsd32_sockaddrp_t) name; 417 syscallarg(netbsd32_sockaddrp_t) name;
413 syscallarg(netbsd32_intp) anamelen; 418 syscallarg(netbsd32_intp) anamelen;
414 } */ 419 } */
415 struct sys_accept_args ua; 420 struct sys_accept_args ua;
416 421
417 NETBSD32TO64_UAP(s); 422 NETBSD32TO64_UAP(s);
418 NETBSD32TOP_UAP(name, struct sockaddr); 423 NETBSD32TOP_UAP(name, struct sockaddr);
419 NETBSD32TOP_UAP(anamelen, socklen_t); 424 NETBSD32TOP_UAP(anamelen, socklen_t);
420 return (sys_accept(l, &ua, retval)); 425
 426 return sys_accept(l, &ua, retval);
421} 427}
422 428
423int 429int
424netbsd32_getpeername(struct lwp *l, const struct netbsd32_getpeername_args *uap, register_t *retval) 430netbsd32_getpeername(struct lwp *l, const struct netbsd32_getpeername_args *uap, register_t *retval)
425{ 431{
426 /* { 432 /* {
427 syscallarg(int) fdes; 433 syscallarg(int) fdes;
428 syscallarg(netbsd32_sockaddrp_t) asa; 434 syscallarg(netbsd32_sockaddrp_t) asa;
429 syscallarg(netbsd32_intp) alen; 435 syscallarg(netbsd32_intp) alen;
430 } */ 436 } */
431 struct sys_getpeername_args ua; 437 struct sys_getpeername_args ua;
432 438
433 NETBSD32TO64_UAP(fdes); 439 NETBSD32TO64_UAP(fdes);
434 NETBSD32TOP_UAP(asa, struct sockaddr); 440 NETBSD32TOP_UAP(asa, struct sockaddr);
435 NETBSD32TOP_UAP(alen, socklen_t); 441 NETBSD32TOP_UAP(alen, socklen_t);
436/* NB: do the protocol specific sockaddrs need to be converted? */ 442/* NB: do the protocol specific sockaddrs need to be converted? */
437 return (sys_getpeername(l, &ua, retval)); 443
 444 return sys_getpeername(l, &ua, retval);
438} 445}
439 446
440int 447int
441netbsd32_getsockname(struct lwp *l, const struct netbsd32_getsockname_args *uap, register_t *retval) 448netbsd32_getsockname(struct lwp *l, const struct netbsd32_getsockname_args *uap, register_t *retval)
442{ 449{
443 /* { 450 /* {
444 syscallarg(int) fdes; 451 syscallarg(int) fdes;
445 syscallarg(netbsd32_sockaddrp_t) asa; 452 syscallarg(netbsd32_sockaddrp_t) asa;
446 syscallarg(netbsd32_intp) alen; 453 syscallarg(netbsd32_intp) alen;
447 } */ 454 } */
448 struct sys_getsockname_args ua; 455 struct sys_getsockname_args ua;
449 456
450 NETBSD32TO64_UAP(fdes); 457 NETBSD32TO64_UAP(fdes);
451 NETBSD32TOP_UAP(asa, struct sockaddr); 458 NETBSD32TOP_UAP(asa, struct sockaddr);
452 NETBSD32TOP_UAP(alen, socklen_t); 459 NETBSD32TOP_UAP(alen, socklen_t);
453 return (sys_getsockname(l, &ua, retval)); 460
 461 return sys_getsockname(l, &ua, retval);
454} 462}
455 463
456int 464int
457netbsd32_access(struct lwp *l, const struct netbsd32_access_args *uap, register_t *retval) 465netbsd32_access(struct lwp *l, const struct netbsd32_access_args *uap, register_t *retval)
458{ 466{
459 /* { 467 /* {
460 syscallarg(const netbsd32_charp) path; 468 syscallarg(const netbsd32_charp) path;
461 syscallarg(int) flags; 469 syscallarg(int) flags;
462 } */ 470 } */
463 struct sys_access_args ua; 471 struct sys_access_args ua;
464 472
465 NETBSD32TOP_UAP(path, const char); 473 NETBSD32TOP_UAP(path, const char);
466 NETBSD32TO64_UAP(flags); 474 NETBSD32TO64_UAP(flags);
@@ -470,708 +478,742 @@ netbsd32_access(struct lwp *l, const str @@ -470,708 +478,742 @@ netbsd32_access(struct lwp *l, const str
470 478
471int 479int
472netbsd32_chflags(struct lwp *l, const struct netbsd32_chflags_args *uap, register_t *retval) 480netbsd32_chflags(struct lwp *l, const struct netbsd32_chflags_args *uap, register_t *retval)
473{ 481{
474 /* { 482 /* {
475 syscallarg(const netbsd32_charp) path; 483 syscallarg(const netbsd32_charp) path;
476 syscallarg(netbsd32_u_long) flags; 484 syscallarg(netbsd32_u_long) flags;
477 } */ 485 } */
478 struct sys_chflags_args ua; 486 struct sys_chflags_args ua;
479 487
480 NETBSD32TOP_UAP(path, const char); 488 NETBSD32TOP_UAP(path, const char);
481 NETBSD32TO64_UAP(flags); 489 NETBSD32TO64_UAP(flags);
482 490
483 return (sys_chflags(l, &ua, retval)); 491 return sys_chflags(l, &ua, retval);
484} 492}
485 493
486int 494int
487netbsd32_fchflags(struct lwp *l, const struct netbsd32_fchflags_args *uap, register_t *retval) 495netbsd32_fchflags(struct lwp *l, const struct netbsd32_fchflags_args *uap, register_t *retval)
488{ 496{
489 /* { 497 /* {
490 syscallarg(int) fd; 498 syscallarg(int) fd;
491 syscallarg(netbsd32_u_long) flags; 499 syscallarg(netbsd32_u_long) flags;
492 } */ 500 } */
493 struct sys_fchflags_args ua; 501 struct sys_fchflags_args ua;
494 502
495 NETBSD32TO64_UAP(fd); 503 NETBSD32TO64_UAP(fd);
496 NETBSD32TO64_UAP(flags); 504 NETBSD32TO64_UAP(flags);
497 505
498 return (sys_fchflags(l, &ua, retval)); 506 return sys_fchflags(l, &ua, retval);
499} 507}
500 508
501int 509int
502netbsd32_lchflags(struct lwp *l, const struct netbsd32_lchflags_args *uap, register_t *retval) 510netbsd32_lchflags(struct lwp *l, const struct netbsd32_lchflags_args *uap, register_t *retval)
503{ 511{
504 /* { 512 /* {
505 syscallarg(const char *) path; 513 syscallarg(const char *) path;
506 syscallarg(netbsd32_u_long) flags; 514 syscallarg(netbsd32_u_long) flags;
507 } */ 515 } */
508 struct sys_lchflags_args ua; 516 struct sys_lchflags_args ua;
509 517
510 NETBSD32TOP_UAP(path, const char); 518 NETBSD32TOP_UAP(path, const char);
511 NETBSD32TO64_UAP(flags); 519 NETBSD32TO64_UAP(flags);
512 520
513 return (sys_lchflags(l, &ua, retval)); 521 return sys_lchflags(l, &ua, retval);
514} 522}
515 523
516int 524int
517netbsd32_kill(struct lwp *l, const struct netbsd32_kill_args *uap, register_t *retval) 525netbsd32_kill(struct lwp *l, const struct netbsd32_kill_args *uap, register_t *retval)
518{ 526{
519 /* { 527 /* {
520 syscallarg(int) pid; 528 syscallarg(int) pid;
521 syscallarg(int) signum; 529 syscallarg(int) signum;
522 } */ 530 } */
523 struct sys_kill_args ua; 531 struct sys_kill_args ua;
524 532
525 NETBSD32TO64_UAP(pid); 533 NETBSD32TO64_UAP(pid);
526 NETBSD32TO64_UAP(signum); 534 NETBSD32TO64_UAP(signum);
527 535
528 return (sys_kill(l, &ua, retval)); 536 return sys_kill(l, &ua, retval);
529} 537}
530 538
531int 539int
532netbsd32_dup(struct lwp *l, const struct netbsd32_dup_args *uap, register_t *retval) 540netbsd32_dup(struct lwp *l, const struct netbsd32_dup_args *uap, register_t *retval)
533{ 541{
534 /* { 542 /* {
535 syscallarg(int) fd; 543 syscallarg(int) fd;
536 } */ 544 } */
537 struct sys_dup_args ua; 545 struct sys_dup_args ua;
538 546
539 NETBSD32TO64_UAP(fd); 547 NETBSD32TO64_UAP(fd);
540 548
541 return (sys_dup(l, &ua, retval)); 549 return sys_dup(l, &ua, retval);
542} 550}
543 551
544int 552int
545netbsd32_profil(struct lwp *l, const struct netbsd32_profil_args *uap, register_t *retval) 553netbsd32_profil(struct lwp *l, const struct netbsd32_profil_args *uap, register_t *retval)
546{ 554{
547 /* { 555 /* {
548 syscallarg(netbsd32_voidp) samples; 556 syscallarg(netbsd32_voidp) samples;
549 syscallarg(netbsd32_size_t) size; 557 syscallarg(netbsd32_size_t) size;
550 syscallarg(netbsd32_u_long) offset; 558 syscallarg(netbsd32_u_long) offset;
551 syscallarg(u_int) scale; 559 syscallarg(u_int) scale;
552 } */ 560 } */
553 struct sys_profil_args ua; 561 struct sys_profil_args ua;
554 562
555 NETBSD32TOP_UAP(samples, void *); 563 NETBSD32TOP_UAP(samples, void *);
556 NETBSD32TOX_UAP(size, size_t); 564 NETBSD32TOX_UAP(size, size_t);
557 NETBSD32TOX_UAP(offset, u_long); 565 NETBSD32TOX_UAP(offset, u_long);
558 NETBSD32TO64_UAP(scale); 566 NETBSD32TO64_UAP(scale);
559 return (sys_profil(l, &ua, retval)); 567
 568 return sys_profil(l, &ua, retval);
560} 569}
561 570
562int 571int
563netbsd32_ktrace(struct lwp *l, const struct netbsd32_ktrace_args *uap, register_t *retval) 572netbsd32_ktrace(struct lwp *l, const struct netbsd32_ktrace_args *uap, register_t *retval)
564{ 573{
565 /* { 574 /* {
566 syscallarg(const netbsd32_charp) fname; 575 syscallarg(const netbsd32_charp) fname;
567 syscallarg(int) ops; 576 syscallarg(int) ops;
568 syscallarg(int) facs; 577 syscallarg(int) facs;
569 syscallarg(int) pid; 578 syscallarg(int) pid;
570 } */ 579 } */
571 struct sys_ktrace_args ua; 580 struct sys_ktrace_args ua;
572 581
573 NETBSD32TOP_UAP(fname, const char); 582 NETBSD32TOP_UAP(fname, const char);
574 NETBSD32TO64_UAP(ops); 583 NETBSD32TO64_UAP(ops);
575 NETBSD32TO64_UAP(facs); 584 NETBSD32TO64_UAP(facs);
576 NETBSD32TO64_UAP(pid); 585 NETBSD32TO64_UAP(pid);
577 return (sys_ktrace(l, &ua, retval)); 586
 587 return sys_ktrace(l, &ua, retval);
578} 588}
579 589
580int 590int
581netbsd32_utrace(struct lwp *l, const struct netbsd32_utrace_args *uap, register_t *retval) 591netbsd32_utrace(struct lwp *l, const struct netbsd32_utrace_args *uap, register_t *retval)
582{ 592{
583 /* { 593 /* {
584 syscallarg(const netbsd32_charp) label; 594 syscallarg(const netbsd32_charp) label;
585 syscallarg(netbsd32_voidp) addr; 595 syscallarg(netbsd32_voidp) addr;
586 syscallarg(netbsd32_size_t) len; 596 syscallarg(netbsd32_size_t) len;
587 } */ 597 } */
588 struct sys_utrace_args ua; 598 struct sys_utrace_args ua;
589 599
590 NETBSD32TOP_UAP(label, const char); 600 NETBSD32TOP_UAP(label, const char);
591 NETBSD32TOP_UAP(addr, void); 601 NETBSD32TOP_UAP(addr, void);
592 NETBSD32TO64_UAP(len); 602 NETBSD32TO64_UAP(len);
593 return (sys_utrace(l, &ua, retval)); 603
 604 return sys_utrace(l, &ua, retval);
594} 605}
595 606
596int 607int
597netbsd32___getlogin(struct lwp *l, const struct netbsd32___getlogin_args *uap, register_t *retval) 608netbsd32___getlogin(struct lwp *l, const struct netbsd32___getlogin_args *uap, register_t *retval)
598{ 609{
599 /* { 610 /* {
600 syscallarg(netbsd32_charp) namebuf; 611 syscallarg(netbsd32_charp) namebuf;
601 syscallarg(u_int) namelen; 612 syscallarg(u_int) namelen;
602 } */ 613 } */
603 struct sys___getlogin_args ua; 614 struct sys___getlogin_args ua;
604 615
605 NETBSD32TOP_UAP(namebuf, char); 616 NETBSD32TOP_UAP(namebuf, char);
606 NETBSD32TO64_UAP(namelen); 617 NETBSD32TO64_UAP(namelen);
607 return (sys___getlogin(l, &ua, retval)); 618
 619 return sys___getlogin(l, &ua, retval);
608} 620}
609 621
610int 622int
611netbsd32_setlogin(struct lwp *l, const struct netbsd32_setlogin_args *uap, register_t *retval) 623netbsd32_setlogin(struct lwp *l, const struct netbsd32_setlogin_args *uap, register_t *retval)
612{ 624{
613 /* { 625 /* {
614 syscallarg(const netbsd32_charp) namebuf; 626 syscallarg(const netbsd32_charp) namebuf;
615 } */ 627 } */
616 struct sys___setlogin_args ua; 628 struct sys___setlogin_args ua;
617 629
618 NETBSD32TOP_UAP(namebuf, char); 630 NETBSD32TOP_UAP(namebuf, char);
619 return (sys___setlogin(l, &ua, retval)); 631
 632 return sys___setlogin(l, &ua, retval);
620} 633}
621 634
622int 635int
623netbsd32_acct(struct lwp *l, const struct netbsd32_acct_args *uap, register_t *retval) 636netbsd32_acct(struct lwp *l, const struct netbsd32_acct_args *uap, register_t *retval)
624{ 637{
625 /* { 638 /* {
626 syscallarg(const netbsd32_charp) path; 639 syscallarg(const netbsd32_charp) path;
627 } */ 640 } */
628 struct sys_acct_args ua; 641 struct sys_acct_args ua;
629 642
630 NETBSD32TOP_UAP(path, const char); 643 NETBSD32TOP_UAP(path, const char);
631 return (sys_acct(l, &ua, retval)); 644
 645 return sys_acct(l, &ua, retval);
632} 646}
633 647
634int 648int
635netbsd32_revoke(struct lwp *l, const struct netbsd32_revoke_args *uap, register_t *retval) 649netbsd32_revoke(struct lwp *l, const struct netbsd32_revoke_args *uap, register_t *retval)
636{ 650{
637 /* { 651 /* {
638 syscallarg(const netbsd32_charp) path; 652 syscallarg(const netbsd32_charp) path;
639 } */ 653 } */
640 struct sys_revoke_args ua; 654 struct sys_revoke_args ua;
641 655
642 NETBSD32TOP_UAP(path, const char); 656 NETBSD32TOP_UAP(path, const char);
643 657
644 return (sys_revoke(l, &ua, retval)); 658 return sys_revoke(l, &ua, retval);
645} 659}
646 660
647int 661int
648netbsd32_symlink(struct lwp *l, const struct netbsd32_symlink_args *uap, register_t *retval) 662netbsd32_symlink(struct lwp *l, const struct netbsd32_symlink_args *uap, register_t *retval)
649{ 663{
650 /* { 664 /* {
651 syscallarg(const netbsd32_charp) path; 665 syscallarg(const netbsd32_charp) path;
652 syscallarg(const netbsd32_charp) link; 666 syscallarg(const netbsd32_charp) link;
653 } */ 667 } */
654 struct sys_symlink_args ua; 668 struct sys_symlink_args ua;
655 669
656 NETBSD32TOP_UAP(path, const char); 670 NETBSD32TOP_UAP(path, const char);
657 NETBSD32TOP_UAP(link, const char); 671 NETBSD32TOP_UAP(link, const char);
658 672
659 return (sys_symlink(l, &ua, retval)); 673 return sys_symlink(l, &ua, retval);
660} 674}
661 675
662int 676int
663netbsd32_readlink(struct lwp *l, const struct netbsd32_readlink_args *uap, register_t *retval) 677netbsd32_readlink(struct lwp *l, const struct netbsd32_readlink_args *uap, register_t *retval)
664{ 678{
665 /* { 679 /* {
666 syscallarg(const netbsd32_charp) path; 680 syscallarg(const netbsd32_charp) path;
667 syscallarg(netbsd32_charp) buf; 681 syscallarg(netbsd32_charp) buf;
668 syscallarg(netbsd32_size_t) count; 682 syscallarg(netbsd32_size_t) count;
669 } */ 683 } */
670 struct sys_readlink_args ua; 684 struct sys_readlink_args ua;
671 685
672 NETBSD32TOP_UAP(path, const char); 686 NETBSD32TOP_UAP(path, const char);
673 NETBSD32TOP_UAP(buf, char); 687 NETBSD32TOP_UAP(buf, char);
674 NETBSD32TOX_UAP(count, size_t); 688 NETBSD32TOX_UAP(count, size_t);
675 689
676 return (sys_readlink(l, &ua, retval)); 690 return sys_readlink(l, &ua, retval);
677} 691}
678 692
679int 693int
680netbsd32_umask(struct lwp *l, const struct netbsd32_umask_args *uap, register_t *retval) 694netbsd32_umask(struct lwp *l, const struct netbsd32_umask_args *uap, register_t *retval)
681{ 695{
682 /* { 696 /* {
683 syscallarg(mode_t) newmask; 697 syscallarg(mode_t) newmask;
684 } */ 698 } */
685 struct sys_umask_args ua; 699 struct sys_umask_args ua;
686 700
687 NETBSD32TO64_UAP(newmask); 701 NETBSD32TO64_UAP(newmask);
688 return (sys_umask(l, &ua, retval)); 702
 703 return sys_umask(l, &ua, retval);
689} 704}
690 705
691int 706int
692netbsd32_chroot(struct lwp *l, const struct netbsd32_chroot_args *uap, register_t *retval) 707netbsd32_chroot(struct lwp *l, const struct netbsd32_chroot_args *uap, register_t *retval)
693{ 708{
694 /* { 709 /* {
695 syscallarg(const netbsd32_charp) path; 710 syscallarg(const netbsd32_charp) path;
696 } */ 711 } */
697 struct sys_chroot_args ua; 712 struct sys_chroot_args ua;
698 713
699 NETBSD32TOP_UAP(path, const char); 714 NETBSD32TOP_UAP(path, const char);
700 return (sys_chroot(l, &ua, retval)); 715
 716 return sys_chroot(l, &ua, retval);
701} 717}
702 718
703int 719int
704netbsd32_munmap(struct lwp *l, const struct netbsd32_munmap_args *uap, register_t *retval) 720netbsd32_munmap(struct lwp *l, const struct netbsd32_munmap_args *uap, register_t *retval)
705{ 721{
706 /* { 722 /* {
707 syscallarg(netbsd32_voidp) addr; 723 syscallarg(netbsd32_voidp) addr;
708 syscallarg(netbsd32_size_t) len; 724 syscallarg(netbsd32_size_t) len;
709 } */ 725 } */
710 struct sys_munmap_args ua; 726 struct sys_munmap_args ua;
711 727
712 NETBSD32TOP_UAP(addr, void); 728 NETBSD32TOP_UAP(addr, void);
713 NETBSD32TOX_UAP(len, size_t); 729 NETBSD32TOX_UAP(len, size_t);
714 return (sys_munmap(l, &ua, retval)); 730
 731 return sys_munmap(l, &ua, retval);
715} 732}
716 733
717int 734int
718netbsd32_mprotect(struct lwp *l, const struct netbsd32_mprotect_args *uap, register_t *retval) 735netbsd32_mprotect(struct lwp *l, const struct netbsd32_mprotect_args *uap, register_t *retval)
719{ 736{
720 /* { 737 /* {
721 syscallarg(netbsd32_voidp) addr; 738 syscallarg(netbsd32_voidp) addr;
722 syscallarg(netbsd32_size_t) len; 739 syscallarg(netbsd32_size_t) len;
723 syscallarg(int) prot; 740 syscallarg(int) prot;
724 } */ 741 } */
725 struct sys_mprotect_args ua; 742 struct sys_mprotect_args ua;
726 743
727 NETBSD32TOP_UAP(addr, void); 744 NETBSD32TOP_UAP(addr, void);
728 NETBSD32TOX_UAP(len, size_t); 745 NETBSD32TOX_UAP(len, size_t);
729 NETBSD32TO64_UAP(prot); 746 NETBSD32TO64_UAP(prot);
730 return (sys_mprotect(l, &ua, retval)); 747
 748 return sys_mprotect(l, &ua, retval);
731} 749}
732 750
733int 751int
734netbsd32_madvise(struct lwp *l, const struct netbsd32_madvise_args *uap, register_t *retval) 752netbsd32_madvise(struct lwp *l, const struct netbsd32_madvise_args *uap, register_t *retval)
735{ 753{
736 /* { 754 /* {
737 syscallarg(netbsd32_voidp) addr; 755 syscallarg(netbsd32_voidp) addr;
738 syscallarg(netbsd32_size_t) len; 756 syscallarg(netbsd32_size_t) len;
739 syscallarg(int) behav; 757 syscallarg(int) behav;
740 } */ 758 } */
741 struct sys_madvise_args ua; 759 struct sys_madvise_args ua;
742 760
743 NETBSD32TOP_UAP(addr, void); 761 NETBSD32TOP_UAP(addr, void);
744 NETBSD32TOX_UAP(len, size_t); 762 NETBSD32TOX_UAP(len, size_t);
745 NETBSD32TO64_UAP(behav); 763 NETBSD32TO64_UAP(behav);
746 return (sys_madvise(l, &ua, retval)); 764
 765 return sys_madvise(l, &ua, retval);
747} 766}
748 767
749int 768int
750netbsd32_mincore(struct lwp *l, const struct netbsd32_mincore_args *uap, register_t *retval) 769netbsd32_mincore(struct lwp *l, const struct netbsd32_mincore_args *uap, register_t *retval)
751{ 770{
752 /* { 771 /* {
753 syscallarg(netbsd32_voidp) addr; 772 syscallarg(netbsd32_voidp) addr;
754 syscallarg(netbsd32_size_t) len; 773 syscallarg(netbsd32_size_t) len;
755 syscallarg(netbsd32_charp) vec; 774 syscallarg(netbsd32_charp) vec;
756 } */ 775 } */
757 struct sys_mincore_args ua; 776 struct sys_mincore_args ua;
758 777
759 NETBSD32TOP_UAP(addr, void *); 778 NETBSD32TOP_UAP(addr, void *);
760 NETBSD32TOX_UAP(len, size_t); 779 NETBSD32TOX_UAP(len, size_t);
761 NETBSD32TOP_UAP(vec, char); 780 NETBSD32TOP_UAP(vec, char);
762 return (sys_mincore(l, &ua, retval)); 781
 782 return sys_mincore(l, &ua, retval);
763} 783}
764 784
765/* XXX MOVE ME XXX ? */ 
766int 785int
767netbsd32_getgroups(struct lwp *l, const struct netbsd32_getgroups_args *uap, register_t *retval) 786netbsd32_getgroups(struct lwp *l, const struct netbsd32_getgroups_args *uap, register_t *retval)
768{ 787{
769 /* { 788 /* {
770 syscallarg(int) gidsetsize; 789 syscallarg(int) gidsetsize;
771 syscallarg(netbsd32_gid_tp) gidset; 790 syscallarg(netbsd32_gid_tp) gidset;
772 } */ 791 } */
773 struct sys_getgroups_args ua; 792 struct sys_getgroups_args ua;
774 793
775 /* Since sizeof (gid_t) == sizeof (netbsd32_gid_t) ... */ 794 /* Since sizeof (gid_t) == sizeof (netbsd32_gid_t) ... */
776 795
777 NETBSD32TO64_UAP(gidsetsize); 796 NETBSD32TO64_UAP(gidsetsize);
778 NETBSD32TOP_UAP(gidset, gid_t); 797 NETBSD32TOP_UAP(gidset, gid_t);
779 return (sys_getgroups(l, &ua, retval)); 798
 799 return sys_getgroups(l, &ua, retval);
780} 800}
781 801
782int 802int
783netbsd32_setgroups(struct lwp *l, const struct netbsd32_setgroups_args *uap, register_t *retval) 803netbsd32_setgroups(struct lwp *l, const struct netbsd32_setgroups_args *uap, register_t *retval)
784{ 804{
785 /* { 805 /* {
786 syscallarg(int) gidsetsize; 806 syscallarg(int) gidsetsize;
787 syscallarg(const netbsd32_gid_tp) gidset; 807 syscallarg(const netbsd32_gid_tp) gidset;
788 } */ 808 } */
789 struct sys_setgroups_args ua; 809 struct sys_setgroups_args ua;
790 810
791 NETBSD32TO64_UAP(gidsetsize); 811 NETBSD32TO64_UAP(gidsetsize);
792 NETBSD32TOP_UAP(gidset, gid_t); 812 NETBSD32TOP_UAP(gidset, gid_t);
793 return (sys_setgroups(l, &ua, retval)); 813
 814 return sys_setgroups(l, &ua, retval);
794} 815}
795 816
796int 817int
797netbsd32_setpgid(struct lwp *l, const struct netbsd32_setpgid_args *uap, register_t *retval) 818netbsd32_setpgid(struct lwp *l, const struct netbsd32_setpgid_args *uap, register_t *retval)
798{ 819{
799 /* { 820 /* {
800 syscallarg(int) pid; 821 syscallarg(int) pid;
801 syscallarg(int) pgid; 822 syscallarg(int) pgid;
802 } */ 823 } */
803 struct sys_setpgid_args ua; 824 struct sys_setpgid_args ua;
804 825
805 NETBSD32TO64_UAP(pid); 826 NETBSD32TO64_UAP(pid);
806 NETBSD32TO64_UAP(pgid); 827 NETBSD32TO64_UAP(pgid);
807 return (sys_setpgid(l, &ua, retval)); 828
 829 return sys_setpgid(l, &ua, retval);
808} 830}
809 831
810int 832int
811netbsd32_fcntl(struct lwp *l, const struct netbsd32_fcntl_args *uap, register_t *retval) 833netbsd32_fcntl(struct lwp *l, const struct netbsd32_fcntl_args *uap, register_t *retval)
812{ 834{
813 /* { 835 /* {
814 syscallarg(int) fd; 836 syscallarg(int) fd;
815 syscallarg(int) cmd; 837 syscallarg(int) cmd;
816 syscallarg(netbsd32_voidp) arg; 838 syscallarg(netbsd32_voidp) arg;
817 } */ 839 } */
818 struct sys_fcntl_args ua; 840 struct sys_fcntl_args ua;
819 841
820 NETBSD32TO64_UAP(fd); 842 NETBSD32TO64_UAP(fd);
821 NETBSD32TO64_UAP(cmd); 843 NETBSD32TO64_UAP(cmd);
822 NETBSD32TOP_UAP(arg, void); 
823 /* we can do this because `struct flock' doesn't change */ 844 /* we can do this because `struct flock' doesn't change */
824 return (sys_fcntl(l, &ua, retval)); 845 NETBSD32TOP_UAP(arg, void);
 846
 847 return sys_fcntl(l, &ua, retval);
825} 848}
826 849
827int 850int
828netbsd32_dup2(struct lwp *l, const struct netbsd32_dup2_args *uap, register_t *retval) 851netbsd32_dup2(struct lwp *l, const struct netbsd32_dup2_args *uap, register_t *retval)
829{ 852{
830 /* { 853 /* {
831 syscallarg(int) from; 854 syscallarg(int) from;
832 syscallarg(int) to; 855 syscallarg(int) to;
833 } */ 856 } */
834 struct sys_dup2_args ua; 857 struct sys_dup2_args ua;
835 858
836 NETBSD32TO64_UAP(from); 859 NETBSD32TO64_UAP(from);
837 NETBSD32TO64_UAP(to); 860 NETBSD32TO64_UAP(to);
838 return (sys_dup2(l, &ua, retval)); 861
 862 return sys_dup2(l, &ua, retval);
839} 863}
840 864
841int 865int
842netbsd32_fsync(struct lwp *l, const struct netbsd32_fsync_args *uap, register_t *retval) 866netbsd32_fsync(struct lwp *l, const struct netbsd32_fsync_args *uap, register_t *retval)
843{ 867{
844 /* { 868 /* {
845 syscallarg(int) fd; 869 syscallarg(int) fd;
846 } */ 870 } */
847 struct sys_fsync_args ua; 871 struct sys_fsync_args ua;
848 872
849 NETBSD32TO64_UAP(fd); 873 NETBSD32TO64_UAP(fd);
850 return (sys_fsync(l, &ua, retval)); 874
 875 return sys_fsync(l, &ua, retval);
851} 876}
852 877
853int 878int
854netbsd32_setpriority(struct lwp *l, const struct netbsd32_setpriority_args *uap, register_t *retval) 879netbsd32_setpriority(struct lwp *l, const struct netbsd32_setpriority_args *uap, register_t *retval)
855{ 880{
856 /* { 881 /* {
857 syscallarg(int) which; 882 syscallarg(int) which;
858 syscallarg(int) who; 883 syscallarg(int) who;
859 syscallarg(int) prio; 884 syscallarg(int) prio;
860 } */ 885 } */
861 struct sys_setpriority_args ua; 886 struct sys_setpriority_args ua;
862 887
863 NETBSD32TO64_UAP(which); 888 NETBSD32TO64_UAP(which);
864 NETBSD32TO64_UAP(who); 889 NETBSD32TO64_UAP(who);
865 NETBSD32TO64_UAP(prio); 890 NETBSD32TO64_UAP(prio);
866 return (sys_setpriority(l, &ua, retval)); 891
 892 return sys_setpriority(l, &ua, retval);
867} 893}
868 894
869int 895int
870netbsd32___socket30(struct lwp *l, const struct netbsd32___socket30_args *uap, register_t *retval) 896netbsd32___socket30(struct lwp *l, const struct netbsd32___socket30_args *uap, register_t *retval)
871{ 897{
872 /* { 898 /* {
873 syscallarg(int) domain; 899 syscallarg(int) domain;
874 syscallarg(int) type; 900 syscallarg(int) type;
875 syscallarg(int) protocol; 901 syscallarg(int) protocol;
876 } */ 902 } */
877 struct sys___socket30_args ua; 903 struct sys___socket30_args ua;
878 904
879 NETBSD32TO64_UAP(domain); 905 NETBSD32TO64_UAP(domain);
880 NETBSD32TO64_UAP(type); 906 NETBSD32TO64_UAP(type);
881 NETBSD32TO64_UAP(protocol); 907 NETBSD32TO64_UAP(protocol);
882 return (sys___socket30(l, &ua, retval)); 908
 909 return sys___socket30(l, &ua, retval);
883} 910}
884 911
885int 912int
886netbsd32_connect(struct lwp *l, const struct netbsd32_connect_args *uap, register_t *retval) 913netbsd32_connect(struct lwp *l, const struct netbsd32_connect_args *uap, register_t *retval)
887{ 914{
888 /* { 915 /* {
889 syscallarg(int) s; 916 syscallarg(int) s;
890 syscallarg(const netbsd32_sockaddrp_t) name; 917 syscallarg(const netbsd32_sockaddrp_t) name;
891 syscallarg(int) namelen; 918 syscallarg(int) namelen;
892 } */ 919 } */
893 struct sys_connect_args ua; 920 struct sys_connect_args ua;
894 921
895 NETBSD32TO64_UAP(s); 922 NETBSD32TO64_UAP(s);
896 NETBSD32TOP_UAP(name, struct sockaddr); 923 NETBSD32TOP_UAP(name, struct sockaddr);
897 NETBSD32TO64_UAP(namelen); 924 NETBSD32TO64_UAP(namelen);
898 return (sys_connect(l, &ua, retval)); 925
 926 return sys_connect(l, &ua, retval);
899} 927}
900 928
901int 929int
902netbsd32_getpriority(struct lwp *l, const struct netbsd32_getpriority_args *uap, register_t *retval) 930netbsd32_getpriority(struct lwp *l, const struct netbsd32_getpriority_args *uap, register_t *retval)
903{ 931{
904 /* { 932 /* {
905 syscallarg(int) which; 933 syscallarg(int) which;
906 syscallarg(int) who; 934 syscallarg(int) who;
907 } */ 935 } */
908 struct sys_getpriority_args ua; 936 struct sys_getpriority_args ua;
909 937
910 NETBSD32TO64_UAP(which); 938 NETBSD32TO64_UAP(which);
911 NETBSD32TO64_UAP(who); 939 NETBSD32TO64_UAP(who);
912 return (sys_getpriority(l, &ua, retval)); 940
 941 return sys_getpriority(l, &ua, retval);
913} 942}
914 943
915int 944int
916netbsd32_bind(struct lwp *l, const struct netbsd32_bind_args *uap, register_t *retval) 945netbsd32_bind(struct lwp *l, const struct netbsd32_bind_args *uap, register_t *retval)
917{ 946{
918 /* { 947 /* {
919 syscallarg(int) s; 948 syscallarg(int) s;
920 syscallarg(const netbsd32_sockaddrp_t) name; 949 syscallarg(const netbsd32_sockaddrp_t) name;
921 syscallarg(int) namelen; 950 syscallarg(int) namelen;
922 } */ 951 } */
923 struct sys_bind_args ua; 952 struct sys_bind_args ua;
924 953
925 NETBSD32TO64_UAP(s); 954 NETBSD32TO64_UAP(s);
926 NETBSD32TOP_UAP(name, struct sockaddr); 955 NETBSD32TOP_UAP(name, struct sockaddr);
927 NETBSD32TO64_UAP(namelen); 956 NETBSD32TO64_UAP(namelen);
928 return (sys_bind(l, &ua, retval)); 957
 958 return sys_bind(l, &ua, retval);
929} 959}
930 960
931int 961int
932netbsd32_setsockopt(struct lwp *l, const struct netbsd32_setsockopt_args *uap, register_t *retval) 962netbsd32_setsockopt(struct lwp *l, const struct netbsd32_setsockopt_args *uap, register_t *retval)
933{ 963{
934 /* { 964 /* {
935 syscallarg(int) s; 965 syscallarg(int) s;
936 syscallarg(int) level; 966 syscallarg(int) level;
937 syscallarg(int) name; 967 syscallarg(int) name;
938 syscallarg(const netbsd32_voidp) val; 968 syscallarg(const netbsd32_voidp) val;
939 syscallarg(int) valsize; 969 syscallarg(int) valsize;
940 } */ 970 } */
941 struct sys_setsockopt_args ua; 971 struct sys_setsockopt_args ua;
942 972
943 NETBSD32TO64_UAP(s); 973 NETBSD32TO64_UAP(s);
944 NETBSD32TO64_UAP(level); 974 NETBSD32TO64_UAP(level);
945 NETBSD32TO64_UAP(name); 975 NETBSD32TO64_UAP(name);
946 NETBSD32TOP_UAP(val, void); 976 NETBSD32TOP_UAP(val, void);
947 NETBSD32TO64_UAP(valsize); 977 NETBSD32TO64_UAP(valsize);
948 /* may be more efficient to do this inline. */ 978 /* may be more efficient to do this inline. */
949 return (sys_setsockopt(l, &ua, retval)); 979
 980 return sys_setsockopt(l, &ua, retval);
950} 981}
951 982
952int 983int
953netbsd32_listen(struct lwp *l, const struct netbsd32_listen_args *uap, register_t *retval) 984netbsd32_listen(struct lwp *l, const struct netbsd32_listen_args *uap, register_t *retval)
954{ 985{
955 /* { 986 /* {
956 syscallarg(int) s; 987 syscallarg(int) s;
957 syscallarg(int) backlog; 988 syscallarg(int) backlog;
958 } */ 989 } */
959 struct sys_listen_args ua; 990 struct sys_listen_args ua;
960 991
961 NETBSD32TO64_UAP(s); 992 NETBSD32TO64_UAP(s);
962 NETBSD32TO64_UAP(backlog); 993 NETBSD32TO64_UAP(backlog);
963 return (sys_listen(l, &ua, retval)); 994
 995 return sys_listen(l, &ua, retval);
964} 996}
965 997
966int 998int
967netbsd32_fchown(struct lwp *l, const struct netbsd32_fchown_args *uap, register_t *retval) 999netbsd32_fchown(struct lwp *l, const struct netbsd32_fchown_args *uap, register_t *retval)
968{ 1000{
969 /* { 1001 /* {
970 syscallarg(int) fd; 1002 syscallarg(int) fd;
971 syscallarg(uid_t) uid; 1003 syscallarg(uid_t) uid;
972 syscallarg(gid_t) gid; 1004 syscallarg(gid_t) gid;
973 } */ 1005 } */
974 struct sys_fchown_args ua; 1006 struct sys_fchown_args ua;
975 1007
976 NETBSD32TO64_UAP(fd); 1008 NETBSD32TO64_UAP(fd);
977 NETBSD32TO64_UAP(uid); 1009 NETBSD32TO64_UAP(uid);
978 NETBSD32TO64_UAP(gid); 1010 NETBSD32TO64_UAP(gid);
979 return (sys_fchown(l, &ua, retval)); 1011
 1012 return sys_fchown(l, &ua, retval);
980} 1013}
981 1014
982int 1015int
983netbsd32_fchmod(struct lwp *l, const struct netbsd32_fchmod_args *uap, register_t *retval) 1016netbsd32_fchmod(struct lwp *l, const struct netbsd32_fchmod_args *uap, register_t *retval)
984{ 1017{
985 /* { 1018 /* {
986 syscallarg(int) fd; 1019 syscallarg(int) fd;
987 syscallarg(mode_t) mode; 1020 syscallarg(mode_t) mode;
988 } */ 1021 } */
989 struct sys_fchmod_args ua; 1022 struct sys_fchmod_args ua;
990 1023
991 NETBSD32TO64_UAP(fd); 1024 NETBSD32TO64_UAP(fd);
992 NETBSD32TO64_UAP(mode); 1025 NETBSD32TO64_UAP(mode);
993 return (sys_fchmod(l, &ua, retval)); 1026
 1027 return sys_fchmod(l, &ua, retval);
994} 1028}
995 1029
996int 1030int
997netbsd32_setreuid(struct lwp *l, const struct netbsd32_setreuid_args *uap, register_t *retval) 1031netbsd32_setreuid(struct lwp *l, const struct netbsd32_setreuid_args *uap, register_t *retval)
998{ 1032{
999 /* { 1033 /* {
1000 syscallarg(uid_t) ruid; 1034 syscallarg(uid_t) ruid;
1001 syscallarg(uid_t) euid; 1035 syscallarg(uid_t) euid;
1002 } */ 1036 } */
1003 struct sys_setreuid_args ua; 1037 struct sys_setreuid_args ua;
1004 1038
1005 NETBSD32TO64_UAP(ruid); 1039 NETBSD32TO64_UAP(ruid);
1006 NETBSD32TO64_UAP(euid); 1040 NETBSD32TO64_UAP(euid);
1007 return (sys_setreuid(l, &ua, retval)); 1041 return sys_setreuid(l, &ua, retval);
1008} 1042}
1009 1043
1010int 1044int
1011netbsd32_setregid(struct lwp *l, const struct netbsd32_setregid_args *uap, register_t *retval) 1045netbsd32_setregid(struct lwp *l, const struct netbsd32_setregid_args *uap, register_t *retval)
1012{ 1046{
1013 /* { 1047 /* {
1014 syscallarg(gid_t) rgid; 1048 syscallarg(gid_t) rgid;
1015 syscallarg(gid_t) egid; 1049 syscallarg(gid_t) egid;
1016 } */ 1050 } */
1017 struct sys_setregid_args ua; 1051 struct sys_setregid_args ua;
1018 1052
1019 NETBSD32TO64_UAP(rgid); 1053 NETBSD32TO64_UAP(rgid);
1020 NETBSD32TO64_UAP(egid); 1054 NETBSD32TO64_UAP(egid);
1021 return (sys_setregid(l, &ua, retval)); 1055
 1056 return sys_setregid(l, &ua, retval);
1022} 1057}
1023 1058
1024int 1059int
1025netbsd32_getsockopt(struct lwp *l, const struct netbsd32_getsockopt_args *uap, register_t *retval) 1060netbsd32_getsockopt(struct lwp *l, const struct netbsd32_getsockopt_args *uap, register_t *retval)
1026{ 1061{
1027 /* { 1062 /* {
1028 syscallarg(int) s; 1063 syscallarg(int) s;
1029 syscallarg(int) level; 1064 syscallarg(int) level;
1030 syscallarg(int) name; 1065 syscallarg(int) name;
1031 syscallarg(netbsd32_voidp) val; 1066 syscallarg(netbsd32_voidp) val;
1032 syscallarg(netbsd32_intp) avalsize; 1067 syscallarg(netbsd32_intp) avalsize;
1033 } */ 1068 } */
1034 struct sys_getsockopt_args ua; 1069 struct sys_getsockopt_args ua;
1035 1070
1036 NETBSD32TO64_UAP(s); 1071 NETBSD32TO64_UAP(s);
1037 NETBSD32TO64_UAP(level); 1072 NETBSD32TO64_UAP(level);
1038 NETBSD32TO64_UAP(name); 1073 NETBSD32TO64_UAP(name);
1039 NETBSD32TOP_UAP(val, void); 1074 NETBSD32TOP_UAP(val, void);
1040 NETBSD32TOP_UAP(avalsize, socklen_t); 1075 NETBSD32TOP_UAP(avalsize, socklen_t);
1041 return (sys_getsockopt(l, &ua, retval)); 1076
 1077 return sys_getsockopt(l, &ua, retval);
1042} 1078}
1043 1079
1044int 1080int
1045netbsd32_getsockopt2(struct lwp *l, const struct netbsd32_getsockopt2_args *uap, register_t *retval) 1081netbsd32_getsockopt2(struct lwp *l, const struct netbsd32_getsockopt2_args *uap, register_t *retval)
1046{ 1082{
1047 /* { 1083 /* {
1048 syscallarg(int) s; 1084 syscallarg(int) s;
1049 syscallarg(int) level; 1085 syscallarg(int) level;
1050 syscallarg(int) name; 1086 syscallarg(int) name;
1051 syscallarg(netbsd32_voidp) val; 1087 syscallarg(netbsd32_voidp) val;
1052 syscallarg(netbsd32_intp) avalsize; 1088 syscallarg(netbsd32_intp) avalsize;
1053 } */ 1089 } */
1054 struct sys_getsockopt2_args ua; 1090 struct sys_getsockopt2_args ua;
1055 1091
1056 NETBSD32TO64_UAP(s); 1092 NETBSD32TO64_UAP(s);
1057 NETBSD32TO64_UAP(level); 1093 NETBSD32TO64_UAP(level);
1058 NETBSD32TO64_UAP(name); 1094 NETBSD32TO64_UAP(name);
1059 NETBSD32TOP_UAP(val, void); 1095 NETBSD32TOP_UAP(val, void);
1060 NETBSD32TOP_UAP(avalsize, socklen_t); 1096 NETBSD32TOP_UAP(avalsize, socklen_t);
1061 return (sys_getsockopt2(l, &ua, retval)); 1097
 1098 return sys_getsockopt2(l, &ua, retval);
1062} 1099}
1063 1100
1064int 1101int
1065netbsd32_rename(struct lwp *l, const struct netbsd32_rename_args *uap, register_t *retval) 1102netbsd32_rename(struct lwp *l, const struct netbsd32_rename_args *uap, register_t *retval)
1066{ 1103{
1067 /* { 1104 /* {
1068 syscallarg(const netbsd32_charp) from; 1105 syscallarg(const netbsd32_charp) from;
1069 syscallarg(const netbsd32_charp) to; 1106 syscallarg(const netbsd32_charp) to;
1070 } */ 1107 } */
1071 struct sys_rename_args ua; 1108 struct sys_rename_args ua;
1072 1109
1073 NETBSD32TOP_UAP(from, const char); 1110 NETBSD32TOP_UAP(from, const char);
1074 NETBSD32TOP_UAP(to, const char); 1111 NETBSD32TOP_UAP(to, const char);
1075 1112
1076 return (sys_rename(l, &ua, retval)); 1113 return sys_rename(l, &ua, retval);
1077} 1114}
1078 1115
1079int 1116int
1080netbsd32_flock(struct lwp *l, const struct netbsd32_flock_args *uap, register_t *retval) 1117netbsd32_flock(struct lwp *l, const struct netbsd32_flock_args *uap, register_t *retval)
1081{ 1118{
1082 /* { 1119 /* {
1083 syscallarg(int) fd; 1120 syscallarg(int) fd;
1084 syscallarg(int) how; 1121 syscallarg(int) how;
1085 } */ 1122 } */
1086 struct sys_flock_args ua; 1123 struct sys_flock_args ua;
1087 1124
1088 NETBSD32TO64_UAP(fd); 1125 NETBSD32TO64_UAP(fd);
1089 NETBSD32TO64_UAP(how); 1126 NETBSD32TO64_UAP(how);
1090 1127
1091 return (sys_flock(l, &ua, retval)); 1128 return sys_flock(l, &ua, retval);
1092} 1129}
1093 1130
1094int 1131int
1095netbsd32_mkfifo(struct lwp *l, const struct netbsd32_mkfifo_args *uap, register_t *retval) 1132netbsd32_mkfifo(struct lwp *l, const struct netbsd32_mkfifo_args *uap, register_t *retval)
1096{ 1133{
1097 /* { 1134 /* {
1098 syscallarg(const netbsd32_charp) path; 1135 syscallarg(const netbsd32_charp) path;
1099 syscallarg(mode_t) mode; 1136 syscallarg(mode_t) mode;
1100 } */ 1137 } */
1101 struct sys_mkfifo_args ua; 1138 struct sys_mkfifo_args ua;
1102 1139
1103 NETBSD32TOP_UAP(path, const char); 1140 NETBSD32TOP_UAP(path, const char);
1104 NETBSD32TO64_UAP(mode); 1141 NETBSD32TO64_UAP(mode);
1105 return (sys_mkfifo(l, &ua, retval)); 1142
 1143 return sys_mkfifo(l, &ua, retval);
1106} 1144}
1107 1145
1108int 1146int
1109netbsd32_shutdown(struct lwp *l, const struct netbsd32_shutdown_args *uap, register_t *retval) 1147netbsd32_shutdown(struct lwp *l, const struct netbsd32_shutdown_args *uap, register_t *retval)
1110{ 1148{
1111 /* { 1149 /* {
1112 syscallarg(int) s; 1150 syscallarg(int) s;
1113 syscallarg(int) how; 1151 syscallarg(int) how;
1114 } */ 1152 } */
1115 struct sys_shutdown_args ua; 1153 struct sys_shutdown_args ua;
1116 1154
1117 NETBSD32TO64_UAP(s); 1155 NETBSD32TO64_UAP(s);
1118 NETBSD32TO64_UAP(how); 1156 NETBSD32TO64_UAP(how);
1119 return (sys_shutdown(l, &ua, retval)); 1157
 1158 return sys_shutdown(l, &ua, retval);
1120} 1159}
1121 1160
1122int 1161int
1123netbsd32_socketpair(struct lwp *l, const struct netbsd32_socketpair_args *uap, register_t *retval) 1162netbsd32_socketpair(struct lwp *l, const struct netbsd32_socketpair_args *uap, register_t *retval)
1124{ 1163{
1125 /* { 1164 /* {
1126 syscallarg(int) domain; 1165 syscallarg(int) domain;
1127 syscallarg(int) type; 1166 syscallarg(int) type;
1128 syscallarg(int) protocol; 1167 syscallarg(int) protocol;
1129 syscallarg(netbsd32_intp) rsv; 1168 syscallarg(netbsd32_intp) rsv;
1130 } */ 1169 } */
1131 struct sys_socketpair_args ua; 1170 struct sys_socketpair_args ua;
1132 1171
1133 NETBSD32TO64_UAP(domain); 1172 NETBSD32TO64_UAP(domain);
1134 NETBSD32TO64_UAP(type); 1173 NETBSD32TO64_UAP(type);
1135 NETBSD32TO64_UAP(protocol); 1174 NETBSD32TO64_UAP(protocol);
1136 NETBSD32TOP_UAP(rsv, int); 1175 NETBSD32TOP_UAP(rsv, int);
 1176
1137 /* Since we're just copying out two `int's we can do this */ 1177 /* Since we're just copying out two `int's we can do this */
1138 return (sys_socketpair(l, &ua, retval)); 1178 return sys_socketpair(l, &ua, retval);
1139} 1179}
1140 1180
1141int 1181int
1142netbsd32_mkdir(struct lwp *l, const struct netbsd32_mkdir_args *uap, register_t *retval) 1182netbsd32_mkdir(struct lwp *l, const struct netbsd32_mkdir_args *uap, register_t *retval)
1143{ 1183{
1144 /* { 1184 /* {
1145 syscallarg(const netbsd32_charp) path; 1185 syscallarg(const netbsd32_charp) path;
1146 syscallarg(mode_t) mode; 1186 syscallarg(mode_t) mode;
1147 } */ 1187 } */
1148 struct sys_mkdir_args ua; 1188 struct sys_mkdir_args ua;
1149 1189
1150 NETBSD32TOP_UAP(path, const char); 1190 NETBSD32TOP_UAP(path, const char);
1151 NETBSD32TO64_UAP(mode); 1191 NETBSD32TO64_UAP(mode);
1152 return (sys_mkdir(l, &ua, retval)); 1192
 1193 return sys_mkdir(l, &ua, retval);
1153} 1194}
1154 1195
1155int 1196int
1156netbsd32_rmdir(struct lwp *l, const struct netbsd32_rmdir_args *uap, register_t *retval) 1197netbsd32_rmdir(struct lwp *l, const struct netbsd32_rmdir_args *uap, register_t *retval)
1157{ 1198{
1158 /* { 1199 /* {
1159 syscallarg(const netbsd32_charp) path; 1200 syscallarg(const netbsd32_charp) path;
1160 } */ 1201 } */
1161 struct sys_rmdir_args ua; 1202 struct sys_rmdir_args ua;
1162 1203
1163 NETBSD32TOP_UAP(path, const char); 1204 NETBSD32TOP_UAP(path, const char);
1164 return (sys_rmdir(l, &ua, retval)); 1205
 1206 return sys_rmdir(l, &ua, retval);
1165} 1207}
1166 1208
1167int 1209int
1168netbsd32___quotactl(struct lwp *l, const struct netbsd32___quotactl_args *uap, register_t *retval) 1210netbsd32___quotactl(struct lwp *l, const struct netbsd32___quotactl_args *uap, register_t *retval)
1169{ 1211{
1170 /* { 1212 /* {
1171 syscallarg(const netbsd32_charp) path; 1213 syscallarg(const netbsd32_charp) path;
1172 syscallarg(netbsd32_voidp) args; 1214 syscallarg(netbsd32_voidp) args;
1173 } */ 1215 } */
1174 struct netbsd32_quotactlargs args32; 1216 struct netbsd32_quotactlargs args32;
1175 struct quotactl_args args; 1217 struct quotactl_args args;
1176 int error; 1218 int error;
1177 1219
@@ -1270,27 +1312,27 @@ netbsd32___getfh30(struct lwp *l, const  @@ -1270,27 +1312,27 @@ netbsd32___getfh30(struct lwp *l, const
1270 fhandle_t *fh; 1312 fhandle_t *fh;
1271 int error; 1313 int error;
1272 struct pathbuf *pb; 1314 struct pathbuf *pb;
1273 struct nameidata nd; 1315 struct nameidata nd;
1274 netbsd32_size_t usz32, sz32; 1316 netbsd32_size_t usz32, sz32;
1275 size_t sz; 1317 size_t sz;
1276 1318
1277 /* 1319 /*
1278 * Must be super user 1320 * Must be super user
1279 */ 1321 */
1280 error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE, 1322 error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
1281 0, NULL, NULL, NULL); 1323 0, NULL, NULL, NULL);
1282 if (error) 1324 if (error)
1283 return (error); 1325 return error;
1284 1326
1285 error = pathbuf_copyin(SCARG_P32(uap, fname), &pb); 1327 error = pathbuf_copyin(SCARG_P32(uap, fname), &pb);
1286 if (error) { 1328 if (error) {
1287 return error; 1329 return error;
1288 } 1330 }
1289 1331
1290 NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | TRYEMULROOT, pb); 1332 NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | TRYEMULROOT, pb);
1291 error = namei(&nd); 1333 error = namei(&nd);
1292 if (error) { 1334 if (error) {
1293 pathbuf_destroy(pb); 1335 pathbuf_destroy(pb);
1294 return error; 1336 return error;
1295 } 1337 }
1296 vp = nd.ni_vp; 1338 vp = nd.ni_vp;
@@ -1309,116 +1351,122 @@ netbsd32___getfh30(struct lwp *l, const  @@ -1309,116 +1351,122 @@ netbsd32___getfh30(struct lwp *l, const
1309 sz32 = sz; 1351 sz32 = sz;
1310 1352
1311 error = copyout(&sz32, SCARG_P32(uap, fh_size), sizeof(sz32)); 1353 error = copyout(&sz32, SCARG_P32(uap, fh_size), sizeof(sz32));
1312 if (error != 0) { 1354 if (error != 0) {
1313 goto out; 1355 goto out;
1314 } 1356 }
1315 if (usz32 >= sz32) { 1357 if (usz32 >= sz32) {
1316 error = copyout(fh, SCARG_P32(uap, fhp), sz); 1358 error = copyout(fh, SCARG_P32(uap, fhp), sz);
1317 } else { 1359 } else {
1318 error = E2BIG; 1360 error = E2BIG;
1319 } 1361 }
1320out: 1362out:
1321 vfs_composefh_free(fh); 1363 vfs_composefh_free(fh);
1322 return (error); 1364 return error;
1323} 1365}
1324 1366
1325int 1367int
1326netbsd32_pread(struct lwp *l, const struct netbsd32_pread_args *uap, register_t *retval) 1368netbsd32_pread(struct lwp *l, const struct netbsd32_pread_args *uap, register_t *retval)
1327{ 1369{
1328 /* { 1370 /* {
1329 syscallarg(int) fd; 1371 syscallarg(int) fd;
1330 syscallarg(netbsd32_voidp) buf; 1372 syscallarg(netbsd32_voidp) buf;
1331 syscallarg(netbsd32_size_t) nbyte; 1373 syscallarg(netbsd32_size_t) nbyte;
1332 syscallarg(int) PAD; 1374 syscallarg(int) PAD;
1333 syscallarg(netbsd32_off_t) offset; 1375 syscallarg(netbsd32_off_t) offset;
1334 } */ 1376 } */
1335 struct sys_pread_args ua; 1377 struct sys_pread_args ua;
1336 1378
1337 NETBSD32TO64_UAP(fd); 1379 NETBSD32TO64_UAP(fd);
1338 NETBSD32TOP_UAP(buf, void); 1380 NETBSD32TOP_UAP(buf, void);
1339 NETBSD32TOX_UAP(nbyte, size_t); 1381 NETBSD32TOX_UAP(nbyte, size_t);
1340 NETBSD32TO64_UAP(PAD); 1382 NETBSD32TO64_UAP(PAD);
1341 NETBSD32TO64_UAP(offset); 1383 NETBSD32TO64_UAP(offset);
 1384
1342 return sys_pread(l, &ua, retval); 1385 return sys_pread(l, &ua, retval);
1343} 1386}
1344 1387
1345int 1388int
1346netbsd32_pwrite(struct lwp *l, const struct netbsd32_pwrite_args *uap, register_t *retval) 1389netbsd32_pwrite(struct lwp *l, const struct netbsd32_pwrite_args *uap, register_t *retval)
1347{ 1390{
1348 /* { 1391 /* {
1349 syscallarg(int) fd; 1392 syscallarg(int) fd;
1350 syscallarg(const netbsd32_voidp) buf; 1393 syscallarg(const netbsd32_voidp) buf;
1351 syscallarg(netbsd32_size_t) nbyte; 1394 syscallarg(netbsd32_size_t) nbyte;
1352 syscallarg(int) PAD; 1395 syscallarg(int) PAD;
1353 syscallarg(netbsd32_off_t) offset; 1396 syscallarg(netbsd32_off_t) offset;
1354 } */ 1397 } */
1355 struct sys_pwrite_args ua; 1398 struct sys_pwrite_args ua;
1356 1399
1357 NETBSD32TO64_UAP(fd); 1400 NETBSD32TO64_UAP(fd);
1358 NETBSD32TOP_UAP(buf, void); 1401 NETBSD32TOP_UAP(buf, void);
1359 NETBSD32TOX_UAP(nbyte, size_t); 1402 NETBSD32TOX_UAP(nbyte, size_t);
1360 NETBSD32TO64_UAP(PAD); 1403 NETBSD32TO64_UAP(PAD);
1361 NETBSD32TO64_UAP(offset); 1404 NETBSD32TO64_UAP(offset);
 1405
1362 return sys_pwrite(l, &ua, retval); 1406 return sys_pwrite(l, &ua, retval);
1363} 1407}
1364 1408
1365int 1409int
1366netbsd32_setgid(struct lwp *l, const struct netbsd32_setgid_args *uap, register_t *retval) 1410netbsd32_setgid(struct lwp *l, const struct netbsd32_setgid_args *uap, register_t *retval)
1367{ 1411{
1368 /* { 1412 /* {
1369 syscallarg(gid_t) gid; 1413 syscallarg(gid_t) gid;
1370 } */ 1414 } */
1371 struct sys_setgid_args ua; 1415 struct sys_setgid_args ua;
1372 1416
1373 NETBSD32TO64_UAP(gid); 1417 NETBSD32TO64_UAP(gid);
1374 return (sys_setgid(l, &ua, retval)); 1418
 1419 return sys_setgid(l, &ua, retval);
1375} 1420}
1376 1421
1377int 1422int
1378netbsd32_setegid(struct lwp *l, const struct netbsd32_setegid_args *uap, register_t *retval) 1423netbsd32_setegid(struct lwp *l, const struct netbsd32_setegid_args *uap, register_t *retval)
1379{ 1424{
1380 /* { 1425 /* {
1381 syscallarg(gid_t) egid; 1426 syscallarg(gid_t) egid;
1382 } */ 1427 } */
1383 struct sys_setegid_args ua; 1428 struct sys_setegid_args ua;
1384 1429
1385 NETBSD32TO64_UAP(egid); 1430 NETBSD32TO64_UAP(egid);
1386 return (sys_setegid(l, &ua, retval)); 1431
 1432 return sys_setegid(l, &ua, retval);
1387} 1433}
1388 1434
1389int 1435int
1390netbsd32_seteuid(struct lwp *l, const struct netbsd32_seteuid_args *uap, register_t *retval) 1436netbsd32_seteuid(struct lwp *l, const struct netbsd32_seteuid_args *uap, register_t *retval)
1391{ 1437{
1392 /* { 1438 /* {
1393 syscallarg(gid_t) euid; 1439 syscallarg(gid_t) euid;
1394 } */ 1440 } */
1395 struct sys_seteuid_args ua; 1441 struct sys_seteuid_args ua;
1396 1442
1397 NETBSD32TO64_UAP(euid); 1443 NETBSD32TO64_UAP(euid);
1398 return (sys_seteuid(l, &ua, retval)); 1444
 1445 return sys_seteuid(l, &ua, retval);
1399} 1446}
1400 1447
1401int 1448int
1402netbsd32_pathconf(struct lwp *l, const struct netbsd32_pathconf_args *uap, register_t *retval) 1449netbsd32_pathconf(struct lwp *l, const struct netbsd32_pathconf_args *uap, register_t *retval)
1403{ 1450{
1404 /* { 1451 /* {
1405 syscallarg(netbsd32_charp) path; 1452 syscallarg(netbsd32_charp) path;
1406 syscallarg(int) name; 1453 syscallarg(int) name;
1407 } */ 1454 } */
1408 struct sys_pathconf_args ua; 1455 struct sys_pathconf_args ua;
1409 1456
1410 NETBSD32TOP_UAP(path, const char); 1457 NETBSD32TOP_UAP(path, const char);
1411 NETBSD32TO64_UAP(name); 1458 NETBSD32TO64_UAP(name);
 1459
1412 return sys_pathconf(l, &ua, retval); 1460 return sys_pathconf(l, &ua, retval);
1413} 1461}
1414 1462
1415int 1463int
1416netbsd32_fpathconf(struct lwp *l, const struct netbsd32_fpathconf_args *uap, register_t *retval) 1464netbsd32_fpathconf(struct lwp *l, const struct netbsd32_fpathconf_args *uap, register_t *retval)
1417{ 1465{
1418 /* { 1466 /* {
1419 syscallarg(int) fd; 1467 syscallarg(int) fd;
1420 syscallarg(int) name; 1468 syscallarg(int) name;
1421 } */ 1469 } */
1422 struct sys_fpathconf_args ua; 1470 struct sys_fpathconf_args ua;
1423 1471
1424 NETBSD32TO64_UAP(fd); 1472 NETBSD32TO64_UAP(fd);
@@ -1475,27 +1523,27 @@ netbsd32_setrlimit(struct lwp *l, const  @@ -1475,27 +1523,27 @@ netbsd32_setrlimit(struct lwp *l, const
1475 /* { 1523 /* {
1476 syscallarg(int) which; 1524 syscallarg(int) which;
1477 syscallarg(const netbsd32_rlimitp_t) rlp; 1525 syscallarg(const netbsd32_rlimitp_t) rlp;
1478 } */ 1526 } */
1479 int which = SCARG(uap, which); 1527 int which = SCARG(uap, which);
1480 struct rlimit alim; 1528 struct rlimit alim;
1481 int error; 1529 int error;
1482 1530
1483 if ((u_int)which >= RLIM_NLIMITS) 1531 if ((u_int)which >= RLIM_NLIMITS)
1484 return EINVAL; 1532 return EINVAL;
1485 1533
1486 error = copyin(SCARG_P32(uap, rlp), &alim, sizeof(struct rlimit)); 1534 error = copyin(SCARG_P32(uap, rlp), &alim, sizeof(struct rlimit));
1487 if (error) 1535 if (error)
1488 return (error); 1536 return error;
1489 1537
1490 fixlimit(which, &alim); 1538 fixlimit(which, &alim);
1491 1539
1492 return dosetrlimit(l, l->l_proc, which, &alim); 1540 return dosetrlimit(l, l->l_proc, which, &alim);
1493} 1541}
1494 1542
1495int 1543int
1496netbsd32_mmap(struct lwp *l, const struct netbsd32_mmap_args *uap, register_t *retval) 1544netbsd32_mmap(struct lwp *l, const struct netbsd32_mmap_args *uap, register_t *retval)
1497{ 1545{
1498 /* { 1546 /* {
1499 syscallarg(netbsd32_voidp) addr; 1547 syscallarg(netbsd32_voidp) addr;
1500 syscallarg(netbsd32_size_t) len; 1548 syscallarg(netbsd32_size_t) len;
1501 syscallarg(int) prot; 1549 syscallarg(int) prot;
@@ -1522,33 +1570,34 @@ netbsd32_mmap(struct lwp *l, const struc @@ -1522,33 +1570,34 @@ netbsd32_mmap(struct lwp *l, const struc
1522 SCARG(&ua, prot) |= PROT_EXEC; 1570 SCARG(&ua, prot) |= PROT_EXEC;
1523 } 1571 }
1524#endif 1572#endif
1525 NETBSD32TO64_UAP(fd); 1573 NETBSD32TO64_UAP(fd);
1526 NETBSD32TOX_UAP(PAD, long); 1574 NETBSD32TOX_UAP(PAD, long);
1527 NETBSD32TOX_UAP(pos, off_t); 1575 NETBSD32TOX_UAP(pos, off_t);
1528#ifdef DEBUG_MMAP 1576#ifdef DEBUG_MMAP
1529 printf("mmap(addr=0x%lx, len=0x%lx, prot=0x%lx, flags=0x%lx, " 1577 printf("mmap(addr=0x%lx, len=0x%lx, prot=0x%lx, flags=0x%lx, "
1530 "fd=%ld, pos=0x%lx);\n", 1578 "fd=%ld, pos=0x%lx);\n",
1531 (long)SCARG(&ua, addr), (long)SCARG(&ua, len), 1579 (long)SCARG(&ua, addr), (long)SCARG(&ua, len),
1532 (long)SCARG(&ua, prot), (long)SCARG(&ua, flags), 1580 (long)SCARG(&ua, prot), (long)SCARG(&ua, flags),
1533 (long)SCARG(&ua, fd), (long)SCARG(&ua, pos)); 1581 (long)SCARG(&ua, fd), (long)SCARG(&ua, pos));
1534#endif 1582#endif
 1583
1535 error = sys_mmap(l, &ua, retval); 1584 error = sys_mmap(l, &ua, retval);
1536 if ((u_long)*retval > (u_long)UINT_MAX) { 1585 if ((u_long)*retval > (u_long)UINT_MAX) {
1537 printf("netbsd32_mmap: retval out of range: 0x%lx\n", 1586 printf("netbsd32_mmap: retval out of range: 0x%lx\n",
1538 (u_long)*retval); 1587 (u_long)*retval);
1539 /* Should try to recover and return an error here. */ 1588 /* Should try to recover and return an error here. */
1540 } 1589 }
1541 return (error); 1590 return error;
1542} 1591}
1543 1592
1544int 1593int
1545netbsd32_mremap(struct lwp *l, const struct netbsd32_mremap_args *uap, register_t *retval) 1594netbsd32_mremap(struct lwp *l, const struct netbsd32_mremap_args *uap, register_t *retval)
1546{ 1595{
1547 /* { 1596 /* {
1548 syscallarg(void *) old_address; 1597 syscallarg(void *) old_address;
1549 syscallarg(size_t) old_size; 1598 syscallarg(size_t) old_size;
1550 syscallarg(void *) new_address; 1599 syscallarg(void *) new_address;
1551 syscallarg(size_t) new_size; 1600 syscallarg(size_t) new_size;
1552 syscallarg(int) flags; 1601 syscallarg(int) flags;
1553 } */ 1602 } */
1554 struct sys_mremap_args ua; 1603 struct sys_mremap_args ua;
@@ -1600,153 +1649,162 @@ netbsd32_lseek(struct lwp *l, const stru @@ -1600,153 +1649,162 @@ netbsd32_lseek(struct lwp *l, const stru
1600int 1649int
1601netbsd32_truncate(struct lwp *l, const struct netbsd32_truncate_args *uap, register_t *retval) 1650netbsd32_truncate(struct lwp *l, const struct netbsd32_truncate_args *uap, register_t *retval)
1602{ 1651{
1603 /* { 1652 /* {
1604 syscallarg(const netbsd32_charp) path; 1653 syscallarg(const netbsd32_charp) path;
1605 syscallarg(int) PAD; 1654 syscallarg(int) PAD;
1606 syscallarg(netbsd32_off_t) length; 1655 syscallarg(netbsd32_off_t) length;
1607 } */ 1656 } */
1608 struct sys_truncate_args ua; 1657 struct sys_truncate_args ua;
1609 1658
1610 NETBSD32TOP_UAP(path, const char); 1659 NETBSD32TOP_UAP(path, const char);
1611 NETBSD32TO64_UAP(PAD); 1660 NETBSD32TO64_UAP(PAD);
1612 NETBSD32TO64_UAP(length); 1661 NETBSD32TO64_UAP(length);
1613 return (sys_truncate(l, &ua, retval)); 1662
 1663 return sys_truncate(l, &ua, retval);
1614} 1664}
1615 1665
1616int 1666int
1617netbsd32_ftruncate(struct lwp *l, const struct netbsd32_ftruncate_args *uap, register_t *retval) 1667netbsd32_ftruncate(struct lwp *l, const struct netbsd32_ftruncate_args *uap, register_t *retval)
1618{ 1668{
1619 /* { 1669 /* {
1620 syscallarg(int) fd; 1670 syscallarg(int) fd;
1621 syscallarg(int) PAD; 1671 syscallarg(int) PAD;
1622 syscallarg(netbsd32_off_t) length; 1672 syscallarg(netbsd32_off_t) length;
1623 } */ 1673 } */
1624 struct sys_ftruncate_args ua; 1674 struct sys_ftruncate_args ua;
1625 1675
1626 NETBSD32TO64_UAP(fd); 1676 NETBSD32TO64_UAP(fd);
1627 NETBSD32TO64_UAP(PAD); 1677 NETBSD32TO64_UAP(PAD);
1628 NETBSD32TO64_UAP(length); 1678 NETBSD32TO64_UAP(length);
1629 return (sys_ftruncate(l, &ua, retval)); 1679
 1680 return sys_ftruncate(l, &ua, retval);
1630} 1681}
1631 1682
1632int 1683int
1633netbsd32_mlock(struct lwp *l, const struct netbsd32_mlock_args *uap, register_t *retval) 1684netbsd32_mlock(struct lwp *l, const struct netbsd32_mlock_args *uap, register_t *retval)
1634{ 1685{
1635 /* { 1686 /* {
1636 syscallarg(const netbsd32_voidp) addr; 1687 syscallarg(const netbsd32_voidp) addr;
1637 syscallarg(netbsd32_size_t) len; 1688 syscallarg(netbsd32_size_t) len;
1638 } */ 1689 } */
1639 struct sys_mlock_args ua; 1690 struct sys_mlock_args ua;
1640 1691
1641 NETBSD32TOP_UAP(addr, const void); 1692 NETBSD32TOP_UAP(addr, const void);
1642 NETBSD32TO64_UAP(len); 1693 NETBSD32TO64_UAP(len);
1643 return (sys_mlock(l, &ua, retval)); 1694
 1695 return sys_mlock(l, &ua, retval);
1644} 1696}
1645 1697
1646int 1698int
1647netbsd32_munlock(struct lwp *l, const struct netbsd32_munlock_args *uap, register_t *retval) 1699netbsd32_munlock(struct lwp *l, const struct netbsd32_munlock_args *uap, register_t *retval)
1648{ 1700{
1649 /* { 1701 /* {
1650 syscallarg(const netbsd32_voidp) addr; 1702 syscallarg(const netbsd32_voidp) addr;
1651 syscallarg(netbsd32_size_t) len; 1703 syscallarg(netbsd32_size_t) len;
1652 } */ 1704 } */
1653 struct sys_munlock_args ua; 1705 struct sys_munlock_args ua;
1654 1706
1655 NETBSD32TOP_UAP(addr, const void); 1707 NETBSD32TOP_UAP(addr, const void);
1656 NETBSD32TO64_UAP(len); 1708 NETBSD32TO64_UAP(len);
1657 return (sys_munlock(l, &ua, retval)); 1709
 1710 return sys_munlock(l, &ua, retval);
1658} 1711}
1659 1712
1660int 1713int
1661netbsd32_undelete(struct lwp *l, const struct netbsd32_undelete_args *uap, register_t *retval) 1714netbsd32_undelete(struct lwp *l, const struct netbsd32_undelete_args *uap, register_t *retval)
1662{ 1715{
1663 /* { 1716 /* {
1664 syscallarg(const netbsd32_charp) path; 1717 syscallarg(const netbsd32_charp) path;
1665 } */ 1718 } */
1666 struct sys_undelete_args ua; 1719 struct sys_undelete_args ua;
1667 1720
1668 NETBSD32TOP_UAP(path, const char); 1721 NETBSD32TOP_UAP(path, const char);
1669 return (sys_undelete(l, &ua, retval)); 1722
 1723 return sys_undelete(l, &ua, retval);
1670} 1724}
1671 1725
1672int 1726int
1673netbsd32_getpgid(struct lwp *l, const struct netbsd32_getpgid_args *uap, register_t *retval) 1727netbsd32_getpgid(struct lwp *l, const struct netbsd32_getpgid_args *uap, register_t *retval)
1674{ 1728{
1675 /* { 1729 /* {
1676 syscallarg(pid_t) pid; 1730 syscallarg(pid_t) pid;
1677 } */ 1731 } */
1678 struct sys_getpgid_args ua; 1732 struct sys_getpgid_args ua;
1679 1733
1680 NETBSD32TO64_UAP(pid); 1734 NETBSD32TO64_UAP(pid);
1681 return (sys_getpgid(l, &ua, retval)); 1735
 1736 return sys_getpgid(l, &ua, retval);
1682} 1737}
1683 1738
1684int 1739int
1685netbsd32_reboot(struct lwp *l, const struct netbsd32_reboot_args *uap, register_t *retval) 1740netbsd32_reboot(struct lwp *l, const struct netbsd32_reboot_args *uap, register_t *retval)
1686{ 1741{
1687 /* { 1742 /* {
1688 syscallarg(int) opt; 1743 syscallarg(int) opt;
1689 syscallarg(netbsd32_charp) bootstr; 1744 syscallarg(netbsd32_charp) bootstr;
1690 } */ 1745 } */
1691 struct sys_reboot_args ua; 1746 struct sys_reboot_args ua;
1692 1747
1693 NETBSD32TO64_UAP(opt); 1748 NETBSD32TO64_UAP(opt);
1694 NETBSD32TOP_UAP(bootstr, char); 1749 NETBSD32TOP_UAP(bootstr, char);
1695 return (sys_reboot(l, &ua, retval)); 1750
 1751 return sys_reboot(l, &ua, retval);
1696} 1752}
1697 1753
1698#include <sys/poll.h> 1754#include <sys/poll.h>
1699int 1755int
1700netbsd32_poll(struct lwp *l, const struct netbsd32_poll_args *uap, register_t *retval) 1756netbsd32_poll(struct lwp *l, const struct netbsd32_poll_args *uap, register_t *retval)
1701{ 1757{
1702 /* { 1758 /* {
1703 syscallarg(netbsd32_pollfdp_t) fds; 1759 syscallarg(netbsd32_pollfdp_t) fds;
1704 syscallarg(u_int) nfds; 1760 syscallarg(u_int) nfds;
1705 syscallarg(int) timeout; 1761 syscallarg(int) timeout;
1706 } */ 1762 } */
1707 struct sys_poll_args ua; 1763 struct sys_poll_args ua;
1708 1764
1709 NETBSD32TOP_UAP(fds, struct pollfd); 1765 NETBSD32TOP_UAP(fds, struct pollfd);
1710 NETBSD32TO64_UAP(nfds); 1766 NETBSD32TO64_UAP(nfds);
1711 NETBSD32TO64_UAP(timeout); 1767 NETBSD32TO64_UAP(timeout);
1712 1768
1713 return (sys_poll(l, &ua, retval)); 1769 return sys_poll(l, &ua, retval);
1714} 1770}
1715 1771
1716int 1772int
1717netbsd32_fdatasync(struct lwp *l, const struct netbsd32_fdatasync_args *uap, register_t *retval) 1773netbsd32_fdatasync(struct lwp *l, const struct netbsd32_fdatasync_args *uap, register_t *retval)
1718{ 1774{
1719 /* { 1775 /* {
1720 syscallarg(int) fd; 1776 syscallarg(int) fd;
1721 } */ 1777 } */
1722 struct sys_fdatasync_args ua; 1778 struct sys_fdatasync_args ua;
1723 1779
1724 NETBSD32TO64_UAP(fd); 1780 NETBSD32TO64_UAP(fd);
1725 return (sys_fdatasync(l, &ua, retval)); 1781
 1782 return sys_fdatasync(l, &ua, retval);
1726} 1783}
1727 1784
1728int 1785int
1729netbsd32___posix_rename(struct lwp *l, const struct netbsd32___posix_rename_args *uap, register_t *retval) 1786netbsd32___posix_rename(struct lwp *l, const struct netbsd32___posix_rename_args *uap, register_t *retval)
1730{ 1787{
1731 /* { 1788 /* {
1732 syscallarg(const netbsd32_charp) from; 1789 syscallarg(const netbsd32_charp) from;
1733 syscallarg(const netbsd32_charp) to; 1790 syscallarg(const netbsd32_charp) to;
1734 } */ 1791 } */
1735 struct sys___posix_rename_args ua; 1792 struct sys___posix_rename_args ua;
1736 1793
1737 NETBSD32TOP_UAP(from, const char); 1794 NETBSD32TOP_UAP(from, const char);
1738 NETBSD32TOP_UAP(to, const char); 1795 NETBSD32TOP_UAP(to, const char);
1739 return (sys___posix_rename(l, &ua, retval)); 1796
 1797 return sys___posix_rename(l, &ua, retval);
1740} 1798}
1741 1799
1742static void 1800static void
1743swapent32_cvt(void *p, const struct swapent *se) 1801swapent32_cvt(void *p, const struct swapent *se)
1744{ 1802{
1745 struct netbsd32_swapent *se32 = p; 1803 struct netbsd32_swapent *se32 = p;
1746 1804
1747 se32->se_dev = se->se_dev; 1805 se32->se_dev = se->se_dev;
1748 se32->se_flags = se->se_flags; 1806 se32->se_flags = se->se_flags;
1749 se32->se_nblks = se->se_nblks; 1807 se32->se_nblks = se->se_nblks;
1750 se32->se_inuse = se->se_inuse; 1808 se32->se_inuse = se->se_inuse;
1751 se32->se_priority = se->se_priority; 1809 se32->se_priority = se->se_priority;
1752 KASSERT(sizeof(se->se_path) <= sizeof(se32->se_path)); 1810 KASSERT(sizeof(se->se_path) <= sizeof(se32->se_path));
@@ -1767,254 +1825,269 @@ netbsd32_swapctl(struct lwp *l, const st @@ -1767,254 +1825,269 @@ netbsd32_swapctl(struct lwp *l, const st
1767 NETBSD32TO64_UAP(cmd); 1825 NETBSD32TO64_UAP(cmd);
1768 NETBSD32TOP_UAP(arg, void); 1826 NETBSD32TOP_UAP(arg, void);
1769 NETBSD32TO64_UAP(misc); 1827 NETBSD32TO64_UAP(misc);
1770 1828
1771 /* SWAP_STATS50 and SWAP_STATS13 structures need no translation */ 1829 /* SWAP_STATS50 and SWAP_STATS13 structures need no translation */
1772 if (SCARG(&ua, cmd) == SWAP_STATS) { 1830 if (SCARG(&ua, cmd) == SWAP_STATS) {
1773 swapsys_lock(RW_READER); 1831 swapsys_lock(RW_READER);
1774 int error = uvm_swap_stats(SCARG(&ua, arg), SCARG(&ua, misc), 1832 int error = uvm_swap_stats(SCARG(&ua, arg), SCARG(&ua, misc),
1775 swapent32_cvt, sizeof(struct netbsd32_swapent), retval); 1833 swapent32_cvt, sizeof(struct netbsd32_swapent), retval);
1776 swapsys_unlock(); 1834 swapsys_unlock();
1777 return error; 1835 return error;
1778 } 1836 }
1779 1837
1780 return (sys_swapctl(l, &ua, retval)); 1838 return sys_swapctl(l, &ua, retval);
1781} 1839}
1782 1840
1783int 1841int
1784netbsd32_minherit(struct lwp *l, const struct netbsd32_minherit_args *uap, register_t *retval) 1842netbsd32_minherit(struct lwp *l, const struct netbsd32_minherit_args *uap, register_t *retval)
1785{ 1843{
1786 /* { 1844 /* {
1787 syscallarg(netbsd32_voidp) addr; 1845 syscallarg(netbsd32_voidp) addr;
1788 syscallarg(netbsd32_size_t) len; 1846 syscallarg(netbsd32_size_t) len;
1789 syscallarg(int) inherit; 1847 syscallarg(int) inherit;
1790 } */ 1848 } */
1791 struct sys_minherit_args ua; 1849 struct sys_minherit_args ua;
1792 1850
1793 NETBSD32TOP_UAP(addr, void); 1851 NETBSD32TOP_UAP(addr, void);
1794 NETBSD32TOX_UAP(len, size_t); 1852 NETBSD32TOX_UAP(len, size_t);
1795 NETBSD32TO64_UAP(inherit); 1853 NETBSD32TO64_UAP(inherit);
1796 return (sys_minherit(l, &ua, retval)); 1854
 1855 return sys_minherit(l, &ua, retval);
1797} 1856}
1798 1857
1799int 1858int
1800netbsd32_lchmod(struct lwp *l, const struct netbsd32_lchmod_args *uap, register_t *retval) 1859netbsd32_lchmod(struct lwp *l, const struct netbsd32_lchmod_args *uap, register_t *retval)
1801{ 1860{
1802 /* { 1861 /* {
1803 syscallarg(const netbsd32_charp) path; 1862 syscallarg(const netbsd32_charp) path;
1804 syscallarg(mode_t) mode; 1863 syscallarg(mode_t) mode;
1805 } */ 1864 } */
1806 struct sys_lchmod_args ua; 1865 struct sys_lchmod_args ua;
1807 1866
1808 NETBSD32TOP_UAP(path, const char); 1867 NETBSD32TOP_UAP(path, const char);
1809 NETBSD32TO64_UAP(mode); 1868 NETBSD32TO64_UAP(mode);
1810 return (sys_lchmod(l, &ua, retval)); 1869
 1870 return sys_lchmod(l, &ua, retval);
1811} 1871}
1812 1872
1813int 1873int
1814netbsd32_lchown(struct lwp *l, const struct netbsd32_lchown_args *uap, register_t *retval) 1874netbsd32_lchown(struct lwp *l, const struct netbsd32_lchown_args *uap, register_t *retval)
1815{ 1875{
1816 /* { 1876 /* {
1817 syscallarg(const netbsd32_charp) path; 1877 syscallarg(const netbsd32_charp) path;
1818 syscallarg(uid_t) uid; 1878 syscallarg(uid_t) uid;
1819 syscallarg(gid_t) gid; 1879 syscallarg(gid_t) gid;
1820 } */ 1880 } */
1821 struct sys_lchown_args ua; 1881 struct sys_lchown_args ua;
1822 1882
1823 NETBSD32TOP_UAP(path, const char); 1883 NETBSD32TOP_UAP(path, const char);
1824 NETBSD32TO64_UAP(uid); 1884 NETBSD32TO64_UAP(uid);
1825 NETBSD32TO64_UAP(gid); 1885 NETBSD32TO64_UAP(gid);
1826 return (sys_lchown(l, &ua, retval)); 1886
 1887 return sys_lchown(l, &ua, retval);
1827} 1888}
1828 1889
1829int 1890int
1830netbsd32___msync13(struct lwp *l, const struct netbsd32___msync13_args *uap, register_t *retval) 1891netbsd32___msync13(struct lwp *l, const struct netbsd32___msync13_args *uap, register_t *retval)
1831{ 1892{
1832 /* { 1893 /* {
1833 syscallarg(netbsd32_voidp) addr; 1894 syscallarg(netbsd32_voidp) addr;
1834 syscallarg(netbsd32_size_t) len; 1895 syscallarg(netbsd32_size_t) len;
1835 syscallarg(int) flags; 1896 syscallarg(int) flags;
1836 } */ 1897 } */
1837 struct sys___msync13_args ua; 1898 struct sys___msync13_args ua;
1838 1899
1839 NETBSD32TOP_UAP(addr, void); 1900 NETBSD32TOP_UAP(addr, void);
1840 NETBSD32TOX_UAP(len, size_t); 1901 NETBSD32TOX_UAP(len, size_t);
1841 NETBSD32TO64_UAP(flags); 1902 NETBSD32TO64_UAP(flags);
1842 return (sys___msync13(l, &ua, retval)); 1903
 1904 return sys___msync13(l, &ua, retval);
1843} 1905}
1844 1906
1845int 1907int
1846netbsd32___posix_chown(struct lwp *l, const struct netbsd32___posix_chown_args *uap, register_t *retval) 1908netbsd32___posix_chown(struct lwp *l, const struct netbsd32___posix_chown_args *uap, register_t *retval)
1847{ 1909{
1848 /* { 1910 /* {
1849 syscallarg(const netbsd32_charp) path; 1911 syscallarg(const netbsd32_charp) path;
1850 syscallarg(uid_t) uid; 1912 syscallarg(uid_t) uid;
1851 syscallarg(gid_t) gid; 1913 syscallarg(gid_t) gid;
1852 } */ 1914 } */
1853 struct sys___posix_chown_args ua; 1915 struct sys___posix_chown_args ua;
1854 1916
1855 NETBSD32TOP_UAP(path, const char); 1917 NETBSD32TOP_UAP(path, const char);
1856 NETBSD32TO64_UAP(uid); 1918 NETBSD32TO64_UAP(uid);
1857 NETBSD32TO64_UAP(gid); 1919 NETBSD32TO64_UAP(gid);
1858 return (sys___posix_chown(l, &ua, retval)); 1920
 1921 return sys___posix_chown(l, &ua, retval);
1859} 1922}
1860 1923
1861int 1924int
1862netbsd32___posix_fchown(struct lwp *l, const struct netbsd32___posix_fchown_args *uap, register_t *retval) 1925netbsd32___posix_fchown(struct lwp *l, const struct netbsd32___posix_fchown_args *uap, register_t *retval)
1863{ 1926{
1864 /* { 1927 /* {
1865 syscallarg(int) fd; 1928 syscallarg(int) fd;
1866 syscallarg(uid_t) uid; 1929 syscallarg(uid_t) uid;
1867 syscallarg(gid_t) gid; 1930 syscallarg(gid_t) gid;
1868 } */ 1931 } */
1869 struct sys___posix_fchown_args ua; 1932 struct sys___posix_fchown_args ua;
1870 1933
1871 NETBSD32TO64_UAP(fd); 1934 NETBSD32TO64_UAP(fd);
1872 NETBSD32TO64_UAP(uid); 1935 NETBSD32TO64_UAP(uid);
1873 NETBSD32TO64_UAP(gid); 1936 NETBSD32TO64_UAP(gid);
1874 return (sys___posix_fchown(l, &ua, retval)); 1937
 1938 return sys___posix_fchown(l, &ua, retval);
1875} 1939}
1876 1940
1877int 1941int
1878netbsd32___posix_lchown(struct lwp *l, const struct netbsd32___posix_lchown_args *uap, register_t *retval) 1942netbsd32___posix_lchown(struct lwp *l, const struct netbsd32___posix_lchown_args *uap, register_t *retval)
1879{ 1943{
1880 /* { 1944 /* {
1881 syscallarg(const netbsd32_charp) path; 1945 syscallarg(const netbsd32_charp) path;
1882 syscallarg(uid_t) uid; 1946 syscallarg(uid_t) uid;
1883 syscallarg(gid_t) gid; 1947 syscallarg(gid_t) gid;
1884 } */ 1948 } */
1885 struct sys___posix_lchown_args ua; 1949 struct sys___posix_lchown_args ua;
1886 1950
1887 NETBSD32TOP_UAP(path, const char); 1951 NETBSD32TOP_UAP(path, const char);
1888 NETBSD32TO64_UAP(uid); 1952 NETBSD32TO64_UAP(uid);
1889 NETBSD32TO64_UAP(gid); 1953 NETBSD32TO64_UAP(gid);
1890 return (sys___posix_lchown(l, &ua, retval)); 1954
 1955 return sys___posix_lchown(l, &ua, retval);
1891} 1956}
1892 1957
1893int 1958int
1894netbsd32_getsid(struct lwp *l, const struct netbsd32_getsid_args *uap, register_t *retval) 1959netbsd32_getsid(struct lwp *l, const struct netbsd32_getsid_args *uap, register_t *retval)
1895{ 1960{
1896 /* { 1961 /* {
1897 syscallarg(pid_t) pid; 1962 syscallarg(pid_t) pid;
1898 } */ 1963 } */
1899 struct sys_getsid_args ua; 1964 struct sys_getsid_args ua;
1900 1965
1901 NETBSD32TO64_UAP(pid); 1966 NETBSD32TO64_UAP(pid);
1902 return (sys_getsid(l, &ua, retval)); 1967
 1968 return sys_getsid(l, &ua, retval);
1903} 1969}
1904 1970
1905int 1971int
1906netbsd32_fktrace(struct lwp *l, const struct netbsd32_fktrace_args *uap, register_t *retval) 1972netbsd32_fktrace(struct lwp *l, const struct netbsd32_fktrace_args *uap, register_t *retval)
1907{ 1973{
1908 /* { 1974 /* {
1909 syscallarg(int) fd; 1975 syscallarg(int) fd;
1910 syscallarg(int) ops; 1976 syscallarg(int) ops;
1911 syscallarg(int) facs; 1977 syscallarg(int) facs;
1912 syscallarg(int) pid; 1978 syscallarg(int) pid;
1913 } */ 1979 } */
1914 struct sys_fktrace_args ua; 1980 struct sys_fktrace_args ua;
1915 1981
1916 NETBSD32TOX_UAP(fd, int); 1982 NETBSD32TOX_UAP(fd, int);
1917 NETBSD32TO64_UAP(ops); 1983 NETBSD32TO64_UAP(ops);
1918 NETBSD32TO64_UAP(facs); 1984 NETBSD32TO64_UAP(facs);
1919 NETBSD32TO64_UAP(pid); 1985 NETBSD32TO64_UAP(pid);
1920 return (sys_fktrace(l, &ua, retval)); 1986
 1987 return sys_fktrace(l, &ua, retval);
1921} 1988}
1922 1989
1923int 1990int
1924netbsd32___sigpending14(struct lwp *l, const struct netbsd32___sigpending14_args *uap, register_t *retval) 1991netbsd32___sigpending14(struct lwp *l, const struct netbsd32___sigpending14_args *uap, register_t *retval)
1925{ 1992{
1926 /* { 1993 /* {
1927 syscallarg(sigset_t *) set; 1994 syscallarg(sigset_t *) set;
1928 } */ 1995 } */
1929 struct sys___sigpending14_args ua; 1996 struct sys___sigpending14_args ua;
1930 1997
1931 NETBSD32TOP_UAP(set, sigset_t); 1998 NETBSD32TOP_UAP(set, sigset_t);
1932 return (sys___sigpending14(l, &ua, retval)); 1999
 2000 return sys___sigpending14(l, &ua, retval);
1933} 2001}
1934 2002
1935int 2003int
1936netbsd32___sigprocmask14(struct lwp *l, const struct netbsd32___sigprocmask14_args *uap, register_t *retval) 2004netbsd32___sigprocmask14(struct lwp *l, const struct netbsd32___sigprocmask14_args *uap, register_t *retval)
1937{ 2005{
1938 /* { 2006 /* {
1939 syscallarg(int) how; 2007 syscallarg(int) how;
1940 syscallarg(const sigset_t *) set; 2008 syscallarg(const sigset_t *) set;
1941 syscallarg(sigset_t *) oset; 2009 syscallarg(sigset_t *) oset;
1942 } */ 2010 } */
1943 struct sys___sigprocmask14_args ua; 2011 struct sys___sigprocmask14_args ua;
1944 2012
1945 NETBSD32TO64_UAP(how); 2013 NETBSD32TO64_UAP(how);
1946 NETBSD32TOP_UAP(set, sigset_t); 2014 NETBSD32TOP_UAP(set, sigset_t);
1947 NETBSD32TOP_UAP(oset, sigset_t); 2015 NETBSD32TOP_UAP(oset, sigset_t);
1948 return (sys___sigprocmask14(l, &ua, retval)); 2016
 2017 return sys___sigprocmask14(l, &ua, retval);
1949} 2018}
1950 2019
1951int 2020int
1952netbsd32___sigsuspend14(struct lwp *l, const struct netbsd32___sigsuspend14_args *uap, register_t *retval) 2021netbsd32___sigsuspend14(struct lwp *l, const struct netbsd32___sigsuspend14_args *uap, register_t *retval)
1953{ 2022{
1954 /* { 2023 /* {
1955 syscallarg(const sigset_t *) set; 2024 syscallarg(const sigset_t *) set;
1956 } */ 2025 } */
1957 struct sys___sigsuspend14_args ua; 2026 struct sys___sigsuspend14_args ua;
1958 2027
1959 NETBSD32TOP_UAP(set, sigset_t); 2028 NETBSD32TOP_UAP(set, sigset_t);
1960 return (sys___sigsuspend14(l, &ua, retval)); 2029
 2030 return sys___sigsuspend14(l, &ua, retval);
1961} 2031}
1962 2032
1963int 2033int
1964netbsd32_fchroot(struct lwp *l, const struct netbsd32_fchroot_args *uap, register_t *retval) 2034netbsd32_fchroot(struct lwp *l, const struct netbsd32_fchroot_args *uap, register_t *retval)
1965{ 2035{
1966 /* { 2036 /* {
1967 syscallarg(int) fd; 2037 syscallarg(int) fd;
1968 } */ 2038 } */
1969 struct sys_fchroot_args ua; 2039 struct sys_fchroot_args ua;
1970 2040
1971 NETBSD32TO64_UAP(fd); 2041 NETBSD32TO64_UAP(fd);
1972 return (sys_fchroot(l, &ua, retval)); 2042
 2043 return sys_fchroot(l, &ua, retval);
1973} 2044}
1974 2045
1975/* 2046/*
1976 * Open a file given a file handle. 2047 * Open a file given a file handle.
1977 * 2048 *
1978 * Check permissions, allocate an open file structure, 2049 * Check permissions, allocate an open file structure,
1979 * and call the device open routine if any. 2050 * and call the device open routine if any.
1980 */ 2051 */
1981int 2052int
1982netbsd32___fhopen40(struct lwp *l, const struct netbsd32___fhopen40_args *uap, register_t *retval) 2053netbsd32___fhopen40(struct lwp *l, const struct netbsd32___fhopen40_args *uap, register_t *retval)
1983{ 2054{
1984 /* { 2055 /* {
1985 syscallarg(const netbsd32_pointer_t *) fhp; 2056 syscallarg(const netbsd32_pointer_t *) fhp;
1986 syscallarg(netbsd32_size_t) fh_size; 2057 syscallarg(netbsd32_size_t) fh_size;
1987 syscallarg(int) flags; 2058 syscallarg(int) flags;
1988 } */ 2059 } */
1989 struct sys___fhopen40_args ua; 2060 struct sys___fhopen40_args ua;
1990 2061
1991 NETBSD32TOP_UAP(fhp, fhandle_t); 2062 NETBSD32TOP_UAP(fhp, fhandle_t);
1992 NETBSD32TO64_UAP(fh_size); 2063 NETBSD32TO64_UAP(fh_size);
1993 NETBSD32TO64_UAP(flags); 2064 NETBSD32TO64_UAP(flags);
1994 return (sys___fhopen40(l, &ua, retval)); 2065
 2066 return sys___fhopen40(l, &ua, retval);
1995} 2067}
1996 2068
1997/* virtual memory syscalls */ 2069/* virtual memory syscalls */
1998int 2070int
1999netbsd32_ovadvise(struct lwp *l, const struct netbsd32_ovadvise_args *uap, register_t *retval) 2071netbsd32_ovadvise(struct lwp *l, const struct netbsd32_ovadvise_args *uap, register_t *retval)
2000{ 2072{
2001 /* { 2073 /* {
2002 syscallarg(int) anom; 2074 syscallarg(int) anom;
2003 } */ 2075 } */
2004 struct sys_ovadvise_args ua; 2076 struct sys_ovadvise_args ua;
2005 2077
2006 NETBSD32TO64_UAP(anom); 2078 NETBSD32TO64_UAP(anom);
2007 return (sys_ovadvise(l, &ua, retval)); 2079
 2080 return sys_ovadvise(l, &ua, retval);
2008} 2081}
2009 2082
2010void 2083void
2011netbsd32_adjust_limits(struct proc *p) 2084netbsd32_adjust_limits(struct proc *p)
2012{ 2085{
2013 static const struct { 2086 static const struct {
2014 int id; 2087 int id;
2015 rlim_t lim; 2088 rlim_t lim;
2016 } lm[] = { 2089 } lm[] = {
2017 { RLIMIT_DATA, MAXDSIZ32 }, 2090 { RLIMIT_DATA, MAXDSIZ32 },
2018 { RLIMIT_STACK, MAXSSIZ32 }, 2091 { RLIMIT_STACK, MAXSSIZ32 },
2019 }; 2092 };
2020 size_t i; 2093 size_t i;
@@ -2058,520 +2131,560 @@ netbsd32_adjust_limits(struct proc *p) @@ -2058,520 +2131,560 @@ netbsd32_adjust_limits(struct proc *p)
2058} 2131}
2059 2132
2060int 2133int
2061netbsd32_uuidgen(struct lwp *l, const struct netbsd32_uuidgen_args *uap, register_t *retval) 2134netbsd32_uuidgen(struct lwp *l, const struct netbsd32_uuidgen_args *uap, register_t *retval)
2062{ 2135{
2063 /* { 2136 /* {
2064 syscallarg(netbsd32_uuidp_t) store; 2137 syscallarg(netbsd32_uuidp_t) store;
2065 syscallarg(int) count; 2138 syscallarg(int) count;
2066 } */ 2139 } */
2067 struct sys_uuidgen_args ua; 2140 struct sys_uuidgen_args ua;
2068 2141
2069 NETBSD32TOP_UAP(store, struct uuid); 2142 NETBSD32TOP_UAP(store, struct uuid);
2070 NETBSD32TO64_UAP(count); 2143 NETBSD32TO64_UAP(count);
2071 return (sys_uuidgen(l, &ua, retval)); 2144
 2145 return sys_uuidgen(l, &ua, retval);
2072} 2146}
2073 2147
2074int 2148int
2075netbsd32_extattrctl(struct lwp *l, const struct netbsd32_extattrctl_args *uap, register_t *retval) 2149netbsd32_extattrctl(struct lwp *l, const struct netbsd32_extattrctl_args *uap, register_t *retval)
2076{ 2150{
2077 /* { 2151 /* {
2078 syscallarg(const netbsd32_charp) path; 2152 syscallarg(const netbsd32_charp) path;
2079 syscallarg(int) cmd; 2153 syscallarg(int) cmd;
2080 syscallarg(const netbsd32_charp) filename; 2154 syscallarg(const netbsd32_charp) filename;
2081 syscallarg(int) attrnamespace; 2155 syscallarg(int) attrnamespace;
2082 syscallarg(const netbsd32_charp) attrname; 2156 syscallarg(const netbsd32_charp) attrname;
2083 } */ 2157 } */
2084 struct sys_extattrctl_args ua; 2158 struct sys_extattrctl_args ua;
2085 2159
2086 NETBSD32TOP_UAP(path, const char); 2160 NETBSD32TOP_UAP(path, const char);
2087 NETBSD32TO64_UAP(cmd); 2161 NETBSD32TO64_UAP(cmd);
2088 NETBSD32TOP_UAP(filename, const char); 2162 NETBSD32TOP_UAP(filename, const char);
2089 NETBSD32TO64_UAP(attrnamespace); 2163 NETBSD32TO64_UAP(attrnamespace);
2090 NETBSD32TOP_UAP(attrname, const char); 2164 NETBSD32TOP_UAP(attrname, const char);
 2165
2091 return sys_extattrctl(l, &ua, retval); 2166 return sys_extattrctl(l, &ua, retval);
2092} 2167}
2093 2168
2094int 2169int
2095netbsd32_extattr_set_fd(struct lwp *l, const struct netbsd32_extattr_set_fd_args *uap, register_t *retval) 2170netbsd32_extattr_set_fd(struct lwp *l, const struct netbsd32_extattr_set_fd_args *uap, register_t *retval)
2096{ 2171{
2097 /* { 2172 /* {
2098 syscallarg(int) fd; 2173 syscallarg(int) fd;
2099 syscallarg(int) attrnamespace; 2174 syscallarg(int) attrnamespace;
2100 syscallarg(const netbsd32_charp) attrname; 2175 syscallarg(const netbsd32_charp) attrname;
2101 syscallarg(const netbsd32_voidp) data; 2176 syscallarg(const netbsd32_voidp) data;
2102 syscallarg(netbsd32_size_t) nbytes; 2177 syscallarg(netbsd32_size_t) nbytes;
2103 } */ 2178 } */
2104 struct sys_extattr_set_fd_args ua; 2179 struct sys_extattr_set_fd_args ua;
2105 2180
2106 NETBSD32TO64_UAP(fd); 2181 NETBSD32TO64_UAP(fd);
2107 NETBSD32TO64_UAP(attrnamespace); 2182 NETBSD32TO64_UAP(attrnamespace);
2108 NETBSD32TOP_UAP(attrname, const char); 2183 NETBSD32TOP_UAP(attrname, const char);
2109 NETBSD32TOP_UAP(data, const void); 2184 NETBSD32TOP_UAP(data, const void);
2110 NETBSD32TOX_UAP(nbytes, size_t); 2185 NETBSD32TOX_UAP(nbytes, size_t);
 2186
2111 return sys_extattr_set_fd(l, &ua, retval); 2187 return sys_extattr_set_fd(l, &ua, retval);
2112} 2188}
2113 2189
2114int 2190int
2115netbsd32_extattr_set_file(struct lwp *l, const struct netbsd32_extattr_set_file_args *uap, register_t *retval) 2191netbsd32_extattr_set_file(struct lwp *l, const struct netbsd32_extattr_set_file_args *uap, register_t *retval)
2116{ 2192{
2117 /* { 2193 /* {
2118 syscallarg(const netbsd32_charp) path; 2194 syscallarg(const netbsd32_charp) path;
2119 syscallarg(int) attrnamespace; 2195 syscallarg(int) attrnamespace;
2120 syscallarg(const netbsd32_charp) attrname; 2196 syscallarg(const netbsd32_charp) attrname;
2121 syscallarg(const netbsd32_voidp) data; 2197 syscallarg(const netbsd32_voidp) data;
2122 syscallarg(netbsd32_size_t) nbytes; 2198 syscallarg(netbsd32_size_t) nbytes;
2123 } */ 2199 } */
2124 struct sys_extattr_set_file_args ua; 2200 struct sys_extattr_set_file_args ua;
2125 2201
2126 NETBSD32TOP_UAP(path, const char); 2202 NETBSD32TOP_UAP(path, const char);
2127 NETBSD32TO64_UAP(attrnamespace); 2203 NETBSD32TO64_UAP(attrnamespace);
2128 NETBSD32TOP_UAP(attrname, const char); 2204 NETBSD32TOP_UAP(attrname, const char);
2129 NETBSD32TOP_UAP(data, const void); 2205 NETBSD32TOP_UAP(data, const void);
2130 NETBSD32TOX_UAP(nbytes, size_t); 2206 NETBSD32TOX_UAP(nbytes, size_t);
 2207
2131 return sys_extattr_set_file(l, &ua, retval); 2208 return sys_extattr_set_file(l, &ua, retval);
2132} 2209}
2133 2210
2134int 2211int
2135netbsd32_extattr_set_link(struct lwp *l, const struct netbsd32_extattr_set_link_args *uap, register_t *retval) 2212netbsd32_extattr_set_link(struct lwp *l, const struct netbsd32_extattr_set_link_args *uap, register_t *retval)
2136{ 2213{
2137 /* { 2214 /* {
2138 syscallarg(const netbsd32_charp) path; 2215 syscallarg(const netbsd32_charp) path;
2139 syscallarg(int) attrnamespace; 2216 syscallarg(int) attrnamespace;
2140 syscallarg(const netbsd32_charp) attrname; 2217 syscallarg(const netbsd32_charp) attrname;
2141 syscallarg(const netbsd32_voidp) data; 2218 syscallarg(const netbsd32_voidp) data;
2142 syscallarg(netbsd32_size_t) nbytes; 2219 syscallarg(netbsd32_size_t) nbytes;
2143 } */ 2220 } */
2144 struct sys_extattr_set_link_args ua; 2221 struct sys_extattr_set_link_args ua;
2145 2222
2146 NETBSD32TOP_UAP(path, const char); 2223 NETBSD32TOP_UAP(path, const char);
2147 NETBSD32TO64_UAP(attrnamespace); 2224 NETBSD32TO64_UAP(attrnamespace);
2148 NETBSD32TOP_UAP(attrname, const char); 2225 NETBSD32TOP_UAP(attrname, const char);
2149 NETBSD32TOP_UAP(data, const void); 2226 NETBSD32TOP_UAP(data, const void);
2150 NETBSD32TOX_UAP(nbytes, size_t); 2227 NETBSD32TOX_UAP(nbytes, size_t);
 2228
2151 return sys_extattr_set_link(l, &ua, retval); 2229 return sys_extattr_set_link(l, &ua, retval);
2152} 2230}
2153 2231
2154int 2232int
2155netbsd32_extattr_get_fd(struct lwp *l, const struct netbsd32_extattr_get_fd_args *uap, register_t *retval) 2233netbsd32_extattr_get_fd(struct lwp *l, const struct netbsd32_extattr_get_fd_args *uap, register_t *retval)
2156{ 2234{
2157 /* { 2235 /* {
2158 syscallarg(int) fd; 2236 syscallarg(int) fd;
2159 syscallarg(int) attrnamespace; 2237 syscallarg(int) attrnamespace;
2160 syscallarg(const netbsd32_charp) attrname; 2238 syscallarg(const netbsd32_charp) attrname;
2161 syscallarg(netbsd32_voidp) data; 2239 syscallarg(netbsd32_voidp) data;
2162 syscallarg(netbsd32_size_t) nbytes; 2240 syscallarg(netbsd32_size_t) nbytes;
2163 } */ 2241 } */
2164 struct sys_extattr_get_fd_args ua; 2242 struct sys_extattr_get_fd_args ua;
2165 2243
2166 NETBSD32TO64_UAP(fd); 2244 NETBSD32TO64_UAP(fd);
2167 NETBSD32TO64_UAP(attrnamespace); 2245 NETBSD32TO64_UAP(attrnamespace);
2168 NETBSD32TOP_UAP(attrname, const char); 2246 NETBSD32TOP_UAP(attrname, const char);
2169 NETBSD32TOP_UAP(data, void); 2247 NETBSD32TOP_UAP(data, void);
2170 NETBSD32TOX_UAP(nbytes, size_t); 2248 NETBSD32TOX_UAP(nbytes, size_t);
 2249
2171 return sys_extattr_get_fd(l, &ua, retval); 2250 return sys_extattr_get_fd(l, &ua, retval);
2172} 2251}
2173 2252
2174int 2253int
2175netbsd32_extattr_get_file(struct lwp *l, const struct netbsd32_extattr_get_file_args *uap, register_t *retval) 2254netbsd32_extattr_get_file(struct lwp *l, const struct netbsd32_extattr_get_file_args *uap, register_t *retval)
2176{ 2255{
2177 /* { 2256 /* {
2178 syscallarg(const netbsd32_charp) path; 2257 syscallarg(const netbsd32_charp) path;
2179 syscallarg(int) attrnamespace; 2258 syscallarg(int) attrnamespace;
2180 syscallarg(const netbsd32_charp) attrname; 2259 syscallarg(const netbsd32_charp) attrname;
2181 syscallarg(netbsd32_voidp) data; 2260 syscallarg(netbsd32_voidp) data;
2182 syscallarg(netbsd32_size_t) nbytes; 2261 syscallarg(netbsd32_size_t) nbytes;
2183 } */ 2262 } */
2184 struct sys_extattr_get_file_args ua; 2263 struct sys_extattr_get_file_args ua;
2185 2264
2186 NETBSD32TOP_UAP(path, const char); 2265 NETBSD32TOP_UAP(path, const char);
2187 NETBSD32TO64_UAP(attrnamespace); 2266 NETBSD32TO64_UAP(attrnamespace);
2188 NETBSD32TOP_UAP(attrname, const char); 2267 NETBSD32TOP_UAP(attrname, const char);
2189 NETBSD32TOP_UAP(data, void); 2268 NETBSD32TOP_UAP(data, void);
2190 NETBSD32TOX_UAP(nbytes, size_t); 2269 NETBSD32TOX_UAP(nbytes, size_t);
 2270
2191 return sys_extattr_get_file(l, &ua, retval); 2271 return sys_extattr_get_file(l, &ua, retval);
2192} 2272}
2193 2273
2194int 2274int
2195netbsd32_extattr_get_link(struct lwp *l, const struct netbsd32_extattr_get_link_args *uap, register_t *retval) 2275netbsd32_extattr_get_link(struct lwp *l, const struct netbsd32_extattr_get_link_args *uap, register_t *retval)
2196{ 2276{
2197 /* { 2277 /* {
2198 syscallarg(const netbsd32_charp) path; 2278 syscallarg(const netbsd32_charp) path;
2199 syscallarg(int) attrnamespace; 2279 syscallarg(int) attrnamespace;
2200 syscallarg(const netbsd32_charp) attrname; 2280 syscallarg(const netbsd32_charp) attrname;
2201 syscallarg(netbsd32_voidp) data; 2281 syscallarg(netbsd32_voidp) data;
2202 syscallarg(netbsd32_size_t) nbytes; 2282 syscallarg(netbsd32_size_t) nbytes;
2203 } */ 2283 } */
2204 struct sys_extattr_get_link_args ua; 2284 struct sys_extattr_get_link_args ua;
2205 2285
2206 NETBSD32TOP_UAP(path, const char); 2286 NETBSD32TOP_UAP(path, const char);
2207 NETBSD32TO64_UAP(attrnamespace); 2287 NETBSD32TO64_UAP(attrnamespace);
2208 NETBSD32TOP_UAP(attrname, const char); 2288 NETBSD32TOP_UAP(attrname, const char);
2209 NETBSD32TOP_UAP(data, void); 2289 NETBSD32TOP_UAP(data, void);
2210 NETBSD32TOX_UAP(nbytes, size_t); 2290 NETBSD32TOX_UAP(nbytes, size_t);
 2291
2211 return sys_extattr_get_link(l, &ua, retval); 2292 return sys_extattr_get_link(l, &ua, retval);
2212} 2293}
2213 2294
2214int 2295int
2215netbsd32_extattr_delete_fd(struct lwp *l, const struct netbsd32_extattr_delete_fd_args *uap, register_t *retval) 2296netbsd32_extattr_delete_fd(struct lwp *l, const struct netbsd32_extattr_delete_fd_args *uap, register_t *retval)
2216{ 2297{
2217 /* { 2298 /* {
2218 syscallarg(int) fd; 2299 syscallarg(int) fd;
2219 syscallarg(int) attrnamespace; 2300 syscallarg(int) attrnamespace;
2220 syscallarg(const netbsd32_charp) attrname; 2301 syscallarg(const netbsd32_charp) attrname;
2221 } */ 2302 } */
2222 struct sys_extattr_delete_fd_args ua; 2303 struct sys_extattr_delete_fd_args ua;
2223 2304
2224 NETBSD32TO64_UAP(fd); 2305 NETBSD32TO64_UAP(fd);
2225 NETBSD32TO64_UAP(attrnamespace); 2306 NETBSD32TO64_UAP(attrnamespace);
2226 NETBSD32TOP_UAP(attrname, const char); 2307 NETBSD32TOP_UAP(attrname, const char);
 2308
2227 return sys_extattr_delete_fd(l, &ua, retval); 2309 return sys_extattr_delete_fd(l, &ua, retval);
2228} 2310}
2229 2311
2230int 2312int
2231netbsd32_extattr_delete_file(struct lwp *l, const struct netbsd32_extattr_delete_file_args *uap, register_t *retval) 2313netbsd32_extattr_delete_file(struct lwp *l, const struct netbsd32_extattr_delete_file_args *uap, register_t *retval)
2232{ 2314{
2233 /* { 2315 /* {
2234 syscallarg(const netbsd32_charp) path; 2316 syscallarg(const netbsd32_charp) path;
2235 syscallarg(int) attrnamespace; 2317 syscallarg(int) attrnamespace;
2236 syscallarg(const netbsd32_charp) attrname; 2318 syscallarg(const netbsd32_charp) attrname;
2237 } */ 2319 } */
2238 struct sys_extattr_delete_file_args ua; 2320 struct sys_extattr_delete_file_args ua;
2239 2321
2240 NETBSD32TOP_UAP(path, const char); 2322 NETBSD32TOP_UAP(path, const char);
2241 NETBSD32TO64_UAP(attrnamespace); 2323 NETBSD32TO64_UAP(attrnamespace);
2242 NETBSD32TOP_UAP(attrname, const char); 2324 NETBSD32TOP_UAP(attrname, const char);
 2325
2243 return sys_extattr_delete_file(l, &ua, retval); 2326 return sys_extattr_delete_file(l, &ua, retval);
2244} 2327}
2245 2328
2246int 2329int
2247netbsd32_extattr_delete_link(struct lwp *l, const struct netbsd32_extattr_delete_link_args *uap, register_t *retval) 2330netbsd32_extattr_delete_link(struct lwp *l, const struct netbsd32_extattr_delete_link_args *uap, register_t *retval)
2248{ 2331{
2249 /* { 2332 /* {
2250 syscallarg(const netbsd32_charp) path; 2333 syscallarg(const netbsd32_charp) path;
2251 syscallarg(int) attrnamespace; 2334 syscallarg(int) attrnamespace;
2252 syscallarg(const netbsd32_charp) attrname; 2335 syscallarg(const netbsd32_charp) attrname;
2253 } */ 2336 } */
2254 struct sys_extattr_delete_link_args ua; 2337 struct sys_extattr_delete_link_args ua;
2255 2338
2256 NETBSD32TOP_UAP(path, const char); 2339 NETBSD32TOP_UAP(path, const char);
2257 NETBSD32TO64_UAP(attrnamespace); 2340 NETBSD32TO64_UAP(attrnamespace);
2258 NETBSD32TOP_UAP(attrname, const char); 2341 NETBSD32TOP_UAP(attrname, const char);
 2342
2259 return sys_extattr_delete_link(l, &ua, retval); 2343 return sys_extattr_delete_link(l, &ua, retval);
2260} 2344}
2261 2345
2262int 2346int
2263netbsd32_extattr_list_fd(struct lwp *l, const struct netbsd32_extattr_list_fd_args *uap, register_t *retval) 2347netbsd32_extattr_list_fd(struct lwp *l, const struct netbsd32_extattr_list_fd_args *uap, register_t *retval)
2264{ 2348{
2265 /* { 2349 /* {
2266 syscallarg(int) fd; 2350 syscallarg(int) fd;
2267 syscallarg(int) attrnamespace; 2351 syscallarg(int) attrnamespace;
2268 syscallarg(netbsd32_voidp) data; 2352 syscallarg(netbsd32_voidp) data;
2269 syscallarg(netbsd32_size_t) nbytes; 2353 syscallarg(netbsd32_size_t) nbytes;
2270 } */ 2354 } */
2271 struct sys_extattr_list_fd_args ua; 2355 struct sys_extattr_list_fd_args ua;
2272 2356
2273 NETBSD32TO64_UAP(fd); 2357 NETBSD32TO64_UAP(fd);
2274 NETBSD32TO64_UAP(attrnamespace); 2358 NETBSD32TO64_UAP(attrnamespace);
2275 NETBSD32TOP_UAP(data, void); 2359 NETBSD32TOP_UAP(data, void);
2276 NETBSD32TOX_UAP(nbytes, size_t); 2360 NETBSD32TOX_UAP(nbytes, size_t);
 2361
2277 return sys_extattr_list_fd(l, &ua, retval); 2362 return sys_extattr_list_fd(l, &ua, retval);
2278} 2363}
2279 2364
2280int 2365int
2281netbsd32_extattr_list_file(struct lwp *l, const struct netbsd32_extattr_list_file_args *uap, register_t *retval) 2366netbsd32_extattr_list_file(struct lwp *l, const struct netbsd32_extattr_list_file_args *uap, register_t *retval)
2282{ 2367{
2283 /* { 2368 /* {
2284 syscallarg(const netbsd32_charp) path; 2369 syscallarg(const netbsd32_charp) path;
2285 syscallarg(int) attrnamespace; 2370 syscallarg(int) attrnamespace;
2286 syscallarg(netbsd32_voidp) data; 2371 syscallarg(netbsd32_voidp) data;
2287 syscallarg(netbsd32_size_t) nbytes; 2372 syscallarg(netbsd32_size_t) nbytes;
2288 } */ 2373 } */
2289 struct sys_extattr_list_file_args ua; 2374 struct sys_extattr_list_file_args ua;
2290 2375
2291 NETBSD32TOP_UAP(path, const char); 2376 NETBSD32TOP_UAP(path, const char);
2292 NETBSD32TO64_UAP(attrnamespace); 2377 NETBSD32TO64_UAP(attrnamespace);
2293 NETBSD32TOP_UAP(data, void); 2378 NETBSD32TOP_UAP(data, void);
2294 NETBSD32TOX_UAP(nbytes, size_t); 2379 NETBSD32TOX_UAP(nbytes, size_t);
 2380
2295 return sys_extattr_list_file(l, &ua, retval); 2381 return sys_extattr_list_file(l, &ua, retval);
2296} 2382}
2297 2383
2298int 2384int
2299netbsd32_extattr_list_link(struct lwp *l, const struct netbsd32_extattr_list_link_args *uap, register_t *retval) 2385netbsd32_extattr_list_link(struct lwp *l, const struct netbsd32_extattr_list_link_args *uap, register_t *retval)
2300{ 2386{
2301 /* { 2387 /* {
2302 syscallarg(const netbsd32_charp) path; 2388 syscallarg(const netbsd32_charp) path;
2303 syscallarg(int) attrnamespace; 2389 syscallarg(int) attrnamespace;
2304 syscallarg(netbsd32_voidp) data; 2390 syscallarg(netbsd32_voidp) data;
2305 syscallarg(netbsd32_size_t) nbytes; 2391 syscallarg(netbsd32_size_t) nbytes;
2306 } */ 2392 } */
2307 struct sys_extattr_list_link_args ua; 2393 struct sys_extattr_list_link_args ua;
2308 2394
2309 NETBSD32TOP_UAP(path, const char); 2395 NETBSD32TOP_UAP(path, const char);
2310 NETBSD32TO64_UAP(attrnamespace); 2396 NETBSD32TO64_UAP(attrnamespace);
2311 NETBSD32TOP_UAP(data, void); 2397 NETBSD32TOP_UAP(data, void);
2312 NETBSD32TOX_UAP(nbytes, size_t); 2398 NETBSD32TOX_UAP(nbytes, size_t);
 2399
2313 return sys_extattr_list_link(l, &ua, retval); 2400 return sys_extattr_list_link(l, &ua, retval);
2314} 2401}
2315 2402
2316int 2403int
2317netbsd32_mlockall(struct lwp *l, const struct netbsd32_mlockall_args *uap, register_t *retval) 2404netbsd32_mlockall(struct lwp *l, const struct netbsd32_mlockall_args *uap, register_t *retval)
2318{ 2405{
2319 /* { 2406 /* {
2320 syscallarg(int) flags; 2407 syscallarg(int) flags;
2321 } */ 2408 } */
2322 struct sys_mlockall_args ua; 2409 struct sys_mlockall_args ua;
2323 2410
2324 NETBSD32TO64_UAP(flags); 2411 NETBSD32TO64_UAP(flags);
2325 return (sys_mlockall(l, &ua, retval)); 2412
 2413 return sys_mlockall(l, &ua, retval);
2326} 2414}
2327 2415
2328int 2416int
2329netbsd32___clone(struct lwp *l, const struct netbsd32___clone_args *uap, register_t *retval) 2417netbsd32___clone(struct lwp *l, const struct netbsd32___clone_args *uap, register_t *retval)
2330{ 2418{
2331 /* { 2419 /* {
2332 syscallarg(int) flags; 2420 syscallarg(int) flags;
2333 syscallarg(netbsd32_voidp) stack; 2421 syscallarg(netbsd32_voidp) stack;
2334 } */ 2422 } */
2335 struct sys___clone_args ua; 2423 struct sys___clone_args ua;
2336 2424
2337 NETBSD32TO64_UAP(flags); 2425 NETBSD32TO64_UAP(flags);
2338 NETBSD32TOP_UAP(stack, void); 2426 NETBSD32TOP_UAP(stack, void);
 2427
2339 return sys___clone(l, &ua, retval); 2428 return sys___clone(l, &ua, retval);
2340} 2429}
2341 2430
2342int 2431int
2343netbsd32_fsync_range(struct lwp *l, const struct netbsd32_fsync_range_args *uap, register_t *retval) 2432netbsd32_fsync_range(struct lwp *l, const struct netbsd32_fsync_range_args *uap, register_t *retval)
2344{ 2433{
2345 /* { 2434 /* {
2346 syscallarg(int) fd; 2435 syscallarg(int) fd;
2347 syscallarg(int) flags; 2436 syscallarg(int) flags;
2348 syscallarg(off_t) start; 2437 syscallarg(off_t) start;
2349 syscallarg(off_t) length; 2438 syscallarg(off_t) length;
2350 } */ 2439 } */
2351 struct sys_fsync_range_args ua; 2440 struct sys_fsync_range_args ua;
2352 2441
2353 NETBSD32TO64_UAP(fd); 2442 NETBSD32TO64_UAP(fd);
2354 NETBSD32TO64_UAP(flags); 2443 NETBSD32TO64_UAP(flags);
2355 NETBSD32TO64_UAP(start); 2444 NETBSD32TO64_UAP(start);
2356 NETBSD32TO64_UAP(length); 2445 NETBSD32TO64_UAP(length);
2357 return (sys_fsync_range(l, &ua, retval)); 2446
 2447 return sys_fsync_range(l, &ua, retval);
2358} 2448}
2359 2449
2360int 2450int
2361netbsd32_rasctl(struct lwp *l, const struct netbsd32_rasctl_args *uap, register_t *retval) 2451netbsd32_rasctl(struct lwp *l, const struct netbsd32_rasctl_args *uap, register_t *retval)
2362{ 2452{
2363 /* { 2453 /* {
2364 syscallarg(netbsd32_voidp) addr; 2454 syscallarg(netbsd32_voidp) addr;
2365 syscallarg(netbsd32_size_t) len; 2455 syscallarg(netbsd32_size_t) len;
2366 syscallarg(int) op; 2456 syscallarg(int) op;
2367 } */ 2457 } */
2368 struct sys_rasctl_args ua; 2458 struct sys_rasctl_args ua;
2369 2459
2370 NETBSD32TOP_UAP(addr, void *); 2460 NETBSD32TOP_UAP(addr, void *);
2371 NETBSD32TOX_UAP(len, size_t); 2461 NETBSD32TOX_UAP(len, size_t);
2372 NETBSD32TO64_UAP(op); 2462 NETBSD32TO64_UAP(op);
 2463
2373 return sys_rasctl(l, &ua, retval); 2464 return sys_rasctl(l, &ua, retval);
2374} 2465}
2375 2466
2376int 2467int
2377netbsd32_setxattr(struct lwp *l, const struct netbsd32_setxattr_args *uap, register_t *retval) 2468netbsd32_setxattr(struct lwp *l, const struct netbsd32_setxattr_args *uap, register_t *retval)
2378{ 2469{
2379 /* { 2470 /* {
2380 syscallarg(const netbsd32_charp) path; 2471 syscallarg(const netbsd32_charp) path;
2381 syscallarg(const netbsd32_charp) name; 2472 syscallarg(const netbsd32_charp) name;
2382 syscallarg(netbsd32_voidp) value; 2473 syscallarg(netbsd32_voidp) value;
2383 syscallarg(netbsd32_size_t) size; 2474 syscallarg(netbsd32_size_t) size;
2384 syscallarg(int) flags; 2475 syscallarg(int) flags;
2385 } */ 2476 } */
2386 struct sys_setxattr_args ua; 2477 struct sys_setxattr_args ua;
 2478
2387 NETBSD32TOP_UAP(path, const char); 2479 NETBSD32TOP_UAP(path, const char);
2388 NETBSD32TOP_UAP(name, const char); 2480 NETBSD32TOP_UAP(name, const char);
2389 NETBSD32TOP_UAP(value, void); 2481 NETBSD32TOP_UAP(value, void);
2390 NETBSD32TOX_UAP(size, size_t); 2482 NETBSD32TOX_UAP(size, size_t);
2391 NETBSD32TO64_UAP(flags); 2483 NETBSD32TO64_UAP(flags);
 2484
2392 return sys_setxattr(l, &ua, retval); 2485 return sys_setxattr(l, &ua, retval);
2393} 2486}
2394 2487
2395int 2488int
2396netbsd32_lsetxattr(struct lwp *l, const struct netbsd32_lsetxattr_args *uap, register_t *retval) 2489netbsd32_lsetxattr(struct lwp *l, const struct netbsd32_lsetxattr_args *uap, register_t *retval)
2397{ 2490{
2398 /* { 2491 /* {
2399 syscallarg(const netbsd32_charp) path; 2492 syscallarg(const netbsd32_charp) path;
2400 syscallarg(const netbsd32_charp) name; 2493 syscallarg(const netbsd32_charp) name;
2401 syscallarg(netbsd32_voidp) value; 2494 syscallarg(netbsd32_voidp) value;
2402 syscallarg(netbsd32_size_t) size; 2495 syscallarg(netbsd32_size_t) size;
2403 syscallarg(int) flags; 2496 syscallarg(int) flags;
2404 } */ 2497 } */
2405 struct sys_lsetxattr_args ua; 2498 struct sys_lsetxattr_args ua;
 2499
2406 NETBSD32TOP_UAP(path, const char); 2500 NETBSD32TOP_UAP(path, const char);
2407 NETBSD32TOP_UAP(name, const char); 2501 NETBSD32TOP_UAP(name, const char);
2408 NETBSD32TOP_UAP(value, void); 2502 NETBSD32TOP_UAP(value, void);
2409 NETBSD32TOX_UAP(size, size_t); 2503 NETBSD32TOX_UAP(size, size_t);
2410 NETBSD32TO64_UAP(flags); 2504 NETBSD32TO64_UAP(flags);
 2505
2411 return sys_lsetxattr(l, &ua, retval); 2506 return sys_lsetxattr(l, &ua, retval);
2412} 2507}
2413 2508
2414int 2509int
2415netbsd32_fsetxattr(struct lwp *l, const struct netbsd32_fsetxattr_args *uap, register_t *retval) 2510netbsd32_fsetxattr(struct lwp *l, const struct netbsd32_fsetxattr_args *uap, register_t *retval)
2416{ 2511{
2417 /* { 2512 /* {
2418 syscallarg(int) fd; 2513 syscallarg(int) fd;
2419 syscallarg(const netbsd32_charp) name; 2514 syscallarg(const netbsd32_charp) name;
2420 syscallarg(netbsd32_voidp) value; 2515 syscallarg(netbsd32_voidp) value;
2421 syscallarg(netbsd32_size_t) size; 2516 syscallarg(netbsd32_size_t) size;
2422 syscallarg(int) flags; 2517 syscallarg(int) flags;
2423 } */ 2518 } */
2424 struct sys_fsetxattr_args ua; 2519 struct sys_fsetxattr_args ua;
 2520
2425 NETBSD32TO64_UAP(fd); 2521 NETBSD32TO64_UAP(fd);
2426 NETBSD32TOP_UAP(name, const char); 2522 NETBSD32TOP_UAP(name, const char);
2427 NETBSD32TOP_UAP(value, void); 2523 NETBSD32TOP_UAP(value, void);
2428 NETBSD32TOX_UAP(size, size_t); 2524 NETBSD32TOX_UAP(size, size_t);
2429 NETBSD32TO64_UAP(flags); 2525 NETBSD32TO64_UAP(flags);
 2526
2430 return sys_fsetxattr(l, &ua, retval); 2527 return sys_fsetxattr(l, &ua, retval);
2431} 2528}
2432 2529
2433int 2530int
2434netbsd32_getxattr(struct lwp *l, const struct netbsd32_getxattr_args *uap, register_t *retval) 2531netbsd32_getxattr(struct lwp *l, const struct netbsd32_getxattr_args *uap, register_t *retval)
2435{ 2532{
2436 /* { 2533 /* {
2437 syscallarg(const netbsd32_charp) path; 2534 syscallarg(const netbsd32_charp) path;
2438 syscallarg(const netbsd32_charp) name; 2535 syscallarg(const netbsd32_charp) name;
2439 syscallarg(netbsd32_voidp) value; 2536 syscallarg(netbsd32_voidp) value;
2440 syscallarg(netbsd32_size_t) size; 2537 syscallarg(netbsd32_size_t) size;
2441 } */ 2538 } */
2442 struct sys_getxattr_args ua; 2539 struct sys_getxattr_args ua;
 2540
2443 NETBSD32TOP_UAP(path, const char); 2541 NETBSD32TOP_UAP(path, const char);
2444 NETBSD32TOP_UAP(name, const char); 2542 NETBSD32TOP_UAP(name, const char);
2445 NETBSD32TOP_UAP(value, void); 2543 NETBSD32TOP_UAP(value, void);
2446 NETBSD32TOX_UAP(size, size_t); 2544 NETBSD32TOX_UAP(size, size_t);
 2545
2447 return sys_getxattr(l, &ua, retval); 2546 return sys_getxattr(l, &ua, retval);
2448} 2547}
2449 2548
2450int 2549int
2451netbsd32_lgetxattr(struct lwp *l, const struct netbsd32_lgetxattr_args *uap, register_t *retval) 2550netbsd32_lgetxattr(struct lwp *l, const struct netbsd32_lgetxattr_args *uap, register_t *retval)
2452{ 2551{
2453 /* { 2552 /* {
2454 syscallarg(const netbsd32_charp) path; 2553 syscallarg(const netbsd32_charp) path;
2455 syscallarg(const netbsd32_charp) name; 2554 syscallarg(const netbsd32_charp) name;
2456 syscallarg(netbsd32_voidp) value; 2555 syscallarg(netbsd32_voidp) value;
2457 syscallarg(netbsd32_size_t) size; 2556 syscallarg(netbsd32_size_t) size;
2458 } */ 2557 } */
2459 struct sys_lgetxattr_args ua; 2558 struct sys_lgetxattr_args ua;
 2559
2460 NETBSD32TOP_UAP(path, const char); 2560 NETBSD32TOP_UAP(path, const char);
2461 NETBSD32TOP_UAP(name, const char); 2561 NETBSD32TOP_UAP(name, const char);
2462 NETBSD32TOP_UAP(value, void); 2562 NETBSD32TOP_UAP(value, void);
2463 NETBSD32TOX_UAP(size, size_t); 2563 NETBSD32TOX_UAP(size, size_t);
 2564
2464 return sys_lgetxattr(l, &ua, retval); 2565 return sys_lgetxattr(l, &ua, retval);
2465} 2566}
2466 2567
2467int 2568int
2468netbsd32_fgetxattr(struct lwp *l, const struct netbsd32_fgetxattr_args *uap, register_t *retval) 2569netbsd32_fgetxattr(struct lwp *l, const struct netbsd32_fgetxattr_args *uap, register_t *retval)
2469{ 2570{
2470 /* { 2571 /* {
2471 syscallarg(int) fd; 2572 syscallarg(int) fd;
2472 syscallarg(const netbsd32_charp) name; 2573 syscallarg(const netbsd32_charp) name;
2473 syscallarg(netbsd32_voidp) value; 2574 syscallarg(netbsd32_voidp) value;
2474 syscallarg(netbsd32_size_t) size; 2575 syscallarg(netbsd32_size_t) size;
2475 } */ 2576 } */
2476 struct sys_fgetxattr_args ua; 2577 struct sys_fgetxattr_args ua;
 2578
2477 NETBSD32TO64_UAP(fd); 2579 NETBSD32TO64_UAP(fd);
2478 NETBSD32TOP_UAP(name, const char); 2580 NETBSD32TOP_UAP(name, const char);
2479 NETBSD32TOP_UAP(value, void); 2581 NETBSD32TOP_UAP(value, void);
2480 NETBSD32TOX_UAP(size, size_t); 2582 NETBSD32TOX_UAP(size, size_t);
 2583
2481 return sys_fgetxattr(l, &ua, retval); 2584 return sys_fgetxattr(l, &ua, retval);
2482} 2585}
2483 2586
2484int 2587int
2485netbsd32_listxattr(struct lwp *l, const struct netbsd32_listxattr_args *uap, register_t *retval) 2588netbsd32_listxattr(struct lwp *l, const struct netbsd32_listxattr_args *uap, register_t *retval)
2486{ 2589{
2487 /* { 2590 /* {
2488 syscallarg(const netbsd32_charp) path; 2591 syscallarg(const netbsd32_charp) path;
2489 syscallarg(netbsd32_charp) list; 2592 syscallarg(netbsd32_charp) list;
2490 syscallarg(netbsd32_size_t) size; 2593 syscallarg(netbsd32_size_t) size;
2491 } */ 2594 } */
2492 struct sys_listxattr_args ua; 2595 struct sys_listxattr_args ua;
 2596
2493 NETBSD32TOP_UAP(path, const char); 2597 NETBSD32TOP_UAP(path, const char);
2494 NETBSD32TOP_UAP(list, char); 2598 NETBSD32TOP_UAP(list, char);
2495 NETBSD32TOX_UAP(size, size_t); 2599 NETBSD32TOX_UAP(size, size_t);
 2600
2496 return sys_listxattr(l, &ua, retval); 2601 return sys_listxattr(l, &ua, retval);
2497} 2602}
2498 2603
2499int 2604int
2500netbsd32_llistxattr(struct lwp *l, const struct netbsd32_llistxattr_args *uap, register_t *retval) 2605netbsd32_llistxattr(struct lwp *l, const struct netbsd32_llistxattr_args *uap, register_t *retval)
2501{ 2606{
2502 /* { 2607 /* {
2503 syscallarg(const netbsd32_charp) path; 2608 syscallarg(const netbsd32_charp) path;
2504 syscallarg(netbsd32_charp) list; 2609 syscallarg(netbsd32_charp) list;
2505 syscallarg(netbsd32_size_t) size; 2610 syscallarg(netbsd32_size_t) size;
2506 } */ 2611 } */
2507 struct sys_llistxattr_args ua; 2612 struct sys_llistxattr_args ua;
 2613
2508 NETBSD32TOP_UAP(path, const char); 2614 NETBSD32TOP_UAP(path, const char);
2509 NETBSD32TOP_UAP(list, char); 2615 NETBSD32TOP_UAP(list, char);
2510 NETBSD32TOX_UAP(size, size_t); 2616 NETBSD32TOX_UAP(size, size_t);
 2617
2511 return sys_llistxattr(l, &ua, retval); 2618 return sys_llistxattr(l, &ua, retval);
2512} 2619}
2513 2620
2514int 2621int
2515netbsd32_flistxattr(struct lwp *l, const struct netbsd32_flistxattr_args *uap, register_t *retval) 2622netbsd32_flistxattr(struct lwp *l, const struct netbsd32_flistxattr_args *uap, register_t *retval)
2516{ 2623{
2517 /* { 2624 /* {
2518 syscallarg(int) fd; 2625 syscallarg(int) fd;
2519 syscallarg(netbsd32_charp) list; 2626 syscallarg(netbsd32_charp) list;
2520 syscallarg(netbsd32_size_t) size; 2627 syscallarg(netbsd32_size_t) size;
2521 } */ 2628 } */
2522 struct sys_flistxattr_args ua; 2629 struct sys_flistxattr_args ua;
 2630
2523 NETBSD32TO64_UAP(fd); 2631 NETBSD32TO64_UAP(fd);
2524 NETBSD32TOP_UAP(list, char); 2632 NETBSD32TOP_UAP(list, char);
2525 NETBSD32TOX_UAP(size, size_t); 2633 NETBSD32TOX_UAP(size, size_t);
 2634
2526 return sys_flistxattr(l, &ua, retval); 2635 return sys_flistxattr(l, &ua, retval);
2527} 2636}
2528 2637
2529int 2638int
2530netbsd32_removexattr(struct lwp *l, const struct netbsd32_removexattr_args *uap, register_t *retval) 2639netbsd32_removexattr(struct lwp *l, const struct netbsd32_removexattr_args *uap, register_t *retval)
2531{ 2640{
2532 /* { 2641 /* {
2533 syscallarg(const netbsd32_charp) path; 2642 syscallarg(const netbsd32_charp) path;
2534 syscallarg(const netbsd32_charp) name; 2643 syscallarg(const netbsd32_charp) name;
2535 } */ 2644 } */
2536 struct sys_removexattr_args ua; 2645 struct sys_removexattr_args ua;
 2646
2537 NETBSD32TOP_UAP(path, const char); 2647 NETBSD32TOP_UAP(path, const char);
2538 NETBSD32TOP_UAP(name, const char); 2648 NETBSD32TOP_UAP(name, const char);
 2649
2539 return sys_removexattr(l, &ua, retval); 2650 return sys_removexattr(l, &ua, retval);
2540} 2651}
2541 2652
2542int 2653int
2543netbsd32_lremovexattr(struct lwp *l, const struct netbsd32_lremovexattr_args *uap, register_t *retval) 2654netbsd32_lremovexattr(struct lwp *l, const struct netbsd32_lremovexattr_args *uap, register_t *retval)
2544{ 2655{
2545 /* { 2656 /* {
2546 syscallarg(const netbsd32_charp) path; 2657 syscallarg(const netbsd32_charp) path;
2547 syscallarg(const netbsd32_charp) name; 2658 syscallarg(const netbsd32_charp) name;
2548 } */ 2659 } */
2549 struct sys_lremovexattr_args ua; 2660 struct sys_lremovexattr_args ua;
2550 NETBSD32TOP_UAP(path, const char); 2661 NETBSD32TOP_UAP(path, const char);
2551 NETBSD32TOP_UAP(name, const char); 2662 NETBSD32TOP_UAP(name, const char);
2552 return sys_lremovexattr(l, &ua, retval); 2663 return sys_lremovexattr(l, &ua, retval);
2553} 2664}
2554 2665
2555int 2666int
2556netbsd32_fremovexattr(struct lwp *l, const struct netbsd32_fremovexattr_args *uap, register_t *retval) 2667netbsd32_fremovexattr(struct lwp *l, const struct netbsd32_fremovexattr_args *uap, register_t *retval)
2557{ 2668{
2558 /* { 2669 /* {
2559 syscallarg(int) fd; 2670 syscallarg(int) fd;
2560 syscallarg(const netbsd32_charp) name; 2671 syscallarg(const netbsd32_charp) name;
2561 } */ 2672 } */
2562 struct sys_fremovexattr_args ua; 2673 struct sys_fremovexattr_args ua;
 2674
2563 NETBSD32TO64_UAP(fd); 2675 NETBSD32TO64_UAP(fd);
2564 NETBSD32TOP_UAP(name, const char); 2676 NETBSD32TOP_UAP(name, const char);
 2677
2565 return sys_fremovexattr(l, &ua, retval); 2678 return sys_fremovexattr(l, &ua, retval);
2566} 2679}
2567 2680
2568int 2681int
2569netbsd32___posix_fadvise50(struct lwp *l, 2682netbsd32___posix_fadvise50(struct lwp *l,
2570 const struct netbsd32___posix_fadvise50_args *uap, register_t *retval) 2683 const struct netbsd32___posix_fadvise50_args *uap, register_t *retval)
2571{ 2684{
2572 /* { 2685 /* {
2573 syscallarg(int) fd; 2686 syscallarg(int) fd;
2574 syscallarg(int) PAD; 2687 syscallarg(int) PAD;
2575 syscallarg(netbsd32_off_t) offset; 2688 syscallarg(netbsd32_off_t) offset;
2576 syscallarg(netbsd32_off_t) len; 2689 syscallarg(netbsd32_off_t) len;
2577 syscallarg(int) advice; 2690 syscallarg(int) advice;
@@ -2590,103 +2703,109 @@ netbsd32__sched_setparam(struct lwp *l, @@ -2590,103 +2703,109 @@ netbsd32__sched_setparam(struct lwp *l,
2590{ 2703{
2591 /* { 2704 /* {
2592 syscallarg(pid_t) pid; 2705 syscallarg(pid_t) pid;
2593 syscallarg(lwpid_t) lid; 2706 syscallarg(lwpid_t) lid;
2594 syscallarg(int) policy; 2707 syscallarg(int) policy;
2595 syscallarg(const netbsd32_sched_paramp_t) params; 2708 syscallarg(const netbsd32_sched_paramp_t) params;
2596 } */ 2709 } */
2597 struct sys__sched_setparam_args ua; 2710 struct sys__sched_setparam_args ua;
2598 2711
2599 NETBSD32TO64_UAP(pid); 2712 NETBSD32TO64_UAP(pid);
2600 NETBSD32TO64_UAP(lid); 2713 NETBSD32TO64_UAP(lid);
2601 NETBSD32TO64_UAP(policy); 2714 NETBSD32TO64_UAP(policy);
2602 NETBSD32TOP_UAP(params, const struct sched_param *); 2715 NETBSD32TOP_UAP(params, const struct sched_param *);
 2716
2603 return sys__sched_setparam(l, &ua, retval); 2717 return sys__sched_setparam(l, &ua, retval);
2604} 2718}
2605 2719
2606int 2720int
2607netbsd32__sched_getparam(struct lwp *l, 2721netbsd32__sched_getparam(struct lwp *l,
2608 const struct netbsd32__sched_getparam_args *uap, 2722 const struct netbsd32__sched_getparam_args *uap,
2609 register_t *retval) 2723 register_t *retval)
2610{ 2724{
2611 /* { 2725 /* {
2612 syscallarg(pid_t) pid; 2726 syscallarg(pid_t) pid;
2613 syscallarg(lwpid_t) lid; 2727 syscallarg(lwpid_t) lid;
2614 syscallarg(netbsd32_intp) policy; 2728 syscallarg(netbsd32_intp) policy;
2615 syscallarg(netbsd32_sched_paramp_t) params; 2729 syscallarg(netbsd32_sched_paramp_t) params;
2616 } */ 2730 } */
2617 struct sys__sched_getparam_args ua; 2731 struct sys__sched_getparam_args ua;
2618 2732
2619 NETBSD32TO64_UAP(pid); 2733 NETBSD32TO64_UAP(pid);
2620 NETBSD32TO64_UAP(lid); 2734 NETBSD32TO64_UAP(lid);
2621 NETBSD32TOP_UAP(policy, int *); 2735 NETBSD32TOP_UAP(policy, int *);
2622 NETBSD32TOP_UAP(params, struct sched_param *); 2736 NETBSD32TOP_UAP(params, struct sched_param *);
 2737
2623 return sys__sched_getparam(l, &ua, retval); 2738 return sys__sched_getparam(l, &ua, retval);
2624} 2739}
2625 2740
2626int 2741int
2627netbsd32__sched_setaffinity(struct lwp *l, 2742netbsd32__sched_setaffinity(struct lwp *l,
2628 const struct netbsd32__sched_setaffinity_args *uap, 2743 const struct netbsd32__sched_setaffinity_args *uap,
2629 register_t *retval) 2744 register_t *retval)
2630{ 2745{
2631 /* { 2746 /* {
2632 syscallarg(pid_t) pid; 2747 syscallarg(pid_t) pid;
2633 syscallarg(lwpid_t) lid; 2748 syscallarg(lwpid_t) lid;
2634 syscallarg(netbsd_size_t) size; 2749 syscallarg(netbsd_size_t) size;
2635 syscallarg(const netbsd32_cpusetp_t) cpuset; 2750 syscallarg(const netbsd32_cpusetp_t) cpuset;
2636 } */ 2751 } */
2637 struct sys__sched_setaffinity_args ua; 2752 struct sys__sched_setaffinity_args ua;
2638 2753
2639 NETBSD32TO64_UAP(pid); 2754 NETBSD32TO64_UAP(pid);
2640 NETBSD32TO64_UAP(lid); 2755 NETBSD32TO64_UAP(lid);
2641 NETBSD32TOX_UAP(size, size_t); 2756 NETBSD32TOX_UAP(size, size_t);
2642 NETBSD32TOP_UAP(cpuset, const cpuset_t *); 2757 NETBSD32TOP_UAP(cpuset, const cpuset_t *);
 2758
2643 return sys__sched_setaffinity(l, &ua, retval); 2759 return sys__sched_setaffinity(l, &ua, retval);
2644} 2760}
2645 2761
2646int 2762int
2647netbsd32__sched_getaffinity(struct lwp *l, 2763netbsd32__sched_getaffinity(struct lwp *l,
2648 const struct netbsd32__sched_getaffinity_args *uap, 2764 const struct netbsd32__sched_getaffinity_args *uap,
2649 register_t *retval) 2765 register_t *retval)
2650{ 2766{
2651 /* { 2767 /* {
2652 syscallarg(pid_t) pid; 2768 syscallarg(pid_t) pid;
2653 syscallarg(lwpid_t) lid; 2769 syscallarg(lwpid_t) lid;
2654 syscallarg(netbsd_size_t) size; 2770 syscallarg(netbsd_size_t) size;
2655 syscallarg(netbsd32_cpusetp_t) cpuset; 2771 syscallarg(netbsd32_cpusetp_t) cpuset;
2656 } */ 2772 } */
2657 struct sys__sched_getaffinity_args ua; 2773 struct sys__sched_getaffinity_args ua;
2658 2774
2659 NETBSD32TO64_UAP(pid); 2775 NETBSD32TO64_UAP(pid);
2660 NETBSD32TO64_UAP(lid); 2776 NETBSD32TO64_UAP(lid);
2661 NETBSD32TOX_UAP(size, size_t); 2777 NETBSD32TOX_UAP(size, size_t);
2662 NETBSD32TOP_UAP(cpuset, cpuset_t *); 2778 NETBSD32TOP_UAP(cpuset, cpuset_t *);
 2779
2663 return sys__sched_getaffinity(l, &ua, retval); 2780 return sys__sched_getaffinity(l, &ua, retval);
2664} 2781}
2665 2782
2666int 2783int
2667netbsd32__sched_protect(struct lwp *l, 2784netbsd32__sched_protect(struct lwp *l,
2668 const struct netbsd32__sched_protect_args *uap, 2785 const struct netbsd32__sched_protect_args *uap,
2669 register_t *retval) 2786 register_t *retval)
2670{ 2787{
2671 /* { 2788 /* {
2672 syscallarg(int) priority; 2789 syscallarg(int) priority;
2673 } */ 2790 } */
2674 struct sys__sched_protect_args ua; 2791 struct sys__sched_protect_args ua;
2675 2792
2676 NETBSD32TO64_UAP(priority); 2793 NETBSD32TO64_UAP(priority);
 2794
2677 return sys__sched_protect(l, &ua, retval); 2795 return sys__sched_protect(l, &ua, retval);
2678} 2796}
2679 2797
 2798// XXX new file
2680int 2799int
2681netbsd32_pipe2(struct lwp *l, const struct netbsd32_pipe2_args *uap, 2800netbsd32_pipe2(struct lwp *l, const struct netbsd32_pipe2_args *uap,
2682 register_t *retval) 2801 register_t *retval)
2683{ 2802{
2684 /* { 2803 /* {
2685 syscallarg(netbsd32_intp) fildes; 2804 syscallarg(netbsd32_intp) fildes;
2686 syscallarg(int) flags; 2805 syscallarg(int) flags;
2687 } */ 2806 } */
2688 int fd[2], error; 2807 int fd[2], error;
2689 2808
2690 error = pipe1(l, fd, SCARG(uap, flags)); 2809 error = pipe1(l, fd, SCARG(uap, flags));
2691 if (error != 0) 2810 if (error != 0)
2692 return error; 2811 return error;