netbsd32_netbsd.c revision 1.222 1 1.222 mrg /* $NetBSD: netbsd32_netbsd.c,v 1.222 2018/12/24 21:27:05 mrg Exp $ */
2 1.1 mrg
3 1.1 mrg /*
4 1.220 mrg * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green
5 1.1 mrg * All rights reserved.
6 1.1 mrg *
7 1.1 mrg * Redistribution and use in source and binary forms, with or without
8 1.1 mrg * modification, are permitted provided that the following conditions
9 1.1 mrg * are met:
10 1.1 mrg * 1. Redistributions of source code must retain the above copyright
11 1.1 mrg * notice, this list of conditions and the following disclaimer.
12 1.1 mrg * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 mrg * notice, this list of conditions and the following disclaimer in the
14 1.1 mrg * documentation and/or other materials provided with the distribution.
15 1.1 mrg *
16 1.1 mrg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1 mrg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1 mrg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1 mrg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1 mrg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 1.1 mrg * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 1.1 mrg * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 1.1 mrg * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 1.1 mrg * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 1.1 mrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1 mrg * SUCH DAMAGE.
27 1.1 mrg */
28 1.62 lukem
29 1.62 lukem #include <sys/cdefs.h>
30 1.222 mrg __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.222 2018/12/24 21:27:05 mrg Exp $");
31 1.220 mrg
32 1.220 mrg /*
33 1.220 mrg * below are all the standard NetBSD system calls, in the 32bit
34 1.220 mrg * environment, with the necessary conversions to 64bit before calling
35 1.220 mrg * the real syscall. anything that needs special attention is handled
36 1.220 mrg * elsewhere - this file should only contain structure assignment and
37 1.220 mrg * calls to the original function.
38 1.220 mrg */
39 1.1 mrg
40 1.58 mrg #if defined(_KERNEL_OPT)
41 1.28 eeh #include "opt_ddb.h"
42 1.6 eeh #include "opt_ntp.h"
43 1.204 christos #include "opt_ktrace.h"
44 1.20 eeh #include "opt_compat_netbsd.h"
45 1.7 drochner #include "opt_compat_43.h"
46 1.20 eeh #include "opt_sysv.h"
47 1.71 martin #include "opt_syscall_debug.h"
48 1.42 jdolecek #endif
49 1.42 jdolecek
50 1.1 mrg #include <sys/param.h>
51 1.1 mrg #include <sys/systm.h>
52 1.6 eeh #include <sys/kernel.h>
53 1.1 mrg #include <sys/mount.h>
54 1.1 mrg #include <sys/socket.h>
55 1.1 mrg #include <sys/sockio.h>
56 1.6 eeh #include <sys/socketvar.h>
57 1.6 eeh #include <sys/mbuf.h>
58 1.182 christos #include <sys/mman.h>
59 1.1 mrg #include <sys/stat.h>
60 1.184 manu #include <sys/swap.h>
61 1.1 mrg #include <sys/time.h>
62 1.4 eeh #include <sys/signalvar.h>
63 1.6 eeh #include <sys/ptrace.h>
64 1.6 eeh #include <sys/ktrace.h>
65 1.6 eeh #include <sys/trace.h>
66 1.6 eeh #include <sys/resourcevar.h>
67 1.6 eeh #include <sys/pool.h>
68 1.6 eeh #include <sys/file.h>
69 1.6 eeh #include <sys/filedesc.h>
70 1.6 eeh #include <sys/namei.h>
71 1.98 christos #include <sys/dirent.h>
72 1.178 dholland #include <sys/quotactl.h>
73 1.153 tron #include <sys/vfs_syscalls.h>
74 1.29 mrg
75 1.29 mrg #include <uvm/uvm_extern.h>
76 1.184 manu #include <uvm/uvm_swap.h>
77 1.29 mrg
78 1.1 mrg #include <sys/syscallargs.h>
79 1.6 eeh #include <sys/proc.h>
80 1.20 eeh #include <sys/acct.h>
81 1.20 eeh #include <sys/exec.h>
82 1.1 mrg
83 1.1 mrg #include <net/if.h>
84 1.1 mrg
85 1.10 mrg #include <compat/netbsd32/netbsd32.h>
86 1.75 christos #include <compat/netbsd32/netbsd32_exec.h>
87 1.42 jdolecek #include <compat/netbsd32/netbsd32_syscall.h>
88 1.10 mrg #include <compat/netbsd32/netbsd32_syscallargs.h>
89 1.56 mrg #include <compat/netbsd32/netbsd32_conv.h>
90 1.1 mrg
91 1.206 christos #include <compat/sys/mman.h>
92 1.206 christos
93 1.28 eeh #if defined(DDB)
94 1.28 eeh #include <ddb/ddbvar.h>
95 1.28 eeh #endif
96 1.4 eeh
97 1.42 jdolecek extern struct sysent netbsd32_sysent[];
98 1.218 pgoyette extern const uint32_t netbsd32_sysent_nomodbits[];
99 1.42 jdolecek #ifdef SYSCALL_DEBUG
100 1.42 jdolecek extern const char * const netbsd32_syscallnames[];
101 1.42 jdolecek #endif
102 1.46 mycroft #ifdef __HAVE_SYSCALL_INTERN
103 1.131 dsl void netbsd32_syscall_intern(struct proc *);
104 1.46 mycroft #else
105 1.131 dsl void syscall(void);
106 1.46 mycroft #endif
107 1.42 jdolecek
108 1.115 christos #define LIMITCHECK(a, b) ((a) != RLIM_INFINITY && (a) > (b))
109 1.115 christos
110 1.82 drochner #ifdef COMPAT_16
111 1.82 drochner extern char netbsd32_sigcode[], netbsd32_esigcode[];
112 1.74 chs struct uvm_object *emul_netbsd32_object;
113 1.82 drochner #endif
114 1.82 drochner
115 1.77 atatat extern struct sysctlnode netbsd32_sysctl_root;
116 1.74 chs
117 1.198 pgoyette #ifdef MODULAR
118 1.198 pgoyette #include <compat/netbsd32/netbsd32_syscalls_autoload.c>
119 1.198 pgoyette #endif
120 1.198 pgoyette
121 1.147 ad struct emul emul_netbsd32 = {
122 1.159 rmind .e_name = "netbsd32",
123 1.159 rmind .e_path = "/emul/netbsd32",
124 1.46 mycroft #ifndef __HAVE_MINIMAL_EMUL
125 1.159 rmind .e_flags = 0,
126 1.159 rmind .e_errno = NULL,
127 1.159 rmind .e_nosys = NETBSD32_SYS_netbsd32_syscall,
128 1.159 rmind .e_nsysent = NETBSD32_SYS_NSYSENT,
129 1.46 mycroft #endif
130 1.159 rmind .e_sysent = netbsd32_sysent,
131 1.218 pgoyette .e_nomodbits = netbsd32_sysent_nomodbits,
132 1.42 jdolecek #ifdef SYSCALL_DEBUG
133 1.159 rmind .e_syscallnames = netbsd32_syscallnames,
134 1.42 jdolecek #else
135 1.159 rmind .e_syscallnames = NULL,
136 1.42 jdolecek #endif
137 1.198 pgoyette #ifdef MODULAR
138 1.198 pgoyette .e_sc_autoload = netbsd32_syscalls_autoload,
139 1.198 pgoyette #endif
140 1.159 rmind .e_sendsig = netbsd32_sendsig,
141 1.159 rmind .e_trapsignal = trapsignal,
142 1.82 drochner #ifdef COMPAT_16
143 1.159 rmind .e_sigcode = netbsd32_sigcode,
144 1.159 rmind .e_esigcode = netbsd32_esigcode,
145 1.159 rmind .e_sigobject = &emul_netbsd32_object,
146 1.82 drochner #else
147 1.159 rmind .e_sigcode = NULL,
148 1.159 rmind .e_esigcode = NULL,
149 1.159 rmind .e_sigobject = NULL,
150 1.82 drochner #endif
151 1.159 rmind .e_setregs = netbsd32_setregs,
152 1.159 rmind .e_proc_exec = NULL,
153 1.159 rmind .e_proc_fork = NULL,
154 1.159 rmind .e_proc_exit = NULL,
155 1.159 rmind .e_lwp_fork = NULL,
156 1.159 rmind .e_lwp_exit = NULL,
157 1.46 mycroft #ifdef __HAVE_SYSCALL_INTERN
158 1.159 rmind .e_syscall_intern = netbsd32_syscall_intern,
159 1.46 mycroft #else
160 1.159 rmind .e_syscall = syscall,
161 1.46 mycroft #endif
162 1.159 rmind .e_sysctlovly = &netbsd32_sysctl_root,
163 1.159 rmind .e_vm_default_addr = netbsd32_vm_default_addr,
164 1.159 rmind .e_usertrap = NULL,
165 1.159 rmind .e_ucsize = sizeof(ucontext32_t),
166 1.203 martin .e_startlwp = startlwp32,
167 1.208 christos #ifdef notyet
168 1.208 christos .e_ktrpsig = netbsd32_ktrpsig,
169 1.208 christos #else
170 1.208 christos .e_ktrpsig = NULL,
171 1.208 christos #endif
172 1.42 jdolecek };
173 1.42 jdolecek
174 1.6 eeh int
175 1.134 dsl netbsd32_exit(struct lwp *l, const struct netbsd32_exit_args *uap, register_t *retval)
176 1.6 eeh {
177 1.134 dsl /* {
178 1.6 eeh syscallarg(int) rval;
179 1.134 dsl } */
180 1.6 eeh struct sys_exit_args ua;
181 1.6 eeh
182 1.11 mrg NETBSD32TO64_UAP(rval);
183 1.70 thorpej return sys_exit(l, &ua, retval);
184 1.6 eeh }
185 1.6 eeh
186 1.1 mrg int
187 1.134 dsl netbsd32_read(struct lwp *l, const struct netbsd32_read_args *uap, register_t *retval)
188 1.1 mrg {
189 1.134 dsl /* {
190 1.1 mrg syscallarg(int) fd;
191 1.10 mrg syscallarg(netbsd32_voidp) buf;
192 1.10 mrg syscallarg(netbsd32_size_t) nbyte;
193 1.134 dsl } */
194 1.1 mrg struct sys_read_args ua;
195 1.1 mrg
196 1.11 mrg NETBSD32TO64_UAP(fd);
197 1.11 mrg NETBSD32TOP_UAP(buf, void *);
198 1.11 mrg NETBSD32TOX_UAP(nbyte, size_t);
199 1.70 thorpej return sys_read(l, &ua, retval);
200 1.1 mrg }
201 1.1 mrg
202 1.1 mrg int
203 1.134 dsl netbsd32_write(struct lwp *l, const struct netbsd32_write_args *uap, register_t *retval)
204 1.1 mrg {
205 1.134 dsl /* {
206 1.1 mrg syscallarg(int) fd;
207 1.10 mrg syscallarg(const netbsd32_voidp) buf;
208 1.10 mrg syscallarg(netbsd32_size_t) nbyte;
209 1.134 dsl } */
210 1.1 mrg struct sys_write_args ua;
211 1.1 mrg
212 1.11 mrg NETBSD32TO64_UAP(fd);
213 1.11 mrg NETBSD32TOP_UAP(buf, void *);
214 1.11 mrg NETBSD32TOX_UAP(nbyte, size_t);
215 1.70 thorpej return sys_write(l, &ua, retval);
216 1.6 eeh }
217 1.6 eeh
218 1.6 eeh int
219 1.134 dsl netbsd32_close(struct lwp *l, const struct netbsd32_close_args *uap, register_t *retval)
220 1.6 eeh {
221 1.134 dsl /* {
222 1.6 eeh syscallarg(int) fd;
223 1.134 dsl } */
224 1.6 eeh struct sys_close_args ua;
225 1.1 mrg
226 1.11 mrg NETBSD32TO64_UAP(fd);
227 1.70 thorpej return sys_close(l, &ua, retval);
228 1.1 mrg }
229 1.1 mrg
230 1.1 mrg int
231 1.134 dsl netbsd32_open(struct lwp *l, const struct netbsd32_open_args *uap, register_t *retval)
232 1.1 mrg {
233 1.134 dsl /* {
234 1.10 mrg syscallarg(const netbsd32_charp) path;
235 1.1 mrg syscallarg(int) flags;
236 1.1 mrg syscallarg(mode_t) mode;
237 1.134 dsl } */
238 1.1 mrg struct sys_open_args ua;
239 1.1 mrg
240 1.11 mrg NETBSD32TOP_UAP(path, const char);
241 1.11 mrg NETBSD32TO64_UAP(flags);
242 1.11 mrg NETBSD32TO64_UAP(mode);
243 1.193 maxv
244 1.193 maxv return sys_open(l, &ua, retval);
245 1.1 mrg }
246 1.1 mrg
247 1.1 mrg int
248 1.134 dsl netbsd32_link(struct lwp *l, const struct netbsd32_link_args *uap, register_t *retval)
249 1.1 mrg {
250 1.134 dsl /* {
251 1.10 mrg syscallarg(const netbsd32_charp) path;
252 1.10 mrg syscallarg(const netbsd32_charp) link;
253 1.134 dsl } */
254 1.1 mrg struct sys_link_args ua;
255 1.1 mrg
256 1.11 mrg NETBSD32TOP_UAP(path, const char);
257 1.11 mrg NETBSD32TOP_UAP(link, const char);
258 1.220 mrg return sys_link(l, &ua, retval);
259 1.1 mrg }
260 1.1 mrg
261 1.1 mrg int
262 1.134 dsl netbsd32_unlink(struct lwp *l, const struct netbsd32_unlink_args *uap, register_t *retval)
263 1.1 mrg {
264 1.134 dsl /* {
265 1.10 mrg syscallarg(const netbsd32_charp) path;
266 1.134 dsl } */
267 1.1 mrg struct sys_unlink_args ua;
268 1.1 mrg
269 1.11 mrg NETBSD32TOP_UAP(path, const char);
270 1.1 mrg
271 1.220 mrg return sys_unlink(l, &ua, retval);
272 1.1 mrg }
273 1.1 mrg
274 1.1 mrg int
275 1.134 dsl netbsd32_chdir(struct lwp *l, const struct netbsd32_chdir_args *uap, register_t *retval)
276 1.1 mrg {
277 1.134 dsl /* {
278 1.10 mrg syscallarg(const netbsd32_charp) path;
279 1.134 dsl } */
280 1.1 mrg struct sys_chdir_args ua;
281 1.1 mrg
282 1.11 mrg NETBSD32TOP_UAP(path, const char);
283 1.1 mrg
284 1.220 mrg return sys_chdir(l, &ua, retval);
285 1.1 mrg }
286 1.1 mrg
287 1.1 mrg int
288 1.134 dsl netbsd32_fchdir(struct lwp *l, const struct netbsd32_fchdir_args *uap, register_t *retval)
289 1.6 eeh {
290 1.134 dsl /* {
291 1.6 eeh syscallarg(int) fd;
292 1.134 dsl } */
293 1.6 eeh struct sys_fchdir_args ua;
294 1.6 eeh
295 1.11 mrg NETBSD32TO64_UAP(fd);
296 1.6 eeh
297 1.220 mrg return sys_fchdir(l, &ua, retval);
298 1.6 eeh }
299 1.6 eeh
300 1.6 eeh int
301 1.153 tron netbsd32___mknod50(struct lwp *l, const struct netbsd32___mknod50_args *uap, register_t *retval)
302 1.1 mrg {
303 1.134 dsl /* {
304 1.10 mrg syscallarg(const netbsd32_charp) path;
305 1.1 mrg syscallarg(mode_t) mode;
306 1.156 njoly syscallarg(netbsd32_dev_t) dev;
307 1.134 dsl } */
308 1.1 mrg
309 1.153 tron return do_sys_mknod(l, SCARG_P32(uap, path), SCARG(uap, mode),
310 1.158 haad SCARG(uap, dev), retval, UIO_USERSPACE);
311 1.1 mrg }
312 1.1 mrg
313 1.1 mrg int
314 1.134 dsl netbsd32_chmod(struct lwp *l, const struct netbsd32_chmod_args *uap, register_t *retval)
315 1.1 mrg {
316 1.134 dsl /* {
317 1.10 mrg syscallarg(const netbsd32_charp) path;
318 1.1 mrg syscallarg(mode_t) mode;
319 1.134 dsl } */
320 1.1 mrg struct sys_chmod_args ua;
321 1.1 mrg
322 1.11 mrg NETBSD32TOP_UAP(path, const char);
323 1.11 mrg NETBSD32TO64_UAP(mode);
324 1.1 mrg
325 1.220 mrg return sys_chmod(l, &ua, retval);
326 1.1 mrg }
327 1.1 mrg
328 1.1 mrg int
329 1.134 dsl netbsd32_chown(struct lwp *l, const struct netbsd32_chown_args *uap, register_t *retval)
330 1.1 mrg {
331 1.134 dsl /* {
332 1.10 mrg syscallarg(const netbsd32_charp) path;
333 1.1 mrg syscallarg(uid_t) uid;
334 1.1 mrg syscallarg(gid_t) gid;
335 1.134 dsl } */
336 1.1 mrg struct sys_chown_args ua;
337 1.1 mrg
338 1.11 mrg NETBSD32TOP_UAP(path, const char);
339 1.11 mrg NETBSD32TO64_UAP(uid);
340 1.11 mrg NETBSD32TO64_UAP(gid);
341 1.1 mrg
342 1.220 mrg return sys_chown(l, &ua, retval);
343 1.1 mrg }
344 1.1 mrg
345 1.1 mrg int
346 1.134 dsl netbsd32_break(struct lwp *l, const struct netbsd32_break_args *uap, register_t *retval)
347 1.1 mrg {
348 1.134 dsl /* {
349 1.10 mrg syscallarg(netbsd32_charp) nsize;
350 1.134 dsl } */
351 1.1 mrg struct sys_obreak_args ua;
352 1.1 mrg
353 1.11 mrg NETBSD32TOP_UAP(nsize, char);
354 1.220 mrg
355 1.220 mrg return sys_obreak(l, &ua, retval);
356 1.1 mrg }
357 1.1 mrg
358 1.1 mrg int
359 1.134 dsl netbsd32_unmount(struct lwp *l, const struct netbsd32_unmount_args *uap, register_t *retval)
360 1.1 mrg {
361 1.134 dsl /* {
362 1.10 mrg syscallarg(const netbsd32_charp) path;
363 1.1 mrg syscallarg(int) flags;
364 1.134 dsl } */
365 1.1 mrg struct sys_unmount_args ua;
366 1.1 mrg
367 1.11 mrg NETBSD32TOP_UAP(path, const char);
368 1.11 mrg NETBSD32TO64_UAP(flags);
369 1.220 mrg
370 1.220 mrg return sys_unmount(l, &ua, retval);
371 1.1 mrg }
372 1.1 mrg
373 1.1 mrg int
374 1.134 dsl netbsd32_setuid(struct lwp *l, const struct netbsd32_setuid_args *uap, register_t *retval)
375 1.6 eeh {
376 1.134 dsl /* {
377 1.6 eeh syscallarg(uid_t) uid;
378 1.134 dsl } */
379 1.6 eeh struct sys_setuid_args ua;
380 1.6 eeh
381 1.11 mrg NETBSD32TO64_UAP(uid);
382 1.220 mrg
383 1.220 mrg return sys_setuid(l, &ua, retval);
384 1.6 eeh }
385 1.6 eeh
386 1.6 eeh int
387 1.134 dsl netbsd32_accept(struct lwp *l, const struct netbsd32_accept_args *uap, register_t *retval)
388 1.1 mrg {
389 1.134 dsl /* {
390 1.1 mrg syscallarg(int) s;
391 1.10 mrg syscallarg(netbsd32_sockaddrp_t) name;
392 1.10 mrg syscallarg(netbsd32_intp) anamelen;
393 1.134 dsl } */
394 1.1 mrg struct sys_accept_args ua;
395 1.1 mrg
396 1.11 mrg NETBSD32TO64_UAP(s);
397 1.11 mrg NETBSD32TOP_UAP(name, struct sockaddr);
398 1.103 mrg NETBSD32TOP_UAP(anamelen, socklen_t);
399 1.220 mrg
400 1.220 mrg return sys_accept(l, &ua, retval);
401 1.1 mrg }
402 1.1 mrg
403 1.1 mrg int
404 1.134 dsl netbsd32_getpeername(struct lwp *l, const struct netbsd32_getpeername_args *uap, register_t *retval)
405 1.1 mrg {
406 1.134 dsl /* {
407 1.1 mrg syscallarg(int) fdes;
408 1.10 mrg syscallarg(netbsd32_sockaddrp_t) asa;
409 1.10 mrg syscallarg(netbsd32_intp) alen;
410 1.134 dsl } */
411 1.1 mrg struct sys_getpeername_args ua;
412 1.1 mrg
413 1.11 mrg NETBSD32TO64_UAP(fdes);
414 1.11 mrg NETBSD32TOP_UAP(asa, struct sockaddr);
415 1.103 mrg NETBSD32TOP_UAP(alen, socklen_t);
416 1.6 eeh /* NB: do the protocol specific sockaddrs need to be converted? */
417 1.220 mrg
418 1.220 mrg return sys_getpeername(l, &ua, retval);
419 1.1 mrg }
420 1.1 mrg
421 1.1 mrg int
422 1.134 dsl netbsd32_getsockname(struct lwp *l, const struct netbsd32_getsockname_args *uap, register_t *retval)
423 1.1 mrg {
424 1.134 dsl /* {
425 1.1 mrg syscallarg(int) fdes;
426 1.10 mrg syscallarg(netbsd32_sockaddrp_t) asa;
427 1.10 mrg syscallarg(netbsd32_intp) alen;
428 1.134 dsl } */
429 1.1 mrg struct sys_getsockname_args ua;
430 1.1 mrg
431 1.11 mrg NETBSD32TO64_UAP(fdes);
432 1.11 mrg NETBSD32TOP_UAP(asa, struct sockaddr);
433 1.103 mrg NETBSD32TOP_UAP(alen, socklen_t);
434 1.220 mrg
435 1.220 mrg return sys_getsockname(l, &ua, retval);
436 1.1 mrg }
437 1.1 mrg
438 1.1 mrg int
439 1.134 dsl netbsd32_access(struct lwp *l, const struct netbsd32_access_args *uap, register_t *retval)
440 1.1 mrg {
441 1.134 dsl /* {
442 1.10 mrg syscallarg(const netbsd32_charp) path;
443 1.1 mrg syscallarg(int) flags;
444 1.134 dsl } */
445 1.1 mrg struct sys_access_args ua;
446 1.1 mrg
447 1.11 mrg NETBSD32TOP_UAP(path, const char);
448 1.11 mrg NETBSD32TO64_UAP(flags);
449 1.1 mrg
450 1.123 dsl return sys_access(l, &ua, retval);
451 1.1 mrg }
452 1.1 mrg
453 1.1 mrg int
454 1.134 dsl netbsd32_chflags(struct lwp *l, const struct netbsd32_chflags_args *uap, register_t *retval)
455 1.1 mrg {
456 1.134 dsl /* {
457 1.10 mrg syscallarg(const netbsd32_charp) path;
458 1.10 mrg syscallarg(netbsd32_u_long) flags;
459 1.134 dsl } */
460 1.1 mrg struct sys_chflags_args ua;
461 1.1 mrg
462 1.11 mrg NETBSD32TOP_UAP(path, const char);
463 1.11 mrg NETBSD32TO64_UAP(flags);
464 1.1 mrg
465 1.220 mrg return sys_chflags(l, &ua, retval);
466 1.1 mrg }
467 1.1 mrg
468 1.1 mrg int
469 1.134 dsl netbsd32_fchflags(struct lwp *l, const struct netbsd32_fchflags_args *uap, register_t *retval)
470 1.1 mrg {
471 1.134 dsl /* {
472 1.1 mrg syscallarg(int) fd;
473 1.10 mrg syscallarg(netbsd32_u_long) flags;
474 1.134 dsl } */
475 1.1 mrg struct sys_fchflags_args ua;
476 1.1 mrg
477 1.11 mrg NETBSD32TO64_UAP(fd);
478 1.11 mrg NETBSD32TO64_UAP(flags);
479 1.1 mrg
480 1.220 mrg return sys_fchflags(l, &ua, retval);
481 1.1 mrg }
482 1.1 mrg
483 1.1 mrg int
484 1.134 dsl netbsd32_lchflags(struct lwp *l, const struct netbsd32_lchflags_args *uap, register_t *retval)
485 1.50 mrg {
486 1.134 dsl /* {
487 1.81 mrg syscallarg(const char *) path;
488 1.50 mrg syscallarg(netbsd32_u_long) flags;
489 1.134 dsl } */
490 1.50 mrg struct sys_lchflags_args ua;
491 1.50 mrg
492 1.50 mrg NETBSD32TOP_UAP(path, const char);
493 1.50 mrg NETBSD32TO64_UAP(flags);
494 1.50 mrg
495 1.220 mrg return sys_lchflags(l, &ua, retval);
496 1.50 mrg }
497 1.50 mrg
498 1.50 mrg int
499 1.134 dsl netbsd32_kill(struct lwp *l, const struct netbsd32_kill_args *uap, register_t *retval)
500 1.6 eeh {
501 1.134 dsl /* {
502 1.6 eeh syscallarg(int) pid;
503 1.6 eeh syscallarg(int) signum;
504 1.134 dsl } */
505 1.6 eeh struct sys_kill_args ua;
506 1.6 eeh
507 1.11 mrg NETBSD32TO64_UAP(pid);
508 1.11 mrg NETBSD32TO64_UAP(signum);
509 1.6 eeh
510 1.220 mrg return sys_kill(l, &ua, retval);
511 1.6 eeh }
512 1.6 eeh
513 1.6 eeh int
514 1.134 dsl netbsd32_dup(struct lwp *l, const struct netbsd32_dup_args *uap, register_t *retval)
515 1.6 eeh {
516 1.134 dsl /* {
517 1.6 eeh syscallarg(int) fd;
518 1.134 dsl } */
519 1.6 eeh struct sys_dup_args ua;
520 1.6 eeh
521 1.11 mrg NETBSD32TO64_UAP(fd);
522 1.6 eeh
523 1.220 mrg return sys_dup(l, &ua, retval);
524 1.6 eeh }
525 1.6 eeh
526 1.6 eeh int
527 1.134 dsl netbsd32_profil(struct lwp *l, const struct netbsd32_profil_args *uap, register_t *retval)
528 1.1 mrg {
529 1.134 dsl /* {
530 1.154 njoly syscallarg(netbsd32_voidp) samples;
531 1.10 mrg syscallarg(netbsd32_size_t) size;
532 1.10 mrg syscallarg(netbsd32_u_long) offset;
533 1.1 mrg syscallarg(u_int) scale;
534 1.134 dsl } */
535 1.1 mrg struct sys_profil_args ua;
536 1.1 mrg
537 1.120 dsl NETBSD32TOP_UAP(samples, void *);
538 1.11 mrg NETBSD32TOX_UAP(size, size_t);
539 1.11 mrg NETBSD32TOX_UAP(offset, u_long);
540 1.11 mrg NETBSD32TO64_UAP(scale);
541 1.220 mrg
542 1.220 mrg return sys_profil(l, &ua, retval);
543 1.1 mrg }
544 1.1 mrg
545 1.1 mrg int
546 1.134 dsl netbsd32_ktrace(struct lwp *l, const struct netbsd32_ktrace_args *uap, register_t *retval)
547 1.1 mrg {
548 1.134 dsl /* {
549 1.10 mrg syscallarg(const netbsd32_charp) fname;
550 1.1 mrg syscallarg(int) ops;
551 1.1 mrg syscallarg(int) facs;
552 1.1 mrg syscallarg(int) pid;
553 1.134 dsl } */
554 1.1 mrg struct sys_ktrace_args ua;
555 1.1 mrg
556 1.11 mrg NETBSD32TOP_UAP(fname, const char);
557 1.11 mrg NETBSD32TO64_UAP(ops);
558 1.11 mrg NETBSD32TO64_UAP(facs);
559 1.11 mrg NETBSD32TO64_UAP(pid);
560 1.220 mrg
561 1.220 mrg return sys_ktrace(l, &ua, retval);
562 1.1 mrg }
563 1.50 mrg
564 1.50 mrg int
565 1.134 dsl netbsd32_utrace(struct lwp *l, const struct netbsd32_utrace_args *uap, register_t *retval)
566 1.50 mrg {
567 1.134 dsl /* {
568 1.50 mrg syscallarg(const netbsd32_charp) label;
569 1.50 mrg syscallarg(netbsd32_voidp) addr;
570 1.50 mrg syscallarg(netbsd32_size_t) len;
571 1.134 dsl } */
572 1.50 mrg struct sys_utrace_args ua;
573 1.50 mrg
574 1.50 mrg NETBSD32TOP_UAP(label, const char);
575 1.50 mrg NETBSD32TOP_UAP(addr, void);
576 1.50 mrg NETBSD32TO64_UAP(len);
577 1.220 mrg
578 1.220 mrg return sys_utrace(l, &ua, retval);
579 1.50 mrg }
580 1.1 mrg
581 1.1 mrg int
582 1.134 dsl netbsd32___getlogin(struct lwp *l, const struct netbsd32___getlogin_args *uap, register_t *retval)
583 1.1 mrg {
584 1.134 dsl /* {
585 1.10 mrg syscallarg(netbsd32_charp) namebuf;
586 1.1 mrg syscallarg(u_int) namelen;
587 1.134 dsl } */
588 1.1 mrg struct sys___getlogin_args ua;
589 1.1 mrg
590 1.11 mrg NETBSD32TOP_UAP(namebuf, char);
591 1.11 mrg NETBSD32TO64_UAP(namelen);
592 1.220 mrg
593 1.220 mrg return sys___getlogin(l, &ua, retval);
594 1.1 mrg }
595 1.1 mrg
596 1.1 mrg int
597 1.134 dsl netbsd32_setlogin(struct lwp *l, const struct netbsd32_setlogin_args *uap, register_t *retval)
598 1.1 mrg {
599 1.134 dsl /* {
600 1.10 mrg syscallarg(const netbsd32_charp) namebuf;
601 1.134 dsl } */
602 1.70 thorpej struct sys___setlogin_args ua;
603 1.1 mrg
604 1.11 mrg NETBSD32TOP_UAP(namebuf, char);
605 1.220 mrg
606 1.220 mrg return sys___setlogin(l, &ua, retval);
607 1.1 mrg }
608 1.1 mrg
609 1.1 mrg int
610 1.134 dsl netbsd32_acct(struct lwp *l, const struct netbsd32_acct_args *uap, register_t *retval)
611 1.1 mrg {
612 1.134 dsl /* {
613 1.10 mrg syscallarg(const netbsd32_charp) path;
614 1.134 dsl } */
615 1.1 mrg struct sys_acct_args ua;
616 1.1 mrg
617 1.11 mrg NETBSD32TOP_UAP(path, const char);
618 1.220 mrg
619 1.220 mrg return sys_acct(l, &ua, retval);
620 1.1 mrg }
621 1.1 mrg
622 1.1 mrg int
623 1.134 dsl netbsd32_revoke(struct lwp *l, const struct netbsd32_revoke_args *uap, register_t *retval)
624 1.1 mrg {
625 1.134 dsl /* {
626 1.10 mrg syscallarg(const netbsd32_charp) path;
627 1.134 dsl } */
628 1.1 mrg struct sys_revoke_args ua;
629 1.1 mrg
630 1.11 mrg NETBSD32TOP_UAP(path, const char);
631 1.1 mrg
632 1.220 mrg return sys_revoke(l, &ua, retval);
633 1.1 mrg }
634 1.1 mrg
635 1.1 mrg int
636 1.134 dsl netbsd32_symlink(struct lwp *l, const struct netbsd32_symlink_args *uap, register_t *retval)
637 1.1 mrg {
638 1.134 dsl /* {
639 1.10 mrg syscallarg(const netbsd32_charp) path;
640 1.10 mrg syscallarg(const netbsd32_charp) link;
641 1.134 dsl } */
642 1.1 mrg struct sys_symlink_args ua;
643 1.1 mrg
644 1.11 mrg NETBSD32TOP_UAP(path, const char);
645 1.11 mrg NETBSD32TOP_UAP(link, const char);
646 1.1 mrg
647 1.220 mrg return sys_symlink(l, &ua, retval);
648 1.1 mrg }
649 1.1 mrg
650 1.1 mrg int
651 1.134 dsl netbsd32_readlink(struct lwp *l, const struct netbsd32_readlink_args *uap, register_t *retval)
652 1.1 mrg {
653 1.134 dsl /* {
654 1.10 mrg syscallarg(const netbsd32_charp) path;
655 1.10 mrg syscallarg(netbsd32_charp) buf;
656 1.10 mrg syscallarg(netbsd32_size_t) count;
657 1.134 dsl } */
658 1.1 mrg struct sys_readlink_args ua;
659 1.1 mrg
660 1.11 mrg NETBSD32TOP_UAP(path, const char);
661 1.11 mrg NETBSD32TOP_UAP(buf, char);
662 1.11 mrg NETBSD32TOX_UAP(count, size_t);
663 1.1 mrg
664 1.220 mrg return sys_readlink(l, &ua, retval);
665 1.1 mrg }
666 1.1 mrg
667 1.1 mrg int
668 1.134 dsl netbsd32_umask(struct lwp *l, const struct netbsd32_umask_args *uap, register_t *retval)
669 1.6 eeh {
670 1.134 dsl /* {
671 1.6 eeh syscallarg(mode_t) newmask;
672 1.134 dsl } */
673 1.6 eeh struct sys_umask_args ua;
674 1.6 eeh
675 1.11 mrg NETBSD32TO64_UAP(newmask);
676 1.220 mrg
677 1.220 mrg return sys_umask(l, &ua, retval);
678 1.6 eeh }
679 1.6 eeh
680 1.6 eeh int
681 1.134 dsl netbsd32_chroot(struct lwp *l, const struct netbsd32_chroot_args *uap, register_t *retval)
682 1.1 mrg {
683 1.134 dsl /* {
684 1.10 mrg syscallarg(const netbsd32_charp) path;
685 1.134 dsl } */
686 1.1 mrg struct sys_chroot_args ua;
687 1.1 mrg
688 1.11 mrg NETBSD32TOP_UAP(path, const char);
689 1.220 mrg
690 1.220 mrg return sys_chroot(l, &ua, retval);
691 1.1 mrg }
692 1.1 mrg
693 1.1 mrg int
694 1.134 dsl netbsd32_munmap(struct lwp *l, const struct netbsd32_munmap_args *uap, register_t *retval)
695 1.1 mrg {
696 1.134 dsl /* {
697 1.10 mrg syscallarg(netbsd32_voidp) addr;
698 1.10 mrg syscallarg(netbsd32_size_t) len;
699 1.134 dsl } */
700 1.1 mrg struct sys_munmap_args ua;
701 1.1 mrg
702 1.11 mrg NETBSD32TOP_UAP(addr, void);
703 1.11 mrg NETBSD32TOX_UAP(len, size_t);
704 1.220 mrg
705 1.220 mrg return sys_munmap(l, &ua, retval);
706 1.1 mrg }
707 1.1 mrg
708 1.1 mrg int
709 1.134 dsl netbsd32_mprotect(struct lwp *l, const struct netbsd32_mprotect_args *uap, register_t *retval)
710 1.1 mrg {
711 1.134 dsl /* {
712 1.10 mrg syscallarg(netbsd32_voidp) addr;
713 1.10 mrg syscallarg(netbsd32_size_t) len;
714 1.1 mrg syscallarg(int) prot;
715 1.134 dsl } */
716 1.1 mrg struct sys_mprotect_args ua;
717 1.1 mrg
718 1.11 mrg NETBSD32TOP_UAP(addr, void);
719 1.11 mrg NETBSD32TOX_UAP(len, size_t);
720 1.11 mrg NETBSD32TO64_UAP(prot);
721 1.220 mrg
722 1.220 mrg return sys_mprotect(l, &ua, retval);
723 1.1 mrg }
724 1.1 mrg
725 1.1 mrg int
726 1.134 dsl netbsd32_madvise(struct lwp *l, const struct netbsd32_madvise_args *uap, register_t *retval)
727 1.1 mrg {
728 1.134 dsl /* {
729 1.10 mrg syscallarg(netbsd32_voidp) addr;
730 1.10 mrg syscallarg(netbsd32_size_t) len;
731 1.1 mrg syscallarg(int) behav;
732 1.134 dsl } */
733 1.1 mrg struct sys_madvise_args ua;
734 1.1 mrg
735 1.11 mrg NETBSD32TOP_UAP(addr, void);
736 1.11 mrg NETBSD32TOX_UAP(len, size_t);
737 1.11 mrg NETBSD32TO64_UAP(behav);
738 1.220 mrg
739 1.220 mrg return sys_madvise(l, &ua, retval);
740 1.1 mrg }
741 1.1 mrg
742 1.1 mrg int
743 1.134 dsl netbsd32_mincore(struct lwp *l, const struct netbsd32_mincore_args *uap, register_t *retval)
744 1.1 mrg {
745 1.134 dsl /* {
746 1.154 njoly syscallarg(netbsd32_voidp) addr;
747 1.10 mrg syscallarg(netbsd32_size_t) len;
748 1.10 mrg syscallarg(netbsd32_charp) vec;
749 1.134 dsl } */
750 1.1 mrg struct sys_mincore_args ua;
751 1.1 mrg
752 1.120 dsl NETBSD32TOP_UAP(addr, void *);
753 1.11 mrg NETBSD32TOX_UAP(len, size_t);
754 1.11 mrg NETBSD32TOP_UAP(vec, char);
755 1.220 mrg
756 1.220 mrg return sys_mincore(l, &ua, retval);
757 1.1 mrg }
758 1.1 mrg
759 1.1 mrg int
760 1.134 dsl netbsd32_getgroups(struct lwp *l, const struct netbsd32_getgroups_args *uap, register_t *retval)
761 1.1 mrg {
762 1.134 dsl /* {
763 1.1 mrg syscallarg(int) gidsetsize;
764 1.10 mrg syscallarg(netbsd32_gid_tp) gidset;
765 1.134 dsl } */
766 1.124 dsl struct sys_getgroups_args ua;
767 1.124 dsl
768 1.124 dsl /* Since sizeof (gid_t) == sizeof (netbsd32_gid_t) ... */
769 1.1 mrg
770 1.124 dsl NETBSD32TO64_UAP(gidsetsize);
771 1.124 dsl NETBSD32TOP_UAP(gidset, gid_t);
772 1.220 mrg
773 1.220 mrg return sys_getgroups(l, &ua, retval);
774 1.1 mrg }
775 1.1 mrg
776 1.1 mrg int
777 1.134 dsl netbsd32_setgroups(struct lwp *l, const struct netbsd32_setgroups_args *uap, register_t *retval)
778 1.1 mrg {
779 1.134 dsl /* {
780 1.1 mrg syscallarg(int) gidsetsize;
781 1.10 mrg syscallarg(const netbsd32_gid_tp) gidset;
782 1.134 dsl } */
783 1.1 mrg struct sys_setgroups_args ua;
784 1.1 mrg
785 1.11 mrg NETBSD32TO64_UAP(gidsetsize);
786 1.11 mrg NETBSD32TOP_UAP(gidset, gid_t);
787 1.220 mrg
788 1.220 mrg return sys_setgroups(l, &ua, retval);
789 1.1 mrg }
790 1.1 mrg
791 1.1 mrg int
792 1.134 dsl netbsd32_setpgid(struct lwp *l, const struct netbsd32_setpgid_args *uap, register_t *retval)
793 1.6 eeh {
794 1.134 dsl /* {
795 1.6 eeh syscallarg(int) pid;
796 1.6 eeh syscallarg(int) pgid;
797 1.134 dsl } */
798 1.6 eeh struct sys_setpgid_args ua;
799 1.6 eeh
800 1.11 mrg NETBSD32TO64_UAP(pid);
801 1.11 mrg NETBSD32TO64_UAP(pgid);
802 1.220 mrg
803 1.220 mrg return sys_setpgid(l, &ua, retval);
804 1.6 eeh }
805 1.6 eeh
806 1.1 mrg int
807 1.134 dsl netbsd32_fcntl(struct lwp *l, const struct netbsd32_fcntl_args *uap, register_t *retval)
808 1.1 mrg {
809 1.134 dsl /* {
810 1.1 mrg syscallarg(int) fd;
811 1.1 mrg syscallarg(int) cmd;
812 1.10 mrg syscallarg(netbsd32_voidp) arg;
813 1.134 dsl } */
814 1.1 mrg struct sys_fcntl_args ua;
815 1.1 mrg
816 1.11 mrg NETBSD32TO64_UAP(fd);
817 1.11 mrg NETBSD32TO64_UAP(cmd);
818 1.220 mrg /* we can do this because `struct flock' doesn't change */
819 1.11 mrg NETBSD32TOP_UAP(arg, void);
820 1.220 mrg
821 1.220 mrg return sys_fcntl(l, &ua, retval);
822 1.1 mrg }
823 1.1 mrg
824 1.1 mrg int
825 1.134 dsl netbsd32_dup2(struct lwp *l, const struct netbsd32_dup2_args *uap, register_t *retval)
826 1.6 eeh {
827 1.134 dsl /* {
828 1.6 eeh syscallarg(int) from;
829 1.6 eeh syscallarg(int) to;
830 1.134 dsl } */
831 1.6 eeh struct sys_dup2_args ua;
832 1.6 eeh
833 1.11 mrg NETBSD32TO64_UAP(from);
834 1.11 mrg NETBSD32TO64_UAP(to);
835 1.220 mrg
836 1.220 mrg return sys_dup2(l, &ua, retval);
837 1.6 eeh }
838 1.6 eeh
839 1.6 eeh int
840 1.134 dsl netbsd32_fsync(struct lwp *l, const struct netbsd32_fsync_args *uap, register_t *retval)
841 1.6 eeh {
842 1.134 dsl /* {
843 1.6 eeh syscallarg(int) fd;
844 1.134 dsl } */
845 1.6 eeh struct sys_fsync_args ua;
846 1.1 mrg
847 1.11 mrg NETBSD32TO64_UAP(fd);
848 1.220 mrg
849 1.220 mrg return sys_fsync(l, &ua, retval);
850 1.6 eeh }
851 1.6 eeh
852 1.6 eeh int
853 1.134 dsl netbsd32_setpriority(struct lwp *l, const struct netbsd32_setpriority_args *uap, register_t *retval)
854 1.6 eeh {
855 1.134 dsl /* {
856 1.6 eeh syscallarg(int) which;
857 1.6 eeh syscallarg(int) who;
858 1.6 eeh syscallarg(int) prio;
859 1.134 dsl } */
860 1.6 eeh struct sys_setpriority_args ua;
861 1.6 eeh
862 1.11 mrg NETBSD32TO64_UAP(which);
863 1.11 mrg NETBSD32TO64_UAP(who);
864 1.11 mrg NETBSD32TO64_UAP(prio);
865 1.220 mrg
866 1.220 mrg return sys_setpriority(l, &ua, retval);
867 1.6 eeh }
868 1.6 eeh
869 1.6 eeh int
870 1.153 tron netbsd32___socket30(struct lwp *l, const struct netbsd32___socket30_args *uap, register_t *retval)
871 1.105 mrg {
872 1.134 dsl /* {
873 1.105 mrg syscallarg(int) domain;
874 1.105 mrg syscallarg(int) type;
875 1.105 mrg syscallarg(int) protocol;
876 1.134 dsl } */
877 1.105 mrg struct sys___socket30_args ua;
878 1.105 mrg
879 1.105 mrg NETBSD32TO64_UAP(domain);
880 1.105 mrg NETBSD32TO64_UAP(type);
881 1.105 mrg NETBSD32TO64_UAP(protocol);
882 1.220 mrg
883 1.220 mrg return sys___socket30(l, &ua, retval);
884 1.1 mrg }
885 1.1 mrg
886 1.1 mrg int
887 1.134 dsl netbsd32_connect(struct lwp *l, const struct netbsd32_connect_args *uap, register_t *retval)
888 1.1 mrg {
889 1.134 dsl /* {
890 1.1 mrg syscallarg(int) s;
891 1.10 mrg syscallarg(const netbsd32_sockaddrp_t) name;
892 1.1 mrg syscallarg(int) namelen;
893 1.134 dsl } */
894 1.1 mrg struct sys_connect_args ua;
895 1.1 mrg
896 1.11 mrg NETBSD32TO64_UAP(s);
897 1.11 mrg NETBSD32TOP_UAP(name, struct sockaddr);
898 1.11 mrg NETBSD32TO64_UAP(namelen);
899 1.220 mrg
900 1.220 mrg return sys_connect(l, &ua, retval);
901 1.1 mrg }
902 1.1 mrg
903 1.6 eeh int
904 1.134 dsl netbsd32_getpriority(struct lwp *l, const struct netbsd32_getpriority_args *uap, register_t *retval)
905 1.6 eeh {
906 1.134 dsl /* {
907 1.6 eeh syscallarg(int) which;
908 1.6 eeh syscallarg(int) who;
909 1.134 dsl } */
910 1.6 eeh struct sys_getpriority_args ua;
911 1.6 eeh
912 1.11 mrg NETBSD32TO64_UAP(which);
913 1.11 mrg NETBSD32TO64_UAP(who);
914 1.220 mrg
915 1.220 mrg return sys_getpriority(l, &ua, retval);
916 1.6 eeh }
917 1.6 eeh
918 1.1 mrg int
919 1.134 dsl netbsd32_bind(struct lwp *l, const struct netbsd32_bind_args *uap, register_t *retval)
920 1.1 mrg {
921 1.134 dsl /* {
922 1.1 mrg syscallarg(int) s;
923 1.10 mrg syscallarg(const netbsd32_sockaddrp_t) name;
924 1.1 mrg syscallarg(int) namelen;
925 1.134 dsl } */
926 1.6 eeh struct sys_bind_args ua;
927 1.1 mrg
928 1.11 mrg NETBSD32TO64_UAP(s);
929 1.11 mrg NETBSD32TOP_UAP(name, struct sockaddr);
930 1.11 mrg NETBSD32TO64_UAP(namelen);
931 1.220 mrg
932 1.220 mrg return sys_bind(l, &ua, retval);
933 1.1 mrg }
934 1.1 mrg
935 1.1 mrg int
936 1.134 dsl netbsd32_setsockopt(struct lwp *l, const struct netbsd32_setsockopt_args *uap, register_t *retval)
937 1.1 mrg {
938 1.134 dsl /* {
939 1.1 mrg syscallarg(int) s;
940 1.1 mrg syscallarg(int) level;
941 1.1 mrg syscallarg(int) name;
942 1.10 mrg syscallarg(const netbsd32_voidp) val;
943 1.1 mrg syscallarg(int) valsize;
944 1.134 dsl } */
945 1.1 mrg struct sys_setsockopt_args ua;
946 1.1 mrg
947 1.11 mrg NETBSD32TO64_UAP(s);
948 1.11 mrg NETBSD32TO64_UAP(level);
949 1.11 mrg NETBSD32TO64_UAP(name);
950 1.11 mrg NETBSD32TOP_UAP(val, void);
951 1.11 mrg NETBSD32TO64_UAP(valsize);
952 1.6 eeh /* may be more efficient to do this inline. */
953 1.220 mrg
954 1.220 mrg return sys_setsockopt(l, &ua, retval);
955 1.1 mrg }
956 1.1 mrg
957 1.1 mrg int
958 1.134 dsl netbsd32_listen(struct lwp *l, const struct netbsd32_listen_args *uap, register_t *retval)
959 1.6 eeh {
960 1.134 dsl /* {
961 1.6 eeh syscallarg(int) s;
962 1.6 eeh syscallarg(int) backlog;
963 1.134 dsl } */
964 1.6 eeh struct sys_listen_args ua;
965 1.6 eeh
966 1.11 mrg NETBSD32TO64_UAP(s);
967 1.11 mrg NETBSD32TO64_UAP(backlog);
968 1.220 mrg
969 1.220 mrg return sys_listen(l, &ua, retval);
970 1.6 eeh }
971 1.6 eeh
972 1.6 eeh int
973 1.134 dsl netbsd32_fchown(struct lwp *l, const struct netbsd32_fchown_args *uap, register_t *retval)
974 1.1 mrg {
975 1.134 dsl /* {
976 1.57 mrg syscallarg(int) fd;
977 1.57 mrg syscallarg(uid_t) uid;
978 1.57 mrg syscallarg(gid_t) gid;
979 1.134 dsl } */
980 1.57 mrg struct sys_fchown_args ua;
981 1.6 eeh
982 1.11 mrg NETBSD32TO64_UAP(fd);
983 1.11 mrg NETBSD32TO64_UAP(uid);
984 1.11 mrg NETBSD32TO64_UAP(gid);
985 1.220 mrg
986 1.220 mrg return sys_fchown(l, &ua, retval);
987 1.6 eeh }
988 1.6 eeh
989 1.6 eeh int
990 1.134 dsl netbsd32_fchmod(struct lwp *l, const struct netbsd32_fchmod_args *uap, register_t *retval)
991 1.6 eeh {
992 1.134 dsl /* {
993 1.6 eeh syscallarg(int) fd;
994 1.6 eeh syscallarg(mode_t) mode;
995 1.134 dsl } */
996 1.6 eeh struct sys_fchmod_args ua;
997 1.6 eeh
998 1.11 mrg NETBSD32TO64_UAP(fd);
999 1.11 mrg NETBSD32TO64_UAP(mode);
1000 1.220 mrg
1001 1.220 mrg return sys_fchmod(l, &ua, retval);
1002 1.6 eeh }
1003 1.6 eeh
1004 1.6 eeh int
1005 1.134 dsl netbsd32_setreuid(struct lwp *l, const struct netbsd32_setreuid_args *uap, register_t *retval)
1006 1.6 eeh {
1007 1.134 dsl /* {
1008 1.6 eeh syscallarg(uid_t) ruid;
1009 1.6 eeh syscallarg(uid_t) euid;
1010 1.134 dsl } */
1011 1.6 eeh struct sys_setreuid_args ua;
1012 1.6 eeh
1013 1.11 mrg NETBSD32TO64_UAP(ruid);
1014 1.11 mrg NETBSD32TO64_UAP(euid);
1015 1.220 mrg return sys_setreuid(l, &ua, retval);
1016 1.6 eeh }
1017 1.1 mrg
1018 1.6 eeh int
1019 1.134 dsl netbsd32_setregid(struct lwp *l, const struct netbsd32_setregid_args *uap, register_t *retval)
1020 1.6 eeh {
1021 1.134 dsl /* {
1022 1.6 eeh syscallarg(gid_t) rgid;
1023 1.6 eeh syscallarg(gid_t) egid;
1024 1.134 dsl } */
1025 1.6 eeh struct sys_setregid_args ua;
1026 1.6 eeh
1027 1.11 mrg NETBSD32TO64_UAP(rgid);
1028 1.11 mrg NETBSD32TO64_UAP(egid);
1029 1.220 mrg
1030 1.220 mrg return sys_setregid(l, &ua, retval);
1031 1.1 mrg }
1032 1.1 mrg
1033 1.1 mrg int
1034 1.134 dsl netbsd32_getsockopt(struct lwp *l, const struct netbsd32_getsockopt_args *uap, register_t *retval)
1035 1.1 mrg {
1036 1.134 dsl /* {
1037 1.1 mrg syscallarg(int) s;
1038 1.1 mrg syscallarg(int) level;
1039 1.1 mrg syscallarg(int) name;
1040 1.10 mrg syscallarg(netbsd32_voidp) val;
1041 1.10 mrg syscallarg(netbsd32_intp) avalsize;
1042 1.134 dsl } */
1043 1.1 mrg struct sys_getsockopt_args ua;
1044 1.1 mrg
1045 1.11 mrg NETBSD32TO64_UAP(s);
1046 1.11 mrg NETBSD32TO64_UAP(level);
1047 1.11 mrg NETBSD32TO64_UAP(name);
1048 1.11 mrg NETBSD32TOP_UAP(val, void);
1049 1.103 mrg NETBSD32TOP_UAP(avalsize, socklen_t);
1050 1.220 mrg
1051 1.220 mrg return sys_getsockopt(l, &ua, retval);
1052 1.1 mrg }
1053 1.1 mrg
1054 1.1 mrg int
1055 1.217 rjs netbsd32_getsockopt2(struct lwp *l, const struct netbsd32_getsockopt2_args *uap, register_t *retval)
1056 1.217 rjs {
1057 1.217 rjs /* {
1058 1.217 rjs syscallarg(int) s;
1059 1.217 rjs syscallarg(int) level;
1060 1.217 rjs syscallarg(int) name;
1061 1.217 rjs syscallarg(netbsd32_voidp) val;
1062 1.217 rjs syscallarg(netbsd32_intp) avalsize;
1063 1.217 rjs } */
1064 1.217 rjs struct sys_getsockopt2_args ua;
1065 1.217 rjs
1066 1.217 rjs NETBSD32TO64_UAP(s);
1067 1.217 rjs NETBSD32TO64_UAP(level);
1068 1.217 rjs NETBSD32TO64_UAP(name);
1069 1.217 rjs NETBSD32TOP_UAP(val, void);
1070 1.217 rjs NETBSD32TOP_UAP(avalsize, socklen_t);
1071 1.220 mrg
1072 1.220 mrg return sys_getsockopt2(l, &ua, retval);
1073 1.217 rjs }
1074 1.217 rjs
1075 1.217 rjs int
1076 1.134 dsl netbsd32_rename(struct lwp *l, const struct netbsd32_rename_args *uap, register_t *retval)
1077 1.1 mrg {
1078 1.134 dsl /* {
1079 1.10 mrg syscallarg(const netbsd32_charp) from;
1080 1.10 mrg syscallarg(const netbsd32_charp) to;
1081 1.134 dsl } */
1082 1.1 mrg struct sys_rename_args ua;
1083 1.1 mrg
1084 1.20 eeh NETBSD32TOP_UAP(from, const char);
1085 1.162 njoly NETBSD32TOP_UAP(to, const char);
1086 1.6 eeh
1087 1.220 mrg return sys_rename(l, &ua, retval);
1088 1.1 mrg }
1089 1.1 mrg
1090 1.1 mrg int
1091 1.134 dsl netbsd32_flock(struct lwp *l, const struct netbsd32_flock_args *uap, register_t *retval)
1092 1.6 eeh {
1093 1.134 dsl /* {
1094 1.6 eeh syscallarg(int) fd;
1095 1.6 eeh syscallarg(int) how;
1096 1.134 dsl } */
1097 1.6 eeh struct sys_flock_args ua;
1098 1.6 eeh
1099 1.11 mrg NETBSD32TO64_UAP(fd);
1100 1.162 njoly NETBSD32TO64_UAP(how);
1101 1.6 eeh
1102 1.220 mrg return sys_flock(l, &ua, retval);
1103 1.6 eeh }
1104 1.6 eeh
1105 1.6 eeh int
1106 1.134 dsl netbsd32_mkfifo(struct lwp *l, const struct netbsd32_mkfifo_args *uap, register_t *retval)
1107 1.1 mrg {
1108 1.134 dsl /* {
1109 1.10 mrg syscallarg(const netbsd32_charp) path;
1110 1.1 mrg syscallarg(mode_t) mode;
1111 1.134 dsl } */
1112 1.1 mrg struct sys_mkfifo_args ua;
1113 1.1 mrg
1114 1.162 njoly NETBSD32TOP_UAP(path, const char);
1115 1.11 mrg NETBSD32TO64_UAP(mode);
1116 1.220 mrg
1117 1.220 mrg return sys_mkfifo(l, &ua, retval);
1118 1.1 mrg }
1119 1.1 mrg
1120 1.1 mrg int
1121 1.134 dsl netbsd32_shutdown(struct lwp *l, const struct netbsd32_shutdown_args *uap, register_t *retval)
1122 1.6 eeh {
1123 1.134 dsl /* {
1124 1.6 eeh syscallarg(int) s;
1125 1.6 eeh syscallarg(int) how;
1126 1.134 dsl } */
1127 1.6 eeh struct sys_shutdown_args ua;
1128 1.6 eeh
1129 1.162 njoly NETBSD32TO64_UAP(s);
1130 1.11 mrg NETBSD32TO64_UAP(how);
1131 1.220 mrg
1132 1.220 mrg return sys_shutdown(l, &ua, retval);
1133 1.6 eeh }
1134 1.6 eeh
1135 1.6 eeh int
1136 1.134 dsl netbsd32_socketpair(struct lwp *l, const struct netbsd32_socketpair_args *uap, register_t *retval)
1137 1.6 eeh {
1138 1.134 dsl /* {
1139 1.6 eeh syscallarg(int) domain;
1140 1.6 eeh syscallarg(int) type;
1141 1.6 eeh syscallarg(int) protocol;
1142 1.10 mrg syscallarg(netbsd32_intp) rsv;
1143 1.134 dsl } */
1144 1.6 eeh struct sys_socketpair_args ua;
1145 1.6 eeh
1146 1.11 mrg NETBSD32TO64_UAP(domain);
1147 1.11 mrg NETBSD32TO64_UAP(type);
1148 1.11 mrg NETBSD32TO64_UAP(protocol);
1149 1.11 mrg NETBSD32TOP_UAP(rsv, int);
1150 1.220 mrg
1151 1.6 eeh /* Since we're just copying out two `int's we can do this */
1152 1.220 mrg return sys_socketpair(l, &ua, retval);
1153 1.6 eeh }
1154 1.6 eeh
1155 1.6 eeh int
1156 1.134 dsl netbsd32_mkdir(struct lwp *l, const struct netbsd32_mkdir_args *uap, register_t *retval)
1157 1.1 mrg {
1158 1.134 dsl /* {
1159 1.10 mrg syscallarg(const netbsd32_charp) path;
1160 1.1 mrg syscallarg(mode_t) mode;
1161 1.134 dsl } */
1162 1.1 mrg struct sys_mkdir_args ua;
1163 1.1 mrg
1164 1.162 njoly NETBSD32TOP_UAP(path, const char);
1165 1.11 mrg NETBSD32TO64_UAP(mode);
1166 1.220 mrg
1167 1.220 mrg return sys_mkdir(l, &ua, retval);
1168 1.1 mrg }
1169 1.1 mrg
1170 1.1 mrg int
1171 1.134 dsl netbsd32_rmdir(struct lwp *l, const struct netbsd32_rmdir_args *uap, register_t *retval)
1172 1.1 mrg {
1173 1.134 dsl /* {
1174 1.10 mrg syscallarg(const netbsd32_charp) path;
1175 1.134 dsl } */
1176 1.1 mrg struct sys_rmdir_args ua;
1177 1.1 mrg
1178 1.11 mrg NETBSD32TOP_UAP(path, const char);
1179 1.220 mrg
1180 1.220 mrg return sys_rmdir(l, &ua, retval);
1181 1.1 mrg }
1182 1.1 mrg
1183 1.1 mrg int
1184 1.134 dsl netbsd32_pread(struct lwp *l, const struct netbsd32_pread_args *uap, register_t *retval)
1185 1.1 mrg {
1186 1.134 dsl /* {
1187 1.1 mrg syscallarg(int) fd;
1188 1.10 mrg syscallarg(netbsd32_voidp) buf;
1189 1.10 mrg syscallarg(netbsd32_size_t) nbyte;
1190 1.157 pooka syscallarg(int) PAD;
1191 1.186 njoly syscallarg(netbsd32_off_t) offset;
1192 1.134 dsl } */
1193 1.1 mrg struct sys_pread_args ua;
1194 1.1 mrg
1195 1.11 mrg NETBSD32TO64_UAP(fd);
1196 1.11 mrg NETBSD32TOP_UAP(buf, void);
1197 1.11 mrg NETBSD32TOX_UAP(nbyte, size_t);
1198 1.157 pooka NETBSD32TO64_UAP(PAD);
1199 1.11 mrg NETBSD32TO64_UAP(offset);
1200 1.220 mrg
1201 1.137 dsl return sys_pread(l, &ua, retval);
1202 1.1 mrg }
1203 1.1 mrg
1204 1.1 mrg int
1205 1.134 dsl netbsd32_pwrite(struct lwp *l, const struct netbsd32_pwrite_args *uap, register_t *retval)
1206 1.1 mrg {
1207 1.134 dsl /* {
1208 1.1 mrg syscallarg(int) fd;
1209 1.10 mrg syscallarg(const netbsd32_voidp) buf;
1210 1.10 mrg syscallarg(netbsd32_size_t) nbyte;
1211 1.157 pooka syscallarg(int) PAD;
1212 1.186 njoly syscallarg(netbsd32_off_t) offset;
1213 1.134 dsl } */
1214 1.1 mrg struct sys_pwrite_args ua;
1215 1.1 mrg
1216 1.11 mrg NETBSD32TO64_UAP(fd);
1217 1.11 mrg NETBSD32TOP_UAP(buf, void);
1218 1.11 mrg NETBSD32TOX_UAP(nbyte, size_t);
1219 1.157 pooka NETBSD32TO64_UAP(PAD);
1220 1.11 mrg NETBSD32TO64_UAP(offset);
1221 1.220 mrg
1222 1.137 dsl return sys_pwrite(l, &ua, retval);
1223 1.1 mrg }
1224 1.1 mrg
1225 1.6 eeh int
1226 1.134 dsl netbsd32_setgid(struct lwp *l, const struct netbsd32_setgid_args *uap, register_t *retval)
1227 1.6 eeh {
1228 1.134 dsl /* {
1229 1.6 eeh syscallarg(gid_t) gid;
1230 1.134 dsl } */
1231 1.6 eeh struct sys_setgid_args ua;
1232 1.6 eeh
1233 1.11 mrg NETBSD32TO64_UAP(gid);
1234 1.220 mrg
1235 1.220 mrg return sys_setgid(l, &ua, retval);
1236 1.6 eeh }
1237 1.6 eeh
1238 1.6 eeh int
1239 1.134 dsl netbsd32_setegid(struct lwp *l, const struct netbsd32_setegid_args *uap, register_t *retval)
1240 1.6 eeh {
1241 1.134 dsl /* {
1242 1.6 eeh syscallarg(gid_t) egid;
1243 1.134 dsl } */
1244 1.6 eeh struct sys_setegid_args ua;
1245 1.6 eeh
1246 1.11 mrg NETBSD32TO64_UAP(egid);
1247 1.220 mrg
1248 1.220 mrg return sys_setegid(l, &ua, retval);
1249 1.6 eeh }
1250 1.6 eeh
1251 1.6 eeh int
1252 1.134 dsl netbsd32_seteuid(struct lwp *l, const struct netbsd32_seteuid_args *uap, register_t *retval)
1253 1.6 eeh {
1254 1.134 dsl /* {
1255 1.6 eeh syscallarg(gid_t) euid;
1256 1.134 dsl } */
1257 1.6 eeh struct sys_seteuid_args ua;
1258 1.6 eeh
1259 1.11 mrg NETBSD32TO64_UAP(euid);
1260 1.220 mrg
1261 1.220 mrg return sys_seteuid(l, &ua, retval);
1262 1.1 mrg }
1263 1.1 mrg
1264 1.1 mrg int
1265 1.134 dsl netbsd32_pathconf(struct lwp *l, const struct netbsd32_pathconf_args *uap, register_t *retval)
1266 1.1 mrg {
1267 1.134 dsl /* {
1268 1.194 matt syscallarg(netbsd32_charp) path;
1269 1.1 mrg syscallarg(int) name;
1270 1.134 dsl } */
1271 1.1 mrg struct sys_pathconf_args ua;
1272 1.1 mrg
1273 1.11 mrg NETBSD32TOP_UAP(path, const char);
1274 1.11 mrg NETBSD32TO64_UAP(name);
1275 1.220 mrg
1276 1.137 dsl return sys_pathconf(l, &ua, retval);
1277 1.1 mrg }
1278 1.1 mrg
1279 1.1 mrg int
1280 1.134 dsl netbsd32_fpathconf(struct lwp *l, const struct netbsd32_fpathconf_args *uap, register_t *retval)
1281 1.1 mrg {
1282 1.134 dsl /* {
1283 1.1 mrg syscallarg(int) fd;
1284 1.1 mrg syscallarg(int) name;
1285 1.134 dsl } */
1286 1.1 mrg struct sys_fpathconf_args ua;
1287 1.1 mrg
1288 1.11 mrg NETBSD32TO64_UAP(fd);
1289 1.11 mrg NETBSD32TO64_UAP(name);
1290 1.221 mrg
1291 1.137 dsl return sys_fpathconf(l, &ua, retval);
1292 1.1 mrg }
1293 1.1 mrg
1294 1.1 mrg int
1295 1.135 dsl netbsd32_mremap(struct lwp *l, const struct netbsd32_mremap_args *uap, register_t *retval)
1296 1.135 dsl {
1297 1.135 dsl /* {
1298 1.135 dsl syscallarg(void *) old_address;
1299 1.135 dsl syscallarg(size_t) old_size;
1300 1.135 dsl syscallarg(void *) new_address;
1301 1.135 dsl syscallarg(size_t) new_size;
1302 1.135 dsl syscallarg(int) flags;
1303 1.135 dsl } */
1304 1.135 dsl struct sys_mremap_args ua;
1305 1.135 dsl
1306 1.135 dsl NETBSD32TOP_UAP(old_address, void);
1307 1.135 dsl NETBSD32TOX_UAP(old_size, size_t);
1308 1.135 dsl NETBSD32TOP_UAP(new_address, void);
1309 1.135 dsl NETBSD32TOX_UAP(new_size, size_t);
1310 1.135 dsl NETBSD32TO64_UAP(flags);
1311 1.135 dsl
1312 1.135 dsl return sys_mremap(l, &ua, retval);
1313 1.135 dsl }
1314 1.135 dsl
1315 1.135 dsl int
1316 1.134 dsl netbsd32_lseek(struct lwp *l, const struct netbsd32_lseek_args *uap, register_t *retval)
1317 1.6 eeh {
1318 1.134 dsl /* {
1319 1.6 eeh syscallarg(int) fd;
1320 1.157 pooka syscallarg(int) PAD;
1321 1.186 njoly syscallarg(netbsd32_off_t) offset;
1322 1.6 eeh syscallarg(int) whence;
1323 1.134 dsl } */
1324 1.6 eeh struct sys_lseek_args ua;
1325 1.138 dsl union {
1326 1.138 dsl register_t retval64[2];
1327 1.138 dsl register32_t retval32[4];
1328 1.138 dsl } newpos;
1329 1.97 martin int rv;
1330 1.6 eeh
1331 1.11 mrg NETBSD32TO64_UAP(fd);
1332 1.157 pooka NETBSD32TO64_UAP(PAD);
1333 1.11 mrg NETBSD32TO64_UAP(offset);
1334 1.11 mrg NETBSD32TO64_UAP(whence);
1335 1.138 dsl rv = sys_lseek(l, &ua, newpos.retval64);
1336 1.138 dsl
1337 1.138 dsl /*
1338 1.138 dsl * We have to split the 64 bit value into 2 halves which will
1339 1.138 dsl * end up in separate 32 bit registers.
1340 1.138 dsl * This should DTRT on big and little-endian systems provided that
1341 1.138 dsl * gcc's 'strict aliasing' tests don't decide that the retval32[]
1342 1.138 dsl * entries can't have been assigned to, so need not be read!
1343 1.138 dsl */
1344 1.138 dsl retval[0] = newpos.retval32[0];
1345 1.138 dsl retval[1] = newpos.retval32[1];
1346 1.138 dsl
1347 1.97 martin return rv;
1348 1.6 eeh }
1349 1.6 eeh
1350 1.6 eeh int
1351 1.134 dsl netbsd32_truncate(struct lwp *l, const struct netbsd32_truncate_args *uap, register_t *retval)
1352 1.1 mrg {
1353 1.134 dsl /* {
1354 1.10 mrg syscallarg(const netbsd32_charp) path;
1355 1.157 pooka syscallarg(int) PAD;
1356 1.186 njoly syscallarg(netbsd32_off_t) length;
1357 1.134 dsl } */
1358 1.1 mrg struct sys_truncate_args ua;
1359 1.1 mrg
1360 1.11 mrg NETBSD32TOP_UAP(path, const char);
1361 1.157 pooka NETBSD32TO64_UAP(PAD);
1362 1.11 mrg NETBSD32TO64_UAP(length);
1363 1.220 mrg
1364 1.220 mrg return sys_truncate(l, &ua, retval);
1365 1.1 mrg }
1366 1.1 mrg
1367 1.1 mrg int
1368 1.134 dsl netbsd32_ftruncate(struct lwp *l, const struct netbsd32_ftruncate_args *uap, register_t *retval)
1369 1.6 eeh {
1370 1.134 dsl /* {
1371 1.6 eeh syscallarg(int) fd;
1372 1.157 pooka syscallarg(int) PAD;
1373 1.186 njoly syscallarg(netbsd32_off_t) length;
1374 1.134 dsl } */
1375 1.6 eeh struct sys_ftruncate_args ua;
1376 1.6 eeh
1377 1.11 mrg NETBSD32TO64_UAP(fd);
1378 1.157 pooka NETBSD32TO64_UAP(PAD);
1379 1.11 mrg NETBSD32TO64_UAP(length);
1380 1.220 mrg
1381 1.220 mrg return sys_ftruncate(l, &ua, retval);
1382 1.6 eeh }
1383 1.6 eeh
1384 1.53 mrg int
1385 1.134 dsl netbsd32_mlock(struct lwp *l, const struct netbsd32_mlock_args *uap, register_t *retval)
1386 1.53 mrg {
1387 1.134 dsl /* {
1388 1.57 mrg syscallarg(const netbsd32_voidp) addr;
1389 1.57 mrg syscallarg(netbsd32_size_t) len;
1390 1.134 dsl } */
1391 1.57 mrg struct sys_mlock_args ua;
1392 1.53 mrg
1393 1.57 mrg NETBSD32TOP_UAP(addr, const void);
1394 1.57 mrg NETBSD32TO64_UAP(len);
1395 1.220 mrg
1396 1.220 mrg return sys_mlock(l, &ua, retval);
1397 1.53 mrg }
1398 1.53 mrg
1399 1.6 eeh int
1400 1.134 dsl netbsd32_munlock(struct lwp *l, const struct netbsd32_munlock_args *uap, register_t *retval)
1401 1.1 mrg {
1402 1.134 dsl /* {
1403 1.57 mrg syscallarg(const netbsd32_voidp) addr;
1404 1.57 mrg syscallarg(netbsd32_size_t) len;
1405 1.134 dsl } */
1406 1.1 mrg struct sys_munlock_args ua;
1407 1.1 mrg
1408 1.11 mrg NETBSD32TOP_UAP(addr, const void);
1409 1.11 mrg NETBSD32TO64_UAP(len);
1410 1.220 mrg
1411 1.220 mrg return sys_munlock(l, &ua, retval);
1412 1.1 mrg }
1413 1.1 mrg
1414 1.1 mrg int
1415 1.134 dsl netbsd32_undelete(struct lwp *l, const struct netbsd32_undelete_args *uap, register_t *retval)
1416 1.1 mrg {
1417 1.134 dsl /* {
1418 1.10 mrg syscallarg(const netbsd32_charp) path;
1419 1.134 dsl } */
1420 1.1 mrg struct sys_undelete_args ua;
1421 1.1 mrg
1422 1.11 mrg NETBSD32TOP_UAP(path, const char);
1423 1.220 mrg
1424 1.220 mrg return sys_undelete(l, &ua, retval);
1425 1.1 mrg }
1426 1.1 mrg
1427 1.6 eeh int
1428 1.134 dsl netbsd32_getpgid(struct lwp *l, const struct netbsd32_getpgid_args *uap, register_t *retval)
1429 1.6 eeh {
1430 1.134 dsl /* {
1431 1.6 eeh syscallarg(pid_t) pid;
1432 1.134 dsl } */
1433 1.6 eeh struct sys_getpgid_args ua;
1434 1.1 mrg
1435 1.11 mrg NETBSD32TO64_UAP(pid);
1436 1.220 mrg
1437 1.220 mrg return sys_getpgid(l, &ua, retval);
1438 1.1 mrg }
1439 1.1 mrg
1440 1.1 mrg int
1441 1.134 dsl netbsd32_reboot(struct lwp *l, const struct netbsd32_reboot_args *uap, register_t *retval)
1442 1.1 mrg {
1443 1.134 dsl /* {
1444 1.1 mrg syscallarg(int) opt;
1445 1.10 mrg syscallarg(netbsd32_charp) bootstr;
1446 1.134 dsl } */
1447 1.1 mrg struct sys_reboot_args ua;
1448 1.1 mrg
1449 1.11 mrg NETBSD32TO64_UAP(opt);
1450 1.11 mrg NETBSD32TOP_UAP(bootstr, char);
1451 1.220 mrg
1452 1.220 mrg return sys_reboot(l, &ua, retval);
1453 1.1 mrg }
1454 1.1 mrg
1455 1.100 manu #include <sys/poll.h>
1456 1.1 mrg int
1457 1.134 dsl netbsd32_poll(struct lwp *l, const struct netbsd32_poll_args *uap, register_t *retval)
1458 1.1 mrg {
1459 1.134 dsl /* {
1460 1.10 mrg syscallarg(netbsd32_pollfdp_t) fds;
1461 1.1 mrg syscallarg(u_int) nfds;
1462 1.1 mrg syscallarg(int) timeout;
1463 1.134 dsl } */
1464 1.1 mrg struct sys_poll_args ua;
1465 1.1 mrg
1466 1.11 mrg NETBSD32TOP_UAP(fds, struct pollfd);
1467 1.11 mrg NETBSD32TO64_UAP(nfds);
1468 1.11 mrg NETBSD32TO64_UAP(timeout);
1469 1.100 manu
1470 1.220 mrg return sys_poll(l, &ua, retval);
1471 1.1 mrg }
1472 1.1 mrg
1473 1.6 eeh int
1474 1.134 dsl netbsd32_fdatasync(struct lwp *l, const struct netbsd32_fdatasync_args *uap, register_t *retval)
1475 1.6 eeh {
1476 1.134 dsl /* {
1477 1.6 eeh syscallarg(int) fd;
1478 1.134 dsl } */
1479 1.6 eeh struct sys_fdatasync_args ua;
1480 1.6 eeh
1481 1.11 mrg NETBSD32TO64_UAP(fd);
1482 1.220 mrg
1483 1.220 mrg return sys_fdatasync(l, &ua, retval);
1484 1.1 mrg }
1485 1.1 mrg
1486 1.1 mrg int
1487 1.134 dsl netbsd32___posix_rename(struct lwp *l, const struct netbsd32___posix_rename_args *uap, register_t *retval)
1488 1.1 mrg {
1489 1.134 dsl /* {
1490 1.10 mrg syscallarg(const netbsd32_charp) from;
1491 1.10 mrg syscallarg(const netbsd32_charp) to;
1492 1.134 dsl } */
1493 1.1 mrg struct sys___posix_rename_args ua;
1494 1.1 mrg
1495 1.20 eeh NETBSD32TOP_UAP(from, const char);
1496 1.20 eeh NETBSD32TOP_UAP(to, const char);
1497 1.220 mrg
1498 1.220 mrg return sys___posix_rename(l, &ua, retval);
1499 1.1 mrg }
1500 1.1 mrg
1501 1.215 christos static void
1502 1.215 christos swapent32_cvt(void *p, const struct swapent *se)
1503 1.184 manu {
1504 1.215 christos struct netbsd32_swapent *se32 = p;
1505 1.184 manu
1506 1.215 christos se32->se_dev = se->se_dev;
1507 1.215 christos se32->se_flags = se->se_flags;
1508 1.215 christos se32->se_nblks = se->se_nblks;
1509 1.215 christos se32->se_inuse = se->se_inuse;
1510 1.215 christos se32->se_priority = se->se_priority;
1511 1.215 christos KASSERT(sizeof(se->se_path) <= sizeof(se32->se_path));
1512 1.215 christos strcpy(se32->se_path, se->se_path);
1513 1.184 manu }
1514 1.184 manu
1515 1.1 mrg int
1516 1.215 christos netbsd32_swapctl(struct lwp *l, const struct netbsd32_swapctl_args *uap,
1517 1.215 christos register_t *retval)
1518 1.1 mrg {
1519 1.134 dsl /* {
1520 1.1 mrg syscallarg(int) cmd;
1521 1.10 mrg syscallarg(const netbsd32_voidp) arg;
1522 1.1 mrg syscallarg(int) misc;
1523 1.134 dsl } */
1524 1.1 mrg struct sys_swapctl_args ua;
1525 1.1 mrg
1526 1.11 mrg NETBSD32TO64_UAP(cmd);
1527 1.89 chs NETBSD32TOP_UAP(arg, void);
1528 1.11 mrg NETBSD32TO64_UAP(misc);
1529 1.184 manu
1530 1.184 manu /* SWAP_STATS50 and SWAP_STATS13 structures need no translation */
1531 1.215 christos if (SCARG(&ua, cmd) == SWAP_STATS) {
1532 1.215 christos swapsys_lock(RW_READER);
1533 1.215 christos int error = uvm_swap_stats(SCARG(&ua, arg), SCARG(&ua, misc),
1534 1.215 christos swapent32_cvt, sizeof(struct netbsd32_swapent), retval);
1535 1.215 christos swapsys_unlock();
1536 1.215 christos return error;
1537 1.215 christos }
1538 1.202 skrll
1539 1.220 mrg return sys_swapctl(l, &ua, retval);
1540 1.1 mrg }
1541 1.1 mrg
1542 1.1 mrg int
1543 1.134 dsl netbsd32_minherit(struct lwp *l, const struct netbsd32_minherit_args *uap, register_t *retval)
1544 1.1 mrg {
1545 1.134 dsl /* {
1546 1.10 mrg syscallarg(netbsd32_voidp) addr;
1547 1.10 mrg syscallarg(netbsd32_size_t) len;
1548 1.1 mrg syscallarg(int) inherit;
1549 1.134 dsl } */
1550 1.1 mrg struct sys_minherit_args ua;
1551 1.1 mrg
1552 1.11 mrg NETBSD32TOP_UAP(addr, void);
1553 1.11 mrg NETBSD32TOX_UAP(len, size_t);
1554 1.11 mrg NETBSD32TO64_UAP(inherit);
1555 1.220 mrg
1556 1.220 mrg return sys_minherit(l, &ua, retval);
1557 1.1 mrg }
1558 1.1 mrg
1559 1.1 mrg int
1560 1.134 dsl netbsd32_lchmod(struct lwp *l, const struct netbsd32_lchmod_args *uap, register_t *retval)
1561 1.1 mrg {
1562 1.134 dsl /* {
1563 1.10 mrg syscallarg(const netbsd32_charp) path;
1564 1.1 mrg syscallarg(mode_t) mode;
1565 1.134 dsl } */
1566 1.1 mrg struct sys_lchmod_args ua;
1567 1.1 mrg
1568 1.11 mrg NETBSD32TOP_UAP(path, const char);
1569 1.11 mrg NETBSD32TO64_UAP(mode);
1570 1.220 mrg
1571 1.220 mrg return sys_lchmod(l, &ua, retval);
1572 1.1 mrg }
1573 1.1 mrg
1574 1.1 mrg int
1575 1.134 dsl netbsd32_lchown(struct lwp *l, const struct netbsd32_lchown_args *uap, register_t *retval)
1576 1.1 mrg {
1577 1.134 dsl /* {
1578 1.10 mrg syscallarg(const netbsd32_charp) path;
1579 1.1 mrg syscallarg(uid_t) uid;
1580 1.1 mrg syscallarg(gid_t) gid;
1581 1.134 dsl } */
1582 1.1 mrg struct sys_lchown_args ua;
1583 1.1 mrg
1584 1.11 mrg NETBSD32TOP_UAP(path, const char);
1585 1.11 mrg NETBSD32TO64_UAP(uid);
1586 1.11 mrg NETBSD32TO64_UAP(gid);
1587 1.220 mrg
1588 1.220 mrg return sys_lchown(l, &ua, retval);
1589 1.1 mrg }
1590 1.1 mrg
1591 1.1 mrg int
1592 1.134 dsl netbsd32___msync13(struct lwp *l, const struct netbsd32___msync13_args *uap, register_t *retval)
1593 1.1 mrg {
1594 1.134 dsl /* {
1595 1.10 mrg syscallarg(netbsd32_voidp) addr;
1596 1.10 mrg syscallarg(netbsd32_size_t) len;
1597 1.1 mrg syscallarg(int) flags;
1598 1.134 dsl } */
1599 1.1 mrg struct sys___msync13_args ua;
1600 1.1 mrg
1601 1.11 mrg NETBSD32TOP_UAP(addr, void);
1602 1.11 mrg NETBSD32TOX_UAP(len, size_t);
1603 1.11 mrg NETBSD32TO64_UAP(flags);
1604 1.220 mrg
1605 1.220 mrg return sys___msync13(l, &ua, retval);
1606 1.1 mrg }
1607 1.1 mrg
1608 1.1 mrg int
1609 1.134 dsl netbsd32___posix_chown(struct lwp *l, const struct netbsd32___posix_chown_args *uap, register_t *retval)
1610 1.1 mrg {
1611 1.134 dsl /* {
1612 1.10 mrg syscallarg(const netbsd32_charp) path;
1613 1.1 mrg syscallarg(uid_t) uid;
1614 1.1 mrg syscallarg(gid_t) gid;
1615 1.134 dsl } */
1616 1.1 mrg struct sys___posix_chown_args ua;
1617 1.1 mrg
1618 1.11 mrg NETBSD32TOP_UAP(path, const char);
1619 1.11 mrg NETBSD32TO64_UAP(uid);
1620 1.11 mrg NETBSD32TO64_UAP(gid);
1621 1.220 mrg
1622 1.220 mrg return sys___posix_chown(l, &ua, retval);
1623 1.1 mrg }
1624 1.1 mrg
1625 1.1 mrg int
1626 1.134 dsl netbsd32___posix_fchown(struct lwp *l, const struct netbsd32___posix_fchown_args *uap, register_t *retval)
1627 1.6 eeh {
1628 1.134 dsl /* {
1629 1.6 eeh syscallarg(int) fd;
1630 1.6 eeh syscallarg(uid_t) uid;
1631 1.6 eeh syscallarg(gid_t) gid;
1632 1.134 dsl } */
1633 1.6 eeh struct sys___posix_fchown_args ua;
1634 1.6 eeh
1635 1.11 mrg NETBSD32TO64_UAP(fd);
1636 1.11 mrg NETBSD32TO64_UAP(uid);
1637 1.11 mrg NETBSD32TO64_UAP(gid);
1638 1.220 mrg
1639 1.220 mrg return sys___posix_fchown(l, &ua, retval);
1640 1.6 eeh }
1641 1.6 eeh
1642 1.6 eeh int
1643 1.134 dsl netbsd32___posix_lchown(struct lwp *l, const struct netbsd32___posix_lchown_args *uap, register_t *retval)
1644 1.1 mrg {
1645 1.134 dsl /* {
1646 1.10 mrg syscallarg(const netbsd32_charp) path;
1647 1.1 mrg syscallarg(uid_t) uid;
1648 1.1 mrg syscallarg(gid_t) gid;
1649 1.134 dsl } */
1650 1.1 mrg struct sys___posix_lchown_args ua;
1651 1.1 mrg
1652 1.11 mrg NETBSD32TOP_UAP(path, const char);
1653 1.11 mrg NETBSD32TO64_UAP(uid);
1654 1.11 mrg NETBSD32TO64_UAP(gid);
1655 1.220 mrg
1656 1.220 mrg return sys___posix_lchown(l, &ua, retval);
1657 1.1 mrg }
1658 1.1 mrg
1659 1.1 mrg int
1660 1.134 dsl netbsd32_getsid(struct lwp *l, const struct netbsd32_getsid_args *uap, register_t *retval)
1661 1.6 eeh {
1662 1.134 dsl /* {
1663 1.6 eeh syscallarg(pid_t) pid;
1664 1.134 dsl } */
1665 1.6 eeh struct sys_getsid_args ua;
1666 1.6 eeh
1667 1.11 mrg NETBSD32TO64_UAP(pid);
1668 1.220 mrg
1669 1.220 mrg return sys_getsid(l, &ua, retval);
1670 1.6 eeh }
1671 1.6 eeh
1672 1.6 eeh int
1673 1.134 dsl netbsd32_fktrace(struct lwp *l, const struct netbsd32_fktrace_args *uap, register_t *retval)
1674 1.6 eeh {
1675 1.134 dsl /* {
1676 1.134 dsl syscallarg(int) fd;
1677 1.6 eeh syscallarg(int) ops;
1678 1.6 eeh syscallarg(int) facs;
1679 1.6 eeh syscallarg(int) pid;
1680 1.134 dsl } */
1681 1.6 eeh struct sys_fktrace_args ua;
1682 1.6 eeh
1683 1.32 mrg NETBSD32TOX_UAP(fd, int);
1684 1.11 mrg NETBSD32TO64_UAP(ops);
1685 1.11 mrg NETBSD32TO64_UAP(facs);
1686 1.11 mrg NETBSD32TO64_UAP(pid);
1687 1.220 mrg
1688 1.220 mrg return sys_fktrace(l, &ua, retval);
1689 1.6 eeh }
1690 1.6 eeh
1691 1.134 dsl int
1692 1.134 dsl netbsd32___sigpending14(struct lwp *l, const struct netbsd32___sigpending14_args *uap, register_t *retval)
1693 1.20 eeh {
1694 1.134 dsl /* {
1695 1.20 eeh syscallarg(sigset_t *) set;
1696 1.134 dsl } */
1697 1.20 eeh struct sys___sigpending14_args ua;
1698 1.20 eeh
1699 1.20 eeh NETBSD32TOP_UAP(set, sigset_t);
1700 1.220 mrg
1701 1.220 mrg return sys___sigpending14(l, &ua, retval);
1702 1.20 eeh }
1703 1.20 eeh
1704 1.134 dsl int
1705 1.134 dsl netbsd32___sigprocmask14(struct lwp *l, const struct netbsd32___sigprocmask14_args *uap, register_t *retval)
1706 1.20 eeh {
1707 1.134 dsl /* {
1708 1.20 eeh syscallarg(int) how;
1709 1.20 eeh syscallarg(const sigset_t *) set;
1710 1.20 eeh syscallarg(sigset_t *) oset;
1711 1.134 dsl } */
1712 1.20 eeh struct sys___sigprocmask14_args ua;
1713 1.20 eeh
1714 1.20 eeh NETBSD32TO64_UAP(how);
1715 1.20 eeh NETBSD32TOP_UAP(set, sigset_t);
1716 1.20 eeh NETBSD32TOP_UAP(oset, sigset_t);
1717 1.220 mrg
1718 1.220 mrg return sys___sigprocmask14(l, &ua, retval);
1719 1.20 eeh }
1720 1.20 eeh
1721 1.134 dsl int
1722 1.134 dsl netbsd32___sigsuspend14(struct lwp *l, const struct netbsd32___sigsuspend14_args *uap, register_t *retval)
1723 1.20 eeh {
1724 1.134 dsl /* {
1725 1.20 eeh syscallarg(const sigset_t *) set;
1726 1.134 dsl } */
1727 1.20 eeh struct sys___sigsuspend14_args ua;
1728 1.20 eeh
1729 1.20 eeh NETBSD32TOP_UAP(set, sigset_t);
1730 1.220 mrg
1731 1.220 mrg return sys___sigsuspend14(l, &ua, retval);
1732 1.171 dsl }
1733 1.20 eeh
1734 1.134 dsl int
1735 1.134 dsl netbsd32_fchroot(struct lwp *l, const struct netbsd32_fchroot_args *uap, register_t *retval)
1736 1.20 eeh {
1737 1.134 dsl /* {
1738 1.20 eeh syscallarg(int) fd;
1739 1.134 dsl } */
1740 1.20 eeh struct sys_fchroot_args ua;
1741 1.87 perry
1742 1.20 eeh NETBSD32TO64_UAP(fd);
1743 1.220 mrg
1744 1.220 mrg return sys_fchroot(l, &ua, retval);
1745 1.20 eeh }
1746 1.20 eeh
1747 1.20 eeh /*
1748 1.20 eeh * Open a file given a file handle.
1749 1.20 eeh *
1750 1.20 eeh * Check permissions, allocate an open file structure,
1751 1.20 eeh * and call the device open routine if any.
1752 1.20 eeh */
1753 1.6 eeh int
1754 1.134 dsl netbsd32___fhopen40(struct lwp *l, const struct netbsd32___fhopen40_args *uap, register_t *retval)
1755 1.20 eeh {
1756 1.134 dsl /* {
1757 1.109 martin syscallarg(const netbsd32_pointer_t *) fhp;
1758 1.109 martin syscallarg(netbsd32_size_t) fh_size;
1759 1.20 eeh syscallarg(int) flags;
1760 1.134 dsl } */
1761 1.109 martin struct sys___fhopen40_args ua;
1762 1.20 eeh
1763 1.20 eeh NETBSD32TOP_UAP(fhp, fhandle_t);
1764 1.109 martin NETBSD32TO64_UAP(fh_size);
1765 1.20 eeh NETBSD32TO64_UAP(flags);
1766 1.220 mrg
1767 1.220 mrg return sys___fhopen40(l, &ua, retval);
1768 1.20 eeh }
1769 1.20 eeh
1770 1.37 martin /* virtual memory syscalls */
1771 1.213 kamil int
1772 1.213 kamil netbsd32_ovadvise(struct lwp *l, const struct netbsd32_ovadvise_args *uap, register_t *retval)
1773 1.213 kamil {
1774 1.213 kamil /* {
1775 1.213 kamil syscallarg(int) anom;
1776 1.213 kamil } */
1777 1.213 kamil struct sys_ovadvise_args ua;
1778 1.213 kamil
1779 1.213 kamil NETBSD32TO64_UAP(anom);
1780 1.220 mrg
1781 1.220 mrg return sys_ovadvise(l, &ua, retval);
1782 1.213 kamil }
1783 1.37 martin
1784 1.90 cube int
1785 1.134 dsl netbsd32_uuidgen(struct lwp *l, const struct netbsd32_uuidgen_args *uap, register_t *retval)
1786 1.90 cube {
1787 1.134 dsl /* {
1788 1.90 cube syscallarg(netbsd32_uuidp_t) store;
1789 1.90 cube syscallarg(int) count;
1790 1.134 dsl } */
1791 1.90 cube struct sys_uuidgen_args ua;
1792 1.90 cube
1793 1.90 cube NETBSD32TOP_UAP(store, struct uuid);
1794 1.90 cube NETBSD32TO64_UAP(count);
1795 1.220 mrg
1796 1.220 mrg return sys_uuidgen(l, &ua, retval);
1797 1.90 cube }
1798 1.91 cube
1799 1.91 cube int
1800 1.134 dsl netbsd32_extattrctl(struct lwp *l, const struct netbsd32_extattrctl_args *uap, register_t *retval)
1801 1.91 cube {
1802 1.134 dsl /* {
1803 1.91 cube syscallarg(const netbsd32_charp) path;
1804 1.91 cube syscallarg(int) cmd;
1805 1.91 cube syscallarg(const netbsd32_charp) filename;
1806 1.91 cube syscallarg(int) attrnamespace;
1807 1.91 cube syscallarg(const netbsd32_charp) attrname;
1808 1.134 dsl } */
1809 1.91 cube struct sys_extattrctl_args ua;
1810 1.91 cube
1811 1.91 cube NETBSD32TOP_UAP(path, const char);
1812 1.91 cube NETBSD32TO64_UAP(cmd);
1813 1.91 cube NETBSD32TOP_UAP(filename, const char);
1814 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1815 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1816 1.220 mrg
1817 1.91 cube return sys_extattrctl(l, &ua, retval);
1818 1.91 cube }
1819 1.91 cube
1820 1.91 cube int
1821 1.134 dsl netbsd32_extattr_set_fd(struct lwp *l, const struct netbsd32_extattr_set_fd_args *uap, register_t *retval)
1822 1.91 cube {
1823 1.134 dsl /* {
1824 1.91 cube syscallarg(int) fd;
1825 1.91 cube syscallarg(int) attrnamespace;
1826 1.91 cube syscallarg(const netbsd32_charp) attrname;
1827 1.91 cube syscallarg(const netbsd32_voidp) data;
1828 1.91 cube syscallarg(netbsd32_size_t) nbytes;
1829 1.134 dsl } */
1830 1.91 cube struct sys_extattr_set_fd_args ua;
1831 1.91 cube
1832 1.91 cube NETBSD32TO64_UAP(fd);
1833 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1834 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1835 1.91 cube NETBSD32TOP_UAP(data, const void);
1836 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
1837 1.220 mrg
1838 1.91 cube return sys_extattr_set_fd(l, &ua, retval);
1839 1.91 cube }
1840 1.91 cube
1841 1.91 cube int
1842 1.134 dsl netbsd32_extattr_set_file(struct lwp *l, const struct netbsd32_extattr_set_file_args *uap, register_t *retval)
1843 1.91 cube {
1844 1.134 dsl /* {
1845 1.91 cube syscallarg(const netbsd32_charp) path;
1846 1.91 cube syscallarg(int) attrnamespace;
1847 1.91 cube syscallarg(const netbsd32_charp) attrname;
1848 1.91 cube syscallarg(const netbsd32_voidp) data;
1849 1.91 cube syscallarg(netbsd32_size_t) nbytes;
1850 1.134 dsl } */
1851 1.91 cube struct sys_extattr_set_file_args ua;
1852 1.91 cube
1853 1.91 cube NETBSD32TOP_UAP(path, const char);
1854 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1855 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1856 1.91 cube NETBSD32TOP_UAP(data, const void);
1857 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
1858 1.220 mrg
1859 1.91 cube return sys_extattr_set_file(l, &ua, retval);
1860 1.91 cube }
1861 1.91 cube
1862 1.91 cube int
1863 1.134 dsl netbsd32_extattr_set_link(struct lwp *l, const struct netbsd32_extattr_set_link_args *uap, register_t *retval)
1864 1.91 cube {
1865 1.134 dsl /* {
1866 1.91 cube syscallarg(const netbsd32_charp) path;
1867 1.91 cube syscallarg(int) attrnamespace;
1868 1.91 cube syscallarg(const netbsd32_charp) attrname;
1869 1.91 cube syscallarg(const netbsd32_voidp) data;
1870 1.91 cube syscallarg(netbsd32_size_t) nbytes;
1871 1.134 dsl } */
1872 1.91 cube struct sys_extattr_set_link_args ua;
1873 1.91 cube
1874 1.91 cube NETBSD32TOP_UAP(path, const char);
1875 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1876 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1877 1.91 cube NETBSD32TOP_UAP(data, const void);
1878 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
1879 1.220 mrg
1880 1.91 cube return sys_extattr_set_link(l, &ua, retval);
1881 1.91 cube }
1882 1.91 cube
1883 1.91 cube int
1884 1.134 dsl netbsd32_extattr_get_fd(struct lwp *l, const struct netbsd32_extattr_get_fd_args *uap, register_t *retval)
1885 1.91 cube {
1886 1.134 dsl /* {
1887 1.91 cube syscallarg(int) fd;
1888 1.91 cube syscallarg(int) attrnamespace;
1889 1.91 cube syscallarg(const netbsd32_charp) attrname;
1890 1.91 cube syscallarg(netbsd32_voidp) data;
1891 1.91 cube syscallarg(netbsd32_size_t) nbytes;
1892 1.134 dsl } */
1893 1.91 cube struct sys_extattr_get_fd_args ua;
1894 1.91 cube
1895 1.91 cube NETBSD32TO64_UAP(fd);
1896 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1897 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1898 1.91 cube NETBSD32TOP_UAP(data, void);
1899 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
1900 1.220 mrg
1901 1.91 cube return sys_extattr_get_fd(l, &ua, retval);
1902 1.91 cube }
1903 1.91 cube
1904 1.91 cube int
1905 1.134 dsl netbsd32_extattr_get_file(struct lwp *l, const struct netbsd32_extattr_get_file_args *uap, register_t *retval)
1906 1.91 cube {
1907 1.134 dsl /* {
1908 1.91 cube syscallarg(const netbsd32_charp) path;
1909 1.91 cube syscallarg(int) attrnamespace;
1910 1.91 cube syscallarg(const netbsd32_charp) attrname;
1911 1.91 cube syscallarg(netbsd32_voidp) data;
1912 1.91 cube syscallarg(netbsd32_size_t) nbytes;
1913 1.134 dsl } */
1914 1.91 cube struct sys_extattr_get_file_args ua;
1915 1.91 cube
1916 1.91 cube NETBSD32TOP_UAP(path, const char);
1917 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1918 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1919 1.91 cube NETBSD32TOP_UAP(data, void);
1920 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
1921 1.220 mrg
1922 1.91 cube return sys_extattr_get_file(l, &ua, retval);
1923 1.91 cube }
1924 1.91 cube
1925 1.91 cube int
1926 1.134 dsl netbsd32_extattr_get_link(struct lwp *l, const struct netbsd32_extattr_get_link_args *uap, register_t *retval)
1927 1.91 cube {
1928 1.134 dsl /* {
1929 1.91 cube syscallarg(const netbsd32_charp) path;
1930 1.91 cube syscallarg(int) attrnamespace;
1931 1.91 cube syscallarg(const netbsd32_charp) attrname;
1932 1.91 cube syscallarg(netbsd32_voidp) data;
1933 1.91 cube syscallarg(netbsd32_size_t) nbytes;
1934 1.134 dsl } */
1935 1.91 cube struct sys_extattr_get_link_args ua;
1936 1.91 cube
1937 1.91 cube NETBSD32TOP_UAP(path, const char);
1938 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1939 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1940 1.91 cube NETBSD32TOP_UAP(data, void);
1941 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
1942 1.220 mrg
1943 1.91 cube return sys_extattr_get_link(l, &ua, retval);
1944 1.91 cube }
1945 1.91 cube
1946 1.91 cube int
1947 1.134 dsl netbsd32_extattr_delete_fd(struct lwp *l, const struct netbsd32_extattr_delete_fd_args *uap, register_t *retval)
1948 1.91 cube {
1949 1.134 dsl /* {
1950 1.91 cube syscallarg(int) fd;
1951 1.91 cube syscallarg(int) attrnamespace;
1952 1.91 cube syscallarg(const netbsd32_charp) attrname;
1953 1.134 dsl } */
1954 1.91 cube struct sys_extattr_delete_fd_args ua;
1955 1.91 cube
1956 1.91 cube NETBSD32TO64_UAP(fd);
1957 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1958 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1959 1.220 mrg
1960 1.91 cube return sys_extattr_delete_fd(l, &ua, retval);
1961 1.91 cube }
1962 1.91 cube
1963 1.91 cube int
1964 1.134 dsl netbsd32_extattr_delete_file(struct lwp *l, const struct netbsd32_extattr_delete_file_args *uap, register_t *retval)
1965 1.91 cube {
1966 1.134 dsl /* {
1967 1.91 cube syscallarg(const netbsd32_charp) path;
1968 1.91 cube syscallarg(int) attrnamespace;
1969 1.91 cube syscallarg(const netbsd32_charp) attrname;
1970 1.134 dsl } */
1971 1.91 cube struct sys_extattr_delete_file_args ua;
1972 1.91 cube
1973 1.91 cube NETBSD32TOP_UAP(path, const char);
1974 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1975 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1976 1.220 mrg
1977 1.91 cube return sys_extattr_delete_file(l, &ua, retval);
1978 1.91 cube }
1979 1.91 cube
1980 1.91 cube int
1981 1.134 dsl netbsd32_extattr_delete_link(struct lwp *l, const struct netbsd32_extattr_delete_link_args *uap, register_t *retval)
1982 1.91 cube {
1983 1.134 dsl /* {
1984 1.91 cube syscallarg(const netbsd32_charp) path;
1985 1.91 cube syscallarg(int) attrnamespace;
1986 1.91 cube syscallarg(const netbsd32_charp) attrname;
1987 1.134 dsl } */
1988 1.91 cube struct sys_extattr_delete_link_args ua;
1989 1.91 cube
1990 1.91 cube NETBSD32TOP_UAP(path, const char);
1991 1.91 cube NETBSD32TO64_UAP(attrnamespace);
1992 1.91 cube NETBSD32TOP_UAP(attrname, const char);
1993 1.220 mrg
1994 1.91 cube return sys_extattr_delete_link(l, &ua, retval);
1995 1.91 cube }
1996 1.91 cube
1997 1.91 cube int
1998 1.134 dsl netbsd32_extattr_list_fd(struct lwp *l, const struct netbsd32_extattr_list_fd_args *uap, register_t *retval)
1999 1.91 cube {
2000 1.134 dsl /* {
2001 1.91 cube syscallarg(int) fd;
2002 1.91 cube syscallarg(int) attrnamespace;
2003 1.91 cube syscallarg(netbsd32_voidp) data;
2004 1.91 cube syscallarg(netbsd32_size_t) nbytes;
2005 1.134 dsl } */
2006 1.91 cube struct sys_extattr_list_fd_args ua;
2007 1.91 cube
2008 1.91 cube NETBSD32TO64_UAP(fd);
2009 1.91 cube NETBSD32TO64_UAP(attrnamespace);
2010 1.91 cube NETBSD32TOP_UAP(data, void);
2011 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
2012 1.220 mrg
2013 1.91 cube return sys_extattr_list_fd(l, &ua, retval);
2014 1.91 cube }
2015 1.91 cube
2016 1.91 cube int
2017 1.134 dsl netbsd32_extattr_list_file(struct lwp *l, const struct netbsd32_extattr_list_file_args *uap, register_t *retval)
2018 1.91 cube {
2019 1.134 dsl /* {
2020 1.91 cube syscallarg(const netbsd32_charp) path;
2021 1.91 cube syscallarg(int) attrnamespace;
2022 1.91 cube syscallarg(netbsd32_voidp) data;
2023 1.91 cube syscallarg(netbsd32_size_t) nbytes;
2024 1.134 dsl } */
2025 1.91 cube struct sys_extattr_list_file_args ua;
2026 1.91 cube
2027 1.91 cube NETBSD32TOP_UAP(path, const char);
2028 1.91 cube NETBSD32TO64_UAP(attrnamespace);
2029 1.91 cube NETBSD32TOP_UAP(data, void);
2030 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
2031 1.220 mrg
2032 1.91 cube return sys_extattr_list_file(l, &ua, retval);
2033 1.91 cube }
2034 1.91 cube
2035 1.91 cube int
2036 1.134 dsl netbsd32_extattr_list_link(struct lwp *l, const struct netbsd32_extattr_list_link_args *uap, register_t *retval)
2037 1.91 cube {
2038 1.134 dsl /* {
2039 1.91 cube syscallarg(const netbsd32_charp) path;
2040 1.91 cube syscallarg(int) attrnamespace;
2041 1.91 cube syscallarg(netbsd32_voidp) data;
2042 1.91 cube syscallarg(netbsd32_size_t) nbytes;
2043 1.134 dsl } */
2044 1.91 cube struct sys_extattr_list_link_args ua;
2045 1.91 cube
2046 1.91 cube NETBSD32TOP_UAP(path, const char);
2047 1.91 cube NETBSD32TO64_UAP(attrnamespace);
2048 1.91 cube NETBSD32TOP_UAP(data, void);
2049 1.91 cube NETBSD32TOX_UAP(nbytes, size_t);
2050 1.220 mrg
2051 1.91 cube return sys_extattr_list_link(l, &ua, retval);
2052 1.91 cube }
2053 1.92 cube
2054 1.92 cube int
2055 1.134 dsl netbsd32_mlockall(struct lwp *l, const struct netbsd32_mlockall_args *uap, register_t *retval)
2056 1.92 cube {
2057 1.134 dsl /* {
2058 1.92 cube syscallarg(int) flags;
2059 1.134 dsl } */
2060 1.92 cube struct sys_mlockall_args ua;
2061 1.92 cube
2062 1.92 cube NETBSD32TO64_UAP(flags);
2063 1.220 mrg
2064 1.220 mrg return sys_mlockall(l, &ua, retval);
2065 1.92 cube }
2066 1.93 cube
2067 1.93 cube int
2068 1.134 dsl netbsd32___clone(struct lwp *l, const struct netbsd32___clone_args *uap, register_t *retval)
2069 1.93 cube {
2070 1.134 dsl /* {
2071 1.93 cube syscallarg(int) flags;
2072 1.93 cube syscallarg(netbsd32_voidp) stack;
2073 1.134 dsl } */
2074 1.93 cube struct sys___clone_args ua;
2075 1.93 cube
2076 1.93 cube NETBSD32TO64_UAP(flags);
2077 1.93 cube NETBSD32TOP_UAP(stack, void);
2078 1.220 mrg
2079 1.93 cube return sys___clone(l, &ua, retval);
2080 1.93 cube }
2081 1.94 cube
2082 1.94 cube int
2083 1.134 dsl netbsd32_fsync_range(struct lwp *l, const struct netbsd32_fsync_range_args *uap, register_t *retval)
2084 1.94 cube {
2085 1.134 dsl /* {
2086 1.94 cube syscallarg(int) fd;
2087 1.94 cube syscallarg(int) flags;
2088 1.94 cube syscallarg(off_t) start;
2089 1.94 cube syscallarg(off_t) length;
2090 1.134 dsl } */
2091 1.94 cube struct sys_fsync_range_args ua;
2092 1.94 cube
2093 1.94 cube NETBSD32TO64_UAP(fd);
2094 1.94 cube NETBSD32TO64_UAP(flags);
2095 1.94 cube NETBSD32TO64_UAP(start);
2096 1.94 cube NETBSD32TO64_UAP(length);
2097 1.220 mrg
2098 1.220 mrg return sys_fsync_range(l, &ua, retval);
2099 1.94 cube }
2100 1.95 cube
2101 1.95 cube int
2102 1.134 dsl netbsd32_rasctl(struct lwp *l, const struct netbsd32_rasctl_args *uap, register_t *retval)
2103 1.95 cube {
2104 1.134 dsl /* {
2105 1.154 njoly syscallarg(netbsd32_voidp) addr;
2106 1.95 cube syscallarg(netbsd32_size_t) len;
2107 1.95 cube syscallarg(int) op;
2108 1.134 dsl } */
2109 1.95 cube struct sys_rasctl_args ua;
2110 1.95 cube
2111 1.120 dsl NETBSD32TOP_UAP(addr, void *);
2112 1.95 cube NETBSD32TOX_UAP(len, size_t);
2113 1.95 cube NETBSD32TO64_UAP(op);
2114 1.220 mrg
2115 1.95 cube return sys_rasctl(l, &ua, retval);
2116 1.95 cube }
2117 1.96 cube
2118 1.96 cube int
2119 1.134 dsl netbsd32_setxattr(struct lwp *l, const struct netbsd32_setxattr_args *uap, register_t *retval)
2120 1.96 cube {
2121 1.134 dsl /* {
2122 1.96 cube syscallarg(const netbsd32_charp) path;
2123 1.96 cube syscallarg(const netbsd32_charp) name;
2124 1.96 cube syscallarg(netbsd32_voidp) value;
2125 1.96 cube syscallarg(netbsd32_size_t) size;
2126 1.96 cube syscallarg(int) flags;
2127 1.134 dsl } */
2128 1.96 cube struct sys_setxattr_args ua;
2129 1.220 mrg
2130 1.96 cube NETBSD32TOP_UAP(path, const char);
2131 1.96 cube NETBSD32TOP_UAP(name, const char);
2132 1.96 cube NETBSD32TOP_UAP(value, void);
2133 1.96 cube NETBSD32TOX_UAP(size, size_t);
2134 1.96 cube NETBSD32TO64_UAP(flags);
2135 1.220 mrg
2136 1.96 cube return sys_setxattr(l, &ua, retval);
2137 1.96 cube }
2138 1.96 cube
2139 1.96 cube int
2140 1.134 dsl netbsd32_lsetxattr(struct lwp *l, const struct netbsd32_lsetxattr_args *uap, register_t *retval)
2141 1.96 cube {
2142 1.134 dsl /* {
2143 1.96 cube syscallarg(const netbsd32_charp) path;
2144 1.96 cube syscallarg(const netbsd32_charp) name;
2145 1.96 cube syscallarg(netbsd32_voidp) value;
2146 1.96 cube syscallarg(netbsd32_size_t) size;
2147 1.96 cube syscallarg(int) flags;
2148 1.134 dsl } */
2149 1.96 cube struct sys_lsetxattr_args ua;
2150 1.220 mrg
2151 1.96 cube NETBSD32TOP_UAP(path, const char);
2152 1.96 cube NETBSD32TOP_UAP(name, const char);
2153 1.96 cube NETBSD32TOP_UAP(value, void);
2154 1.96 cube NETBSD32TOX_UAP(size, size_t);
2155 1.96 cube NETBSD32TO64_UAP(flags);
2156 1.220 mrg
2157 1.96 cube return sys_lsetxattr(l, &ua, retval);
2158 1.96 cube }
2159 1.96 cube
2160 1.96 cube int
2161 1.134 dsl netbsd32_fsetxattr(struct lwp *l, const struct netbsd32_fsetxattr_args *uap, register_t *retval)
2162 1.96 cube {
2163 1.134 dsl /* {
2164 1.96 cube syscallarg(int) fd;
2165 1.96 cube syscallarg(const netbsd32_charp) name;
2166 1.96 cube syscallarg(netbsd32_voidp) value;
2167 1.96 cube syscallarg(netbsd32_size_t) size;
2168 1.96 cube syscallarg(int) flags;
2169 1.134 dsl } */
2170 1.96 cube struct sys_fsetxattr_args ua;
2171 1.220 mrg
2172 1.96 cube NETBSD32TO64_UAP(fd);
2173 1.96 cube NETBSD32TOP_UAP(name, const char);
2174 1.96 cube NETBSD32TOP_UAP(value, void);
2175 1.96 cube NETBSD32TOX_UAP(size, size_t);
2176 1.96 cube NETBSD32TO64_UAP(flags);
2177 1.220 mrg
2178 1.96 cube return sys_fsetxattr(l, &ua, retval);
2179 1.96 cube }
2180 1.96 cube
2181 1.96 cube int
2182 1.134 dsl netbsd32_getxattr(struct lwp *l, const struct netbsd32_getxattr_args *uap, register_t *retval)
2183 1.96 cube {
2184 1.134 dsl /* {
2185 1.96 cube syscallarg(const netbsd32_charp) path;
2186 1.96 cube syscallarg(const netbsd32_charp) name;
2187 1.96 cube syscallarg(netbsd32_voidp) value;
2188 1.96 cube syscallarg(netbsd32_size_t) size;
2189 1.134 dsl } */
2190 1.96 cube struct sys_getxattr_args ua;
2191 1.220 mrg
2192 1.96 cube NETBSD32TOP_UAP(path, const char);
2193 1.96 cube NETBSD32TOP_UAP(name, const char);
2194 1.96 cube NETBSD32TOP_UAP(value, void);
2195 1.96 cube NETBSD32TOX_UAP(size, size_t);
2196 1.220 mrg
2197 1.96 cube return sys_getxattr(l, &ua, retval);
2198 1.96 cube }
2199 1.96 cube
2200 1.96 cube int
2201 1.134 dsl netbsd32_lgetxattr(struct lwp *l, const struct netbsd32_lgetxattr_args *uap, register_t *retval)
2202 1.96 cube {
2203 1.134 dsl /* {
2204 1.96 cube syscallarg(const netbsd32_charp) path;
2205 1.96 cube syscallarg(const netbsd32_charp) name;
2206 1.96 cube syscallarg(netbsd32_voidp) value;
2207 1.96 cube syscallarg(netbsd32_size_t) size;
2208 1.134 dsl } */
2209 1.96 cube struct sys_lgetxattr_args ua;
2210 1.220 mrg
2211 1.96 cube NETBSD32TOP_UAP(path, const char);
2212 1.96 cube NETBSD32TOP_UAP(name, const char);
2213 1.96 cube NETBSD32TOP_UAP(value, void);
2214 1.96 cube NETBSD32TOX_UAP(size, size_t);
2215 1.220 mrg
2216 1.96 cube return sys_lgetxattr(l, &ua, retval);
2217 1.96 cube }
2218 1.96 cube
2219 1.96 cube int
2220 1.134 dsl netbsd32_fgetxattr(struct lwp *l, const struct netbsd32_fgetxattr_args *uap, register_t *retval)
2221 1.96 cube {
2222 1.134 dsl /* {
2223 1.96 cube syscallarg(int) fd;
2224 1.96 cube syscallarg(const netbsd32_charp) name;
2225 1.96 cube syscallarg(netbsd32_voidp) value;
2226 1.96 cube syscallarg(netbsd32_size_t) size;
2227 1.134 dsl } */
2228 1.96 cube struct sys_fgetxattr_args ua;
2229 1.220 mrg
2230 1.96 cube NETBSD32TO64_UAP(fd);
2231 1.96 cube NETBSD32TOP_UAP(name, const char);
2232 1.96 cube NETBSD32TOP_UAP(value, void);
2233 1.96 cube NETBSD32TOX_UAP(size, size_t);
2234 1.220 mrg
2235 1.96 cube return sys_fgetxattr(l, &ua, retval);
2236 1.96 cube }
2237 1.96 cube
2238 1.96 cube int
2239 1.134 dsl netbsd32_listxattr(struct lwp *l, const struct netbsd32_listxattr_args *uap, register_t *retval)
2240 1.96 cube {
2241 1.134 dsl /* {
2242 1.96 cube syscallarg(const netbsd32_charp) path;
2243 1.96 cube syscallarg(netbsd32_charp) list;
2244 1.96 cube syscallarg(netbsd32_size_t) size;
2245 1.134 dsl } */
2246 1.96 cube struct sys_listxattr_args ua;
2247 1.220 mrg
2248 1.96 cube NETBSD32TOP_UAP(path, const char);
2249 1.96 cube NETBSD32TOP_UAP(list, char);
2250 1.96 cube NETBSD32TOX_UAP(size, size_t);
2251 1.220 mrg
2252 1.96 cube return sys_listxattr(l, &ua, retval);
2253 1.96 cube }
2254 1.96 cube
2255 1.96 cube int
2256 1.134 dsl netbsd32_llistxattr(struct lwp *l, const struct netbsd32_llistxattr_args *uap, register_t *retval)
2257 1.96 cube {
2258 1.134 dsl /* {
2259 1.96 cube syscallarg(const netbsd32_charp) path;
2260 1.96 cube syscallarg(netbsd32_charp) list;
2261 1.96 cube syscallarg(netbsd32_size_t) size;
2262 1.134 dsl } */
2263 1.96 cube struct sys_llistxattr_args ua;
2264 1.220 mrg
2265 1.96 cube NETBSD32TOP_UAP(path, const char);
2266 1.96 cube NETBSD32TOP_UAP(list, char);
2267 1.96 cube NETBSD32TOX_UAP(size, size_t);
2268 1.220 mrg
2269 1.96 cube return sys_llistxattr(l, &ua, retval);
2270 1.96 cube }
2271 1.96 cube
2272 1.96 cube int
2273 1.134 dsl netbsd32_flistxattr(struct lwp *l, const struct netbsd32_flistxattr_args *uap, register_t *retval)
2274 1.96 cube {
2275 1.134 dsl /* {
2276 1.96 cube syscallarg(int) fd;
2277 1.96 cube syscallarg(netbsd32_charp) list;
2278 1.96 cube syscallarg(netbsd32_size_t) size;
2279 1.134 dsl } */
2280 1.96 cube struct sys_flistxattr_args ua;
2281 1.220 mrg
2282 1.96 cube NETBSD32TO64_UAP(fd);
2283 1.96 cube NETBSD32TOP_UAP(list, char);
2284 1.96 cube NETBSD32TOX_UAP(size, size_t);
2285 1.220 mrg
2286 1.96 cube return sys_flistxattr(l, &ua, retval);
2287 1.96 cube }
2288 1.96 cube
2289 1.96 cube int
2290 1.134 dsl netbsd32_removexattr(struct lwp *l, const struct netbsd32_removexattr_args *uap, register_t *retval)
2291 1.96 cube {
2292 1.134 dsl /* {
2293 1.96 cube syscallarg(const netbsd32_charp) path;
2294 1.96 cube syscallarg(const netbsd32_charp) name;
2295 1.134 dsl } */
2296 1.96 cube struct sys_removexattr_args ua;
2297 1.220 mrg
2298 1.96 cube NETBSD32TOP_UAP(path, const char);
2299 1.96 cube NETBSD32TOP_UAP(name, const char);
2300 1.220 mrg
2301 1.96 cube return sys_removexattr(l, &ua, retval);
2302 1.96 cube }
2303 1.96 cube
2304 1.96 cube int
2305 1.134 dsl netbsd32_lremovexattr(struct lwp *l, const struct netbsd32_lremovexattr_args *uap, register_t *retval)
2306 1.96 cube {
2307 1.134 dsl /* {
2308 1.96 cube syscallarg(const netbsd32_charp) path;
2309 1.96 cube syscallarg(const netbsd32_charp) name;
2310 1.134 dsl } */
2311 1.96 cube struct sys_lremovexattr_args ua;
2312 1.96 cube NETBSD32TOP_UAP(path, const char);
2313 1.96 cube NETBSD32TOP_UAP(name, const char);
2314 1.96 cube return sys_lremovexattr(l, &ua, retval);
2315 1.96 cube }
2316 1.96 cube
2317 1.96 cube int
2318 1.134 dsl netbsd32_fremovexattr(struct lwp *l, const struct netbsd32_fremovexattr_args *uap, register_t *retval)
2319 1.96 cube {
2320 1.134 dsl /* {
2321 1.96 cube syscallarg(int) fd;
2322 1.96 cube syscallarg(const netbsd32_charp) name;
2323 1.134 dsl } */
2324 1.96 cube struct sys_fremovexattr_args ua;
2325 1.220 mrg
2326 1.96 cube NETBSD32TO64_UAP(fd);
2327 1.96 cube NETBSD32TOP_UAP(name, const char);
2328 1.220 mrg
2329 1.96 cube return sys_fremovexattr(l, &ua, retval);
2330 1.96 cube }
2331 1.129 dsl
2332 1.140 martin int
2333 1.140 martin netbsd32___posix_fadvise50(struct lwp *l,
2334 1.141 martin const struct netbsd32___posix_fadvise50_args *uap, register_t *retval)
2335 1.140 martin {
2336 1.140 martin /* {
2337 1.140 martin syscallarg(int) fd;
2338 1.157 pooka syscallarg(int) PAD;
2339 1.186 njoly syscallarg(netbsd32_off_t) offset;
2340 1.186 njoly syscallarg(netbsd32_off_t) len;
2341 1.140 martin syscallarg(int) advice;
2342 1.140 martin } */
2343 1.140 martin
2344 1.155 skrll *retval = do_posix_fadvise(SCARG(uap, fd), SCARG(uap, offset),
2345 1.143 ad SCARG(uap, len), SCARG(uap, advice));
2346 1.155 skrll
2347 1.155 skrll return 0;
2348 1.140 martin }
2349 1.136 dsl
2350 1.153 tron int
2351 1.153 tron netbsd32__sched_setparam(struct lwp *l,
2352 1.153 tron const struct netbsd32__sched_setparam_args *uap,
2353 1.153 tron register_t *retval)
2354 1.153 tron {
2355 1.153 tron /* {
2356 1.153 tron syscallarg(pid_t) pid;
2357 1.153 tron syscallarg(lwpid_t) lid;
2358 1.153 tron syscallarg(int) policy;
2359 1.153 tron syscallarg(const netbsd32_sched_paramp_t) params;
2360 1.153 tron } */
2361 1.153 tron struct sys__sched_setparam_args ua;
2362 1.153 tron
2363 1.153 tron NETBSD32TO64_UAP(pid);
2364 1.153 tron NETBSD32TO64_UAP(lid);
2365 1.153 tron NETBSD32TO64_UAP(policy);
2366 1.153 tron NETBSD32TOP_UAP(params, const struct sched_param *);
2367 1.220 mrg
2368 1.153 tron return sys__sched_setparam(l, &ua, retval);
2369 1.153 tron }
2370 1.153 tron
2371 1.153 tron int
2372 1.153 tron netbsd32__sched_getparam(struct lwp *l,
2373 1.153 tron const struct netbsd32__sched_getparam_args *uap,
2374 1.153 tron register_t *retval)
2375 1.153 tron {
2376 1.153 tron /* {
2377 1.153 tron syscallarg(pid_t) pid;
2378 1.153 tron syscallarg(lwpid_t) lid;
2379 1.153 tron syscallarg(netbsd32_intp) policy;
2380 1.153 tron syscallarg(netbsd32_sched_paramp_t) params;
2381 1.153 tron } */
2382 1.153 tron struct sys__sched_getparam_args ua;
2383 1.153 tron
2384 1.153 tron NETBSD32TO64_UAP(pid);
2385 1.153 tron NETBSD32TO64_UAP(lid);
2386 1.153 tron NETBSD32TOP_UAP(policy, int *);
2387 1.153 tron NETBSD32TOP_UAP(params, struct sched_param *);
2388 1.220 mrg
2389 1.153 tron return sys__sched_getparam(l, &ua, retval);
2390 1.153 tron }
2391 1.153 tron
2392 1.153 tron int
2393 1.153 tron netbsd32__sched_setaffinity(struct lwp *l,
2394 1.153 tron const struct netbsd32__sched_setaffinity_args *uap,
2395 1.153 tron register_t *retval)
2396 1.153 tron {
2397 1.153 tron /* {
2398 1.153 tron syscallarg(pid_t) pid;
2399 1.153 tron syscallarg(lwpid_t) lid;
2400 1.153 tron syscallarg(netbsd_size_t) size;
2401 1.153 tron syscallarg(const netbsd32_cpusetp_t) cpuset;
2402 1.153 tron } */
2403 1.153 tron struct sys__sched_setaffinity_args ua;
2404 1.153 tron
2405 1.153 tron NETBSD32TO64_UAP(pid);
2406 1.153 tron NETBSD32TO64_UAP(lid);
2407 1.153 tron NETBSD32TOX_UAP(size, size_t);
2408 1.153 tron NETBSD32TOP_UAP(cpuset, const cpuset_t *);
2409 1.220 mrg
2410 1.153 tron return sys__sched_setaffinity(l, &ua, retval);
2411 1.153 tron }
2412 1.153 tron
2413 1.153 tron int
2414 1.153 tron netbsd32__sched_getaffinity(struct lwp *l,
2415 1.153 tron const struct netbsd32__sched_getaffinity_args *uap,
2416 1.153 tron register_t *retval)
2417 1.153 tron {
2418 1.153 tron /* {
2419 1.153 tron syscallarg(pid_t) pid;
2420 1.153 tron syscallarg(lwpid_t) lid;
2421 1.153 tron syscallarg(netbsd_size_t) size;
2422 1.153 tron syscallarg(netbsd32_cpusetp_t) cpuset;
2423 1.153 tron } */
2424 1.153 tron struct sys__sched_getaffinity_args ua;
2425 1.153 tron
2426 1.153 tron NETBSD32TO64_UAP(pid);
2427 1.153 tron NETBSD32TO64_UAP(lid);
2428 1.153 tron NETBSD32TOX_UAP(size, size_t);
2429 1.153 tron NETBSD32TOP_UAP(cpuset, cpuset_t *);
2430 1.220 mrg
2431 1.153 tron return sys__sched_getaffinity(l, &ua, retval);
2432 1.153 tron }
2433 1.153 tron
2434 1.172 njoly int
2435 1.201 skrll netbsd32__sched_protect(struct lwp *l,
2436 1.201 skrll const struct netbsd32__sched_protect_args *uap,
2437 1.201 skrll register_t *retval)
2438 1.201 skrll {
2439 1.201 skrll /* {
2440 1.201 skrll syscallarg(int) priority;
2441 1.201 skrll } */
2442 1.201 skrll struct sys__sched_protect_args ua;
2443 1.201 skrll
2444 1.201 skrll NETBSD32TO64_UAP(priority);
2445 1.220 mrg
2446 1.201 skrll return sys__sched_protect(l, &ua, retval);
2447 1.201 skrll }
2448 1.201 skrll
2449 1.173 njoly int
2450 1.173 njoly netbsd32_dup3(struct lwp *l, const struct netbsd32_dup3_args *uap,
2451 1.173 njoly register_t *retval)
2452 1.173 njoly {
2453 1.173 njoly /* {
2454 1.173 njoly syscallarg(int) from;
2455 1.173 njoly syscallarg(int) to;
2456 1.173 njoly syscallarg(int) flags;
2457 1.173 njoly } */
2458 1.173 njoly struct sys_dup3_args ua;
2459 1.173 njoly
2460 1.173 njoly NETBSD32TO64_UAP(from);
2461 1.173 njoly NETBSD32TO64_UAP(to);
2462 1.173 njoly NETBSD32TO64_UAP(flags);
2463 1.173 njoly
2464 1.173 njoly return sys_dup3(l, &ua, retval);
2465 1.173 njoly }
2466 1.173 njoly
2467 1.174 njoly int
2468 1.174 njoly netbsd32_kqueue1(struct lwp *l, const struct netbsd32_kqueue1_args *uap,
2469 1.174 njoly register_t *retval)
2470 1.174 njoly {
2471 1.174 njoly /* {
2472 1.174 njoly syscallarg(int) flags;
2473 1.174 njoly } */
2474 1.174 njoly struct sys_kqueue1_args ua;
2475 1.174 njoly
2476 1.174 njoly NETBSD32TO64_UAP(flags);
2477 1.177 matt
2478 1.174 njoly return sys_kqueue1(l, &ua, retval);
2479 1.174 njoly }
2480 1.174 njoly
2481 1.177 matt int
2482 1.177 matt netbsd32_paccept(struct lwp *l, const struct netbsd32_paccept_args *uap,
2483 1.177 matt register_t *retval)
2484 1.177 matt {
2485 1.177 matt /* {
2486 1.177 matt syscallarg(int) s;
2487 1.177 matt syscallarg(netbsd32_sockaddrp_t) name;
2488 1.177 matt syscallarg(netbsd32_socklenp_t) anamelen;
2489 1.177 matt syscallarg(const netbsd32_sigsetp_t) mask;
2490 1.177 matt syscallarg(int) flags;
2491 1.177 matt } */
2492 1.177 matt struct sys_paccept_args ua;
2493 1.177 matt
2494 1.177 matt NETBSD32TO64_UAP(s);
2495 1.177 matt NETBSD32TOP_UAP(name, struct sockaddr *);
2496 1.177 matt NETBSD32TOP_UAP(anamelen, socklen_t *);
2497 1.177 matt NETBSD32TOP_UAP(mask, const sigset_t *);
2498 1.177 matt NETBSD32TO64_UAP(flags);
2499 1.177 matt
2500 1.177 matt return sys_paccept(l, &ua, retval);
2501 1.177 matt }
2502 1.177 matt
2503 1.195 martin int
2504 1.195 martin netbsd32_fdiscard(struct lwp *l, const struct netbsd32_fdiscard_args *uap,
2505 1.195 martin register_t *retval)
2506 1.195 martin {
2507 1.195 martin /* {
2508 1.195 martin syscallarg(int) fd;
2509 1.195 martin syscallarg(netbsd32_off_t) pos;
2510 1.195 martin syscallarg(netbsd32_off_t) len;
2511 1.195 martin } */
2512 1.195 martin struct sys_fdiscard_args ua;
2513 1.195 martin
2514 1.195 martin NETBSD32TO64_UAP(fd);
2515 1.195 martin NETBSD32TO64_UAP(pos);
2516 1.195 martin NETBSD32TO64_UAP(len);
2517 1.195 martin
2518 1.195 martin return sys_fdiscard(l, &ua, retval);
2519 1.195 martin }
2520 1.195 martin
2521 1.195 martin int
2522 1.195 martin netbsd32_posix_fallocate(struct lwp *l, const struct netbsd32_posix_fallocate_args *uap,
2523 1.195 martin register_t *retval)
2524 1.195 martin {
2525 1.195 martin /* {
2526 1.195 martin syscallarg(int) fd;
2527 1.195 martin syscallarg(netbsd32_off_t) pos;
2528 1.195 martin syscallarg(netbsd32_off_t) len;
2529 1.195 martin } */
2530 1.195 martin struct sys_posix_fallocate_args ua;
2531 1.195 martin
2532 1.195 martin NETBSD32TO64_UAP(fd);
2533 1.195 martin NETBSD32TO64_UAP(pos);
2534 1.195 martin NETBSD32TO64_UAP(len);
2535 1.195 martin
2536 1.195 martin return sys_posix_fallocate(l, &ua, retval);
2537 1.195 martin }
2538 1.195 martin
2539 1.196 martin int
2540 1.196 martin netbsd32_pset_create(struct lwp *l,
2541 1.196 martin const struct netbsd32_pset_create_args *uap, register_t *retval)
2542 1.196 martin {
2543 1.196 martin /* {
2544 1.196 martin syscallarg(netbsd32_psetidp_t) psid;
2545 1.196 martin }; */
2546 1.219 mrg struct sys_pset_create_args ua;
2547 1.196 martin
2548 1.219 mrg NETBSD32TOP_UAP(psid, psetid_t);
2549 1.219 mrg
2550 1.219 mrg return sys_pset_create(l, &ua, retval);
2551 1.196 martin }
2552 1.196 martin
2553 1.196 martin int
2554 1.196 martin netbsd32_pset_destroy(struct lwp *l,
2555 1.196 martin const struct netbsd32_pset_destroy_args *uap, register_t *retval)
2556 1.196 martin {
2557 1.196 martin /* {
2558 1.196 martin syscallarg(psetid_t) psid;
2559 1.196 martin }; */
2560 1.196 martin
2561 1.196 martin return sys_pset_destroy(l, (const void *)uap, retval);
2562 1.196 martin }
2563 1.196 martin
2564 1.196 martin int
2565 1.196 martin netbsd32_pset_assign(struct lwp *l,
2566 1.196 martin const struct netbsd32_pset_assign_args *uap, register_t *retval)
2567 1.196 martin {
2568 1.196 martin /* {
2569 1.196 martin syscallarg(psetid_t) psid;
2570 1.196 martin syscallarg(cpuid_t) cpuid;
2571 1.196 martin syscallarg(netbsd32_psetidp_t) opsid;
2572 1.196 martin }; */
2573 1.196 martin struct sys_pset_assign_args ua;
2574 1.196 martin
2575 1.196 martin SCARG(&ua, psid) = SCARG(uap, psid);
2576 1.196 martin NETBSD32TO64_UAP(cpuid);
2577 1.196 martin NETBSD32TOP_UAP(opsid, psetid_t);
2578 1.196 martin
2579 1.196 martin return sys_pset_assign(l, &ua, retval);
2580 1.196 martin }
2581 1.196 martin
2582 1.196 martin int
2583 1.196 martin netbsd32__pset_bind(struct lwp *l,
2584 1.196 martin const struct netbsd32__pset_bind_args *uap, register_t *retval)
2585 1.196 martin {
2586 1.196 martin /* {
2587 1.196 martin syscallarg(idtype_t) idtype;
2588 1.196 martin syscallarg(id_t) first_id;
2589 1.196 martin syscallarg(id_t) second_id;
2590 1.196 martin syscallarg(psetid_t) psid;
2591 1.196 martin syscallarg(netbsd32_psetidp_t) opsid;
2592 1.196 martin }; */
2593 1.196 martin struct sys__pset_bind_args ua;
2594 1.196 martin
2595 1.196 martin SCARG(&ua, idtype) = SCARG(uap, idtype);
2596 1.196 martin SCARG(&ua, first_id) = SCARG(uap, first_id);
2597 1.196 martin SCARG(&ua, second_id) = SCARG(uap, second_id);
2598 1.196 martin SCARG(&ua, psid) = SCARG(uap, psid);
2599 1.196 martin NETBSD32TOP_UAP(opsid, psetid_t);
2600 1.196 martin
2601 1.196 martin return sys__pset_bind(l, &ua, retval);
2602 1.196 martin }
2603 1.195 martin
2604 1.195 martin
2605 1.129 dsl /*
2606 1.129 dsl * MI indirect system call support.
2607 1.129 dsl * Only used if the MD netbsd32_syscall.c doesn't intercept the calls.
2608 1.129 dsl */
2609 1.129 dsl
2610 1.129 dsl #define NETBSD32_SYSCALL
2611 1.129 dsl #undef SYS_NSYSENT
2612 1.129 dsl #define SYS_NSYSENT NETBSD32_SYS_NSYSENT
2613 1.129 dsl
2614 1.153 tron #define SYS_SYSCALL netbsd32_syscall
2615 1.129 dsl #include "../../kern/sys_syscall.c"
2616 1.129 dsl #undef SYS_SYSCALL
2617 1.129 dsl
2618 1.153 tron #define SYS_SYSCALL netbsd32____syscall
2619 1.129 dsl #include "../../kern/sys_syscall.c"
2620 1.129 dsl #undef SYS_SYSCALL
2621