ansify function definitionsdiff -r1.20 -r1.21 src/sys/compat/linux32/arch/amd64/linux32_machdep.c
(cegger)
--- src/sys/compat/linux32/arch/amd64/linux32_machdep.c 2008/10/19 09:44:31 1.20
+++ src/sys/compat/linux32/arch/amd64/linux32_machdep.c 2009/03/15 15:56:50 1.21
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux32_machdep.c,v 1.20 2008/10/19 09:44:31 njoly Exp $ */ | 1 | /* $NetBSD: linux32_machdep.c,v 1.21 2009/03/15 15:56:50 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. | 4 | * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | 14 | * 3. All advertising materials mentioning features or use of this software | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS'' | 21 | * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS'' | |
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | |
23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | 24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | |
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
31 | * POSSIBILITY OF SUCH DAMAGE. | 31 | * POSSIBILITY OF SUCH DAMAGE. | |
32 | */ | 32 | */ | |
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.20 2008/10/19 09:44:31 njoly Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.21 2009/03/15 15:56:50 cegger Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/signalvar.h> | 38 | #include <sys/signalvar.h> | |
39 | #include <sys/kernel.h> | 39 | #include <sys/kernel.h> | |
40 | #include <sys/proc.h> | 40 | #include <sys/proc.h> | |
41 | #include <sys/user.h> | 41 | #include <sys/user.h> | |
42 | #include <sys/buf.h> | 42 | #include <sys/buf.h> | |
43 | #include <sys/reboot.h> | 43 | #include <sys/reboot.h> | |
44 | #include <sys/conf.h> | 44 | #include <sys/conf.h> | |
45 | #include <sys/exec.h> | 45 | #include <sys/exec.h> | |
46 | #include <sys/file.h> | 46 | #include <sys/file.h> | |
47 | #include <sys/callout.h> | 47 | #include <sys/callout.h> | |
@@ -345,31 +345,28 @@ linux32_setregs(struct lwp *l, struct ex | @@ -345,31 +345,28 @@ linux32_setregs(struct lwp *l, struct ex | |||
345 | 345 | |||
346 | static void | 346 | static void | |
347 | linux32_save_ucontext(struct lwp *l, struct trapframe *tf, const sigset_t *mask, struct sigaltstack *sas, struct linux32_ucontext *uc) | 347 | linux32_save_ucontext(struct lwp *l, struct trapframe *tf, const sigset_t *mask, struct sigaltstack *sas, struct linux32_ucontext *uc) | |
348 | { | 348 | { | |
349 | uc->uc_flags = 0; | 349 | uc->uc_flags = 0; | |
350 | NETBSD32PTR32(uc->uc_link, NULL); | 350 | NETBSD32PTR32(uc->uc_link, NULL); | |
351 | native_to_linux32_sigaltstack(&uc->uc_stack, sas); | 351 | native_to_linux32_sigaltstack(&uc->uc_stack, sas); | |
352 | linux32_save_sigcontext(l, tf, mask, &uc->uc_mcontext); | 352 | linux32_save_sigcontext(l, tf, mask, &uc->uc_mcontext); | |
353 | native_to_linux32_sigset(&uc->uc_sigmask, mask); | 353 | native_to_linux32_sigset(&uc->uc_sigmask, mask); | |
354 | (void)memset(&uc->uc_fpregs_mem, 0, sizeof(uc->uc_fpregs_mem)); | 354 | (void)memset(&uc->uc_fpregs_mem, 0, sizeof(uc->uc_fpregs_mem)); | |
355 | } | 355 | } | |
356 | 356 | |||
357 | static void | 357 | static void | |
358 | linux32_save_sigcontext(l, tf, mask, sc) | 358 | linux32_save_sigcontext(struct lwp *l, struct trapframe *tf, | |
359 | struct lwp *l; | 359 | const sigset_t *mask, struct linux32_sigcontext *sc) | |
360 | struct trapframe *tf; | |||
361 | const sigset_t *mask; | |||
362 | struct linux32_sigcontext *sc; | |||
363 | { | 360 | { | |
364 | /* Save register context. */ | 361 | /* Save register context. */ | |
365 | sc->sc_gs = tf->tf_gs; | 362 | sc->sc_gs = tf->tf_gs; | |
366 | sc->sc_fs = tf->tf_fs; | 363 | sc->sc_fs = tf->tf_fs; | |
367 | sc->sc_es = tf->tf_es; | 364 | sc->sc_es = tf->tf_es; | |
368 | sc->sc_ds = tf->tf_ds; | 365 | sc->sc_ds = tf->tf_ds; | |
369 | sc->sc_eflags = tf->tf_rflags; | 366 | sc->sc_eflags = tf->tf_rflags; | |
370 | sc->sc_edi = tf->tf_rdi; | 367 | sc->sc_edi = tf->tf_rdi; | |
371 | sc->sc_esi = tf->tf_rsi; | 368 | sc->sc_esi = tf->tf_rsi; | |
372 | sc->sc_esp = tf->tf_rsp; | 369 | sc->sc_esp = tf->tf_rsp; | |
373 | sc->sc_ebp = tf->tf_rbp; | 370 | sc->sc_ebp = tf->tf_rbp; | |
374 | sc->sc_ebx = tf->tf_rbx; | 371 | sc->sc_ebx = tf->tf_rbx; | |
375 | sc->sc_edx = tf->tf_rdx; | 372 | sc->sc_edx = tf->tf_rdx; | |
@@ -412,30 +409,28 @@ linux32_sys_rt_sigreturn(struct lwp *l, | @@ -412,30 +409,28 @@ linux32_sys_rt_sigreturn(struct lwp *l, | |||
412 | /* { | 409 | /* { | |
413 | syscallarg(linux32_ucontextp_t) ucp; | 410 | syscallarg(linux32_ucontextp_t) ucp; | |
414 | } */ | 411 | } */ | |
415 | struct linux32_ucontext ctx; | 412 | struct linux32_ucontext ctx; | |
416 | int error; | 413 | int error; | |
417 | 414 | |||
418 | if ((error = copyin(SCARG_P32(uap, ucp), &ctx, sizeof(ctx))) != 0) | 415 | if ((error = copyin(SCARG_P32(uap, ucp), &ctx, sizeof(ctx))) != 0) | |
419 | return error; | 416 | return error; | |
420 | 417 | |||
421 | return linux32_restore_sigcontext(l, &ctx.uc_mcontext, retval); | 418 | return linux32_restore_sigcontext(l, &ctx.uc_mcontext, retval); | |
422 | } | 419 | } | |
423 | 420 | |||
424 | static int | 421 | static int | |
425 | linux32_restore_sigcontext(l, scp, retval) | 422 | linux32_restore_sigcontext(struct lwp *l, struct linux32_sigcontext *scp, | |
426 | struct lwp *l; | 423 | register_t *retval) | |
427 | struct linux32_sigcontext *scp; | |||
428 | register_t *retval; | |||
429 | { | 424 | { | |
430 | struct trapframe *tf; | 425 | struct trapframe *tf; | |
431 | struct proc *p = l->l_proc; | 426 | struct proc *p = l->l_proc; | |
432 | struct sigaltstack *sas = &l->l_sigstk; | 427 | struct sigaltstack *sas = &l->l_sigstk; | |
433 | sigset_t mask; | 428 | sigset_t mask; | |
434 | ssize_t ss_gap; | 429 | ssize_t ss_gap; | |
435 | 430 | |||
436 | /* Restore register context. */ | 431 | /* Restore register context. */ | |
437 | tf = l->l_md.md_regs; | 432 | tf = l->l_md.md_regs; | |
438 | 433 | |||
439 | /* | 434 | /* | |
440 | * Check for security violations. If we're returning to | 435 | * Check for security violations. If we're returning to | |
441 | * protected mode, the CPU will validate the segment registers | 436 | * protected mode, the CPU will validate the segment registers |
--- src/sys/compat/linux32/common/linux32_exec_elf32.c 2008/04/28 20:23:44 1.8
+++ src/sys/compat/linux32/common/linux32_exec_elf32.c 2009/03/15 15:56:50 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux32_exec_elf32.c,v 1.8 2008/04/28 20:23:44 martin Exp $ */ | 1 | /* $NetBSD: linux32_exec_elf32.c,v 1.9 2009/03/15 15:56:50 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1995, 1998, 2000, 2001,2006 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1995, 1998, 2000, 2001,2006 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Christos Zoulas, Frank van der Linden, Eric Haszlakiewicz and | 8 | * by Christos Zoulas, Frank van der Linden, Eric Haszlakiewicz and | |
9 | * Emmanuel Dreyfus. | 9 | * Emmanuel Dreyfus. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
30 | * POSSIBILITY OF SUCH DAMAGE. | 30 | * POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: linux32_exec_elf32.c,v 1.8 2008/04/28 20:23:44 martin Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: linux32_exec_elf32.c,v 1.9 2009/03/15 15:56:50 cegger Exp $"); | |
35 | 35 | |||
36 | #define ELFSIZE 32 | 36 | #define ELFSIZE 32 | |
37 | 37 | |||
38 | #include <sys/param.h> | 38 | #include <sys/param.h> | |
39 | #include <sys/systm.h> | 39 | #include <sys/systm.h> | |
40 | #include <sys/proc.h> | 40 | #include <sys/proc.h> | |
41 | #include <sys/malloc.h> | 41 | #include <sys/malloc.h> | |
42 | #include <sys/vnode.h> | 42 | #include <sys/vnode.h> | |
43 | #include <sys/exec.h> | 43 | #include <sys/exec.h> | |
44 | #include <sys/exec_elf.h> | 44 | #include <sys/exec_elf.h> | |
45 | #include <sys/kauth.h> | 45 | #include <sys/kauth.h> | |
46 | #include <sys/kernel.h> | 46 | #include <sys/kernel.h> | |
47 | #include <sys/resourcevar.h> | 47 | #include <sys/resourcevar.h> | |
@@ -55,32 +55,28 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_exec | @@ -55,32 +55,28 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_exec | |||
55 | 55 | |||
56 | #include <machine/frame.h> | 56 | #include <machine/frame.h> | |
57 | 57 | |||
58 | #ifdef DEBUG_LINUX | 58 | #ifdef DEBUG_LINUX | |
59 | #define DPRINTF(a) uprintf a | 59 | #define DPRINTF(a) uprintf a | |
60 | #else | 60 | #else | |
61 | #define DPRINTF(a) | 61 | #define DPRINTF(a) | |
62 | #endif | 62 | #endif | |
63 | 63 | |||
64 | int linux32_copyinargs(struct exec_package *, struct ps_strings *, | 64 | int linux32_copyinargs(struct exec_package *, struct ps_strings *, | |
65 | void *, size_t, const void *, const void *); | 65 | void *, size_t, const void *, const void *); | |
66 | 66 | |||
67 | int | 67 | int | |
68 | ELFNAME2(linux32,probe)(l, epp, eh, itp, pos) | 68 | ELFNAME2(linux32,probe)(struct lwp *l, struct exec_package *epp, | |
69 | struct lwp *l; | 69 | void *eh, char *itp, vaddr_t *pos) | |
70 | struct exec_package *epp; | |||
71 | void *eh; | |||
72 | char *itp; | |||
73 | vaddr_t *pos; | |||
74 | { | 70 | { | |
75 | int error; | 71 | int error; | |
76 | 72 | |||
77 | if (((error = ELFNAME2(linux,signature)(l, epp, eh, itp)) != 0) && | 73 | if (((error = ELFNAME2(linux,signature)(l, epp, eh, itp)) != 0) && | |
78 | #ifdef LINUX32_GCC_SIGNATURE | 74 | #ifdef LINUX32_GCC_SIGNATURE | |
79 | ((error = ELFNAME2(linux,gcc_signature)(l, epp, eh)) != 0) && | 75 | ((error = ELFNAME2(linux,gcc_signature)(l, epp, eh)) != 0) && | |
80 | #endif | 76 | #endif | |
81 | #ifdef LINUX32_ATEXIT_SIGNATURE | 77 | #ifdef LINUX32_ATEXIT_SIGNATURE | |
82 | ((error = ELFNAME2(linux,atexit_signature)(l, epp, eh)) != 0) && | 78 | ((error = ELFNAME2(linux,atexit_signature)(l, epp, eh)) != 0) && | |
83 | #endif | 79 | #endif | |
84 | #ifdef LINUX32_DEBUGLINK_SIGNATURE | 80 | #ifdef LINUX32_DEBUGLINK_SIGNATURE | |
85 | ((error = ELFNAME2(linux,debuglink_signature)(l, epp, eh)) != 0) && | 81 | ((error = ELFNAME2(linux,debuglink_signature)(l, epp, eh)) != 0) && | |
86 | #endif | 82 | #endif |
--- src/sys/compat/linux32/common/linux32_unistd.c 2009/01/16 13:10:47 1.30
+++ src/sys/compat/linux32/common/linux32_unistd.c 2009/03/15 15:56:50 1.31
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux32_unistd.c,v 1.30 2009/01/16 13:10:47 njoly Exp $ */ | 1 | /* $NetBSD: linux32_unistd.c,v 1.31 2009/03/15 15:56:50 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. | 4 | * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | 14 | * 3. All advertising materials mentioning features or use of this software | |
@@ -23,27 +23,27 @@ | @@ -23,27 +23,27 @@ | |||
23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | 24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | |
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
31 | * POSSIBILITY OF SUCH DAMAGE. | 31 | * POSSIBILITY OF SUCH DAMAGE. | |
32 | */ | 32 | */ | |
33 | 33 | |||
34 | #include <sys/cdefs.h> | 34 | #include <sys/cdefs.h> | |
35 | 35 | |||
36 | __KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.30 2009/01/16 13:10:47 njoly Exp $"); | 36 | __KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.31 2009/03/15 15:56:50 cegger Exp $"); | |
37 | 37 | |||
38 | #include <sys/types.h> | 38 | #include <sys/types.h> | |
39 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
40 | #include <sys/fstypes.h> | 40 | #include <sys/fstypes.h> | |
41 | #include <sys/signal.h> | 41 | #include <sys/signal.h> | |
42 | #include <sys/dirent.h> | 42 | #include <sys/dirent.h> | |
43 | #include <sys/kernel.h> | 43 | #include <sys/kernel.h> | |
44 | #include <sys/fcntl.h> | 44 | #include <sys/fcntl.h> | |
45 | #include <sys/select.h> | 45 | #include <sys/select.h> | |
46 | #include <sys/proc.h> | 46 | #include <sys/proc.h> | |
47 | #include <sys/ucred.h> | 47 | #include <sys/ucred.h> | |
48 | #include <sys/swap.h> | 48 | #include <sys/swap.h> | |
49 | #include <sys/kauth.h> | 49 | #include <sys/kauth.h> | |
@@ -133,32 +133,29 @@ linux32_sys_oldselect(struct lwp *l, con | @@ -133,32 +133,29 @@ linux32_sys_oldselect(struct lwp *l, con | |||
133 | } */ | 133 | } */ | |
134 | struct linux32_oldselect lsp32; | 134 | struct linux32_oldselect lsp32; | |
135 | int error; | 135 | int error; | |
136 | 136 | |||
137 | if ((error = copyin(SCARG_P32(uap, lsp), &lsp32, sizeof(lsp32))) != 0) | 137 | if ((error = copyin(SCARG_P32(uap, lsp), &lsp32, sizeof(lsp32))) != 0) | |
138 | return error; | 138 | return error; | |
139 | 139 | |||
140 | return linux32_select1(l, retval, lsp32.nfds, | 140 | return linux32_select1(l, retval, lsp32.nfds, | |
141 | NETBSD32PTR64(lsp32.readfds), NETBSD32PTR64(lsp32.writefds), | 141 | NETBSD32PTR64(lsp32.readfds), NETBSD32PTR64(lsp32.writefds), | |
142 | NETBSD32PTR64(lsp32.exceptfds), NETBSD32PTR64(lsp32.timeout)); | 142 | NETBSD32PTR64(lsp32.exceptfds), NETBSD32PTR64(lsp32.timeout)); | |
143 | } | 143 | } | |
144 | 144 | |||
145 | static int | 145 | static int | |
146 | linux32_select1(l, retval, nfds, readfds, writefds, exceptfds, timeout) | 146 | linux32_select1(struct lwp *l, register_t *retval, int nfds, | |
147 | struct lwp *l; | 147 | fd_set *readfds, fd_set *writefds, fd_set *exceptfds, | |
148 | register_t *retval; | 148 | struct timeval *timeout) | |
149 | int nfds; | |||
150 | fd_set *readfds, *writefds, *exceptfds; | |||
151 | struct timeval *timeout; | |||
152 | { | 149 | { | |
153 | struct timeval tv0, tv1, utv, *tv = NULL; | 150 | struct timeval tv0, tv1, utv, *tv = NULL; | |
154 | struct netbsd32_timeval50 utv32; | 151 | struct netbsd32_timeval50 utv32; | |
155 | int error; | 152 | int error; | |
156 | 153 | |||
157 | timerclear(&utv); /* XXX GCC4 */ | 154 | timerclear(&utv); /* XXX GCC4 */ | |
158 | 155 | |||
159 | /* | 156 | /* | |
160 | * Store current time for computation of the amount of | 157 | * Store current time for computation of the amount of | |
161 | * time left. | 158 | * time left. | |
162 | */ | 159 | */ | |
163 | if (timeout) { | 160 | if (timeout) { | |
164 | if ((error = copyin(timeout, &utv32, sizeof(utv32)))) | 161 | if ((error = copyin(timeout, &utv32, sizeof(utv32)))) |