diff options
| author | ad <ad@NetBSD.org> | 2007-02-09 21:55:00 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2007-02-09 21:55:00 +0000 |
| commit | b07ec3fc388a5aeae51e8871aa89eefea3ce1e53 (patch) | |
| tree | c93d3b23a29f98ac0e26c9d43afb509219d0ea42 /sys/compat | |
| parent | 5c1aad3ad0b9d2403784bd52128e8e8399e22254 (diff) | |
Merge newlock2 to head.
Diffstat (limited to 'sys/compat')
303 files changed, 1306 insertions, 1625 deletions
diff --git a/sys/compat/aoutm68k/aoutm68k_stat.c b/sys/compat/aoutm68k/aoutm68k_stat.c index 89df8c68b62..5a9c578a4d3 100644 --- a/sys/compat/aoutm68k/aoutm68k_stat.c +++ b/sys/compat/aoutm68k/aoutm68k_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: aoutm68k_stat.c,v 1.15 2006/08/01 21:05:14 martin Exp $ */ +/* $NetBSD: aoutm68k_stat.c,v 1.16 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: aoutm68k_stat.c,v 1.15 2006/08/01 21:05:14 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aoutm68k_stat.c,v 1.16 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: aoutm68k_stat.c,v 1.15 2006/08/01 21:05:14 martin Ex #include <sys/stat.h> #include <sys/syscall.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/stat.h> diff --git a/sys/compat/aoutm68k/aoutm68k_syscalls.c b/sys/compat/aoutm68k/aoutm68k_syscalls.c index 74783faf88b..352da42c2d4 100644 --- a/sys/compat/aoutm68k/aoutm68k_syscalls.c +++ b/sys/compat/aoutm68k/aoutm68k_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: aoutm68k_syscalls.c,v 1.23 2006/09/01 21:19:44 matt Exp $ */ +/* $NetBSD: aoutm68k_syscalls.c,v 1.24 2007/02/09 21:55:16 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: aoutm68k_syscalls.c,v 1.23 2006/09/01 21:19:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aoutm68k_syscalls.c,v 1.24 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -25,7 +25,6 @@ __KERNEL_RCSID(0, "$NetBSD: aoutm68k_syscalls.c,v 1.23 2006/09/01 21:19:44 matt #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/aoutm68k/aoutm68k_syscallargs.h> #endif /* _KERNEL_OPT */ diff --git a/sys/compat/aoutm68k/aoutm68k_sysent.c b/sys/compat/aoutm68k/aoutm68k_sysent.c index e4d14505e8e..97dabb5d169 100644 --- a/sys/compat/aoutm68k/aoutm68k_sysent.c +++ b/sys/compat/aoutm68k/aoutm68k_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: aoutm68k_sysent.c,v 1.27 2006/09/01 21:19:44 matt Exp $ */ +/* $NetBSD: aoutm68k_sysent.c,v 1.28 2007/02/09 21:55:16 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: aoutm68k_sysent.c,v 1.27 2006/09/01 21:19:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aoutm68k_sysent.c,v 1.28 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -24,7 +24,6 @@ __KERNEL_RCSID(0, "$NetBSD: aoutm68k_sysent.c,v 1.27 2006/09/01 21:19:44 matt Ex #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/aoutm68k/aoutm68k_syscallargs.h> diff --git a/sys/compat/aoutm68k/syscalls.master b/sys/compat/aoutm68k/syscalls.master index a46003491f6..8536d0c123d 100644 --- a/sys/compat/aoutm68k/syscalls.master +++ b/sys/compat/aoutm68k/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.21 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.22 2007/02/09 21:55:16 ad Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -50,7 +50,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/aoutm68k/aoutm68k_syscallargs.h> diff --git a/sys/compat/common/compat_file.c b/sys/compat/common/compat_file.c index b13a0b7a2d4..ea2966181eb 100644 --- a/sys/compat/common/compat_file.c +++ b/sys/compat/common/compat_file.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat_file.c,v 1.19 2006/07/14 20:06:57 christos Exp $ */ +/* $NetBSD: compat_file.c,v 1.20 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: compat_file.c,v 1.19 2006/07/14 20:06:57 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_file.c,v 1.20 2007/02/09 21:55:16 ad Exp $"); #include "opt_compat_darwin.h" #include "opt_nfsserver.h" @@ -62,7 +62,6 @@ __KERNEL_RCSID(0, "$NetBSD: compat_file.c,v 1.19 2006/07/14 20:06:57 christos Ex #include <sys/domain.h> #include <sys/protosw.h> #include <sys/socketvar.h> -#include <sys/sa.h> #include <sys/un.h> #include <uvm/uvm_extern.h> diff --git a/sys/compat/common/kern_exit_43.c b/sys/compat/common/kern_exit_43.c index 8e7e8635761..2528f3858fe 100644 --- a/sys/compat/common/kern_exit_43.c +++ b/sys/compat/common/kern_exit_43.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit_43.c,v 1.16 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: kern_exit_43.c,v 1.17 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_exit_43.c,v 1.16 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit_43.c,v 1.17 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_exit_43.c,v 1.16 2007/01/29 01:52:44 hubertf Ex #include <sys/acct.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/cpu.h> diff --git a/sys/compat/common/kern_info_09.c b/sys/compat/common/kern_info_09.c index b90ea31e768..9a5015c4298 100644 --- a/sys/compat/common/kern_info_09.c +++ b/sys/compat/common/kern_info_09.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_info_09.c,v 1.17 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: kern_info_09.c,v 1.18 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1982, 1986, 1991, 1993 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_info_09.c,v 1.17 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_info_09.c,v 1.18 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_info_09.c,v 1.17 2006/11/16 01:32:41 christos E #include <sys/sysctl.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> /* ARGSUSED */ diff --git a/sys/compat/common/kern_info_43.c b/sys/compat/common/kern_info_43.c index 6640bc30ac1..24151cfe8be 100644 --- a/sys/compat/common/kern_info_43.c +++ b/sys/compat/common/kern_info_43.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_info_43.c,v 1.26 2007/01/04 18:27:36 elad Exp $ */ +/* $NetBSD: kern_info_43.c,v 1.27 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1982, 1986, 1991, 1993 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_info_43.c,v 1.26 2007/01/04 18:27:36 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_info_43.c,v 1.27 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_info_43.c,v 1.26 2007/01/04 18:27:36 elad Exp $ #include <sys/sysctl.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> int diff --git a/sys/compat/common/kern_ipc_10.c b/sys/compat/common/kern_ipc_10.c index 560b9b253fe..38fbaee83e9 100644 --- a/sys/compat/common/kern_ipc_10.c +++ b/sys/compat/common/kern_ipc_10.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_ipc_10.c,v 1.18 2005/11/10 18:39:30 christos Exp $ */ +/* $NetBSD: kern_ipc_10.c,v 1.19 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1994 Adam Glass and Charles M. Hannum. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_ipc_10.c,v 1.18 2005/11/10 18:39:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_ipc_10.c,v 1.19 2007/02/09 21:55:16 ad Exp $"); #include "opt_sysv.h" @@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_ipc_10.c,v 1.18 2005/11/10 18:39:30 christos Ex #include <sys/sem.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_util.h> diff --git a/sys/compat/common/kern_resource_43.c b/sys/compat/common/kern_resource_43.c index 5195814e4bf..b1eb82488db 100644 --- a/sys/compat/common/kern_resource_43.c +++ b/sys/compat/common/kern_resource_43.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_resource_43.c,v 1.17 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: kern_resource_43.c,v 1.18 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_resource_43.c,v 1.17 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_resource_43.c,v 1.18 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_resource_43.c,v 1.17 2006/11/16 01:32:41 christ #include <sys/proc.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> /* ARGSUSED */ diff --git a/sys/compat/common/kern_sig_13.c b/sys/compat/common/kern_sig_13.c index 3965fb4b704..69c663be488 100644 --- a/sys/compat/common/kern_sig_13.c +++ b/sys/compat/common/kern_sig_13.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sig_13.c,v 1.13 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: kern_sig_13.c,v 1.14 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_sig_13.c,v 1.13 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sig_13.c,v 1.14 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_sig_13.c,v 1.13 2006/11/16 01:32:41 christos Ex #include <sys/systm.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/limits.h> @@ -127,7 +126,6 @@ compat_13_sys_sigaltstack(struct lwp *l, void *v, register_t *retval) syscallarg(const struct sigaltstack13 *) nss; syscallarg(struct sigaltstack13 *) oss; } */ *uap = v; - struct proc *p = l->l_proc; struct sigaltstack13 ness, oess; struct sigaltstack nbss, obss; int error; @@ -138,7 +136,7 @@ compat_13_sys_sigaltstack(struct lwp *l, void *v, register_t *retval) return (error); native_sigaltstack13_to_sigaltstack(&ness, &nbss); } - error = sigaltstack1(p, + error = sigaltstack1(l, SCARG(uap, nss) ? &nbss : 0, SCARG(uap, oss) ? &obss : 0); if (error) return (error); @@ -159,7 +157,6 @@ compat_13_sys_sigaction(struct lwp *l, void *v, register_t *retval) syscallarg(const struct sigaction13 *) nsa; syscallarg(struct sigaction13 *) osa; } */ *uap = v; - struct proc *p = l->l_proc; struct sigaction13 nesa, oesa; struct sigaction nbsa, obsa; int error; @@ -170,7 +167,7 @@ compat_13_sys_sigaction(struct lwp *l, void *v, register_t *retval) return (error); native_sigaction13_to_sigaction(&nesa, &nbsa); } - error = sigaction1(p, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0, NULL, 0); if (error) @@ -198,7 +195,9 @@ compat_13_sys_sigprocmask(struct lwp *l, void *v, register_t *retval) ness = SCARG(uap, mask); native_sigset13_to_sigset(&ness, &nbss); - error = sigprocmask1(p, SCARG(uap, how), &nbss, &obss); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SCARG(uap, how), &nbss, &obss); + mutex_exit(&p->p_smutex); if (error) return (error); native_sigset_to_sigset13(&obss, &oess); @@ -209,11 +208,10 @@ compat_13_sys_sigprocmask(struct lwp *l, void *v, register_t *retval) int compat_13_sys_sigpending(struct lwp *l, void *v, register_t *retval) { - struct proc *p = l->l_proc; sigset13_t ess; sigset_t bss; - sigpending1(p, &bss); + sigpending1(l, &bss); native_sigset_to_sigset13(&bss, &ess); *retval = ess; return (0); @@ -225,11 +223,10 @@ compat_13_sys_sigsuspend(struct lwp *l, void *v, register_t *retval) struct compat_13_sys_sigsuspend_args /* { syscallarg(sigset13_t) mask; } */ *uap = v; - struct proc *p = l->l_proc; sigset13_t ess; sigset_t bss; ess = SCARG(uap, mask); native_sigset13_to_sigset(&ess, &bss); - return (sigsuspend1(p, &bss)); + return (sigsuspend1(l, &bss)); } diff --git a/sys/compat/common/kern_sig_43.c b/sys/compat/common/kern_sig_43.c index fb3cc4594c1..40bf61466b3 100644 --- a/sys/compat/common/kern_sig_43.c +++ b/sys/compat/common/kern_sig_43.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sig_43.c,v 1.25 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: kern_sig_43.c,v 1.26 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.25 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.26 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -64,7 +64,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.25 2006/11/16 01:32:41 christos Ex #include <sys/kauth.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/cpu.h> @@ -158,7 +157,9 @@ compat_43_sys_sigblock(struct lwp *l, void *v, register_t *retval) nsm = SCARG(uap, mask); compat_43_sigmask_to_sigset(&nsm, &nss); - error = sigprocmask1(p, SIG_BLOCK, &nss, &oss); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SIG_BLOCK, &nss, &oss); + mutex_exit(&p->p_smutex); if (error) return (error); compat_43_sigset_to_sigmask(&oss, &osm); @@ -179,7 +180,9 @@ compat_43_sys_sigsetmask(struct lwp *l, void *v, register_t *retval) nsm = SCARG(uap, mask); compat_43_sigmask_to_sigset(&nsm, &nss); - error = sigprocmask1(p, SIG_SETMASK, &nss, &oss); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SIG_SETMASK, &nss, &oss); + mutex_exit(&p->p_smutex); if (error) return (error); compat_43_sigset_to_sigmask(&oss, &osm); @@ -195,7 +198,6 @@ compat_43_sys_sigstack(struct lwp *l, void *v, register_t *retval) syscallarg(struct sigstack *) nss; syscallarg(struct sigstack *) oss; } */ *uap = v; - struct proc *p = l->l_proc; struct sigstack nss, oss; struct sigaltstack nsa, osa; int error; @@ -206,7 +208,7 @@ compat_43_sys_sigstack(struct lwp *l, void *v, register_t *retval) return (error); compat_43_sigstack_to_sigaltstack(&nss, &nsa); } - error = sigaltstack1(p, + error = sigaltstack1(l, SCARG(uap, nss) ? &nsa : 0, SCARG(uap, oss) ? &osa : 0); if (error) return (error); @@ -231,7 +233,6 @@ compat_43_sys_sigvec(struct lwp *l, void *v, register_t *retval) syscallarg(const struct sigvec *) nsv; syscallarg(struct sigvec *) osv; } */ *uap = v; - struct proc *p = l->l_proc; struct sigvec nsv, osv; struct sigaction nsa, osa; int error; @@ -242,7 +243,7 @@ compat_43_sys_sigvec(struct lwp *l, void *v, register_t *retval) return (error); compat_43_sigvec_to_sigaction(&nsv, &nsa); } - error = sigaction1(p, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0, NULL, 0); if (error) diff --git a/sys/compat/common/kern_xxx_12.c b/sys/compat/common/kern_xxx_12.c index 49ccb12c9a1..736f1591f1e 100644 --- a/sys/compat/common/kern_xxx_12.c +++ b/sys/compat/common/kern_xxx_12.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_xxx_12.c,v 1.11 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: kern_xxx_12.c,v 1.12 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.11 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.12 2007/02/09 21:55:16 ad Exp $"); /*#ifdef COMPAT_12*/ @@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.11 2006/11/16 01:32:41 christos Ex #include <sys/proc.h> #include <sys/reboot.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/kauth.h> diff --git a/sys/compat/common/sysv_msg_14.c b/sys/compat/common/sysv_msg_14.c index 0cfe72c86b5..945f2de657c 100644 --- a/sys/compat/common/sysv_msg_14.c +++ b/sys/compat/common/sysv_msg_14.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysv_msg_14.c,v 1.12 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: sysv_msg_14.c,v 1.13 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysv_msg_14.c,v 1.12 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysv_msg_14.c,v 1.13 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: sysv_msg_14.c,v 1.12 2006/11/16 01:32:41 christos Ex #define SYSVMSG #endif -#include <sys/sa.h> #include <sys/syscallargs.h> static void msqid_ds14_to_native __P((struct msqid_ds14 *, struct msqid_ds *)); diff --git a/sys/compat/common/sysv_sem_14.c b/sys/compat/common/sysv_sem_14.c index a9f563a26d6..144b45e60d6 100644 --- a/sys/compat/common/sysv_sem_14.c +++ b/sys/compat/common/sysv_sem_14.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysv_sem_14.c,v 1.10 2006/07/23 22:06:08 ad Exp $ */ +/* $NetBSD: sysv_sem_14.c,v 1.11 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysv_sem_14.c,v 1.10 2006/07/23 22:06:08 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysv_sem_14.c,v 1.11 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: sysv_sem_14.c,v 1.10 2006/07/23 22:06:08 ad Exp $"); #define SYSVSEM #endif -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/sem.h> diff --git a/sys/compat/common/sysv_shm_14.c b/sys/compat/common/sysv_shm_14.c index 49cf94f2dff..b5081d6f121 100644 --- a/sys/compat/common/sysv_shm_14.c +++ b/sys/compat/common/sysv_shm_14.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysv_shm_14.c,v 1.10 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: sysv_shm_14.c,v 1.11 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysv_shm_14.c,v 1.10 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysv_shm_14.c,v 1.11 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: sysv_shm_14.c,v 1.10 2006/11/16 01:32:41 christos Ex #define SYSVSHM #endif -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/shm.h> diff --git a/sys/compat/common/uipc_syscalls_30.c b/sys/compat/common/uipc_syscalls_30.c index 67612756f7a..738a98d2d2a 100644 --- a/sys/compat/common/uipc_syscalls_30.c +++ b/sys/compat/common/uipc_syscalls_30.c @@ -1,9 +1,9 @@ -/* $NetBSD: uipc_syscalls_30.c,v 1.1 2006/06/26 21:23:57 mrg Exp $ */ +/* $NetBSD: uipc_syscalls_30.c,v 1.2 2007/02/09 21:55:16 ad Exp $ */ /* written by Pavel Cahyna, 2006. Public domain. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_30.c,v 1.1 2006/06/26 21:23:57 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_30.c,v 1.2 2007/02/09 21:55:16 ad Exp $"); /* * System call interface to the socket abstraction. @@ -14,7 +14,6 @@ __KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_30.c,v 1.1 2006/06/26 21:23:57 mrg Exp #include <sys/msg.h> #include <sys/sysctl.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/errno.h> diff --git a/sys/compat/common/uipc_syscalls_43.c b/sys/compat/common/uipc_syscalls_43.c index 03c15716a1b..281f371a058 100644 --- a/sys/compat/common/uipc_syscalls_43.c +++ b/sys/compat/common/uipc_syscalls_43.c @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_syscalls_43.c,v 1.26 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: uipc_syscalls_43.c,v 1.27 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1990, 1993 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.26 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.27 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.26 2007/01/29 01:52:44 hubert #include <sys/protosw.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/socket.h> diff --git a/sys/compat/common/vfs_syscalls_12.c b/sys/compat/common/vfs_syscalls_12.c index 04c6d6db90d..e9d57689dbf 100644 --- a/sys/compat/common/vfs_syscalls_12.c +++ b/sys/compat/common/vfs_syscalls_12.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls_12.c,v 1.19 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: vfs_syscalls_12.c,v 1.20 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.19 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.20 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.19 2006/11/16 01:32:41 christo #include <sys/uio.h> #include <sys/dirent.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/stat.h> diff --git a/sys/compat/common/vfs_syscalls_20.c b/sys/compat/common/vfs_syscalls_20.c index dcdbad4c960..13d88060c93 100644 --- a/sys/compat/common/vfs_syscalls_20.c +++ b/sys/compat/common/vfs_syscalls_20.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls_20.c,v 1.15 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: vfs_syscalls_20.c,v 1.16 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.15 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.16 2007/02/09 21:55:16 ad Exp $"); #include "opt_compat_netbsd.h" #include "opt_compat_43.h" @@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.15 2006/11/16 01:32:41 christo #include <sys/malloc.h> #include <sys/dirent.h> #include <sys/sysctl.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/kauth.h> diff --git a/sys/compat/common/vfs_syscalls_30.c b/sys/compat/common/vfs_syscalls_30.c index 998601998bf..89959fb4b79 100644 --- a/sys/compat/common/vfs_syscalls_30.c +++ b/sys/compat/common/vfs_syscalls_30.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls_30.c,v 1.18 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: vfs_syscalls_30.c,v 1.19 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.18 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.19 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -54,7 +54,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.18 2006/11/16 01:32:41 christo #include <sys/malloc.h> #include <sys/kauth.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_util.h> diff --git a/sys/compat/common/vfs_syscalls_43.c b/sys/compat/common/vfs_syscalls_43.c index d1b2f2d3902..c0351f0f1ca 100644 --- a/sys/compat/common/vfs_syscalls_43.c +++ b/sys/compat/common/vfs_syscalls_43.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls_43.c,v 1.34 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: vfs_syscalls_43.c,v 1.35 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.34 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.35 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "fs_union.h" @@ -64,7 +64,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.34 2006/11/16 01:32:41 christo #include <sys/sysctl.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/stat.h> diff --git a/sys/compat/common/vm_12.c b/sys/compat/common/vm_12.c index cd16834d0cb..2a19bab021c 100644 --- a/sys/compat/common/vm_12.c +++ b/sys/compat/common/vm_12.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_12.c,v 1.14 2005/12/11 12:19:56 christos Exp $ */ +/* $NetBSD: vm_12.c,v 1.15 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1997 Matthew R. Green @@ -29,12 +29,11 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm_12.c,v 1.14 2005/12/11 12:19:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_12.c,v 1.15 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/mount.h> /* needed for next include! */ -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/swap.h> diff --git a/sys/compat/common/vm_43.c b/sys/compat/common/vm_43.c index 2771045b1d3..6db2000460d 100644 --- a/sys/compat/common/vm_43.c +++ b/sys/compat/common/vm_43.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_43.c,v 1.13 2006/11/16 01:32:41 christos Exp $ */ +/* $NetBSD: vm_43.c,v 1.14 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1991, 1993 @@ -82,7 +82,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm_43.c,v 1.13 2006/11/16 01:32:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_43.c,v 1.14 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -94,7 +94,6 @@ __KERNEL_RCSID(0, "$NetBSD: vm_43.c,v 1.13 2006/11/16 01:32:41 christos Exp $"); #include <sys/mman.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <miscfs/specfs/specdev.h> diff --git a/sys/compat/darwin/darwin_attr.c b/sys/compat/darwin/darwin_attr.c index 3b778047593..34d3f87bc17 100644 --- a/sys/compat/darwin/darwin_attr.c +++ b/sys/compat/darwin/darwin_attr.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_attr.c,v 1.12 2006/07/23 22:06:08 ad Exp $ */ +/* $NetBSD: darwin_attr.c,v 1.13 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,14 +37,13 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_attr.c,v 1.12 2006/07/23 22:06:08 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_attr.c,v 1.13 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/types.h> #include <sys/proc.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/lwp.h> #include <sys/file.h> #include <sys/filedesc.h> diff --git a/sys/compat/darwin/darwin_audit.c b/sys/compat/darwin/darwin_audit.c index 6bf55c45fad..7756e91b9ad 100644 --- a/sys/compat/darwin/darwin_audit.c +++ b/sys/compat/darwin/darwin_audit.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_audit.c,v 1.5 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: darwin_audit.c,v 1.6 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_audit.c,v 1.5 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_audit.c,v 1.6 2007/02/09 21:55:16 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_audit.c,v 1.5 2006/11/16 01:32:42 christos Ex #include <sys/mount.h> #include <sys/proc.h> #include <sys/ktrace.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/signal.h> diff --git a/sys/compat/darwin/darwin_exec.c b/sys/compat/darwin/darwin_exec.c index f3fa8f01ba7..69279abe9cf 100644 --- a/sys/compat/darwin/darwin_exec.c +++ b/sys/compat/darwin/darwin_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_exec.c,v 1.47 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: darwin_exec.c,v 1.48 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include "opt_compat_darwin.h" /* For COMPAT_DARWIN in mach_port.h */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_exec.c,v 1.47 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_exec.c,v 1.48 2007/02/09 21:55:16 ad Exp $"); #include "opt_syscall_debug.h" @@ -131,7 +131,7 @@ const struct emul emul_darwin = { uvm_default_mapaddr, NULL, - NULL, + 0, }; /* @@ -336,7 +336,7 @@ darwin_e_proc_exit(p) caddr_t sg = stackgap_init(p, 0); ded = p->p_emuldata; - l = proc_representative_lwp(p); + l = LIST_FIRST(&p->p_lwps); /* * mach_init is setting the bootstrap port for other processes. * If mach_init dies, we want to restore the original bootstrap diff --git a/sys/compat/darwin/darwin_ioctl.c b/sys/compat/darwin/darwin_ioctl.c index bd35b2ed16c..21e0829019e 100644 --- a/sys/compat/darwin/darwin_ioctl.c +++ b/sys/compat/darwin/darwin_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_ioctl.c,v 1.5 2005/12/11 12:19:56 christos Exp $ */ +/* $NetBSD: darwin_ioctl.c,v 1.6 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_ioctl.c,v 1.5 2005/12/11 12:19:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_ioctl.c,v 1.6 2007/02/09 21:55:16 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -48,7 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_ioctl.c,v 1.5 2005/12/11 12:19:56 christos Ex #include <sys/dirent.h> #include <sys/vnode.h> #include <sys/proc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> diff --git a/sys/compat/darwin/darwin_ktrace.c b/sys/compat/darwin/darwin_ktrace.c index b8b1022dcc9..50703256eca 100644 --- a/sys/compat/darwin/darwin_ktrace.c +++ b/sys/compat/darwin/darwin_ktrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_ktrace.c,v 1.8 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: darwin_ktrace.c,v 1.9 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_ktrace.c,v 1.8 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_ktrace.c,v 1.9 2007/02/09 21:55:16 ad Exp $"); #include "opt_ktrace.h" @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_ktrace.c,v 1.8 2006/11/16 01:32:42 christos E #include <sys/mount.h> #include <sys/proc.h> #include <sys/ktrace.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/signal.h> diff --git a/sys/compat/darwin/darwin_mman.c b/sys/compat/darwin/darwin_mman.c index 54c61c728f3..625f3b13230 100644 --- a/sys/compat/darwin/darwin_mman.c +++ b/sys/compat/darwin/darwin_mman.c @@ -1,6 +1,6 @@ #undef DEBUG_DARWIN #undef DEBUG_MACH -/* $NetBSD: darwin_mman.c,v 1.21 2006/06/20 03:21:30 christos Exp $ */ +/* $NetBSD: darwin_mman.c,v 1.22 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_mman.c,v 1.21 2006/06/20 03:21:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_mman.c,v 1.22 2007/02/09 21:55:16 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_mman.c,v 1.21 2006/06/20 03:21:30 christos Ex #include <sys/filedesc.h> #include <sys/vnode.h> #include <sys/exec.h> -#include <sys/sa.h> #include <sys/syscallargs.h> diff --git a/sys/compat/darwin/darwin_mount.c b/sys/compat/darwin/darwin_mount.c index e54fd036dd8..7955e245157 100644 --- a/sys/compat/darwin/darwin_mount.c +++ b/sys/compat/darwin/darwin_mount.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_mount.c,v 1.9 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: darwin_mount.c,v 1.10 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,12 +37,11 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_mount.c,v 1.9 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_mount.c,v 1.10 2007/02/09 21:55:16 ad Exp $"); #include <sys/types.h> #include <sys/param.h> #include <sys/systm.h> -#include <sys/sa.h> #include <sys/mount.h> #include <sys/proc.h> #include <sys/vnode.h> diff --git a/sys/compat/darwin/darwin_ptrace.c b/sys/compat/darwin/darwin_ptrace.c index 59d566e1054..e2f7824d71b 100644 --- a/sys/compat/darwin/darwin_ptrace.c +++ b/sys/compat/darwin/darwin_ptrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_ptrace.c,v 1.10 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: darwin_ptrace.c,v 1.11 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_ptrace.c,v 1.10 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_ptrace.c,v 1.11 2007/02/09 21:55:16 ad Exp $"); #include "opt_ptrace.h" @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_ptrace.c,v 1.10 2006/11/16 01:32:42 christos #include <sys/mount.h> #include <sys/proc.h> #include <sys/ptrace.h> -#include <sys/sa.h> #include <sys/syscall.h> #include <sys/syscallargs.h> @@ -89,6 +88,8 @@ darwin_sys_ptrace(l, v, retval) return ENOSYS; #endif + /* XXXAD locking */ + ded = (struct darwin_emuldata *)p->p_emuldata; switch (req) { @@ -113,7 +114,7 @@ darwin_sys_ptrace(l, v, retval) break; case DARWIN_PT_SIGEXC: - if ((p->p_flag & P_TRACED) == 0) + if ((p->p_slflag & PSL_TRACED) == 0) return EBUSY; ded->ded_flags |= DARWIN_DED_SIGEXC; @@ -126,7 +127,7 @@ darwin_sys_ptrace(l, v, retval) return (ESRCH); if ((t->p_emul == &emul_darwin) && - (t->p_flag & P_TRACED) && + (t->p_slflag & PSL_TRACED) && (t->p_pptr == p)) { ded = t->p_emuldata; if (ded->ded_flags & DARWIN_DED_SIGEXC) { @@ -139,10 +140,18 @@ darwin_sys_ptrace(l, v, retval) * If the process is not marked as stopped, * sys_ptrace sanity checks will return EBUSY. */ - proc_stop(t, 0); + mutex_enter(&proclist_mutex); + mutex_enter(&t->p_smutex); + proc_stop(t, 0, SIGSTOP); + mutex_exit(&t->p_smutex); + mutex_exit(&proclist_mutex); if ((error = sys_ptrace(l, v, retval)) != 0) { + mutex_enter(&proclist_mutex); + mutex_enter(&t->p_smutex); proc_unstop(t); + mutex_exit(&t->p_smutex); + mutex_exit(&proclist_mutex); if (had_sigexc) ded->ded_flags |= DARWIN_DED_SIGEXC; } @@ -157,17 +166,17 @@ darwin_sys_ptrace(l, v, retval) return ESRCH; /* Checks from native ptrace */ - if (!ISSET(t->p_flag, P_TRACED)) + if (!ISSET(t->p_slflag, PSL_TRACED)) return EPERM; - if (ISSET(t->p_flag, P_FSTRACE)) + if (ISSET(t->p_slflag, PSL_FSTRACE)) return EBUSY; if (t->p_pptr != p) return EBUSY; #if 0 - if (t->p_stat != SSTOP || !ISSET(t->p_flag, P_WAITED)) + if (t->p_stat != SSTOP || !ISSET(t->p_sflag, PS_WAITED)) return EBUSY; #endif if ((signo < 0) || (signo > NSIG)) @@ -175,7 +184,7 @@ darwin_sys_ptrace(l, v, retval) t->p_xstat = signo; if (signo != 0) - sigaddset(&p->p_sigctx.ps_siglist, signo); + sigaddset(&p->p_sigpend.sp_set, signo); break; } diff --git a/sys/compat/darwin/darwin_signal.c b/sys/compat/darwin/darwin_signal.c index a76d863b0b0..ab00598d798 100644 --- a/sys/compat/darwin/darwin_signal.c +++ b/sys/compat/darwin/darwin_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_signal.c,v 1.22 2006/10/19 15:11:59 reinoud Exp $ */ +/* $NetBSD: darwin_signal.c,v 1.23 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_signal.c,v 1.22 2006/10/19 15:11:59 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_signal.c,v 1.23 2007/02/09 21:55:16 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_signal.c,v 1.22 2006/10/19 15:11:59 reinoud E #include <sys/mount.h> #include <sys/proc.h> #include <sys/signal.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/signal.h> @@ -133,7 +132,7 @@ darwin_sys_sigaction(l, v, retval) void darwin_trapsignal(l, ksi) struct lwp *l; - const struct ksiginfo *ksi; + struct ksiginfo *ksi; { if (mach_trapsignal1(l, ksi) != 0) trapsignal(l, ksi); @@ -162,7 +161,7 @@ darwin_tracesig(p, signo) code[0] = MACH_SOFT_SIGNAL; code[1] = signo; - l = proc_representative_lwp(p); + l = proc_representative_lwp(p, NULL, 0); error = mach_exception(l, MACH_EXC_SOFTWARE, code); /* Inhibit normal signal delivery */ diff --git a/sys/compat/darwin/darwin_signal.h b/sys/compat/darwin/darwin_signal.h index 8239dc0e108..c453b4e3764 100644 --- a/sys/compat/darwin/darwin_signal.h +++ b/sys/compat/darwin/darwin_signal.h @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_signal.h,v 1.14 2005/12/11 12:19:56 christos Exp $ */ +/* $NetBSD: darwin_signal.h,v 1.15 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -80,7 +80,7 @@ struct darwin___sigaction { }; void darwin_sendsig(const ksiginfo_t *, const sigset_t *); -void darwin_trapsignal(struct lwp *, const struct ksiginfo *); +void darwin_trapsignal(struct lwp *, struct ksiginfo *); int darwin_tracesig(struct proc *, int); void native_to_darwin_siginfo(const struct ksiginfo *, struct darwin___siginfo *); diff --git a/sys/compat/darwin/darwin_socket.c b/sys/compat/darwin/darwin_socket.c index 9f2e5037b63..892c1b85cf0 100644 --- a/sys/compat/darwin/darwin_socket.c +++ b/sys/compat/darwin/darwin_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_socket.c,v 1.11 2006/06/26 21:23:57 mrg Exp $ */ +/* $NetBSD: darwin_socket.c,v 1.12 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,14 +37,13 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_socket.c,v 1.11 2006/06/26 21:23:57 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_socket.c,v 1.12 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/socket.h> #include <sys/signal.h> #include <sys/lwp.h> -#include <sys/sa.h> #include <sys/socketvar.h> #include <sys/un.h> #include <sys/ucred.h> diff --git a/sys/compat/darwin/darwin_stat.c b/sys/compat/darwin/darwin_stat.c index 99b36998642..e5c7fcde1a5 100644 --- a/sys/compat/darwin/darwin_stat.c +++ b/sys/compat/darwin/darwin_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_stat.c,v 1.5 2005/12/11 12:19:56 christos Exp $ */ +/* $NetBSD: darwin_stat.c,v 1.6 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,13 +37,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_stat.c,v 1.5 2005/12/11 12:19:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_stat.c,v 1.6 2007/02/09 21:55:16 ad Exp $"); #include <sys/types.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/stat.h> #include <sys/syscallargs.h> diff --git a/sys/compat/darwin/darwin_syscalls.c b/sys/compat/darwin/darwin_syscalls.c index 0e1d7db072c..25d76b684ce 100644 --- a/sys/compat/darwin/darwin_syscalls.c +++ b/sys/compat/darwin/darwin_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_syscalls.c,v 1.49 2005/12/11 12:19:56 christos Exp $ */ +/* $NetBSD: darwin_syscalls.c,v 1.50 2007/02/09 21:55:16 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.49 2005/12/11 12:19:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.50 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -23,7 +23,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.49 2005/12/11 12:19:56 christo #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_file.h> #include <compat/sys/signal.h> diff --git a/sys/compat/darwin/darwin_sysctl.c b/sys/compat/darwin/darwin_sysctl.c index 8270dea69d5..7bffa4319f7 100644 --- a/sys/compat/darwin/darwin_sysctl.c +++ b/sys/compat/darwin/darwin_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_sysctl.c,v 1.46 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: darwin_sysctl.c,v 1.47 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_sysctl.c,v 1.46 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_sysctl.c,v 1.47 2007/02/09 21:55:16 ad Exp $"); #include "opt_ktrace.h" @@ -54,7 +54,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_sysctl.c,v 1.46 2006/11/16 01:32:42 christos #ifdef KTRACE #include <sys/ktrace.h> #endif -#include <sys/sa.h> #include <sys/tty.h> #include <sys/kauth.h> @@ -86,7 +85,7 @@ static const char *darwin_sysctl_hw_machine = "Power Macintosh"; static int darwin_sysctl_dokproc(SYSCTLFN_PROTO); static void darwin_fill_kproc(struct proc *, struct darwin_kinfo_proc *); -static void native_to_darwin_pflag(int *, int); +static void native_to_darwin_pflag(int *, struct proc *); static int darwin_sysctl_procargs(SYSCTLFN_PROTO); static int darwin_sysctl_net(SYSCTLFN_PROTO); static int darwin_sysctl_kdebug(SYSCTLFN_PROTO); @@ -649,7 +648,7 @@ darwin_sysctl_dokproc(SYSCTLFN_ARGS) elem_count = name[3]; } - proclist_lock_read(); + rw_enter(&proclist_lock, RW_READER); pd = proclists; again: @@ -684,11 +683,11 @@ again: case DARWIN_KERN_PROC_TTY: if (arg == (int) KERN_PROC_TTY_REVOKE) { - if ((p->p_flag & P_CONTROLT) == 0 || + if ((p->p_lflag & PL_CONTROLT) == 0 || p->p_session->s_ttyp == NULL || p->p_session->s_ttyvp != NULL) continue; - } else if ((p->p_flag & P_CONTROLT) == 0 || + } else if ((p->p_lflag & PL_CONTROLT) == 0 || p->p_session->s_ttyp == NULL) { continue; } else if (p->p_session->s_ttyp->t_dev != @@ -727,7 +726,7 @@ again: pd++; if (pd->pd_list != NULL) goto again; - proclist_unlock_read(); + rw_exit(&proclist_lock); if (where != NULL) { *oldlenp = (caddr_t)dp - where; @@ -739,7 +738,7 @@ again: } return (0); cleanup: - proclist_unlock_read(); + rw_exit(&proclist_lock); return (error); } @@ -756,7 +755,7 @@ darwin_fill_kproc(p, dkp) struct darwin_eproc *de; printf("fillkproc: pid %d\n", p->p_pid); - l = proc_representative_lwp(p); + l = proc_representative_lwp(p, NULL, 1); (void)memset(dkp, 0, sizeof(*dkp)); dep = (struct darwin_extern_proc *)&dkp->kp_proc; @@ -765,7 +764,7 @@ darwin_fill_kproc(p, dkp) /* (ptr) dep->p_un */ /* (ptr) dep->p_vmspace */ /* (ptr) dep->p_sigacts */ - native_to_darwin_pflag(&dep->p_flag, p->p_flag); + native_to_darwin_pflag(&dep->p_flag, p); dep->p_stat = p->p_stat; /* XXX Neary the same */ dep->p_pid = p->p_pid; dep->p_oppid = p->p_opptr->p_pid; @@ -788,12 +787,10 @@ darwin_fill_kproc(p, dkp) dep->p_iticks = p->p_iticks; dep->p_traceflag = p->p_traceflag; /* XXX */ /* (ptr) dep->p_tracep */ - native_sigset13_to_sigset(&dep->p_siglist, - &p->p_sigctx.ps_siglist); + native_sigset13_to_sigset(&dep->p_siglist, &l->l_sigpendset->sp_set); /* (ptr) dep->p_textvp */ /* dep->p_holdcnt */ - native_sigset13_to_sigset(&dep->p_sigmask, - &p->p_sigctx.ps_sigmask); + native_sigset13_to_sigset(&dep->p_sigmask, &l->l_sigmask); native_sigset13_to_sigset(&dep->p_sigignore, &p->p_sigctx.ps_sigignore); native_sigset13_to_sigset(&dep->p_sigcatch, @@ -833,7 +830,7 @@ darwin_fill_kproc(p, dkp) de->e_ppid = p->p_pptr->p_pid; de->e_pgid = p->p_pgid; de->e_jobc = p->p_pgrp->pg_jobc; - if ((p->p_flag & P_CONTROLT) && (p->p_session->s_ttyp != NULL)) { + if ((p->p_lflag & PL_CONTROLT) && (p->p_session->s_ttyp != NULL)) { de->e_tdev = native_to_darwin_dev(p->p_session->s_ttyp->t_dev); de->e_tpgid = p->p_session->s_ttyp->t_pgrp ? @@ -863,43 +860,45 @@ darwin_fill_kproc(p, dkp) } static void -native_to_darwin_pflag(dfp, bf) - int *dfp; - int bf; +native_to_darwin_pflag(int *dfp, struct proc *p) { int df = 0; + int bf = p->p_flag; + int bsf = p->p_sflag; + int bslf = p->p_slflag; + struct lwp *l = proc_representative_lwp(p, NULL, 1); + int lf = l->l_flag; if (bf & P_ADVLOCK) df |= DARWIN_P_ADVLOCK; - if (bf & P_CONTROLT) + if (bf & PL_CONTROLT) /* XXXAD */ df |= DARWIN_P_CONTROLT; - if (bf & P_NOCLDSTOP) + if (bsf & PS_NOCLDSTOP) df |= DARWIN_P_NOCLDSTOP; - if (bf & P_PPWAIT) + if (bsf & PS_PPWAIT) df |= DARWIN_P_PPWAIT; - if (bf & P_PROFIL) + if (bsf & PST_PROFIL) df |= DARWIN_P_PROFIL; if (bf & P_SUGID) df |= DARWIN_P_SUGID; if (bf & P_SYSTEM) df |= DARWIN_P_SYSTEM; - if (bf & P_TRACED) + if (bslf & PSL_TRACED) df |= DARWIN_P_TRACED; - if (bf & P_WAITED) +#if 0 + if (lf & LP_WAITED) df |= DARWIN_P_WAITED; - if (bf & P_WEXIT) +#endif + if (bsf & PS_WEXIT) df |= DARWIN_P_WEXIT; if (bf & P_EXEC) df |= DARWIN_P_EXEC; - if (bf & P_OWEUPC) + if (lf & LP_OWEUPC) df |= DARWIN_P_OWEUPC; - if (bf & P_FSTRACE) + if (bslf & PSL_FSTRACE) df |= DARWIN_P_FSTRACE; if (bf & P_NOCLDWAIT) df |= DARWIN_P_NOCLDWAIT; - if (bf & P_NOCLDWAIT) - df |= DARWIN_P_NOCLDWAIT; - *dfp = df; return; } @@ -952,7 +951,7 @@ darwin_sysctl_procargs(SYSCTLFN_ARGS) * Lock the process down in memory. */ /* XXXCDC: how should locking work here? */ - if ((p->p_flag & P_WEXIT) || (p->p_vmspace->vm_refcnt < 1)) + if ((p->p_sflag & PS_WEXIT) || (p->p_vmspace->vm_refcnt < 1)) return (EFAULT); p->p_vmspace->vm_refcnt++; /* XXX */ diff --git a/sys/compat/darwin/darwin_sysent.c b/sys/compat/darwin/darwin_sysent.c index b3232c0b149..dd5019f18c6 100644 --- a/sys/compat/darwin/darwin_sysent.c +++ b/sys/compat/darwin/darwin_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_sysent.c,v 1.49 2005/12/11 12:19:56 christos Exp $ */ +/* $NetBSD: darwin_sysent.c,v 1.50 2007/02/09 21:55:16 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.49 2005/12/11 12:19:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.50 2007/02/09 21:55:16 ad Exp $"); #include "opt_ktrace.h" #include "opt_nfsserver.h" @@ -22,7 +22,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.49 2005/12/11 12:19:56 christos #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_file.h> #include <compat/sys/signal.h> diff --git a/sys/compat/darwin/darwin_thread.c b/sys/compat/darwin/darwin_thread.c index 5d00c247272..e2f677f7a5b 100644 --- a/sys/compat/darwin/darwin_thread.c +++ b/sys/compat/darwin/darwin_thread.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_thread.c,v 1.12 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: darwin_thread.c,v 1.13 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_thread.c,v 1.12 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_thread.c,v 1.13 2007/02/09 21:55:16 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: darwin_thread.c,v 1.12 2006/11/16 01:32:42 christos #include <sys/signal.h> #include <sys/mount.h> #include <sys/proc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> diff --git a/sys/compat/darwin/darwin_unistd.c b/sys/compat/darwin/darwin_unistd.c index fb3d0299993..b1460acbc8c 100644 --- a/sys/compat/darwin/darwin_unistd.c +++ b/sys/compat/darwin/darwin_unistd.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_unistd.c,v 1.7 2005/12/11 12:19:56 christos Exp $ */ +/* $NetBSD: darwin_unistd.c,v 1.8 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,13 +37,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: darwin_unistd.c,v 1.7 2005/12/11 12:19:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_unistd.c,v 1.8 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/proc.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/endian.h> #include <sys/syscallargs.h> diff --git a/sys/compat/darwin/syscalls.master b/sys/compat/darwin/syscalls.master index 4fd88613312..e10e38246db 100644 --- a/sys/compat/darwin/syscalls.master +++ b/sys/compat/darwin/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.30 2005/12/11 12:19:56 christos Exp $ + $NetBSD: syscalls.master,v 1.31 2007/02/09 21:55:16 ad Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -51,7 +51,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_file.h> diff --git a/sys/compat/freebsd/freebsd_exec.c b/sys/compat/freebsd/freebsd_exec.c index b914bd7509f..bd52dd843cb 100644 --- a/sys/compat/freebsd/freebsd_exec.c +++ b/sys/compat/freebsd/freebsd_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_exec.c,v 1.32 2006/08/30 02:02:21 christos Exp $ */ +/* $NetBSD: freebsd_exec.c,v 1.33 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1993, 1994 Christopher G. Demetriou @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_exec.c,v 1.32 2006/08/30 02:02:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_exec.c,v 1.33 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_syscall_debug.h" @@ -99,5 +99,5 @@ const struct emul emul_freebsd = { uvm_default_mapaddr, NULL, /* e_usertrap */ - NULL, /* e_sa */ + 0, /* e_ucsize */ }; diff --git a/sys/compat/freebsd/freebsd_file.c b/sys/compat/freebsd/freebsd_file.c index 0abf2e30c20..08f86e77b27 100644 --- a/sys/compat/freebsd/freebsd_file.c +++ b/sys/compat/freebsd/freebsd_file.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_file.c,v 1.22 2006/07/13 16:28:39 martin Exp $ */ +/* $NetBSD: freebsd_file.c,v 1.23 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_file.c,v 1.22 2006/07/13 16:28:39 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_file.c,v 1.23 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "fs_nfs.h" @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_file.c,v 1.22 2006/07/13 16:28:39 martin Exp #include <sys/mount.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/freebsd/freebsd_syscallargs.h> diff --git a/sys/compat/freebsd/freebsd_ioctl.c b/sys/compat/freebsd/freebsd_ioctl.c index 448afd85079..e8384b4aa7f 100644 --- a/sys/compat/freebsd/freebsd_ioctl.c +++ b/sys/compat/freebsd/freebsd_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_ioctl.c,v 1.10 2005/12/11 12:20:02 christos Exp $ */ +/* $NetBSD: freebsd_ioctl.c,v 1.11 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_ioctl.c,v 1.10 2005/12/11 12:20:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_ioctl.c,v 1.11 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -40,7 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_ioctl.c,v 1.10 2005/12/11 12:20:02 christos #include <sys/mount.h> #include <sys/sockio.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <net/if.h> diff --git a/sys/compat/freebsd/freebsd_ipc.c b/sys/compat/freebsd/freebsd_ipc.c index d98a6e630af..2217c685dca 100644 --- a/sys/compat/freebsd/freebsd_ipc.c +++ b/sys/compat/freebsd/freebsd_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_ipc.c,v 1.12 2005/11/10 18:47:53 christos Exp $ */ +/* $NetBSD: freebsd_ipc.c,v 1.13 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1994 Adam Glass and Charles M. Hannum. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_ipc.c,v 1.12 2005/11/10 18:47:53 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_ipc.c,v 1.13 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_ipc.c,v 1.12 2005/11/10 18:47:53 christos Ex #include <sys/malloc.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/shm.h> diff --git a/sys/compat/freebsd/freebsd_misc.c b/sys/compat/freebsd/freebsd_misc.c index acb2c9b666b..a89b1f8f672 100644 --- a/sys/compat/freebsd/freebsd_misc.c +++ b/sys/compat/freebsd/freebsd_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_misc.c,v 1.27 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: freebsd_misc.c,v 1.28 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1995 Frank van der Linden @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_misc.c,v 1.27 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_misc.c,v 1.28 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_misc.c,v 1.27 2006/11/16 01:32:42 christos E #include <sys/ktrace.h> #endif -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/freebsd/freebsd_syscallargs.h> @@ -182,7 +181,6 @@ freebsd_sys_sigaction4(struct lwp *l, void *v, register_t *retval) syscallarg(const struct freebsd_sigaction4 *) nsa; syscallarg(struct freebsd_sigaction4 *) osa; } */ *uap = v; - struct proc *p = l->l_proc; struct freebsd_sigaction4 nesa, oesa; struct sigaction nbsa, obsa; int error; @@ -195,7 +193,7 @@ freebsd_sys_sigaction4(struct lwp *l, void *v, register_t *retval) nbsa.sa_mask = nesa.freebsd_sa_mask; nbsa.sa_flags = nesa.freebsd_sa_flags; } - error = sigaction1(p, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0, NULL, 0); if (error) diff --git a/sys/compat/freebsd/freebsd_ptrace.c b/sys/compat/freebsd/freebsd_ptrace.c index d99312d54c6..9bc14f73852 100644 --- a/sys/compat/freebsd/freebsd_ptrace.c +++ b/sys/compat/freebsd/freebsd_ptrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_ptrace.c,v 1.12 2006/09/01 21:20:46 matt Exp $ */ +/* $NetBSD: freebsd_ptrace.c,v 1.13 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.12 2006/09/01 21:20:46 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.13 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ptrace.h" @@ -85,7 +85,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.12 2006/09/01 21:20:46 matt Exp #include <sys/uio.h> #include <sys/user.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/signal.h> diff --git a/sys/compat/freebsd/freebsd_syscalls.c b/sys/compat/freebsd/freebsd_syscalls.c index 7b7ba5a43b3..8a00fd43b24 100644 --- a/sys/compat/freebsd/freebsd_syscalls.c +++ b/sys/compat/freebsd/freebsd_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_syscalls.c,v 1.66 2006/09/01 21:19:44 matt Exp $ */ +/* $NetBSD: freebsd_syscalls.c,v 1.67 2007/02/09 21:55:16 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_syscalls.c,v 1.66 2006/09/01 21:19:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_syscalls.c,v 1.67 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -25,7 +25,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_syscalls.c,v 1.66 2006/09/01 21:19:44 matt E #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/signal.h> #include <compat/freebsd/freebsd_syscallargs.h> diff --git a/sys/compat/freebsd/freebsd_sysctl.c b/sys/compat/freebsd/freebsd_sysctl.c index 58ed2e6a127..80bd3c3efa1 100644 --- a/sys/compat/freebsd/freebsd_sysctl.c +++ b/sys/compat/freebsd/freebsd_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_sysctl.c,v 1.7 2006/09/24 21:44:58 dbj Exp $ */ +/* $NetBSD: freebsd_sysctl.c,v 1.8 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_sysctl.c,v 1.7 2006/09/24 21:44:58 dbj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_sysctl.c,v 1.8 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -60,7 +60,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_sysctl.c,v 1.7 2006/09/24 21:44:58 dbj Exp $ #include <sys/ktrace.h> #endif -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/freebsd/freebsd_syscallargs.h> diff --git a/sys/compat/freebsd/freebsd_sysent.c b/sys/compat/freebsd/freebsd_sysent.c index 4129d0fa53b..92d936d0165 100644 --- a/sys/compat/freebsd/freebsd_sysent.c +++ b/sys/compat/freebsd/freebsd_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_sysent.c,v 1.68 2006/09/01 21:19:44 matt Exp $ */ +/* $NetBSD: freebsd_sysent.c,v 1.69 2007/02/09 21:55:16 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: freebsd_sysent.c,v 1.68 2006/09/01 21:19:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: freebsd_sysent.c,v 1.69 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -24,7 +24,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_sysent.c,v 1.68 2006/09/01 21:19:44 matt Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/signal.h> #include <compat/freebsd/freebsd_syscallargs.h> diff --git a/sys/compat/freebsd/syscalls.master b/sys/compat/freebsd/syscalls.master index 17f0c607a90..3224faf8ed6 100644 --- a/sys/compat/freebsd/syscalls.master +++ b/sys/compat/freebsd/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.55 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.56 2007/02/09 21:55:16 ad Exp $ ; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -47,7 +47,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/signal.h> diff --git a/sys/compat/hpux/hpux_compat.c b/sys/compat/hpux/hpux_compat.c index e26b14408ec..2291ec75de5 100644 --- a/sys/compat/hpux/hpux_compat.c +++ b/sys/compat/hpux/hpux_compat.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_compat.c,v 1.82 2007/01/04 15:21:09 elad Exp $ */ +/* $NetBSD: hpux_compat.c,v 1.83 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1990, 1993 @@ -82,7 +82,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_compat.c,v 1.82 2007/01/04 15:21:09 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_compat.c,v 1.83 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -123,7 +123,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_compat.c,v 1.82 2007/01/04 15:21:09 elad Exp $" #include <machine/psl.h> #include <machine/vmparam.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> @@ -612,7 +611,9 @@ hpux_sys_rtprio(lp, v, retval) nice = (SCARG(uap, prio) >> 3) - 16; break; } + mutex_enter(&p->p_mutex); error = donice(lp, p, nice); + mutex_exit(&p->p_mutex); if (error == EACCES) error = EPERM; return (error); @@ -1164,7 +1165,7 @@ hpux_sys_setpgrp_6x(l, v, retval) struct proc *p = l->l_proc; if (p->p_pid != p->p_pgid) - enterpgrp(p, p->p_pid, 0); + enterpgrp(p, p->p_pid, p->p_pid, 0); *retval = p->p_pgid; return (0); } @@ -1351,7 +1352,9 @@ hpux_sys_nice_6x(l, v, retval) struct proc *p = l->l_proc; int error; + mutex_enter(&p->p_mutex); error = donice(l, p, (p->p_nice - NZERO) + SCARG(uap, nval)); + mutex_exit(&p->p_mutex); if (error == 0) *retval = p->p_nice - NZERO; return (error); diff --git a/sys/compat/hpux/hpux_exec.c b/sys/compat/hpux/hpux_exec.c index ce556068c15..159446e99e0 100644 --- a/sys/compat/hpux/hpux_exec.c +++ b/sys/compat/hpux/hpux_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_exec.c,v 1.48 2005/12/11 12:20:02 christos Exp $ */ +/* $NetBSD: hpux_exec.c,v 1.49 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_exec.c,v 1.48 2005/12/11 12:20:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_exec.c,v 1.49 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_syscall_debug.h" @@ -95,7 +95,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_exec.c,v 1.48 2005/12/11 12:20:02 christos Exp #include <machine/cpu.h> #include <machine/reg.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> diff --git a/sys/compat/hpux/hpux_exec_aout.c b/sys/compat/hpux/hpux_exec_aout.c index e6cb09c6351..6244b3acf43 100644 --- a/sys/compat/hpux/hpux_exec_aout.c +++ b/sys/compat/hpux/hpux_exec_aout.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_exec_aout.c,v 1.13 2005/12/11 12:20:02 christos Exp $ */ +/* $NetBSD: hpux_exec_aout.c,v 1.14 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_exec_aout.c,v 1.13 2005/12/11 12:20:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_exec_aout.c,v 1.14 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -89,7 +89,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_exec_aout.c,v 1.13 2005/12/11 12:20:02 christos #include <machine/cpu.h> #include <machine/reg.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> diff --git a/sys/compat/hpux/hpux_file.c b/sys/compat/hpux/hpux_file.c index 52f89e97f38..3eef7ae7cff 100644 --- a/sys/compat/hpux/hpux_file.c +++ b/sys/compat/hpux/hpux_file.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_file.c,v 1.30 2006/09/25 16:16:18 pavel Exp $ */ +/* $NetBSD: hpux_file.c,v 1.31 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -119,7 +119,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_file.c,v 1.30 2006/09/25 16:16:18 pavel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_file.c,v 1.31 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -147,7 +147,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_file.c,v 1.30 2006/09/25 16:16:18 pavel Exp $") #include <machine/psl.h> #include <machine/vmparam.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> diff --git a/sys/compat/hpux/hpux_ipc.c b/sys/compat/hpux/hpux_ipc.c index b5b87ba2fd9..99263cb110f 100644 --- a/sys/compat/hpux/hpux_ipc.c +++ b/sys/compat/hpux/hpux_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_ipc.c,v 1.7 2006/07/23 22:06:08 ad Exp $ */ +/* $NetBSD: hpux_ipc.c,v 1.8 2007/02/09 21:55:16 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_ipc.c,v 1.7 2006/07/23 22:06:08 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_ipc.c,v 1.8 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -63,7 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_ipc.c,v 1.7 2006/07/23 22:06:08 ad Exp $"); #include <sys/systm.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> diff --git a/sys/compat/hpux/hpux_net.c b/sys/compat/hpux/hpux_net.c index 1246b8ad41f..d170a69c77e 100644 --- a/sys/compat/hpux/hpux_net.c +++ b/sys/compat/hpux/hpux_net.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_net.c,v 1.32 2006/06/30 09:06:32 he Exp $ */ +/* $NetBSD: hpux_net.c,v 1.33 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1990, 1993 @@ -82,7 +82,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_net.c,v 1.32 2006/06/30 09:06:32 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_net.c,v 1.33 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -102,7 +102,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_net.c,v 1.32 2006/06/30 09:06:32 he Exp $"); #include <sys/socketvar.h> #include <sys/uio.h> #include <sys/ktrace.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> diff --git a/sys/compat/hpux/hpux_sig.c b/sys/compat/hpux/hpux_sig.c index 8b02803a31b..9ae7face2f0 100644 --- a/sys/compat/hpux/hpux_sig.c +++ b/sys/compat/hpux/hpux_sig.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_sig.c,v 1.29 2005/12/11 12:20:02 christos Exp $ */ +/* $NetBSD: hpux_sig.c,v 1.30 2007/02/09 21:55:16 ad Exp $ */ /* * Copyright (c) 1990, 1993 @@ -82,7 +82,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_sig.c,v 1.29 2005/12/11 12:20:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_sig.c,v 1.30 2007/02/09 21:55:16 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -90,7 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_sig.c,v 1.29 2005/12/11 12:20:02 christos Exp $ #include <sys/mount.h> #include <sys/proc.h> #include <sys/signalvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/signal.h> diff --git a/sys/compat/hpux/hpux_syscalls.c b/sys/compat/hpux/hpux_syscalls.c index 8cf4af3ea51..1816f60cfe4 100644 --- a/sys/compat/hpux/hpux_syscalls.c +++ b/sys/compat/hpux/hpux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_syscalls.c,v 1.41 2006/06/26 21:30:50 mrg Exp $ */ +/* $NetBSD: hpux_syscalls.c,v 1.42 2007/02/09 21:55:16 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_syscalls.c,v 1.41 2006/06/26 21:30:50 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_syscalls.c,v 1.42 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -21,7 +21,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_syscalls.c,v 1.41 2006/06/26 21:30:50 mrg Exp $ #include <sys/mount.h> #include <sys/exec.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> #include <compat/hpux/hpux_syscallargs.h> diff --git a/sys/compat/hpux/hpux_sysent.c b/sys/compat/hpux/hpux_sysent.c index b12903343eb..aab6eb10a3d 100644 --- a/sys/compat/hpux/hpux_sysent.c +++ b/sys/compat/hpux/hpux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpux_sysent.c,v 1.44 2006/06/26 21:30:50 mrg Exp $ */ +/* $NetBSD: hpux_sysent.c,v 1.45 2007/02/09 21:55:16 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpux_sysent.c,v 1.44 2006/06/26 21:30:50 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpux_sysent.c,v 1.45 2007/02/09 21:55:16 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: hpux_sysent.c,v 1.44 2006/06/26 21:30:50 mrg Exp $") #include <sys/mount.h> #include <sys/exec.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> #include <compat/hpux/hpux_syscallargs.h> diff --git a/sys/compat/hpux/syscalls.master b/sys/compat/hpux/syscalls.master index 7d6c6da62f6..5a4613db18b 100644 --- a/sys/compat/hpux/syscalls.master +++ b/sys/compat/hpux/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.28 2006/06/26 21:23:57 mrg Exp $ + $NetBSD: syscalls.master,v 1.29 2007/02/09 21:55:16 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -42,7 +42,6 @@ #include <sys/mount.h> #include <sys/exec.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/hpux/hpux.h> diff --git a/sys/compat/ibcs2/ibcs2_exec.c b/sys/compat/ibcs2/ibcs2_exec.c index c3803c29ae1..b75937b3b37 100644 --- a/sys/compat/ibcs2/ibcs2_exec.c +++ b/sys/compat/ibcs2/ibcs2_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_exec.c,v 1.65 2006/08/30 15:22:45 christos Exp $ */ +/* $NetBSD: ibcs2_exec.c,v 1.66 2007/02/09 21:55:17 ad Exp $ */ /* * Copyright (c) 1994, 1995, 1998 Scott Bartram @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec.c,v 1.65 2006/08/30 15:22:45 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec.c,v 1.66 2007/02/09 21:55:17 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_syscall_debug.h" @@ -113,7 +113,7 @@ const struct emul emul_ibcs2 = { uvm_default_mapaddr, NULL, /* e_usertrap */ - NULL, /* e_sa */ + 0, /* e_ucsize */ }; /* diff --git a/sys/compat/ibcs2/ibcs2_exec_xout.c b/sys/compat/ibcs2/ibcs2_exec_xout.c index e00e4e39c78..17e8a6b807e 100644 --- a/sys/compat/ibcs2/ibcs2_exec_xout.c +++ b/sys/compat/ibcs2/ibcs2_exec_xout.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_exec_xout.c,v 1.13 2006/07/23 22:06:08 ad Exp $ */ +/* $NetBSD: ibcs2_exec_xout.c,v 1.14 2007/02/09 21:55:17 ad Exp $ */ /* * Copyright (c) 1994, 1995, 1998 Scott Bartram @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_xout.c,v 1.13 2006/07/23 22:06:08 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_xout.c,v 1.14 2007/02/09 21:55:17 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_xout.c,v 1.13 2006/07/23 22:06:08 ad Exp #include <sys/resourcevar.h> #include <sys/mman.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/cpu.h> diff --git a/sys/compat/ibcs2/ibcs2_fcntl.c b/sys/compat/ibcs2/ibcs2_fcntl.c index 921ebdd32e0..0c44d32a18e 100644 --- a/sys/compat/ibcs2/ibcs2_fcntl.c +++ b/sys/compat/ibcs2/ibcs2_fcntl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_fcntl.c,v 1.24 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: ibcs2_fcntl.c,v 1.25 2007/02/09 21:55:17 ad Exp $ */ /* * Copyright (c) 1995 Scott Bartram @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_fcntl.c,v 1.24 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_fcntl.c,v 1.25 2007/02/09 21:55:17 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -40,7 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_fcntl.c,v 1.24 2006/11/16 01:32:42 christos Ex #include <sys/ioctl.h> #include <sys/kernel.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/vnode.h> #include <sys/kauth.h> @@ -186,7 +185,7 @@ ibcs2_sys_open(l, v, retval) CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); ret = sys_open(l, uap, retval); - if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + if (!ret && !noctty && SESS_LEADER(p) && !(p->p_lflag & PL_CONTROLT)) { struct filedesc *fdp = p->p_fd; struct file *fp; diff --git a/sys/compat/ibcs2/ibcs2_ioctl.c b/sys/compat/ibcs2/ibcs2_ioctl.c index 98467b39e13..604a16bfc75 100644 --- a/sys/compat/ibcs2/ibcs2_ioctl.c +++ b/sys/compat/ibcs2/ibcs2_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_ioctl.c,v 1.37 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: ibcs2_ioctl.c,v 1.38 2007/02/09 21:55:17 ad Exp $ */ /* * Copyright (c) 1994, 1995 Scott Bartram @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.37 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.38 2007/02/09 21:55:17 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -59,7 +59,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.37 2006/11/16 01:32:42 christos Ex #include <sys/unistd.h> #include <net/if.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ibcs2/ibcs2_types.h> diff --git a/sys/compat/ibcs2/ibcs2_ipc.c b/sys/compat/ibcs2/ibcs2_ipc.c index 62120a070c3..4f6d7383531 100644 --- a/sys/compat/ibcs2/ibcs2_ipc.c +++ b/sys/compat/ibcs2/ibcs2_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_ipc.c,v 1.21 2005/11/11 17:10:42 christos Exp $ */ +/* $NetBSD: ibcs2_ipc.c,v 1.22 2007/02/09 21:55:17 ad Exp $ */ /* * Copyright (c) 1995 Scott Bartram @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_ipc.c,v 1.21 2005/11/11 17:10:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_ipc.c,v 1.22 2007/02/09 21:55:17 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -60,7 +60,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_ipc.c,v 1.21 2005/11/11 17:10:42 christos Exp #include <sys/msg.h> #include <sys/sem.h> #include <sys/shm.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ibcs2/ibcs2_types.h> diff --git a/sys/compat/ibcs2/ibcs2_misc.c b/sys/compat/ibcs2/ibcs2_misc.c index 045d6e69f73..97b76b42810 100644 --- a/sys/compat/ibcs2/ibcs2_misc.c +++ b/sys/compat/ibcs2/ibcs2_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_misc.c,v 1.82 2007/01/04 18:27:36 elad Exp $ */ +/* $NetBSD: ibcs2_misc.c,v 1.83 2007/02/09 21:55:18 ad Exp $ */ /* * Copyright (c) 1992, 1993 @@ -95,7 +95,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.82 2007/01/04 18:27:36 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.83 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -126,7 +126,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.82 2007/01/04 18:27:36 elad Exp $") #include <sys/kauth.h> #include <netinet/in.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <miscfs/specfs/specdev.h> diff --git a/sys/compat/ibcs2/ibcs2_signal.c b/sys/compat/ibcs2/ibcs2_signal.c index 4319c108157..07b8e9dfb14 100644 --- a/sys/compat/ibcs2/ibcs2_signal.c +++ b/sys/compat/ibcs2/ibcs2_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_signal.c,v 1.24 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: ibcs2_signal.c,v 1.25 2007/02/09 21:55:18 ad Exp $ */ /* * Copyright (c) 1995 Scott Bartram @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_signal.c,v 1.24 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_signal.c,v 1.25 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -41,7 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_signal.c,v 1.24 2006/11/16 01:32:42 christos E #include <sys/signal.h> #include <sys/signalvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ibcs2/ibcs2_types.h> @@ -184,7 +183,6 @@ ibcs2_sys_sigaction(struct lwp *l, void *v, register_t *retval) syscallarg(const struct ibcs2_sigaction *) nsa; syscallarg(struct ibcs2_sigaction *) osa; } */ *uap = v; - struct proc *p = l->l_proc; struct ibcs2_sigaction nisa, oisa; struct sigaction nbsa, obsa; int error, signum = SCARG(uap, signum); @@ -199,7 +197,7 @@ ibcs2_sys_sigaction(struct lwp *l, void *v, register_t *retval) return (error); ibcs2_to_native_sigaction(&nisa, &nbsa); } - error = sigaction1(p, signum, + error = sigaction1(l, signum, SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0, NULL, 0); if (error) @@ -220,7 +218,6 @@ ibcs2_sys_sigaltstack(struct lwp *l, void *v, register_t *retval) syscallarg(const struct ibcs2_sigaltstack *) nss; syscallarg(struct ibcs2_sigaltstack *) oss; } */ *uap = v; - struct proc *p = l->l_proc; struct ibcs2_sigaltstack nsss, osss; struct sigaltstack nbss, obss; int error; @@ -231,7 +228,7 @@ ibcs2_sys_sigaltstack(struct lwp *l, void *v, register_t *retval) return (error); ibcs2_to_native_sigaltstack(&nsss, &nbss); } - error = sigaltstack1(p, + error = sigaltstack1(l, SCARG(uap, nss) ? &nbss : 0, SCARG(uap, oss) ? &obss : 0); if (error) return (error); @@ -254,7 +251,6 @@ ibcs2_sys_sigsys(l, v, retval) syscallarg(int) sig; syscallarg(ibcs2_sig_t) fp; } */ *uap = v; - struct proc *p = l->l_proc; struct sigaction nbsa, obsa; sigset_t ss; int error, signum = IBCS2_SIGNO(SCARG(uap, sig)); @@ -273,7 +269,7 @@ ibcs2_sys_sigsys(l, v, retval) nbsa.sa_handler = (sig_t)SCARG(uap, fp); sigemptyset(&nbsa.sa_mask); nbsa.sa_flags = 0; - error = sigaction1(p, signum, &nbsa, &obsa, NULL, 0); + error = sigaction1(l, signum, &nbsa, &obsa, NULL, 0); if (error) return (error); *retval = (int)obsa.sa_handler; @@ -283,23 +279,23 @@ ibcs2_sys_sigsys(l, v, retval) sighold: sigemptyset(&ss); sigaddset(&ss, signum); - return (sigprocmask1(p, SIG_BLOCK, &ss, 0)); + return (sigprocmask1(l, SIG_BLOCK, &ss, 0)); case IBCS2_SIGRELSE_MASK: sigemptyset(&ss); sigaddset(&ss, signum); - return (sigprocmask1(p, SIG_UNBLOCK, &ss, 0)); + return (sigprocmask1(l, SIG_UNBLOCK, &ss, 0)); case IBCS2_SIGIGNORE_MASK: nbsa.sa_handler = SIG_IGN; sigemptyset(&nbsa.sa_mask); nbsa.sa_flags = 0; - return (sigaction1(p, signum, &nbsa, 0, NULL, 0)); + return (sigaction1(l, signum, &nbsa, 0, NULL, 0)); case IBCS2_SIGPAUSE_MASK: - ss = p->p_sigctx.ps_sigmask; + ss = l->l_sigmask; sigdelset(&ss, signum); - return (sigsuspend1(p, &ss)); + return (sigsuspend1(l, &ss)); default: return (ENOSYS); @@ -314,7 +310,6 @@ ibcs2_sys_sigprocmask(struct lwp *l, void *v, register_t *retval) syscallarg(const ibcs2_sigset_t *) set; syscallarg(ibcs2_sigset_t *) oset; } */ *uap = v; - struct proc *p = l->l_proc; ibcs2_sigset_t niss, oiss; sigset_t nbss, obss; int how; @@ -340,7 +335,7 @@ ibcs2_sys_sigprocmask(struct lwp *l, void *v, register_t *retval) return (error); ibcs2_to_native_sigset(&niss, &nbss); } - error = sigprocmask1(p, how, + error = sigprocmask1(l, how, SCARG(uap, set) ? &nbss : 0, SCARG(uap, oset) ? &obss : 0); if (error) return (error); @@ -359,11 +354,10 @@ ibcs2_sys_sigpending(struct lwp *l, void *v, register_t *retval) struct ibcs2_sys_sigpending_args /* { syscallarg(ibcs2_sigset_t *) set; } */ *uap = v; - struct proc *p = l->l_proc; sigset_t bss; ibcs2_sigset_t iss; - sigpending1(p, &bss); + sigpending1(l, &bss); native_to_ibcs2_sigset(&bss, &iss); return (copyout(&iss, SCARG(uap, set), sizeof(iss))); } @@ -374,7 +368,6 @@ ibcs2_sys_sigsuspend(struct lwp *l, void *v, register_t *retval) struct ibcs2_sys_sigsuspend_args /* { syscallarg(const ibcs2_sigset_t *) set; } */ *uap = v; - struct proc *p = l->l_proc; ibcs2_sigset_t sss; sigset_t bss; int error; @@ -386,14 +379,14 @@ ibcs2_sys_sigsuspend(struct lwp *l, void *v, register_t *retval) ibcs2_to_native_sigset(&sss, &bss); } - return (sigsuspend1(p, SCARG(uap, set) ? &bss : 0)); + return (sigsuspend1(l, SCARG(uap, set) ? &bss : 0)); } int ibcs2_sys_pause(struct lwp *l, void *v, register_t *retval) { - return (sigsuspend1(l->l_proc, 0)); + return (sigsuspend1(l, 0)); } int diff --git a/sys/compat/ibcs2/ibcs2_socksys.c b/sys/compat/ibcs2/ibcs2_socksys.c index 0a05ad1ca49..29c781c30bf 100644 --- a/sys/compat/ibcs2/ibcs2_socksys.c +++ b/sys/compat/ibcs2/ibcs2_socksys.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_socksys.c,v 1.14 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: ibcs2_socksys.c,v 1.15 2007/02/09 21:55:18 ad Exp $ */ /* * Copyright (c) 1994, 1995 Scott Bartram @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_socksys.c,v 1.14 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_socksys.c,v 1.15 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -41,7 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_socksys.c,v 1.14 2007/01/29 01:52:44 hubertf E #include <net/if.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ibcs2/ibcs2_socksys.h> diff --git a/sys/compat/ibcs2/ibcs2_stat.c b/sys/compat/ibcs2/ibcs2_stat.c index d70aef678e2..7b1350cfe91 100644 --- a/sys/compat/ibcs2/ibcs2_stat.c +++ b/sys/compat/ibcs2/ibcs2_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_stat.c,v 1.35 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: ibcs2_stat.c,v 1.36 2007/02/09 21:55:18 ad Exp $ */ /* * Copyright (c) 1995, 1998 Scott Bartram * All rights reserved. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.35 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.36 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -40,7 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.35 2006/11/16 01:32:42 christos Exp #include <sys/kernel.h> #include <sys/mount.h> #include <sys/vnode.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ibcs2/ibcs2_types.h> diff --git a/sys/compat/ibcs2/ibcs2_syscalls.c b/sys/compat/ibcs2/ibcs2_syscalls.c index 2bacf9540a9..4a88bef05fd 100644 --- a/sys/compat/ibcs2/ibcs2_syscalls.c +++ b/sys/compat/ibcs2/ibcs2_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_syscalls.c,v 1.40 2005/12/11 12:20:03 christos Exp $ */ +/* $NetBSD: ibcs2_syscalls.c,v 1.41 2007/02/09 21:55:18 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscalls.c,v 1.40 2005/12/11 12:20:03 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscalls.c,v 1.41 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -18,7 +18,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_syscalls.c,v 1.40 2005/12/11 12:20:03 christos #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ibcs2/ibcs2_types.h> #include <compat/ibcs2/ibcs2_signal.h> diff --git a/sys/compat/ibcs2/ibcs2_sysent.c b/sys/compat/ibcs2/ibcs2_sysent.c index a0885309d26..578496fdeb2 100644 --- a/sys/compat/ibcs2/ibcs2_sysent.c +++ b/sys/compat/ibcs2/ibcs2_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_sysent.c,v 1.41 2005/12/11 12:20:03 christos Exp $ */ +/* $NetBSD: ibcs2_sysent.c,v 1.42 2007/02/09 21:55:18 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibcs2_sysent.c,v 1.41 2005/12/11 12:20:03 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_sysent.c,v 1.42 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -17,7 +17,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_sysent.c,v 1.41 2005/12/11 12:20:03 christos E #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ibcs2/ibcs2_types.h> #include <compat/ibcs2/ibcs2_signal.h> diff --git a/sys/compat/ibcs2/syscalls.master b/sys/compat/ibcs2/syscalls.master index 94e8f30159d..375d78c8680 100644 --- a/sys/compat/ibcs2/syscalls.master +++ b/sys/compat/ibcs2/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.31 2005/12/11 12:20:03 christos Exp $ + $NetBSD: syscalls.master,v 1.32 2007/02/09 21:55:18 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -39,7 +39,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ibcs2/ibcs2_types.h> #include <compat/ibcs2/ibcs2_signal.h> diff --git a/sys/compat/irix/irix_exec.c b/sys/compat/irix/irix_exec.c index 4ff83308454..1a2b2e981e4 100644 --- a/sys/compat/irix/irix_exec.c +++ b/sys/compat/irix/irix_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_exec.c,v 1.43 2006/12/25 18:31:18 wiz Exp $ */ +/* $NetBSD: irix_exec.c,v 1.44 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2001-2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_exec.c,v 1.43 2006/12/25 18:31:18 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_exec.c,v 1.44 2007/02/09 21:55:18 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_syscall_debug.h" @@ -200,7 +200,7 @@ irix_e_proc_exit(p) /* * Send SIGHUP to child process as requested using prctl(2) */ - proclist_lock_read(); + mutex_enter(&proclist_mutex); PROCLIST_FOREACH(pp, &allproc) { /* Select IRIX processes */ if (irix_check_exec(pp) == 0) @@ -210,7 +210,7 @@ irix_e_proc_exit(p) if (ied->ied_termchild && pp->p_pptr == p) psignal(pp, native_to_svr4_signo[SIGHUP]); } - proclist_unlock_read(); + mutex_exit(&proclist_mutex); /* * Remove the process from share group processes list, if relevant. diff --git a/sys/compat/irix/irix_fcntl.c b/sys/compat/irix/irix_fcntl.c index a1184049d54..79153848065 100644 --- a/sys/compat/irix/irix_fcntl.c +++ b/sys/compat/irix/irix_fcntl.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_fcntl.c,v 1.16 2006/07/23 22:06:08 ad Exp $ */ +/* $NetBSD: irix_fcntl.c,v 1.17 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2001-2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.16 2006/07/23 22:06:08 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.17 2007/02/09 21:55:18 ad Exp $"); #include <sys/types.h> #include <sys/signal.h> @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.16 2006/07/23 22:06:08 ad Exp $"); #include <sys/filedesc.h> #include <sys/systm.h> #include <sys/fcntl.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <miscfs/specfs/specdev.h> diff --git a/sys/compat/irix/irix_ioctl.c b/sys/compat/irix/irix_ioctl.c index 7acf034da6b..d66191d5eba 100644 --- a/sys/compat/irix/irix_ioctl.c +++ b/sys/compat/irix/irix_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_ioctl.c,v 1.11 2006/07/31 20:52:13 bjh21 Exp $ */ +/* $NetBSD: irix_ioctl.c,v 1.12 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_ioctl.c,v 1.11 2006/07/31 20:52:13 bjh21 Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_ioctl.c,v 1.12 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_ioctl.c,v 1.11 2006/07/31 20:52:13 bjh21 Exp $" #include <sys/ioctl.h> #include <sys/vnode.h> #include <sys/types.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/conf.h> diff --git a/sys/compat/irix/irix_misc.c b/sys/compat/irix/irix_misc.c index 12e5d982672..eec709711aa 100644 --- a/sys/compat/irix/irix_misc.c +++ b/sys/compat/irix/irix_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_misc.c,v 1.7 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_misc.c,v 1.8 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_misc.c,v 1.7 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_misc.c,v 1.8 2007/02/09 21:55:18 ad Exp $"); #include <sys/types.h> #include <sys/signal.h> @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_misc.c,v 1.7 2005/12/11 12:20:12 christos Exp $ #include <sys/kernel.h> #include <sys/proc.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/irix/irix_mman.c b/sys/compat/irix/irix_mman.c index f2472ccf041..c04251dbdda 100644 --- a/sys/compat/irix/irix_mman.c +++ b/sys/compat/irix/irix_mman.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_mman.c,v 1.12 2006/07/23 22:06:08 ad Exp $ */ +/* $NetBSD: irix_mman.c,v 1.13 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_mman.c,v 1.12 2006/07/23 22:06:08 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_mman.c,v 1.13 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_mman.c,v 1.12 2006/07/23 22:06:08 ad Exp $"); #include <sys/mount.h> #include <sys/lock.h> #include <sys/systm.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/irix/irix_prctl.c b/sys/compat/irix/irix_prctl.c index 80aa780ad86..2b4703e22aa 100644 --- a/sys/compat/irix/irix_prctl.c +++ b/sys/compat/irix/irix_prctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_prctl.c,v 1.34 2007/01/05 15:40:51 elad Exp $ */ +/* $NetBSD: irix_prctl.c,v 1.35 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2001-2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_prctl.c,v 1.34 2007/01/05 15:40:51 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_prctl.c,v 1.35 2007/02/09 21:55:18 ad Exp $"); #include <sys/errno.h> #include <sys/types.h> @@ -417,7 +417,7 @@ irix_sproc_child(isc) struct irix_sproc_child_args *isc; { struct proc *p2 = *isc->isc_proc; - struct lwp *l2 = proc_representative_lwp(p2); + struct lwp *l2 = curlwp; int inh = isc->isc_inh; struct lwp *lparent = isc->isc_parent_lwp; struct proc *parent = lparent->l_proc; @@ -630,7 +630,7 @@ irix_sys_procblk(l, v, retval) LIST_FOREACH(iedp, &isg->isg_head, ied_sglist) { /* Recall procblk for this process */ SCARG(&cup, pid) = iedp->ied_p->p_pid; - ied_lwp = proc_representative_lwp(iedp->ied_p); + ied_lwp = proc_representative_lwp(iedp->ied_p, NULL, 0); error = irix_sys_procblk(ied_lwp, &cup, retval); if (error != 0) last_error = error; @@ -674,7 +674,7 @@ irix_prda_init(p) evc.ev_len = sizeof(struct irix_prda); evc.ev_prot = UVM_PROT_RW; evc.ev_proc = *vmcmd_map_zero; - l = proc_representative_lwp(p); + l = proc_representative_lwp(p, NULL, 0); if ((error = (*evc.ev_proc)(l, &evc)) != 0) return error; diff --git a/sys/compat/irix/irix_resource.c b/sys/compat/irix/irix_resource.c index 4509b35fdda..d8fe2a452d3 100644 --- a/sys/compat/irix/irix_resource.c +++ b/sys/compat/irix/irix_resource.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_resource.c,v 1.6 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_resource.c,v 1.7 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_resource.c,v 1.6 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_resource.c,v 1.7 2007/02/09 21:55:18 ad Exp $"); #include <sys/types.h> #include <sys/signal.h> @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_resource.c,v 1.6 2005/12/11 12:20:12 christos E #include <sys/proc.h> #include <sys/systm.h> #include <sys/resource.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_util.h> diff --git a/sys/compat/irix/irix_signal.c b/sys/compat/irix/irix_signal.c index 8d133641413..14ba5f5e297 100644 --- a/sys/compat/irix/irix_signal.c +++ b/sys/compat/irix/irix_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_signal.c,v 1.34 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_signal.c,v 1.35 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 1994, 2001-2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.34 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.35 2007/02/09 21:55:18 ad Exp $"); #include <sys/types.h> #include <sys/signal.h> @@ -72,7 +72,7 @@ __KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.34 2005/12/11 12:20:12 christos Ex extern const int native_to_svr4_signo[]; extern const int svr4_to_native_signo[]; -static int irix_wait_siginfo __P((struct proc *, int, +static int irix_wait_siginfo __P((struct proc *, int, int, struct irix_irix5_siginfo *)); static void irix_signal_siginfo __P((struct irix_irix5_siginfo *, int, u_long, caddr_t)); @@ -94,9 +94,9 @@ static void irix_get_sigcontext __P((struct irix_sigcontext*, struct lwp *)); * This is ripped from svr4_setinfo. See irix_sys_waitsys... */ static int -irix_wait_siginfo(p, st, s) +irix_wait_siginfo(p, st, stat, s) struct proc *p; - int st; + int st, stat; struct irix_irix5_siginfo *s; { struct irix_irix5_siginfo i; @@ -109,7 +109,7 @@ irix_wait_siginfo(p, st, s) if (p) { i.isi_pid = p->p_pid; - if (p->p_stat == SZOMB) { + if (stat == SZOMB) { i.isi_stime = p->p_ru->ru_stime.tv_sec; i.isi_utime = p->p_ru->ru_utime.tv_sec; } @@ -289,7 +289,7 @@ irix_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) * Do we need to jump onto the signal stack? */ onstack = - (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 + (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && (SIGACTION(p, ksi->ksi_signo).sa_flags & SA_ONSTACK) != 0; #ifdef DEBUG_IRIX if (onstack) @@ -299,8 +299,8 @@ irix_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) * Allocate space for the signal handler context. */ if (onstack) - sp = (void *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp - + p->p_sigctx.ps_sigstk.ss_size); + sp = (void *)((caddr_t)l->l_sigstk.ss_sp + + l->l_sigstk.ss_size); else /* cast for _MIPS_BSD_API == _MIPS_BSD_API_LP32_64CLEAN case */ sp = (void *)(u_int32_t)f->f_regs[_R_SP]; @@ -326,7 +326,11 @@ irix_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) /* * Install the sigframe onto the stack */ + sendsig_reset(l, ksi->ksi_signo); + mutex_exit(&p->p_smutex); error = copyout(&sf.isf_ctx, sp, sizeof(sf.isf_ctx)); + mutex_enter(&p->p_smutex); + if (error != 0) { /* * Process has trashed its stack; give it an illegal @@ -381,7 +385,7 @@ irix_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) * Remember that we're now on the signal stack. */ if (onstack) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; #ifdef DEBUG_IRIX printf("returning from irix_sendsig()\n"); @@ -396,10 +400,11 @@ irix_set_sigcontext (scp, mask, code, l) int code; struct lwp *l; { - struct proc *p = l->l_proc; int i; struct frame *f; + KASSERT(mutex_owned(&l->l_proc->p_smutex)); + #ifdef DEBUG_IRIX printf("irix_set_sigcontext()\n"); #endif @@ -441,7 +446,7 @@ irix_set_sigcontext (scp, mask, code, l) * Save signal stack */ scp->isc_ssflags = - (p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK) ? IRIX_SS_ONSTACK : 0; + (l->l_sigstk.ss_flags & SS_ONSTACK) ? IRIX_SS_ONSTACK : 0; return; } @@ -453,12 +458,14 @@ irix_set_ucontext(ucp, mask, code, l) int code; struct lwp *l; { - struct proc *p = l->l_proc; struct frame *f; + KASSERT(mutex_owned(&l->l_proc->p_smutex)); + #ifdef DEBUG_IRIX printf("irix_set_ucontext()\n"); #endif + f = (struct frame *)l->l_md.md_regs; /* * Save general purpose registers @@ -494,15 +501,15 @@ irix_set_ucontext(ucp, mask, code, l) /* * Save signal stack */ - ucp->iuc_stack.ss_sp = p->p_sigctx.ps_sigstk.ss_sp; - ucp->iuc_stack.ss_size = p->p_sigctx.ps_sigstk.ss_size; + ucp->iuc_stack.ss_sp = l->l_sigstk.ss_sp; + ucp->iuc_stack.ss_size = l->l_sigstk.ss_size; - if (p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK) + if (l->l_sigstk.ss_flags & SS_ONSTACK) ucp->iuc_stack.ss_flags |= IRIX_SS_ONSTACK; else ucp->iuc_stack.ss_flags &= ~IRIX_SS_ONSTACK; - if (p->p_sigctx.ps_sigstk.ss_flags & SS_DISABLE) + if (l->l_sigstk.ss_flags & SS_DISABLE) ucp->iuc_stack.ss_flags |= IRIX_SS_DISABLE; else ucp->iuc_stack.ss_flags &= ~IRIX_SS_DISABLE; @@ -528,6 +535,7 @@ irix_sys_sigreturn(l, v, retval) } */ *uap = v; void *usf; struct irix_sigframe ksf; + struct proc *p = l->l_proc; int error; #ifdef DEBUG_IRIX @@ -549,14 +557,18 @@ irix_sys_sigreturn(l, v, retval) if ((error = copyin(usf, &ksf.isf_ctx.iss.iuc, sizeof(ksf.isf_ctx))) != 0) return error; - + + mutex_enter(&p->p_smutex); irix_get_ucontext(&ksf.isf_ctx.iss.iuc, l); + mutex_exit(&p->p_smutex); } else { if ((error = copyin(usf, &ksf.isf_ctx.isc, sizeof(ksf.isf_ctx))) != 0) return error; + mutex_enter(&p->p_smutex); irix_get_sigcontext(&ksf.isf_ctx.isc, l); + mutex_exit(&p->p_smutex); } #ifdef DEBUG_IRIX @@ -574,10 +586,11 @@ irix_get_ucontext(ucp, l) struct irix_ucontext *ucp; struct lwp *l; { - struct proc *p = l->l_proc; struct frame *f; sigset_t mask; + KASSERT(mutex_owned(&l->l_proc->p_smutex)); + /* Restore the register context. */ f = (struct frame *)l->l_md.md_regs; @@ -615,18 +628,18 @@ irix_get_ucontext(ucp, l) * Restore stack */ if (ucp->iuc_flags & IRIX_UC_STACK) { - p->p_sigctx.ps_sigstk.ss_sp = ucp->iuc_stack.ss_sp; - p->p_sigctx.ps_sigstk.ss_size = ucp->iuc_stack.ss_size; + l->l_sigstk.ss_sp = ucp->iuc_stack.ss_sp; + l->l_sigstk.ss_size = ucp->iuc_stack.ss_size; if (ucp->iuc_stack.ss_flags & IRIX_SS_ONSTACK) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; + l->l_sigstk.ss_flags &= ~SS_ONSTACK; if (ucp->iuc_stack.ss_flags & IRIX_SS_DISABLE) - p->p_sigctx.ps_sigstk.ss_flags |= IRIX_SS_DISABLE; + l->l_sigstk.ss_flags |= IRIX_SS_DISABLE; else - p->p_sigctx.ps_sigstk.ss_flags &= ~IRIX_SS_DISABLE; + l->l_sigstk.ss_flags &= ~IRIX_SS_DISABLE; } /* @@ -635,7 +648,7 @@ irix_get_ucontext(ucp, l) if (ucp->iuc_flags & IRIX_UC_SIGMASK) { /* Restore signal mask. */ irix_to_native_sigset(&ucp->iuc_sigmask, &mask); - (void)sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void)sigprocmask1(l, SIG_SETMASK, &mask, 0); } return; @@ -646,11 +659,12 @@ irix_get_sigcontext(scp, l) struct irix_sigcontext *scp; struct lwp *l; { - struct proc *p = l->l_proc; int i; struct frame *f; sigset_t mask; + KASSERT(mutex_owned(&l->l_proc->p_smutex)); + /* Restore the register context. */ f = (struct frame *)l->l_md.md_regs; @@ -677,14 +691,14 @@ irix_get_sigcontext(scp, l) /* Restore signal stack. */ if (scp->isc_ssflags & IRIX_SS_ONSTACK) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; + l->l_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ irix_to_native_sigset(&scp->isc_sigset, &mask); - (void)sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void)sigprocmask1(l, SIG_SETMASK, &mask, 0); return; } @@ -739,14 +753,17 @@ irix_sys_getcontext(l, v, retval) kucp.iuc_flags = IRIX_UC_ALL; kucp.iuc_link = NULL; /* XXX */ - native_to_irix_sigset(&p->p_sigctx.ps_sigmask, &kucp.iuc_sigmask); - kucp.iuc_stack.ss_sp = p->p_sigctx.ps_sigstk.ss_sp; - kucp.iuc_stack.ss_size = p->p_sigctx.ps_sigstk.ss_size; + + mutex_enter(&p->p_smutex); + native_to_irix_sigset(&l->l_sigmask, &kucp.iuc_sigmask); + kucp.iuc_stack.ss_sp = l->l_sigstk.ss_sp; + kucp.iuc_stack.ss_size = l->l_sigstk.ss_size; kucp.iuc_stack.ss_flags = 0; - if (p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK) + if (l->l_sigstk.ss_flags & SS_ONSTACK) kucp.iuc_stack.ss_flags &= IRIX_SS_ONSTACK; - if (p->p_sigctx.ps_sigstk.ss_flags & SS_DISABLE) + if (l->l_sigstk.ss_flags & SS_DISABLE) kucp.iuc_stack.ss_flags &= IRIX_SS_DISABLE; + mutex_exit(&p->p_smutex); for (i = 0; i < 36; i++) /* Is order correct? */ kucp.iuc_mcontext.svr4___gregs[i] = f->f_regs[i]; @@ -785,21 +802,25 @@ irix_sys_setcontext(l, v, retval) f = (struct frame *)l->l_md.md_regs; + mutex_enter(&p->p_smutex); + if (kucp.iuc_flags & IRIX_UC_SIGMASK) irix_to_native_sigset(&kucp.iuc_sigmask, - &p->p_sigctx.ps_sigmask); + &l->l_sigmask); if (kucp.iuc_flags & IRIX_UC_STACK) { - p->p_sigctx.ps_sigstk.ss_sp = kucp.iuc_stack.ss_sp; - p->p_sigctx.ps_sigstk.ss_size = + l->l_sigstk.ss_sp = kucp.iuc_stack.ss_sp; + l->l_sigstk.ss_size = (unsigned long)kucp.iuc_stack.ss_sp; - p->p_sigctx.ps_sigstk.ss_flags = 0; + l->l_sigstk.ss_flags = 0; if (kucp.iuc_stack.ss_flags & IRIX_SS_ONSTACK) - p->p_sigctx.ps_sigstk.ss_flags &= SS_ONSTACK; + l->l_sigstk.ss_flags &= SS_ONSTACK; if (kucp.iuc_stack.ss_flags & IRIX_SS_DISABLE) - p->p_sigctx.ps_sigstk.ss_flags &= SS_DISABLE; + l->l_sigstk.ss_flags &= SS_DISABLE; } + mutex_exit(&p->p_smutex); + if (kucp.iuc_flags & IRIX_UC_CPU) for (i = 0; i < 36; i++) /* Is register order right? */ f->f_regs[i] = kucp.iuc_mcontext.svr4___gregs[i]; @@ -839,10 +860,8 @@ irix_sys_waitsys(l, v, retval) syscallarg(int) options; syscallarg(struct rusage *) ru; } */ *uap = v; - struct proc *parent = l->l_proc; - int error; - struct proc *child; - int options; + struct proc *parent = l->l_proc, *child; + int options, status, error, stat; switch (SCARG(uap, type)) { case SVR4_P_PID: @@ -877,36 +896,48 @@ irix_sys_waitsys(l, v, retval) if (SCARG(uap, options) & (SVR4_WSTOPPED|SVR4_WCONTINUED)) options |= WUNTRACED; - error = find_stopped_child(parent, SCARG(uap,pid), options, &child); - if (error != 0) + rw_enter(&proclist_lock, RW_WRITER); + error = find_stopped_child(parent, SCARG(uap,pid), options, &child, + &status); + stat = child->p_stat; /* XXXSMP */ + if (error != 0) { + rw_exit(&proclist_lock); return error; + } *retval = 0; - if (child == NULL) - return irix_wait_siginfo(NULL, 0, SCARG(uap, info)); + if (child == NULL) { + rw_exit(&proclist_lock); + return irix_wait_siginfo(NULL, 0, stat, SCARG(uap, info)); + } - if (child->p_stat == SZOMB) { + if (stat == SZOMB) { #ifdef DEBUG_IRIX printf("irix_sys_wait(): found %d\n", child->p_pid); #endif - if ((error = irix_wait_siginfo(child, child->p_xstat, - SCARG(uap, info))) != 0) + if ((error = irix_wait_siginfo(child, status, stat, + SCARG(uap, info))) != 0) { + rw_exit(&proclist_lock); return error; - + } if ((SCARG(uap, options) & SVR4_WNOWAIT)) { #ifdef DEBUG_IRIX printf(("irix_sys_wait(): Don't wait\n")); #endif + rw_exit(&proclist_lock); return 0; } if (SCARG(uap, ru) && /* XXX (dsl) is this copying out the right data??? child->p_ru would seem more appropriate! */ (error = copyout(&(parent->p_stats->p_ru), - (caddr_t)SCARG(uap, ru), sizeof(struct rusage)))) + (caddr_t)SCARG(uap, ru), sizeof(struct rusage)))) { + rw_exit(&proclist_lock); return error; + } - proc_free(child); + /* proc_free() will release the lock. */ + proc_free(child, NULL); return 0; } @@ -915,8 +946,9 @@ irix_sys_waitsys(l, v, retval) #ifdef DEBUG_IRIX printf("jobcontrol %d\n", child->p_pid); #endif - return irix_wait_siginfo(child, W_STOPCODE(child->p_xstat), - SCARG(uap, info)); + rw_exit(&proclist_lock); + return irix_wait_siginfo(child, W_STOPCODE(status), stat, + SCARG(uap, info)); } int @@ -947,7 +979,7 @@ irix_sys_sigprocmask(l, v, retval) return error; SCARG(&cup, set) = stackgap_alloc(p, &sg, sizeof(niss)); - obss = &p->p_sigctx.ps_sigmask; + obss = &l->l_sigmask; native_to_irix_sigset(obss, &oiss); /* preserve the higher 32 bits */ niss.bits[3] = oiss.bits[3]; diff --git a/sys/compat/irix/irix_stat.c b/sys/compat/irix/irix_stat.c index f5cc928b88c..947be6da88c 100644 --- a/sys/compat/irix/irix_stat.c +++ b/sys/compat/irix/irix_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_stat.c,v 1.13 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_stat.c,v 1.14 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_stat.c,v 1.13 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_stat.c,v 1.14 2007/02/09 21:55:18 ad Exp $"); #include <sys/errno.h> #include <sys/types.h> @@ -48,7 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_stat.c,v 1.13 2005/12/11 12:20:12 christos Exp #include <sys/stdint.h> #include <sys/stat.h> #include <sys/systm.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_util.h> diff --git a/sys/compat/irix/irix_swap.c b/sys/compat/irix/irix_swap.c index 773a952b1d3..96ae4af5539 100644 --- a/sys/compat/irix/irix_swap.c +++ b/sys/compat/irix/irix_swap.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_swap.c,v 1.15 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_swap.c,v 1.16 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_swap.c,v 1.15 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_swap.c,v 1.16 2007/02/09 21:55:18 ad Exp $"); #include <sys/types.h> #include <sys/signal.h> @@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_swap.c,v 1.15 2005/12/11 12:20:12 christos Exp #include <sys/swap.h> #include <sys/vnode.h> #include <sys/namei.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm_page.h> diff --git a/sys/compat/irix/irix_syscalls.c b/sys/compat/irix/irix_syscalls.c index d52f9476988..df2682e9ad1 100644 --- a/sys/compat/irix/irix_syscalls.c +++ b/sys/compat/irix/irix_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_syscalls.c,v 1.55 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_syscalls.c,v 1.56 2007/02/09 21:55:18 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_syscalls.c,v 1.55 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_syscalls.c,v 1.56 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -22,7 +22,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_syscalls.c,v 1.55 2005/12/11 12:20:12 christos #include <sys/mount.h> #include <sys/poll.h> #include <sys/ioctl_compat.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> #include <compat/svr4/svr4_signal.h> diff --git a/sys/compat/irix/irix_sysent.c b/sys/compat/irix/irix_sysent.c index 7474b1ba0f5..77b24d1a282 100644 --- a/sys/compat/irix/irix_sysent.c +++ b/sys/compat/irix/irix_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_sysent.c,v 1.55 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_sysent.c,v 1.56 2007/02/09 21:55:18 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_sysent.c,v 1.55 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_sysent.c,v 1.56 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -21,7 +21,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_sysent.c,v 1.55 2005/12/11 12:20:12 christos Ex #include <sys/mount.h> #include <sys/poll.h> #include <sys/ioctl_compat.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> #include <compat/svr4/svr4_signal.h> diff --git a/sys/compat/irix/irix_syssgi.c b/sys/compat/irix/irix_syssgi.c index 9d7b8771456..4459058e78b 100644 --- a/sys/compat/irix/irix_syssgi.c +++ b/sys/compat/irix/irix_syssgi.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_syssgi.c,v 1.42 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_syssgi.c,v 1.43 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2001-2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_syssgi.c,v 1.42 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_syssgi.c,v 1.43 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -65,7 +65,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_syssgi.c,v 1.42 2005/12/11 12:20:12 christos Ex #include <sys/exec.h> #include <sys/exec_elf.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm_extern.h> diff --git a/sys/compat/irix/irix_systeminfo.c b/sys/compat/irix/irix_systeminfo.c index a949fb2d290..9fbcf2207ed 100644 --- a/sys/compat/irix/irix_systeminfo.c +++ b/sys/compat/irix/irix_systeminfo.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_systeminfo.c,v 1.11 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: irix_systeminfo.c,v 1.12 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: irix_systeminfo.c,v 1.11 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_systeminfo.c,v 1.12 2007/02/09 21:55:18 ad Exp $"); #include <sys/types.h> #include <sys/signal.h> @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_systeminfo.c,v 1.11 2005/12/11 12:20:12 christo #include <sys/proc.h> #include <sys/systm.h> #include <sys/sysctl.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_util.h> diff --git a/sys/compat/irix/syscalls.master b/sys/compat/irix/syscalls.master index 063d769cc98..f93d34731cf 100644 --- a/sys/compat/irix/syscalls.master +++ b/sys/compat/irix/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.49 2005/12/11 12:20:12 christos Exp $ + $NetBSD: syscalls.master,v 1.50 2007/02/09 21:55:18 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -43,7 +43,6 @@ #include <sys/mount.h> #include <sys/poll.h> #include <sys/ioctl_compat.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/linux/arch/alpha/linux_machdep.c b/sys/compat/linux/arch/alpha/linux_machdep.c index a87a8162f56..9871f869417 100644 --- a/sys/compat/linux/arch/alpha/linux_machdep.c +++ b/sys/compat/linux/arch/alpha/linux_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.35 2006/07/23 22:06:08 ad Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.36 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.35 2006/07/23 22:06:08 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.36 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -62,7 +62,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.35 2006/07/23 22:06:08 ad Exp $" #include <sys/mount.h> #include <sys/vnode.h> #include <sys/device.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/filedesc.h> #include <sys/exec_elf.h> @@ -125,12 +124,12 @@ setup_linux_rt_sigframe(struct trapframe *tf, int sig, const sigset_t *mask) struct lwp *l = curlwp; struct proc *p = l->l_proc; struct linux_rt_sigframe *sfp, sigframe; - int onstack; + int onstack, error; int fsize, rndfsize; extern char linux_rt_sigcode[], linux_rt_esigcode[]; /* Do we need to jump onto the signal stack? */ - onstack = (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && + onstack = (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0; /* Allocate space for the signal handler context. */ @@ -139,8 +138,8 @@ setup_linux_rt_sigframe(struct trapframe *tf, int sig, const sigset_t *mask) if (onstack) sfp = (struct linux_rt_sigframe *) - ((caddr_t)p->p_sigctx.ps_sigstk.ss_sp + - p->p_sigctx.ps_sigstk.ss_size); + ((caddr_t)l->l_sigstk.ss_sp + + l->l_sigstk.ss_size); else sfp = (struct linux_rt_sigframe *)(alpha_pal_rdusp()); sfp = (struct linux_rt_sigframe *)((caddr_t)sfp - rndfsize); @@ -188,7 +187,12 @@ setup_linux_rt_sigframe(struct trapframe *tf, int sig, const sigset_t *mask) sigframe.info.lsi_pid = p->p_pid; sigframe.info.lsi_uid = kauth_cred_geteuid(l->l_cred); /* Use real uid here? */ - if (copyout((caddr_t)&sigframe, (caddr_t)sfp, fsize) != 0) { + sendsig_reset(l, sig); + mutex_exit(&p->p_smutex); + error = copyout((caddr_t)&sigframe, (caddr_t)sfp, fsize); + mutex_enter(&p->p_smutex); + + if (error != 0) { #ifdef DEBUG if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) printf("sendsig(%d): copyout failed on sig %d\n", @@ -215,7 +219,7 @@ setup_linux_rt_sigframe(struct trapframe *tf, int sig, const sigset_t *mask) /* Remember that we're now on the signal stack. */ if (onstack) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; } void setup_linux_sigframe(tf, sig, mask) @@ -226,12 +230,12 @@ void setup_linux_sigframe(tf, sig, mask) struct lwp *l = curlwp; struct proc *p = l->l_proc; struct linux_sigframe *sfp, sigframe; - int onstack; + int onstack, error; int fsize, rndfsize; extern char linux_sigcode[], linux_esigcode[]; /* Do we need to jump onto the signal stack? */ - onstack = (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && + onstack = (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0; /* Allocate space for the signal handler context. */ @@ -240,8 +244,8 @@ void setup_linux_sigframe(tf, sig, mask) if (onstack) sfp = (struct linux_sigframe *) - ((caddr_t)p->p_sigctx.ps_sigstk.ss_sp + - p->p_sigctx.ps_sigstk.ss_size); + ((caddr_t)l->l_sigstk.ss_sp + + l->l_sigstk.ss_size); else sfp = (struct linux_sigframe *)(alpha_pal_rdusp()); sfp = (struct linux_sigframe *)((caddr_t)sfp - rndfsize); @@ -276,7 +280,12 @@ void setup_linux_sigframe(tf, sig, mask) sigframe.sf_sc.sc_traparg_a1 = tf->tf_regs[FRAME_A1]; sigframe.sf_sc.sc_traparg_a2 = tf->tf_regs[FRAME_A2]; - if (copyout((caddr_t)&sigframe, (caddr_t)sfp, fsize) != 0) { + sendsig_reset(l, sig); + mutex_exit(&p->p_smutex); + error = copyout((caddr_t)&sigframe, (caddr_t)sfp, fsize); + mutex_enter(&p->p_smutex); + + if (error != 0) { #ifdef DEBUG if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) printf("sendsig(%d): copyout failed on sig %d\n", @@ -303,7 +312,7 @@ void setup_linux_sigframe(tf, sig, mask) /* Remember that we're now on the signal stack. */ if (onstack) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; } /* @@ -376,20 +385,22 @@ int linux_restore_sigcontext(struct lwp *l, struct linux_sigcontext context, sigset_t *mask) { - struct proc *p = l->l_proc; + /* * Linux doesn't (yet) have alternate signal stacks. * However, the OSF/1 sigcontext which they use has * an onstack member. This could be needed in the future. */ + mutex_enter(&p->p_smutex); if (context.sc_onstack & LINUX_SA_ONSTACK) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; + l->l_sigstk.ss_flags &= ~SS_ONSTACK; /* Reset the signal mask */ - (void) sigprocmask1(p, SIG_SETMASK, mask, 0); + (void) sigprocmask1(l, SIG_SETMASK, mask, 0); + mutex_exit(&p->p_smutex); /* * Check for security violations. diff --git a/sys/compat/linux/arch/alpha/linux_pipe.c b/sys/compat/linux/arch/alpha/linux_pipe.c index 9de68ed4b07..b0664a6b673 100644 --- a/sys/compat/linux/arch/alpha/linux_pipe.c +++ b/sys/compat/linux/arch/alpha/linux_pipe.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_pipe.c,v 1.9 2005/12/11 12:20:12 christos Exp $ */ +/* $NetBSD: linux_pipe.c,v 1.10 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.9 2005/12/11 12:20:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.10 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -48,7 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.9 2005/12/11 12:20:12 christos Exp #include <sys/mount.h> #include <sys/proc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/arch/alpha/linux_syscalls.c b/sys/compat/linux/arch/alpha/linux_syscalls.c index 9981bb87de2..fad3454ddcb 100644 --- a/sys/compat/linux/arch/alpha/linux_syscalls.c +++ b/sys/compat/linux/arch/alpha/linux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.62 2006/09/01 21:19:44 matt Exp $ */ +/* $NetBSD: linux_syscalls.c,v 1.63 2007/02/09 21:55:18 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.62 2006/09/01 21:19:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.63 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -21,7 +21,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.62 2006/09/01 21:19:44 matt Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/alpha/linux_sysent.c b/sys/compat/linux/arch/alpha/linux_sysent.c index 6fc2abb8145..4fae92f1257 100644 --- a/sys/compat/linux/arch/alpha/linux_sysent.c +++ b/sys/compat/linux/arch/alpha/linux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.61 2006/09/01 21:19:44 matt Exp $ */ +/* $NetBSD: linux_sysent.c,v 1.62 2007/02/09 21:55:18 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.61 2006/09/01 21:19:44 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.62 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.61 2006/09/01 21:19:44 matt Exp $ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/alpha/syscalls.master b/sys/compat/linux/arch/alpha/syscalls.master index 8dc5574b84d..8f7a42e7ea1 100644 --- a/sys/compat/linux/arch/alpha/syscalls.master +++ b/sys/compat/linux/arch/alpha/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.55 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.56 2007/02/09 21:55:18 ad Exp $ ; ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -68,7 +68,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/arch/amd64/linux_commons.c b/sys/compat/linux/arch/amd64/linux_commons.c index 41a6b724cc8..56ad730e998 100644 --- a/sys/compat/linux/arch/amd64/linux_commons.c +++ b/sys/compat/linux/arch/amd64/linux_commons.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_commons.c,v 1.5 2006/02/09 19:18:56 manu Exp $ */ +/* $NetBSD: linux_commons.c,v 1.6 2007/02/09 21:55:18 ad Exp $ */ /* * This file includes C files from the common @@ -13,7 +13,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.5 2006/02/09 19:18:56 manu Exp $"); +__KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.6 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -26,7 +26,6 @@ __KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.5 2006/02/09 19:18:56 manu Exp $ #include <sys/param.h> #include <sys/mount.h> #include <sys/signal.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/amd64/linux_machdep.c b/sys/compat/linux/arch/amd64/linux_machdep.c index e9d59bd65d7..898727e59d7 100644 --- a/sys/compat/linux/arch/amd64/linux_machdep.c +++ b/sys/compat/linux/arch/amd64/linux_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.15 2006/09/20 09:54:55 manu Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.16 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.15 2006/09/20 09:54:55 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.16 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -124,7 +124,7 @@ linux_sendsig(ksi, mask) struct lwp *l = curlwp; struct proc *p = l->l_proc; struct sigacts *ps = p->p_sigacts; - int onstack; + int onstack, error; int sig = ksi->ksi_signo; struct linux_rt_sigframe *sfp, sigframe; struct linux__fpstate *fpsp, fpstate; @@ -134,6 +134,9 @@ linux_sendsig(ksi, mask) linux_sigset_t lmask; char *sp; int error; + sigset_t tmask; + + tmask = *mask; /* Do we need to jump onto the signal stack? */ onstack = @@ -156,9 +159,9 @@ linux_sendsig(ksi, mask) (((long)sp - sizeof(struct linux__fpstate)) & ~0xfUL); fpsp = (struct linux__fpstate *)sp; + mutex_exit(&p->p_smutex); (void)process_read_fpregs(l, &fpregs); bzero(&fpstate, sizeof(fpstate)); - fpstate.cwd = fpregs.fp_fcw; fpstate.swd = fpregs.fp_fsw; fpstate.twd = fpregs.fp_ftw; @@ -171,8 +174,10 @@ linux_sendsig(ksi, mask) sizeof(fpstate.st_space)); memcpy(&fpstate.xmm_space, &fpregs.fp_xmm, sizeof(fpstate.xmm_space)); + error = copyout(&fpstate, fpsp, sizeof(fpstate)); + mutex_enter(&p->p_smutex) - if ((error = copyout(&fpstate, fpsp, sizeof(fpstate))) != 0) { + if (error != 0) { sigexit(l, SIGILL); return; } @@ -287,7 +292,12 @@ linux_sendsig(ksi, mask) break; } - if ((error = copyout(&sigframe, sp, sizeof(sigframe))) != 0) { + sendsig_reset(l, sig); + mutex_exit(&p->p_smutex); + error = copyout(&sigframe, sp, sizeof(sigframe)); + mutex_enter(&p->p_smutex); + + if (error != 0) { sigexit(l, SIGILL); return; } @@ -371,6 +381,7 @@ linux_sys_rt_sigreturn(l, v, retval) fp = (struct linux_rt_sigframe *)(tf->tf_rsp - 8); if ((error = copyin(fp, &frame, sizeof(frame))) != 0) { + mutex_enter(&l->l_proc->p_smutex); sigexit(l, SIGILL); return error; } @@ -431,6 +442,7 @@ linux_sys_rt_sigreturn(l, v, retval) if (lsigctx->fpstate != NULL) { error = copyin(lsigctx->fpstate, &fpstate, sizeof(fpstate)); if (error != 0) { + mutex_enter(&l->l_proc->p_smutex); sigexit(l, SIGILL); return error; } @@ -465,7 +477,11 @@ linux_sys_rt_sigreturn(l, v, retval) /* * And let setucontext deal with that. */ - return setucontext(l, &uctx); + mutex_enter(&l->l_proc->p_smutex); + error = setucontext(l, &uctx); + mutex_exit(&l->l_proc->p_smutex); + + return error; } int diff --git a/sys/compat/linux/arch/amd64/linux_syscalls.c b/sys/compat/linux/arch/amd64/linux_syscalls.c index d468053738c..cd26eb3de65 100644 --- a/sys/compat/linux/arch/amd64/linux_syscalls.c +++ b/sys/compat/linux/arch/amd64/linux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.16 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_syscalls.c,v 1.17 2007/02/09 21:55:18 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.16 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.17 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.16 2006/09/01 21:19:45 matt Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_mmap.h> diff --git a/sys/compat/linux/arch/amd64/linux_sysent.c b/sys/compat/linux/arch/amd64/linux_sysent.c index 330b915de78..b7c4394a06c 100644 --- a/sys/compat/linux/arch/amd64/linux_sysent.c +++ b/sys/compat/linux/arch/amd64/linux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.16 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_sysent.c,v 1.17 2007/02/09 21:55:18 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.16 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.17 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.16 2006/09/01 21:19:45 matt Exp $ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_mmap.h> diff --git a/sys/compat/linux/arch/amd64/syscalls.master b/sys/compat/linux/arch/amd64/syscalls.master index d2177c565fe..6b2d287dcff 100644 --- a/sys/compat/linux/arch/amd64/syscalls.master +++ b/sys/compat/linux/arch/amd64/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.15 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.16 2007/02/09 21:55:18 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -43,7 +43,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/arch/arm/linux_commons.c b/sys/compat/linux/arch/arm/linux_commons.c index 412e26adea1..48f08af5b3e 100644 --- a/sys/compat/linux/arch/arm/linux_commons.c +++ b/sys/compat/linux/arch/arm/linux_commons.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_commons.c,v 1.3 2003/01/18 08:02:47 thorpej Exp $ */ +/* $NetBSD: linux_commons.c,v 1.4 2007/02/09 21:55:18 ad Exp $ */ /* * This file includes C files from the common @@ -13,7 +13,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.3 2003/01/18 08:02:47 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.4 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -26,7 +26,6 @@ __KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.3 2003/01/18 08:02:47 thorpej Ex #include <sys/param.h> #include <sys/mount.h> #include <sys/signal.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include "../../common/linux_pipe.c" diff --git a/sys/compat/linux/arch/arm/linux_machdep.c b/sys/compat/linux/arch/arm/linux_machdep.c index ff0dfc7a46a..73defd1f666 100644 --- a/sys/compat/linux/arch/arm/linux_machdep.c +++ b/sys/compat/linux/arch/arm/linux_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.18 2006/08/23 21:16:58 bjh21 Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.19 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include <sys/param.h> -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.18 2006/08/23 21:16:58 bjh21 Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.19 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -58,7 +58,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.18 2006/08/23 21:16:58 bjh21 Exp #include <sys/mount.h> #include <sys/vnode.h> #include <sys/device.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/filedesc.h> #include <sys/exec_elf.h> @@ -92,7 +91,7 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) struct proc *p = l->l_proc; struct trapframe *tf; struct linux_sigframe *fp, frame; - int onstack; + int onstack, error; const int sig = ksi->ksi_signo; sig_t catcher = SIGACTION(p, sig).sa_handler; @@ -105,13 +104,13 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) /* Do we need to jump onto the signal stack? */ onstack = - (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && + (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0; /* Allocate space for the signal handler context. */ if (onstack) - fp = (struct linux_sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp + - p->p_sigctx.ps_sigstk.ss_size); + fp = (struct linux_sigframe *)((caddr_t)l->l_sigstk.ss_sp + + l->l_sigstk.ss_size); else fp = (struct linux_sigframe *)tf->tf_usr_sp; fp--; @@ -154,8 +153,13 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) frame.sf_sc.sc_trapno = 0; frame.sf_sc.sc_error_code = 0; frame.sf_sc.sc_fault_address = (u_int32_t) ksi->ksi_addr; + sendsig_reset(l, sig); - if (copyout(&frame, fp, sizeof(frame)) != 0) { + mutex_exit(&p->p_smutex); + error = copyout(&frame, fp, sizeof(frame)); + mutex_enter(&p->p_smutex); + + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. @@ -175,7 +179,7 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) /* Remember that we're now on the signal stack. */ if (onstack) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; } @@ -250,13 +254,17 @@ linux_sys_sigreturn(l, v, retval) tf->tf_pc = frame.sf_sc.sc_pc; tf->tf_spsr = frame.sf_sc.sc_cpsr; + mutex_enter(&p->p_smutex); + /* Restore signal stack. */ - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; + l->l_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ linux_old_extra_to_native_sigset(&mask, &frame.sf_sc.sc_mask, frame.sf_extramask); - (void) sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void) sigprocmask1(l, SIG_SETMASK, &mask, 0); + + mutex_exit(&p->p_smutex); return (EJUSTRETURN); } diff --git a/sys/compat/linux/arch/arm/linux_ptrace.c b/sys/compat/linux/arch/arm/linux_ptrace.c index 1a065061491..1d7a8d7dacf 100644 --- a/sys/compat/linux/arch/arm/linux_ptrace.c +++ b/sys/compat/linux/arch/arm/linux_ptrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ptrace.c,v 1.6 2006/09/01 21:20:46 matt Exp $ */ +/* $NetBSD: linux_ptrace.c,v 1.7 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.6 2006/09/01 21:20:46 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.7 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/malloc.h> @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.6 2006/09/01 21:20:46 matt Exp $" #include <sys/proc.h> #include <sys/ptrace.h> #include <sys/systm.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm_extern.h> diff --git a/sys/compat/linux/arch/arm/linux_syscalls.c b/sys/compat/linux/arch/arm/linux_syscalls.c index 25de9b2303c..f98a90b4689 100644 --- a/sys/compat/linux/arch/arm/linux_syscalls.c +++ b/sys/compat/linux/arch/arm/linux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.28 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_syscalls.c,v 1.29 2007/02/09 21:55:18 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.28 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.29 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.28 2006/09/01 21:19:45 matt Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_mmap.h> diff --git a/sys/compat/linux/arch/arm/linux_sysent.c b/sys/compat/linux/arch/arm/linux_sysent.c index beb7c985e7b..f1787c67f39 100644 --- a/sys/compat/linux/arch/arm/linux_sysent.c +++ b/sys/compat/linux/arch/arm/linux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.28 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_sysent.c,v 1.29 2007/02/09 21:55:18 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.28 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.29 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_43.h" @@ -18,7 +18,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.28 2006/09/01 21:19:45 matt Exp $ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_mmap.h> diff --git a/sys/compat/linux/arch/arm/syscalls.master b/sys/compat/linux/arch/arm/syscalls.master index 683967bdc9f..4985e6c2177 100644 --- a/sys/compat/linux/arch/arm/syscalls.master +++ b/sys/compat/linux/arch/arm/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.26 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.27 2007/02/09 21:55:18 ad Exp $ ; Derived from sys/compat/linux/arch/*/syscalls.master ; and from Linux 2.4.12 arch/arm/kernel/calls.S @@ -43,7 +43,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/arch/i386/linux_commons.c b/sys/compat/linux/arch/i386/linux_commons.c index c76830e1559..bd705464d08 100644 --- a/sys/compat/linux/arch/i386/linux_commons.c +++ b/sys/compat/linux/arch/i386/linux_commons.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_commons.c,v 1.7 2003/01/18 08:02:47 thorpej Exp $ */ +/* $NetBSD: linux_commons.c,v 1.8 2007/02/09 21:55:18 ad Exp $ */ /* * This file includes C files from the common @@ -13,7 +13,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.7 2003/01/18 08:02:47 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.8 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -26,7 +26,6 @@ __KERNEL_RCSID(1, "$NetBSD: linux_commons.c,v 1.7 2003/01/18 08:02:47 thorpej Ex #include <sys/param.h> #include <sys/mount.h> #include <sys/signal.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include "../../common/linux_pipe.c" diff --git a/sys/compat/linux/arch/i386/linux_machdep.c b/sys/compat/linux/arch/i386/linux_machdep.c index 7666df3dabe..3fdd91dbf89 100644 --- a/sys/compat/linux/arch/i386/linux_machdep.c +++ b/sys/compat/linux/arch/i386/linux_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.121 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.122 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.121 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.122 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_vm86.h" @@ -62,7 +62,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.121 2007/01/29 01:52:44 hubertf #include <sys/mount.h> #include <sys/vnode.h> #include <sys/device.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/filedesc.h> #include <sys/exec_elf.h> @@ -275,11 +274,11 @@ linux_rt_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) struct proc *p = l->l_proc; struct trapframe *tf; struct linux_rt_sigframe *fp, frame; - int onstack; + int onstack, error; linux_siginfo_t *lsi; int sig = ksi->ksi_signo; sig_t catcher = SIGACTION(p, sig).sa_handler; - struct sigaltstack *sas = &p->p_sigctx.ps_sigstk; + struct sigaltstack *sas = &l->l_sigstk; tf = l->l_md.md_regs; /* Do we need to jump onto the signal stack? */ @@ -345,8 +344,13 @@ linux_rt_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) /* Save register context. */ linux_save_ucontext(l, tf, mask, sas, &frame.sf_uc); + sendsig_reset(l, sig); - if (copyout(&frame, fp, sizeof(frame)) != 0) { + mutex_exit(&p->p_smutex); + error = copyout(&frame, fp, sizeof(frame)); + mutex_enter(&p->p_smutex); + + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. @@ -381,10 +385,10 @@ linux_old_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) struct proc *p = l->l_proc; struct trapframe *tf; struct linux_sigframe *fp, frame; - int onstack; + int onstack, error; int sig = ksi->ksi_signo; sig_t catcher = SIGACTION(p, sig).sa_handler; - struct sigaltstack *sas = &p->p_sigctx.ps_sigstk; + struct sigaltstack *sas = &l->l_sigstk; tf = l->l_md.md_regs; @@ -408,8 +412,13 @@ linux_old_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) frame.sf_sig = native_to_linux_signo[sig]; linux_save_sigcontext(l, tf, mask, &frame.sf_sc); + sendsig_reset(l, sig); + + mutex_exit(&p->p_smutex); + error = copyout(&frame, fp, sizeof(frame)); + mutex_enter(&p->p_smutex); - if (copyout(&frame, fp, sizeof(frame)) != 0) { + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. @@ -497,7 +506,7 @@ linux_restore_sigcontext(struct lwp *l, struct linux_sigcontext *scp, register_t *retval) { struct proc *p = l->l_proc; - struct sigaltstack *sas = &p->p_sigctx.ps_sigstk; + struct sigaltstack *sas = &l->l_sigstk; struct trapframe *tf; sigset_t mask; ssize_t ss_gap; @@ -555,6 +564,7 @@ linux_restore_sigcontext(struct lwp *l, struct linux_sigcontext *scp, * Linux really does it this way; it doesn't have space in sigframe * to save the onstack flag. */ + mutex_enter(&p->p_smutex); ss_gap = (ssize_t) ((caddr_t) scp->sc_esp_at_signal - (caddr_t) sas->ss_sp); if (ss_gap >= 0 && ss_gap < sas->ss_size) @@ -564,7 +574,9 @@ linux_restore_sigcontext(struct lwp *l, struct linux_sigcontext *scp, /* Restore signal mask. */ linux_old_to_native_sigset(&mask, &scp->sc_mask); - (void) sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void) sigprocmask1(l, SIG_SETMASK, &mask, 0); + mutex_exit(&p->p_smutex); + DPRINTF(("sigreturn exit esp=%x eip=%x\n", tf->tf_esp, tf->tf_eip)); return EJUSTRETURN; } diff --git a/sys/compat/linux/arch/i386/linux_ptrace.c b/sys/compat/linux/arch/i386/linux_ptrace.c index a4eb25333e5..ddabe5cadf4 100644 --- a/sys/compat/linux/arch/i386/linux_ptrace.c +++ b/sys/compat/linux/arch/i386/linux_ptrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ptrace.c,v 1.15 2006/09/01 21:20:46 matt Exp $ */ +/* $NetBSD: linux_ptrace.c,v 1.16 2007/02/09 21:55:18 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.15 2006/09/01 21:20:46 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.16 2007/02/09 21:55:18 ad Exp $"); #include <sys/param.h> #include <sys/malloc.h> @@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.15 2006/09/01 21:20:46 matt Exp $ #include <sys/proc.h> #include <sys/ptrace.h> #include <sys/systm.h> -#include <sys/sa.h> #include <sys/syscall.h> #include <sys/syscallargs.h> #include <uvm/uvm_extern.h> @@ -157,6 +156,8 @@ linux_sys_ptrace_arch(l, v, retval) (request != LINUX_PTRACE_SETFPREGS)) return EIO; + /* XXXAD locking */ + /* Find the process we're supposed to be operating on. */ if ((t = pfind(SCARG(uap, pid))) == NULL) return ESRCH; @@ -165,14 +166,14 @@ linux_sys_ptrace_arch(l, v, retval) * You can't do what you want to the process if: * (1) It's not being traced at all, */ - if (!ISSET(t->p_flag, P_TRACED)) + if (!ISSET(t->p_slflag, PSL_TRACED)) return EPERM; /* * (2) it's being traced by procfs (which has * different signal delivery semantics), */ - if (ISSET(t->p_flag, P_FSTRACE)) + if (ISSET(t->p_slflag, PSL_FSTRACE)) return EBUSY; /* @@ -184,7 +185,7 @@ linux_sys_ptrace_arch(l, v, retval) /* * (4) it's not currently stopped. */ - if (t->p_stat != SSTOP || !ISSET(t->p_flag, P_WAITED)) + if (t->p_stat != SSTOP || !t->p_waited /* XXXSMP */) return EBUSY; /* XXX NJWLWP diff --git a/sys/compat/linux/arch/i386/linux_syscalls.c b/sys/compat/linux/arch/i386/linux_syscalls.c index 6e861b29133..c5d90b865b3 100644 --- a/sys/compat/linux/arch/i386/linux_syscalls.c +++ b/sys/compat/linux/arch/i386/linux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.66 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_syscalls.c,v 1.67 2007/02/09 21:55:18 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.66 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.67 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.66 2006/09/01 21:19:45 matt Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_mmap.h> diff --git a/sys/compat/linux/arch/i386/linux_sysent.c b/sys/compat/linux/arch/i386/linux_sysent.c index 98818fe5d86..3bf75aa88b0 100644 --- a/sys/compat/linux/arch/i386/linux_sysent.c +++ b/sys/compat/linux/arch/i386/linux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.65 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_sysent.c,v 1.66 2007/02/09 21:55:18 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.65 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.66 2007/02/09 21:55:18 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_43.h" @@ -18,7 +18,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.65 2006/09/01 21:19:45 matt Exp $ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_mmap.h> diff --git a/sys/compat/linux/arch/i386/syscalls.master b/sys/compat/linux/arch/i386/syscalls.master index 9dcc5473991..d66b56d26ca 100644 --- a/sys/compat/linux/arch/i386/syscalls.master +++ b/sys/compat/linux/arch/i386/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.80 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.81 2007/02/09 21:55:18 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -42,7 +42,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/arch/m68k/linux_machdep.c b/sys/compat/linux/arch/m68k/linux_machdep.c index 842b78c5649..94a59af44b0 100644 --- a/sys/compat/linux/arch/m68k/linux_machdep.c +++ b/sys/compat/linux/arch/m68k/linux_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.29 2007/01/04 18:27:36 elad Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.30 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.29 2007/01/04 18:27:36 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.30 2007/02/09 21:55:19 ad Exp $"); #define COMPAT_LINUX 1 @@ -50,7 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.29 2007/01/04 18:27:36 elad Exp #include <sys/mount.h> #include <sys/signal.h> #include <sys/signalvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/kauth.h> @@ -119,6 +118,7 @@ setup_linux_sigframe(frame, sig, mask, usp) struct proc *p = l->l_proc; struct linux_sigframe *fp, kf; short ft; + int error; ft = frame->f_format; @@ -234,8 +234,13 @@ setup_linux_sigframe(frame, sig, mask, usp) kf.sf_c.c_sc.sc_sp = frame->f_regs[SP]; kf.sf_c.c_sc.sc_pc = frame->f_pc; kf.sf_c.c_sc.sc_ps = frame->f_sr; + sendsig_reset(l, sig); + + mutex_exit(&p->p_smutex); + error = copyout(&kf, fp, sizeof(struct linux_sigframe)); + mutex_enter(&p->p_smutex); - if (copyout(&kf, fp, sizeof(struct linux_sigframe))) { + if (error) { #ifdef DEBUG if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) printf("setup_linux_sigframe(%d): copyout failed on sig %d\n", @@ -279,6 +284,7 @@ setup_linux_rt_sigframe(frame, sig, mask, usp, l) { struct proc *p = l->l_proc; struct linux_rt_sigframe *fp, kf; + int error; short ft; ft = frame->f_format; @@ -410,13 +416,18 @@ setup_linux_rt_sigframe(frame, sig, mask, usp, l) /* Build the signal context to be used by sigreturn. */ native_to_linux_sigset(&kf.sf_uc.uc_sigmask, mask); - kf.sf_uc.uc_stack.ss_sp = p->p_sigctx.ps_sigstk.ss_sp; + kf.sf_uc.uc_stack.ss_sp = l->l_sigstk.ss_sp; kf.sf_uc.uc_stack.ss_flags = - (p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK ? LINUX_SS_ONSTACK : 0) | - (p->p_sigctx.ps_sigstk.ss_flags & SS_DISABLE ? LINUX_SS_DISABLE : 0); - kf.sf_uc.uc_stack.ss_size = p->p_sigctx.ps_sigstk.ss_size; + (l->l_sigstk.ss_flags & SS_ONSTACK ? LINUX_SS_ONSTACK : 0) | + (l->l_sigstk.ss_flags & SS_DISABLE ? LINUX_SS_DISABLE : 0); + kf.sf_uc.uc_stack.ss_size = l->l_sigstk.ss_size; + sendsig_reset(l, sig); - if (copyout(&kf, fp, sizeof(struct linux_rt_sigframe))) { + mutex_exit(&p->p_smutex); + error = copyout(&kf, fp, sizeof(struct linux_rt_sigframe)); + mutex_enter(&p->p_smutex); + + if (error) { #ifdef DEBUG if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) printf("setup_linux_rt_sigframe(%d): copyout failed on sig %d\n", @@ -475,7 +486,7 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) /* Remember that we're now on the signal stack. */ if (onstack) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; #ifdef DEBUG if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) @@ -530,8 +541,11 @@ linux_sys_sigreturn(l, v, retval) #endif /* Grab whole of the sigcontext. */ - if (copyin((caddr_t) usp, &tsigc2, sizeof tsigc2)) -bad: sigexit(l, SIGSEGV); + if (copyin((caddr_t) usp, &tsigc2, sizeof tsigc2)) { +bad: + mutex_enter(&p->p_smutex); + sigexit(l, SIGSEGV); + } scp = &tsigc2.c_sc; @@ -557,8 +571,10 @@ bad: sigexit(l, SIGSEGV); sz, frame->f_stackadj); #endif + mutex_enter(&p->p_smutex); + /* Restore signal stack. */ - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; + l->l_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ #if LINUX__NSIG_WORDS > 1 @@ -567,7 +583,9 @@ bad: sigexit(l, SIGSEGV); #else linux_old_to_native_sigset(&scp->sc_mask, &mask); #endif - (void) sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void) sigprocmask1(l, SIG_SETMASK, &mask, 0); + + mutex_exit(&p->p_smutex); /* * Restore the user supplied information. @@ -681,8 +699,11 @@ linux_sys_rt_sigreturn(l, v, retval) #endif /* Grab whole of the ucontext. */ - if (copyin(ucp, &tuc, sizeof tuc)) -bad: sigexit(l, SIGSEGV); + if (copyin(ucp, &tuc, sizeof tuc)) { +bad: + mutex_enter(&p->p_smutex); + sigexit(l, SIGSEGV); + } /* * Check kernel stack and re-enter to syscall() if needed. @@ -709,14 +730,18 @@ bad: sigexit(l, SIGSEGV); if (tuc.uc_mc.mc_version != LINUX_MCONTEXT_VERSION) goto bad; + mutex_enter(&p->p_smutex); + /* Restore signal stack. */ - p->p_sigctx.ps_sigstk.ss_flags = - (p->p_sigctx.ps_sigstk.ss_flags & ~SS_ONSTACK) | + l->l_sigstk.ss_flags = + (l->l_sigstk.ss_flags & ~SS_ONSTACK) | (tuc.uc_stack.ss_flags & LINUX_SS_ONSTACK ? SS_ONSTACK : 0); /* Restore signal mask. */ linux_to_native_sigset(&mask, &tuc.uc_sigmask); - (void) sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void) sigprocmask1(l, SIG_SETMASK, &mask, 0); + + mutex_exit(&p->p_smutex); /* * Restore the user supplied information. diff --git a/sys/compat/linux/arch/m68k/linux_syscalls.c b/sys/compat/linux/arch/m68k/linux_syscalls.c index 2ea06693303..ac9750b612c 100644 --- a/sys/compat/linux/arch/m68k/linux_syscalls.c +++ b/sys/compat/linux/arch/m68k/linux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.58 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_syscalls.c,v 1.59 2007/02/09 21:55:19 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.58 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.59 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.58 2006/09/01 21:19:45 matt Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/m68k/linux_sysent.c b/sys/compat/linux/arch/m68k/linux_sysent.c index d5b279e39d1..214d9d783df 100644 --- a/sys/compat/linux/arch/m68k/linux_sysent.c +++ b/sys/compat/linux/arch/m68k/linux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.58 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_sysent.c,v 1.59 2007/02/09 21:55:19 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.58 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.59 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.58 2006/09/01 21:19:45 matt Exp $ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/m68k/syscalls.master b/sys/compat/linux/arch/m68k/syscalls.master index 5ae1182403a..c3ecd58e3ab 100644 --- a/sys/compat/linux/arch/m68k/syscalls.master +++ b/sys/compat/linux/arch/m68k/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.52 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.53 2007/02/09 21:55:19 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -43,7 +43,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/arch/mips/linux_machdep.c b/sys/compat/linux/arch/mips/linux_machdep.c index 3cf47327cce..33667839e10 100644 --- a/sys/compat/linux/arch/mips/linux_machdep.c +++ b/sys/compat/linux/arch/mips/linux_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.28 2007/01/04 18:27:36 elad Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.29 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.28 2007/01/04 18:27:36 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.29 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.28 2007/01/04 18:27:36 elad Exp #include <sys/mount.h> #include <sys/vnode.h> #include <sys/device.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/filedesc.h> #include <sys/exec_elf.h> @@ -131,7 +130,7 @@ linux_sendsig(ksi, mask) struct proc *p = l->l_proc; struct linux_sigframe *fp; struct frame *f; - int i,onstack; + int i, onstack, error; sig_t catcher = SIGACTION(p, sig).sa_handler; struct linux_sigframe sf; @@ -144,7 +143,7 @@ linux_sendsig(ksi, mask) * Do we need to jump onto the signal stack? */ onstack = - (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && + (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0; /* @@ -158,8 +157,8 @@ linux_sendsig(ksi, mask) */ if (onstack) fp = (struct linux_sigframe *) - ((caddr_t)p->p_sigctx.ps_sigstk.ss_sp - + p->p_sigctx.ps_sigstk.ss_size); + ((caddr_t)l->l_sigstk.ss_sp + + l->l_sigstk.ss_size); else /* cast for _MIPS_BSD_API == _MIPS_BSD_API_LP32_64CLEAN case */ fp = (struct linux_sigframe *)(u_int32_t)f->f_regs[_R_SP]; @@ -186,17 +185,22 @@ linux_sendsig(ksi, mask) sf.lsf_sc.lsc_status = f->f_regs[_R_SR]; sf.lsf_sc.lsc_cause = f->f_regs[_R_CAUSE]; sf.lsf_sc.lsc_badvaddr = f->f_regs[_R_BADVADDR]; + sendsig_reset(l, sig); /* * Save signal stack. XXX broken */ - /* kregs.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK; */ + /* kregs.sc_onstack = l->l_sigstk.ss_flags & SS_ONSTACK; */ /* * Install the sigframe onto the stack */ fp -= sizeof(struct linux_sigframe); - if (copyout(&sf, fp, sizeof(sf)) != 0) { + mutex_exit(&p->p_smutex); + error = copyout(&sf, fp, sizeof(sf); + mutex_enter(&p->p_smutex); + + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. @@ -225,7 +229,7 @@ linux_sendsig(ksi, mask) /* Remember that we're now on the signal stack. */ if (onstack) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; return; } @@ -274,12 +278,16 @@ linux_sys_sigreturn(l, v, retval) f->f_regs[_R_BADVADDR] = ksf.lsf_sc.lsc_badvaddr; f->f_regs[_R_CAUSE] = ksf.lsf_sc.lsc_cause; + mutex_enter(&p->p_smutex); + /* Restore signal stack. */ - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; + l->l_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ linux_to_native_sigset(&mask, (linux_sigset_t *)&ksf.lsf_mask); - (void)sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void)sigprocmask1(l, SIG_SETMASK, &mask, 0); + + mutex_exit(&p->p_smutex); return (EJUSTRETURN); } diff --git a/sys/compat/linux/arch/mips/linux_ptrace.c b/sys/compat/linux/arch/mips/linux_ptrace.c index d08429eff12..0c6186a8733 100644 --- a/sys/compat/linux/arch/mips/linux_ptrace.c +++ b/sys/compat/linux/arch/mips/linux_ptrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ptrace.c,v 1.5 2006/08/30 11:14:39 matt Exp $ */ +/* $NetBSD: linux_ptrace.c,v 1.6 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.5 2006/08/30 11:14:39 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.6 2007/02/09 21:55:19 ad Exp $"); #include "opt_ptrace.h" #include <sys/param.h> @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.5 2006/08/30 11:14:39 matt Exp $" #include <sys/proc.h> #include <sys/ptrace.h> #include <sys/systm.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm_extern.h> diff --git a/sys/compat/linux/arch/mips/linux_syscalls.c b/sys/compat/linux/arch/mips/linux_syscalls.c index b4749d77767..34650c175c4 100644 --- a/sys/compat/linux/arch/mips/linux_syscalls.c +++ b/sys/compat/linux/arch/mips/linux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.25 2006/06/10 21:16:50 christos Exp $ */ +/* $NetBSD: linux_syscalls.c,v 1.26 2007/02/09 21:55:19 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.25 2006/06/10 21:16:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.26 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.25 2006/06/10 21:16:50 christos #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/mips/linux_sysent.c b/sys/compat/linux/arch/mips/linux_sysent.c index 4bb144b59db..fd45895b0f4 100644 --- a/sys/compat/linux/arch/mips/linux_sysent.c +++ b/sys/compat/linux/arch/mips/linux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.25 2006/06/10 21:16:50 christos Exp $ */ +/* $NetBSD: linux_sysent.c,v 1.26 2007/02/09 21:55:19 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.25 2006/06/10 21:16:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.26 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.25 2006/06/10 21:16:50 christos E #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/mips/syscalls.master b/sys/compat/linux/arch/mips/syscalls.master index 9a5020cde0b..a70ba5441fa 100644 --- a/sys/compat/linux/arch/mips/syscalls.master +++ b/sys/compat/linux/arch/mips/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.21 2006/06/10 21:15:33 christos Exp $ + $NetBSD: syscalls.master,v 1.22 2007/02/09 21:55:19 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -50,7 +50,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/arch/powerpc/linux_machdep.c b/sys/compat/linux/arch/powerpc/linux_machdep.c index 95a7b2f1f20..5bdd2ee8eb0 100644 --- a/sys/compat/linux/arch/powerpc/linux_machdep.c +++ b/sys/compat/linux/arch/powerpc/linux_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.c,v 1.31 2005/12/11 12:20:16 christos Exp $ */ +/* $NetBSD: linux_machdep.c,v 1.32 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.31 2005/12/11 12:20:16 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.32 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.31 2005/12/11 12:20:16 christos #include <sys/mount.h> #include <sys/vnode.h> #include <sys/device.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/filedesc.h> #include <sys/exec_elf.h> @@ -128,7 +127,7 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) struct linux_pt_regs linux_regs; struct linux_sigcontext sc; register_t fp; - int onstack; + int onstack, error; int i; tf = trapframe(l); @@ -137,7 +136,7 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) * Do we need to jump onto the signal stack? */ onstack = - (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && + (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 && (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0; /* @@ -151,8 +150,8 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) */ if (onstack) { fp = (register_t) - ((caddr_t)p->p_sigctx.ps_sigstk.ss_sp + - p->p_sigctx.ps_sigstk.ss_size); + ((caddr_t)l->l_sigstk.ss_sp + + l->l_sigstk.ss_size); } else { fp = tf->fixreg[1]; } @@ -212,11 +211,16 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) * binaries. But the Linux kernel seems to do without it, and it * just skip it when building the stack frame. Hence the LINUX_ABIGAP. */ - if (copyout(&frame, (caddr_t)fp, sizeof (frame) - LINUX_ABIGAP) != 0) { + sendsig_reset(l, sig); + mutex_exit(&p->p_smutex); + error = copyout(&frame, (caddr_t)fp, sizeof (frame) - LINUX_ABIGAP); + + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. */ + mutex_enter(&p->p_smutex); sigexit(l, SIGILL); /* NOTREACHED */ } @@ -225,7 +229,10 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) * Add a sigcontext on the stack */ fp -= sizeof(struct linux_sigcontext); - if (copyout(&sc, (caddr_t)fp, sizeof (struct linux_sigcontext)) != 0) { + error = copyout(&sc, (caddr_t)fp, sizeof (struct linux_sigcontext)); + mutex_enter(&p->p_smutex); + + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. @@ -251,7 +258,7 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) * Remember that we're now on the signal stack. */ if (onstack) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; #ifdef DEBUG_LINUX printf("linux_sendsig: exitting. fp=0x%lx\n",(long)fp); #endif @@ -309,7 +316,6 @@ linux_sys_rt_sigreturn(l, v, retval) tf = trapframe(l); #ifdef DEBUG_LINUX - printf("linux_sys_sigreturn: trapframe=0x%lx scp=0x%lx\n", (unsigned long)tf, (unsigned long)scp); #endif @@ -333,6 +339,8 @@ linux_sys_rt_sigreturn(l, v, retval) memcpy(curpcb->pcb_fpu.fpreg, (caddr_t)&sregs.lfp_regs, sizeof(curpcb->pcb_fpu.fpreg)); + mutex_enter(&p->p_smutex); + /* * Restore signal stack. * @@ -342,15 +350,17 @@ linux_sys_rt_sigreturn(l, v, retval) * It seems to be supported in libc6... */ /* if (sc.sc_onstack & SS_ONSTACK) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; else */ - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; + l->l_sigstk.ss_flags &= ~SS_ONSTACK; /* * Grab the signal mask */ linux_to_native_sigset(&mask, &sigframe.luc.luc_sigmask); - (void) sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void) sigprocmask1(l, SIG_SETMASK, &mask, 0); + + mutex_exit(&p->p_smutex); return (EJUSTRETURN); } @@ -422,6 +432,8 @@ linux_sys_sigreturn(l, v, retval) memcpy(curpcb->pcb_fpu.fpreg, (caddr_t)&sregs.lfp_regs, sizeof(curpcb->pcb_fpu.fpreg)); + mutex_enter(&p->p_smutex); + /* * Restore signal stack. * @@ -430,15 +442,17 @@ linux_sys_sigreturn(l, v, retval) */ #if 0 if (sc.sc_onstack & SS_ONSTACK) - p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK; + l->l_sigstk.ss_flags |= SS_ONSTACK; else #endif - p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK; + l->l_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ linux_old_extra_to_native_sigset(&mask, &context.lmask, &context._unused[3]); - (void) sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void) sigprocmask1(l, SIG_SETMASK, &mask, 0); + + mutex_exit(&p->p_smutex); return (EJUSTRETURN); } diff --git a/sys/compat/linux/arch/powerpc/linux_ptrace.c b/sys/compat/linux/arch/powerpc/linux_ptrace.c index b14dbdd6593..fb270f0793b 100644 --- a/sys/compat/linux/arch/powerpc/linux_ptrace.c +++ b/sys/compat/linux/arch/powerpc/linux_ptrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ptrace.c,v 1.13 2006/08/30 11:14:39 matt Exp $ */ +/* $NetBSD: linux_ptrace.c,v 1.14 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.13 2006/08/30 11:14:39 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.14 2007/02/09 21:55:19 ad Exp $"); #include "opt_ptrace.h" @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.13 2006/08/30 11:14:39 matt Exp $ #include <sys/proc.h> #include <sys/ptrace.h> #include <sys/systm.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm_extern.h> @@ -147,14 +146,14 @@ linux_sys_ptrace_arch(l, v, retval) /* XXX Check me! (From NetBSD/i386) */ * You can't do what you want to the process if: * (1) It's not being traced at all, */ - if (!ISSET(t->p_flag, P_TRACED)) + if (!ISSET(t->p_slflag, PSL_TRACED)) /* XXXSMP */ return EPERM; /* * (2) it's being traced by procfs (which has * different signal delivery semantics), */ - if (ISSET(t->p_flag, P_FSTRACE)) + if (ISSET(t->p_slflag, PSL_FSTRACE)) return EBUSY; /* @@ -166,7 +165,7 @@ linux_sys_ptrace_arch(l, v, retval) /* XXX Check me! (From NetBSD/i386) */ /* * (4) it's not currently stopped. */ - if (t->p_stat != SSTOP || !ISSET(t->p_flag, P_WAITED)) + if (t->p_stat != SSTOP || !t->p_waited) return EBUSY; lt = LIST_FIRST(&t->p_lwps); diff --git a/sys/compat/linux/arch/powerpc/linux_syscalls.c b/sys/compat/linux/arch/powerpc/linux_syscalls.c index 8302be318bf..e4acd430127 100644 --- a/sys/compat/linux/arch/powerpc/linux_syscalls.c +++ b/sys/compat/linux/arch/powerpc/linux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.34 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_syscalls.c,v 1.35 2007/02/09 21:55:19 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.34 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.35 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.34 2006/09/01 21:19:45 matt Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/powerpc/linux_sysent.c b/sys/compat/linux/arch/powerpc/linux_sysent.c index 4a2ab6a28c2..4babbf0d6af 100644 --- a/sys/compat/linux/arch/powerpc/linux_sysent.c +++ b/sys/compat/linux/arch/powerpc/linux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.35 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: linux_sysent.c,v 1.36 2007/02/09 21:55:19 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.35 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.36 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.35 2006/09/01 21:19:45 matt Exp $ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> #include <compat/linux/common/linux_signal.h> diff --git a/sys/compat/linux/arch/powerpc/syscalls.master b/sys/compat/linux/arch/powerpc/syscalls.master index 0844e41bd10..26d6a451226 100644 --- a/sys/compat/linux/arch/powerpc/syscalls.master +++ b/sys/compat/linux/arch/powerpc/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.29 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.30 2007/02/09 21:55:19 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -72,7 +72,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_blkio.c b/sys/compat/linux/common/linux_blkio.c index 378b2dca52e..3cc4267f317 100644 --- a/sys/compat/linux/common/linux_blkio.c +++ b/sys/compat/linux/common/linux_blkio.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_blkio.c,v 1.12 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_blkio.c,v 1.13 2007/02/09 21:55:19 ad Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_blkio.c,v 1.12 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_blkio.c,v 1.13 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_blkio.c,v 1.12 2006/11/16 01:32:42 christos Ex #include <sys/proc.h> #include <sys/disklabel.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_break.c b/sys/compat/linux/common/linux_break.c index 32d19e17b71..8af653d8109 100644 --- a/sys/compat/linux/common/linux_break.c +++ b/sys/compat/linux/common/linux_break.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_break.c,v 1.53 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_break.c,v 1.54 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,13 +37,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_break.c,v 1.53 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_break.c,v 1.54 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_cdrom.c b/sys/compat/linux/common/linux_cdrom.c index 0dca185d998..1ed44cedfb4 100644 --- a/sys/compat/linux/common/linux_cdrom.c +++ b/sys/compat/linux/common/linux_cdrom.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_cdrom.c,v 1.20 2006/06/12 00:42:18 christos Exp $ */ +/* $NetBSD: linux_cdrom.c,v 1.21 2007/02/09 21:55:19 ad Exp $ */ /* * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.20 2006/06/12 00:42:18 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.21 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.20 2006/06/12 00:42:18 christos Ex #include <sys/dvdio.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_exec.c b/sys/compat/linux/common/linux_exec.c index d3821c2bb60..655fe4dc891 100644 --- a/sys/compat/linux/common/linux_exec.c +++ b/sys/compat/linux/common/linux_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.c,v 1.89 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_exec.c,v 1.90 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1994, 1995, 1998, 2000 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.89 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.90 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.89 2006/11/16 01:32:42 christos Exp #include <sys/exec_elf.h> #include <sys/mman.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/ptrace.h> /* For proc_reparent() */ @@ -158,7 +157,7 @@ const struct emul emul_linux = { uvm_default_mapaddr, linux_usertrap, - NULL, + 0, }; static void diff --git a/sys/compat/linux/common/linux_exec.h b/sys/compat/linux/common/linux_exec.h index 61305942fd1..83722ca63c1 100644 --- a/sys/compat/linux/common/linux_exec.h +++ b/sys/compat/linux/common/linux_exec.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.h,v 1.39 2006/08/23 19:49:09 manu Exp $ */ +/* $NetBSD: linux_exec.h,v 1.40 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -135,7 +135,7 @@ void linux_setregs __P((struct lwp *, struct exec_package *, u_long)); int exec_linux_aout_makecmds __P((struct lwp *, struct exec_package *)); int linux_aout_copyargs __P((struct lwp *, struct exec_package *, struct ps_strings *, char **, void *)); -void linux_trapsignal __P((struct lwp *, const ksiginfo_t *)); +void linux_trapsignal __P((struct lwp *, ksiginfo_t *)); int linux_usertrap __P((struct lwp *, vaddr_t, void *)); #ifdef LINUX_NPTL void linux_nptl_proc_fork __P((struct proc *, struct proc *, diff --git a/sys/compat/linux/common/linux_exec_aout.c b/sys/compat/linux/common/linux_exec_aout.c index 7bfca48af78..afa84451778 100644 --- a/sys/compat/linux/common/linux_exec_aout.c +++ b/sys/compat/linux/common/linux_exec_aout.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec_aout.c,v 1.60 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_exec_aout.c,v 1.61 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.60 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.61 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.60 2006/11/16 01:32:42 christo #include <sys/exec_elf.h> #include <sys/mman.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/cpu.h> diff --git a/sys/compat/linux/common/linux_exec_elf32.c b/sys/compat/linux/common/linux_exec_elf32.c index 48c3550ddd4..82efe4e63db 100644 --- a/sys/compat/linux/common/linux_exec_elf32.c +++ b/sys/compat/linux/common/linux_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec_elf32.c,v 1.76 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_exec_elf32.c,v 1.77 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.76 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.77 2007/02/09 21:55:19 ad Exp $"); #ifndef ELFSIZE /* XXX should die */ @@ -63,7 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.76 2006/11/16 01:32:42 christ #include <sys/kauth.h> #include <sys/mman.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/cpu.h> diff --git a/sys/compat/linux/common/linux_fdio.c b/sys/compat/linux/common/linux_fdio.c index 12161b92eed..778abfbe823 100644 --- a/sys/compat/linux/common/linux_fdio.c +++ b/sys/compat/linux/common/linux_fdio.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_fdio.c,v 1.8 2005/12/11 12:20:19 christos Exp $ */ +/* $NetBSD: linux_fdio.c,v 1.9 2007/02/09 21:55:19 ad Exp $ */ /* * Copyright (c) 2000 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.8 2005/12/11 12:20:19 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.9 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.8 2005/12/11 12:20:19 christos Exp #include <sys/fdio.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <dev/isa/fdreg.h> diff --git a/sys/compat/linux/common/linux_file.c b/sys/compat/linux/common/linux_file.c index 8acfa18bb3f..778ce492507 100644 --- a/sys/compat/linux/common/linux_file.c +++ b/sys/compat/linux/common/linux_file.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_file.c,v 1.76 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_file.c,v 1.77 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.76 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.77 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -61,7 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_file.c,v 1.76 2006/11/16 01:32:42 christos Exp #include <sys/conf.h> #include <sys/pipe.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> @@ -209,7 +208,7 @@ linux_sys_open(l, v, retval) * terminal yet, and the O_NOCTTY flag is not set, try to make * this the controlling terminal. */ - if (!(fl & O_NOCTTY) && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + if (!(fl & O_NOCTTY) && SESS_LEADER(p) && !(p->p_lflag & PL_CONTROLT)) { struct filedesc *fdp = p->p_fd; struct file *fp; diff --git a/sys/compat/linux/common/linux_file64.c b/sys/compat/linux/common/linux_file64.c index cb6e173daf9..319f5709483 100644 --- a/sys/compat/linux/common/linux_file64.c +++ b/sys/compat/linux/common/linux_file64.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_file64.c,v 1.34 2006/07/23 22:06:09 ad Exp $ */ +/* $NetBSD: linux_file64.c,v 1.35 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998, 2000 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.34 2006/07/23 22:06:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.35 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -59,7 +59,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.34 2006/07/23 22:06:09 ad Exp $") #include <sys/tty.h> #include <sys/conf.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_hdio.c b/sys/compat/linux/common/linux_hdio.c index 157714b9ca9..04968aedba6 100644 --- a/sys/compat/linux/common/linux_hdio.c +++ b/sys/compat/linux/common/linux_hdio.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_hdio.c,v 1.10 2005/12/11 12:20:19 christos Exp $ */ +/* $NetBSD: linux_hdio.c,v 1.11 2007/02/09 21:55:19 ad Exp $ */ /* * Copyright (c) 2000 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_hdio.c,v 1.10 2005/12/11 12:20:19 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_hdio.c,v 1.11 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_hdio.c,v 1.10 2005/12/11 12:20:19 christos Exp #include <dev/ic/wdcreg.h> #include <sys/ataio.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_ioctl.c b/sys/compat/linux/common/linux_ioctl.c index 15265618fa5..33264ff9485 100644 --- a/sys/compat/linux/common/linux_ioctl.c +++ b/sys/compat/linux/common/linux_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ioctl.c,v 1.45 2006/07/23 22:06:09 ad Exp $ */ +/* $NetBSD: linux_ioctl.c,v 1.46 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.45 2006/07/23 22:06:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.46 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "sequencer.h" @@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.45 2006/07/23 22:06:09 ad Exp $"); #include <net/if.h> #include <sys/sockio.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_ipc.c b/sys/compat/linux/common/linux_ipc.c index 18311e7b6b7..7abcbb3cc33 100644 --- a/sys/compat/linux/common/linux_ipc.c +++ b/sys/compat/linux/common/linux_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ipc.c,v 1.37 2006/09/13 19:55:49 manu Exp $ */ +/* $NetBSD: linux_ipc.c,v 1.38 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.37 2006/09/13 19:55:49 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.38 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.37 2006/09/13 19:55:49 manu Exp $"); #include <sys/systm.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_ipccall.c b/sys/compat/linux/common/linux_ipccall.c index 6fc821f1908..3a8297f6bf6 100644 --- a/sys/compat/linux/common/linux_ipccall.c +++ b/sys/compat/linux/common/linux_ipccall.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ipccall.c,v 1.26 2005/12/11 12:20:19 christos Exp $ */ +/* $NetBSD: linux_ipccall.c,v 1.27 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_ipccall.c,v 1.26 2005/12/11 12:20:19 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ipccall.c,v 1.27 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ipccall.c,v 1.26 2005/12/11 12:20:19 christos /* real syscalls */ #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> /* sys_ipc + args prototype */ diff --git a/sys/compat/linux/common/linux_llseek.c b/sys/compat/linux/common/linux_llseek.c index 5d6d27b6fae..d27850df0be 100644 --- a/sys/compat/linux/common/linux_llseek.c +++ b/sys/compat/linux/common/linux_llseek.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_llseek.c,v 1.27 2003/01/18 08:02:53 thorpej Exp $ */ +/* $NetBSD: linux_llseek.c,v 1.28 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_llseek.c,v 1.27 2003/01/18 08:02:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_llseek.c,v 1.28 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_llseek.c,v 1.27 2003/01/18 08:02:53 thorpej Ex #include <sys/malloc.h> #include <sys/conf.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c index a2ed00cffed..5564426d558 100644 --- a/sys/compat/linux/common/linux_misc.c +++ b/sys/compat/linux/common/linux_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.165 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_misc.c,v 1.166 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.165 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.166 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ptrace.h" @@ -104,7 +104,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.165 2006/11/16 01:32:42 christos Ex #include <sys/ptrace.h> #include <machine/ptrace.h> -#include <sys/sa.h> #include <sys/syscall.h> #include <sys/syscallargs.h> @@ -269,7 +268,7 @@ linux_sys_wait4(l, v, retval) if ((error = sys_wait4(l, &w4a, retval))) return error; - sigdelset(&p->p_sigctx.ps_siglist, SIGCHLD); + sigdelset(&p->p_sigpend.sp_set, SIGCHLD); /* XXXAD ksiginfo leak */ if (status != NULL) { if ((error = copyin(status, &tstat, sizeof tstat))) @@ -781,12 +780,13 @@ linux_sys_times(l, v, retval) struct linux_tms ltms; struct rusage ru; - calcru(p, &ru.ru_utime, &ru.ru_stime, NULL); + mutex_enter(&p->p_smutex); + calcru(p, &ru.ru_utime, &ru.ru_stime, NULL, NULL); ltms.ltms_utime = CONVTCK(ru.ru_utime); ltms.ltms_stime = CONVTCK(ru.ru_stime); - ltms.ltms_cutime = CONVTCK(p->p_stats->p_cru.ru_utime); ltms.ltms_cstime = CONVTCK(p->p_stats->p_cru.ru_stime); + mutex_exit(&p->p_smutex); if ((error = copyout(<ms, SCARG(uap, tms), sizeof ltms))) return error; diff --git a/sys/compat/linux/common/linux_misc_notalpha.c b/sys/compat/linux/common/linux_misc_notalpha.c index ecda951f068..330a81a9d10 100644 --- a/sys/compat/linux/common/linux_misc_notalpha.c +++ b/sys/compat/linux/common/linux_misc_notalpha.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc_notalpha.c,v 1.84 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_misc_notalpha.c,v 1.85 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.84 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.85 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -56,7 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.84 2006/11/16 01:32:42 chr #include <sys/wait.h> #include <sys/kauth.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_mtio.c b/sys/compat/linux/common/linux_mtio.c index 82ce93458b9..a11e9e0895f 100644 --- a/sys/compat/linux/common/linux_mtio.c +++ b/sys/compat/linux/common/linux_mtio.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_mtio.c,v 1.2 2005/12/11 12:20:19 christos Exp $ */ +/* $NetBSD: linux_mtio.c,v 1.3 2007/02/09 21:55:19 ad Exp $ */ /* * Copyright (c) 2005 Soren S. Jorvang. All rights reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_mtio.c,v 1.2 2005/12/11 12:20:19 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_mtio.c,v 1.3 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -38,7 +38,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_mtio.c,v 1.2 2005/12/11 12:20:19 christos Exp #include <sys/mtio.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_oldmmap.c b/sys/compat/linux/common/linux_oldmmap.c index 4f0c953a021..a9eb810bc47 100644 --- a/sys/compat/linux/common/linux_oldmmap.c +++ b/sys/compat/linux/common/linux_oldmmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_oldmmap.c,v 1.65 2006/02/09 19:18:56 manu Exp $ */ +/* $NetBSD: linux_oldmmap.c,v 1.66 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,13 +37,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_oldmmap.c,v 1.65 2006/02/09 19:18:56 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_oldmmap.c,v 1.66 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm_param.h> diff --git a/sys/compat/linux/common/linux_oldolduname.c b/sys/compat/linux/common/linux_oldolduname.c index e3824500332..b6ceac2653c 100644 --- a/sys/compat/linux/common/linux_oldolduname.c +++ b/sys/compat/linux/common/linux_oldolduname.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_oldolduname.c,v 1.60 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_oldolduname.c,v 1.61 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,14 +37,13 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.60 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.61 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_oldselect.c b/sys/compat/linux/common/linux_oldselect.c index 1cb09931e07..fe3655c125e 100644 --- a/sys/compat/linux/common/linux_oldselect.c +++ b/sys/compat/linux/common/linux_oldselect.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_oldselect.c,v 1.53 2003/01/18 08:04:38 thorpej Exp $ */ +/* $NetBSD: linux_oldselect.c,v 1.54 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,13 +37,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_oldselect.c,v 1.53 2003/01/18 08:04:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_oldselect.c,v 1.54 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_olduname.c b/sys/compat/linux/common/linux_olduname.c index b3ad5b1cbab..b0bff614ca2 100644 --- a/sys/compat/linux/common/linux_olduname.c +++ b/sys/compat/linux/common/linux_olduname.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_olduname.c,v 1.60 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_olduname.c,v 1.61 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.60 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.61 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.60 2006/11/16 01:32:42 christos #include <sys/mman.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_pipe.c b/sys/compat/linux/common/linux_pipe.c index bd188ed02be..2ba4eee585c 100644 --- a/sys/compat/linux/common/linux_pipe.c +++ b/sys/compat/linux/common/linux_pipe.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_pipe.c,v 1.57 2005/12/11 12:20:19 christos Exp $ */ +/* $NetBSD: linux_pipe.c,v 1.58 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.57 2005/12/11 12:20:19 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.58 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.57 2005/12/11 12:20:19 christos Exp #include <sys/mman.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_sched.c b/sys/compat/linux/common/linux_sched.c index f5d0879fc7b..a0afcab2d68 100644 --- a/sys/compat/linux/common/linux_sched.c +++ b/sys/compat/linux/common/linux_sched.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sched.c,v 1.39 2007/02/05 18:31:36 njoly Exp $ */ +/* $NetBSD: linux_sched.c,v 1.40 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.39 2007/02/05 18:31:36 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.40 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/mount.h> @@ -50,7 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.39 2007/02/05 18:31:36 njoly Exp $ #include <sys/systm.h> #include <sys/sysctl.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/wait.h> #include <sys/kauth.h> diff --git a/sys/compat/linux/common/linux_sg.c b/sys/compat/linux/common/linux_sg.c index 55a961fbfc6..37042783990 100644 --- a/sys/compat/linux/common/linux_sg.c +++ b/sys/compat/linux/common/linux_sg.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sg.c,v 1.8 2006/09/13 00:51:12 christos Exp $ */ +/* $NetBSD: linux_sg.c,v 1.9 2007/02/09 21:55:19 ad Exp $ */ /* * Copyright (c) 2004 Soren S. Jorvang. All rights reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sg.c,v 1.8 2006/09/13 00:51:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sg.c,v 1.9 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -41,7 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sg.c,v 1.8 2006/09/13 00:51:12 christos Exp $" #include <dev/scsipi/scsipi_all.h> #include <dev/scsipi/scsiconf.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_sig_notalpha.c b/sys/compat/linux/common/linux_sig_notalpha.c index 73d9bc19bb9..d2624cadf10 100644 --- a/sys/compat/linux/common/linux_sig_notalpha.c +++ b/sys/compat/linux/common/linux_sig_notalpha.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sig_notalpha.c,v 1.32 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_sig_notalpha.c,v 1.33 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sig_notalpha.c,v 1.32 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sig_notalpha.c,v 1.33 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sig_notalpha.c,v 1.32 2006/11/16 01:32:42 chri #include <sys/signal.h> #include <sys/signalvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> @@ -81,7 +80,6 @@ linux_sys_signal(l, v, retval) syscallarg(int) signum; syscallarg(linux_handler_t) handler; } */ *uap = v; - struct proc *p = l->l_proc; struct sigaction nbsa, obsa; int error, sig; @@ -93,7 +91,7 @@ linux_sys_signal(l, v, retval) nbsa.sa_handler = SCARG(uap, handler); sigemptyset(&nbsa.sa_mask); nbsa.sa_flags = SA_RESETHAND | SA_NODEFER; - error = sigaction1(p, linux_to_native_signo[sig], + error = sigaction1(l, linux_to_native_signo[sig], &nbsa, &obsa, NULL, 0); if (error == 0) *retval = (int)(long)obsa.sa_handler; /* XXXmanu cast */ @@ -111,7 +109,9 @@ linux_sys_siggetmask(struct lwp *l, void *v, linux_old_sigset_t lss; int error; - error = sigprocmask1(p, SIG_SETMASK, 0, &bss); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SIG_SETMASK, 0, &bss); + mutex_exit(&p->p_smutex); if (error) return (error); native_to_linux_old_sigset(&lss, &bss); @@ -133,14 +133,16 @@ linux_sys_sigsetmask(l, v, retval) struct linux_sys_sigsetmask_args /* { syscallarg(linux_old_sigset_t) mask; } */ *uap = v; - struct proc *p = l->l_proc; sigset_t nbss, obss; linux_old_sigset_t nlss, olss; + struct proc *p = l->l_proc; int error; nlss = SCARG(uap, mask); linux_old_to_native_sigset(&nbss, &nlss); - error = sigprocmask1(p, SIG_SETMASK, &nbss, &obss); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SIG_SETMASK, &nbss, &obss); + mutex_exit(&p->p_smutex); if (error) return (error); native_to_linux_old_sigset(&olss, &obss); @@ -156,9 +158,8 @@ linux_sys_sigprocmask(struct lwp *l, void *v, register_t *retval) syscallarg(const linux_old_sigset_t *) set; syscallarg(linux_old_sigset_t *) oset; } */ *uap = v; - struct proc *p = l->l_proc; - return(linux_sigprocmask1(p, SCARG(uap, how), + return(linux_sigprocmask1(l, SCARG(uap, how), SCARG(uap, set), SCARG(uap, oset))); } #endif /* !__amd64__ */ @@ -170,8 +171,7 @@ linux_sys_sigprocmask(struct lwp *l, void *v, register_t *retval) int linux_sys_pause(struct lwp *l, void *v, register_t *retval) { - struct proc *p = l->l_proc; - return (sigsuspend1(p, 0)); + return (sigsuspend1(l, 0)); } diff --git a/sys/compat/linux/common/linux_sigaction.c b/sys/compat/linux/common/linux_sigaction.c index 33b4e15d0f3..b40c2f6f933 100644 --- a/sys/compat/linux/common/linux_sigaction.c +++ b/sys/compat/linux/common/linux_sigaction.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sigaction.c,v 1.29 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_sigaction.c,v 1.30 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sigaction.c,v 1.29 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sigaction.c,v 1.30 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sigaction.c,v 1.29 2006/11/16 01:32:42 christo #include <sys/signal.h> #include <sys/signalvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> @@ -77,7 +76,6 @@ linux_sys_sigaction(struct lwp *l, void *v, register_t *retval) syscallarg(const struct linux_old_sigaction *) nsa; syscallarg(struct linux_old_sigaction *) osa; } */ *uap = v; - struct proc *p = l->l_proc; struct linux_old_sigaction nlsa, olsa; struct sigaction nbsa, obsa; int error, sig; @@ -100,7 +98,7 @@ linux_sys_sigaction(struct lwp *l, void *v, register_t *retval) sigemptyset(&obsa.sa_mask); obsa.sa_flags = 0; } else { - error = sigaction1(p, linux_to_native_signo[sig], + error = sigaction1(l, linux_to_native_signo[sig], SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0, NULL, 0); if (error) diff --git a/sys/compat/linux/common/linux_signal.c b/sys/compat/linux/common/linux_signal.c index 0fb144449a0..d767cf103fb 100644 --- a/sys/compat/linux/common/linux_signal.c +++ b/sys/compat/linux/common/linux_signal.c @@ -1,4 +1,5 @@ -/* $NetBSD: linux_signal.c,v 1.52 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_signal.c,v 1.53 2007/02/09 21:55:19 ad Exp $ */ + /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -54,7 +55,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.52 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.53 2007/02/09 21:55:19 ad Exp $"); #define COMPAT_LINUX 1 @@ -70,7 +71,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.52 2006/11/16 01:32:42 christos E #include <sys/signalvar.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> @@ -288,14 +288,13 @@ linux_sys_rt_sigaction(struct lwp *l, void *v, register_t *retval) syscallarg(struct linux_sigaction *) osa; syscallarg(size_t) sigsetsize; } */ *uap = v; - struct proc *p = l->l_proc; struct linux_sigaction nlsa, olsa; struct sigaction nbsa, obsa; int error, sig; void *tramp = NULL; int vers = 0; #if defined __amd64__ - struct sigacts *ps = p->p_sigacts; + struct sigacts *ps = l->l_proc->p_sigacts; #endif if (SCARG(uap, sigsetsize) != sizeof(linux_sigset_t)) @@ -324,7 +323,7 @@ linux_sys_rt_sigaction(struct lwp *l, void *v, register_t *retval) } #endif - error = sigaction1(p, linux_to_native_signo[sig], + error = sigaction1(l, linux_to_native_signo[sig], SCARG(uap, nsa) ? &nbsa : NULL, SCARG(uap, osa) ? &obsa : NULL, tramp, vers); @@ -349,12 +348,13 @@ linux_sys_rt_sigaction(struct lwp *l, void *v, register_t *retval) } int -linux_sigprocmask1(p, how, set, oset) - struct proc *p; +linux_sigprocmask1(l, how, set, oset) + struct lwp *l; int how; const linux_old_sigset_t *set; linux_old_sigset_t *oset; { + struct proc *p = l->l_proc; linux_old_sigset_t nlss, olss; sigset_t nbss, obss; int error; @@ -379,8 +379,10 @@ linux_sigprocmask1(p, how, set, oset) return (error); linux_old_to_native_sigset(&nbss, &nlss); } - error = sigprocmask1(p, how, + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, how, set ? &nbss : NULL, oset ? &obss : NULL); + mutex_exit(&p->p_smutex); if (error) return (error); if (oset) { @@ -401,9 +403,9 @@ linux_sys_rt_sigprocmask(struct lwp *l, void *v, register_t *retval) syscallarg(linux_sigset_t *) oset; syscallarg(size_t) sigsetsize; } */ *uap = v; - struct proc *p = l->l_proc; linux_sigset_t nlss, olss, *oset; const linux_sigset_t *set; + struct proc *p = l->l_proc; sigset_t nbss, obss; int error, how; @@ -433,8 +435,10 @@ linux_sys_rt_sigprocmask(struct lwp *l, void *v, register_t *retval) return (error); linux_to_native_sigset(&nbss, &nlss); } - error = sigprocmask1(p, how, + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, how, set ? &nbss : NULL, oset ? &obss : NULL); + mutex_exit(&p->p_smutex); if (!error && oset) { native_to_linux_sigset(&olss, &obss); error = copyout(&olss, oset, sizeof(olss)); @@ -449,14 +453,13 @@ linux_sys_rt_sigpending(struct lwp *l, void *v, register_t *retval) syscallarg(linux_sigset_t *) set; syscallarg(size_t) sigsetsize; } */ *uap = v; - struct proc *p = l->l_proc; sigset_t bss; linux_sigset_t lss; if (SCARG(uap, sigsetsize) != sizeof(linux_sigset_t)) return (EINVAL); - sigpending1(p, &bss); + sigpending1(l, &bss); native_to_linux_sigset(&lss, &bss); return copyout(&lss, SCARG(uap, set), sizeof(lss)); } @@ -468,11 +471,10 @@ linux_sys_sigpending(struct lwp *l, void *v, register_t *retval) struct linux_sys_sigpending_args /* { syscallarg(linux_old_sigset_t *) mask; } */ *uap = v; - struct proc *p = l->l_proc; sigset_t bss; linux_old_sigset_t lss; - sigpending1(p, &bss); + sigpending1(l, &bss); native_to_linux_old_sigset(&lss, &bss); return copyout(&lss, SCARG(uap, set), sizeof(lss)); } @@ -485,13 +487,12 @@ linux_sys_sigsuspend(struct lwp *l, void *v, register_t *retval) syscallarg(int) oldmask; syscallarg(int) mask; } */ *uap = v; - struct proc *p = l->l_proc; linux_old_sigset_t lss; sigset_t bss; lss = SCARG(uap, mask); linux_old_to_native_sigset(&bss, &lss); - return (sigsuspend1(p, &bss)); + return (sigsuspend1(l, &bss)); } #endif /* __amd64__ */ @@ -502,7 +503,6 @@ linux_sys_rt_sigsuspend(struct lwp *l, void *v, register_t *retval) syscallarg(linux_sigset_t *) unewset; syscallarg(size_t) sigsetsize; } */ *uap = v; - struct proc *p = l->l_proc; linux_sigset_t lss; sigset_t bss; int error; @@ -516,7 +516,7 @@ linux_sys_rt_sigsuspend(struct lwp *l, void *v, register_t *retval) linux_to_native_sigset(&bss, &lss); - return (sigsuspend1(p, &bss)); + return (sigsuspend1(l, &bss)); } /* @@ -606,13 +606,13 @@ linux_sys_sigaltstack(struct lwp *l, void *v, register_t *retval) syscallarg(const struct linux_sigaltstack *) ss; syscallarg(struct linux_sigaltstack *) oss; } */ *uap = v; - struct proc *p = l->l_proc; struct linux_sigaltstack ss; struct sigaltstack nss; - int error; + struct proc *p = l->l_proc; + int error = 0; if (SCARG(uap, oss)) { - native_to_linux_sigaltstack(&ss, &p->p_sigctx.ps_sigstk); + native_to_linux_sigaltstack(&ss, &l->l_sigstk); if ((error = copyout(&ss, SCARG(uap, oss), sizeof(ss))) != 0) return error; } @@ -622,20 +622,23 @@ linux_sys_sigaltstack(struct lwp *l, void *v, register_t *retval) return error; linux_to_native_sigaltstack(&nss, &ss); + mutex_enter(&p->p_smutex); + if (nss.ss_flags & ~SS_ALLBITS) - return EINVAL; - - if (nss.ss_flags & SS_DISABLE) { - if (p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK) - return EINVAL; - } else { - if (nss.ss_size < LINUX_MINSIGSTKSZ) - return ENOMEM; - } - p->p_sigctx.ps_sigstk = nss; + error = EINVAL; + else if (nss.ss_flags & SS_DISABLE) { + if (l->l_sigstk.ss_flags & SS_ONSTACK) + error = EINVAL; + } else if (nss.ss_size < LINUX_MINSIGSTKSZ) + error = ENOMEM; + + if (error == 0) + l->l_sigstk = nss; + + mutex_exit(&p->p_smutex); } - return 0; + return error; } #endif /* LINUX_SS_ONSTACK */ diff --git a/sys/compat/linux/common/linux_signal.h b/sys/compat/linux/common/linux_signal.h index 0d148545568..165bfb33bf6 100644 --- a/sys/compat/linux/common/linux_signal.h +++ b/sys/compat/linux/common/linux_signal.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_signal.h,v 1.25 2005/12/11 12:20:19 christos Exp $ */ +/* $NetBSD: linux_signal.h,v 1.26 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ extern const int native_to_linux_signo[]; extern const int linux_to_native_signo[]; __BEGIN_DECLS -int linux_sigprocmask1 __P((struct proc *, int, const linux_old_sigset_t *, +int linux_sigprocmask1 __P((struct lwp *, int, const linux_old_sigset_t *, linux_old_sigset_t *)); #if LINUX__NSIG_WORDS > 1 diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c index 1bdbadf4292..014bbeab2de 100644 --- a/sys/compat/linux/common/linux_socket.c +++ b/sys/compat/linux/common/linux_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.68 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_socket.c,v 1.69 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.68 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.69 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -76,7 +76,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.68 2006/11/16 01:32:42 christos E #include <sys/exec.h> #include <sys/kauth.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <lib/libkern/libkern.h> diff --git a/sys/compat/linux/common/linux_socketcall.c b/sys/compat/linux/common/linux_socketcall.c index 8c0b34e0878..0a1a8990c0e 100644 --- a/sys/compat/linux/common/linux_socketcall.c +++ b/sys/compat/linux/common/linux_socketcall.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socketcall.c,v 1.30 2005/12/11 12:20:19 christos Exp $ */ +/* $NetBSD: linux_socketcall.c,v 1.31 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.30 2005/12/11 12:20:19 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.31 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -59,7 +59,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_socketcall.c,v 1.30 2005/12/11 12:20:19 christ #include <sys/vnode.h> #include <sys/device.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_sysctl.c b/sys/compat/linux/common/linux_sysctl.c index 74955b984c8..11de9241240 100644 --- a/sys/compat/linux/common/linux_sysctl.c +++ b/sys/compat/linux/common/linux_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysctl.c,v 1.24 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_sysctl.c,v 1.25 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.24 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.25 2007/02/09 21:55:19 ad Exp $"); #if defined (_KERNEL_OPT) #include "opt_ktrace.h" @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.24 2006/11/16 01:32:42 christos E #include <sys/proc.h> #include <sys/mount.h> #include <sys/sysctl.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #ifdef KTRACE #include <sys/ktrace.h> diff --git a/sys/compat/linux/common/linux_termios.c b/sys/compat/linux/common/linux_termios.c index 7eb97511af8..f39c37e4537 100644 --- a/sys/compat/linux/common/linux_termios.c +++ b/sys/compat/linux/common/linux_termios.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_termios.c,v 1.27 2006/11/25 22:03:41 elad Exp $ */ +/* $NetBSD: linux_termios.c,v 1.28 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.27 2006/11/25 22:03:41 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.28 2007/02/09 21:55:19 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ptm.h" @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.27 2006/11/25 22:03:41 elad Exp #include <sys/mount.h> #include <sys/termios.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/linux/common/linux_types.h> diff --git a/sys/compat/linux/common/linux_time.c b/sys/compat/linux/common/linux_time.c index 3fdd0fa614a..7a88e12341a 100644 --- a/sys/compat/linux/common/linux_time.c +++ b/sys/compat/linux/common/linux_time.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp $ */ +/* $NetBSD: linux_time.c,v 1.15 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.15 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/ucred.h> @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp #include <sys/stdint.h> #include <sys/time.h> #include <sys/systm.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/lwp.h> #include <sys/proc.h> diff --git a/sys/compat/linux/common/linux_uselib.c b/sys/compat/linux/common/linux_uselib.c index db2063c1c06..837bf923001 100644 --- a/sys/compat/linux/common/linux_uselib.c +++ b/sys/compat/linux/common/linux_uselib.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_uselib.c,v 1.18 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_uselib.c,v 1.19 2007/02/09 21:55:19 ad Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.18 2006/11/16 01:32:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.19 2007/02/09 21:55:19 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.18 2006/11/16 01:32:42 christos E #include <sys/exec_elf.h> #include <sys/mman.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/cpu.h> diff --git a/sys/compat/linux32/arch/amd64/linux32_machdep.c b/sys/compat/linux32/arch/amd64/linux32_machdep.c index 85e5e2e052a..dd6606b1f59 100644 --- a/sys/compat/linux32/arch/amd64/linux32_machdep.c +++ b/sys/compat/linux32/arch/amd64/linux32_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_machdep.c,v 1.3 2006/11/22 13:56:09 christos Exp $ */ +/* $NetBSD: linux32_machdep.c,v 1.4 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -31,7 +31,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.3 2006/11/22 13:56:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.4 2007/02/09 21:55:21 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.3 2006/11/22 13:56:09 christos #include <sys/mount.h> #include <sys/vnode.h> #include <sys/device.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/filedesc.h> #include <sys/exec_elf.h> @@ -116,7 +115,7 @@ linux32_old_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) struct proc *p = l->l_proc; struct trapframe *tf; struct linux32_sigframe *fp, frame; - int onstack; + int onstack, error; int sig = ksi->ksi_signo; sig_t catcher = SIGACTION(p, sig).sa_handler; struct sigaltstack *sas = &p->p_sigctx.ps_sigstk; @@ -141,7 +140,12 @@ linux32_old_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) linux32_save_sigcontext(l, tf, mask, &frame.sf_sc); - if (copyout(&frame, fp, sizeof(frame)) != 0) { + sendsig_reset(l, sig); + mutex_exit(&p->p_smutex); + error = copyout(&frame, fp, sizeof(frame)); + mutex_enter(&p->p_smutex); + + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. @@ -177,9 +181,9 @@ linux32_rt_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) struct proc *p = l->l_proc; struct trapframe *tf; struct linux32_rt_sigframe *fp, frame; - int onstack; + int onstack, error; linux32_siginfo_t *lsi; - int sig = ksi->ksi_signo; + int sig = ksi->ksi_signo, error; sig_t catcher = SIGACTION(p, sig).sa_handler; struct sigaltstack *sas = &p->p_sigctx.ps_sigstk; @@ -242,9 +246,13 @@ linux32_rt_sendsig(const ksiginfo_t *ksi, const sigset_t *mask) } /* Save register context. */ + sendsig_reset(l, sig); + mutex_exit(&p->p_smutex); linux32_save_ucontext(l, tf, mask, sas, &frame.sf_uc); + error = copyout(&frame, fp, sizeof(frame)); + mutex_enter(&p->p-smutex); - if (copyout(&frame, fp, sizeof(frame)) != 0) { + if (error != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. diff --git a/sys/compat/linux32/arch/amd64/linux32_missing.c b/sys/compat/linux32/arch/amd64/linux32_missing.c index bfa9667a74f..26f1029a1aa 100644 --- a/sys/compat/linux32/arch/amd64/linux32_missing.c +++ b/sys/compat/linux32/arch/amd64/linux32_missing.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_missing.c,v 1.1 2006/02/09 19:18:57 manu Exp $ */ +/* $NetBSD: linux32_missing.c,v 1.2 2007/02/09 21:55:21 ad Exp $ */ #include "opt_compat_linux32.h" @@ -6,7 +6,6 @@ #include <sys/time.h> #include <sys/param.h> #include <sys/lwp.h> -#include <sys/sa.h> #include <sys/ucred.h> #include <sys/mount.h> #include <sys/systm.h> diff --git a/sys/compat/linux32/arch/amd64/linux32_syscalls.c b/sys/compat/linux32/arch/amd64/linux32_syscalls.c index 0bbc7d0673a..e136434fb0e 100644 --- a/sys/compat/linux32/arch/amd64/linux32_syscalls.c +++ b/sys/compat/linux32/arch/amd64/linux32_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_syscalls.c,v 1.12 2007/02/08 12:32:17 njoly Exp $ */ +/* $NetBSD: linux32_syscalls.c,v 1.13 2007/02/09 21:55:21 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_syscalls.c,v 1.12 2007/02/08 12:32:17 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_syscalls.c,v 1.13 2007/02/09 21:55:21 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_syscalls.c,v 1.12 2007/02/08 12:32:17 njoly #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/netbsd32_machdep.h> #include <compat/netbsd32/netbsd32.h> diff --git a/sys/compat/linux32/arch/amd64/linux32_sysent.c b/sys/compat/linux32/arch/amd64/linux32_sysent.c index 817774c774e..1e7e72e9372 100644 --- a/sys/compat/linux32/arch/amd64/linux32_sysent.c +++ b/sys/compat/linux32/arch/amd64/linux32_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_sysent.c,v 1.12 2007/02/08 12:32:17 njoly Exp $ */ +/* $NetBSD: linux32_sysent.c,v 1.13 2007/02/09 21:55:21 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_sysent.c,v 1.12 2007/02/08 12:32:17 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_sysent.c,v 1.13 2007/02/09 21:55:21 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_43.h" @@ -18,7 +18,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_sysent.c,v 1.12 2007/02/08 12:32:17 njoly Ex #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/netbsd32_machdep.h> #include <compat/netbsd32/netbsd32.h> diff --git a/sys/compat/linux32/arch/amd64/syscalls.master b/sys/compat/linux32/arch/amd64/syscalls.master index 8f21932c16a..4d2d8e67d5c 100644 --- a/sys/compat/linux32/arch/amd64/syscalls.master +++ b/sys/compat/linux32/arch/amd64/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.9 2007/02/08 12:29:39 njoly Exp $ + $NetBSD: syscalls.master,v 1.10 2007/02/09 21:55:21 ad Exp $ ; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file. ; (See syscalls.conf to see what it is processed into.) @@ -40,7 +40,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <machine/netbsd32_machdep.h> diff --git a/sys/compat/linux32/common/linux32_dirent.c b/sys/compat/linux32/common/linux32_dirent.c index d5fdcd5084c..c37617eba92 100644 --- a/sys/compat/linux32/common/linux32_dirent.c +++ b/sys/compat/linux32/common/linux32_dirent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_dirent.c,v 1.1 2006/02/09 19:18:57 manu Exp $ */ +/* $NetBSD: linux32_dirent.c,v 1.2 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.1 2006/02/09 19:18:57 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.2 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.1 2006/02/09 19:18:57 manu Exp #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_exec.c b/sys/compat/linux32/common/linux32_exec.c index e5a82118e0c..0ecce5f2274 100644 --- a/sys/compat/linux32/common/linux32_exec.c +++ b/sys/compat/linux32/common/linux32_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_exec.c,v 1.3 2006/08/23 19:49:09 manu Exp $ */ +/* $NetBSD: linux32_exec.c,v 1.4 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 1994-2006 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_exec.c,v 1.3 2006/08/23 19:49:09 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_exec.c,v 1.4 2007/02/09 21:55:21 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_exec.c,v 1.3 2006/08/23 19:49:09 manu Exp $" #include <sys/exec_elf.h> #include <sys/mman.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/ptrace.h> /* For proc_reparent() */ diff --git a/sys/compat/linux32/common/linux32_fcntl.c b/sys/compat/linux32/common/linux32_fcntl.c index 11dddaf5ea3..7f17c36c2f4 100644 --- a/sys/compat/linux32/common/linux32_fcntl.c +++ b/sys/compat/linux32/common/linux32_fcntl.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_fcntl.c,v 1.1 2006/02/09 19:18:57 manu Exp $ */ +/* $NetBSD: linux32_fcntl.c,v 1.2 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_fcntl.c,v 1.1 2006/02/09 19:18:57 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_fcntl.c,v 1.2 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_fcntl.c,v 1.1 2006/02/09 19:18:57 manu Exp $ #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_mman.c b/sys/compat/linux32/common/linux32_mman.c index 3c76e816066..6d33f1c0a58 100644 --- a/sys/compat/linux32/common/linux32_mman.c +++ b/sys/compat/linux32/common/linux32_mman.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_mman.c,v 1.2 2006/09/13 19:55:49 manu Exp $ */ +/* $NetBSD: linux32_mman.c,v 1.3 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_mman.c,v 1.2 2006/09/13 19:55:49 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_mman.c,v 1.3 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_mman.c,v 1.2 2006/09/13 19:55:49 manu Exp $" #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_resource.c b/sys/compat/linux32/common/linux32_resource.c index 7fef8f675fa..88940e55f94 100644 --- a/sys/compat/linux32/common/linux32_resource.c +++ b/sys/compat/linux32/common/linux32_resource.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_resource.c,v 1.2 2006/06/25 16:15:40 manu Exp $ */ +/* $NetBSD: linux32_resource.c,v 1.3 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_resource.c,v 1.2 2006/06/25 16:15:40 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_resource.c,v 1.3 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_resource.c,v 1.2 2006/06/25 16:15:40 manu Ex #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_sched.c b/sys/compat/linux32/common/linux32_sched.c index 41f1b6d9078..ebab7f0c3f1 100644 --- a/sys/compat/linux32/common/linux32_sched.c +++ b/sys/compat/linux32/common/linux32_sched.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_sched.c,v 1.2 2006/09/13 19:55:49 manu Exp $ */ +/* $NetBSD: linux32_sched.c,v 1.3 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_sched.c,v 1.2 2006/09/13 19:55:49 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_sched.c,v 1.3 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_sched.c,v 1.2 2006/09/13 19:55:49 manu Exp $ #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_socket.c b/sys/compat/linux32/common/linux32_socket.c index 3f1ac1a19e4..fafd18761d3 100644 --- a/sys/compat/linux32/common/linux32_socket.c +++ b/sys/compat/linux32/common/linux32_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_socket.c,v 1.2 2006/09/13 19:55:49 manu Exp $ */ +/* $NetBSD: linux32_socket.c,v 1.3 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.2 2006/09/13 19:55:49 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.3 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.2 2006/09/13 19:55:49 manu Exp #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_stat.c b/sys/compat/linux32/common/linux32_stat.c index 3435f3b9819..c87b3f09435 100644 --- a/sys/compat/linux32/common/linux32_stat.c +++ b/sys/compat/linux32/common/linux32_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_stat.c,v 1.1 2006/02/09 19:18:57 manu Exp $ */ +/* $NetBSD: linux32_stat.c,v 1.2 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_stat.c,v 1.1 2006/02/09 19:18:57 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_stat.c,v 1.2 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_stat.c,v 1.1 2006/02/09 19:18:57 manu Exp $" #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_sysctl.c b/sys/compat/linux32/common/linux32_sysctl.c index d93f69841d7..70648915c14 100644 --- a/sys/compat/linux32/common/linux32_sysctl.c +++ b/sys/compat/linux32/common/linux32_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_sysctl.c,v 1.3 2006/09/23 22:12:00 manu Exp $ */ +/* $NetBSD: linux32_sysctl.c,v 1.4 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -31,7 +31,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.3 2006/09/23 22:12:00 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.4 2007/02/09 21:55:21 ad Exp $"); #include "opt_ktrace.h" @@ -41,7 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.3 2006/09/23 22:12:00 manu Exp #include <sys/proc.h> #include <sys/mount.h> #include <sys/sysctl.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #ifdef KTRACE #include <sys/ktrace.h> diff --git a/sys/compat/linux32/common/linux32_sysinfo.c b/sys/compat/linux32/common/linux32_sysinfo.c index 5cf0608f1bb..932a892a225 100644 --- a/sys/compat/linux32/common/linux32_sysinfo.c +++ b/sys/compat/linux32/common/linux32_sysinfo.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_sysinfo.c,v 1.1 2006/09/13 19:55:49 manu Exp $ */ +/* $NetBSD: linux32_sysinfo.c,v 1.2 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,12 +33,11 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_sysinfo.c,v 1.1 2006/09/13 19:55:49 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_sysinfo.c,v 1.2 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> #include <sys/kernel.h> -#include <sys/sa.h> #include <sys/dirent.h> #include <sys/syscallargs.h> diff --git a/sys/compat/linux32/common/linux32_time.c b/sys/compat/linux32/common/linux32_time.c index a2b85bc18f0..f1c800337df 100644 --- a/sys/compat/linux32/common/linux32_time.c +++ b/sys/compat/linux32/common/linux32_time.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_time.c,v 1.6 2006/11/14 13:34:29 elad Exp $ */ +/* $NetBSD: linux32_time.c,v 1.7 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.6 2006/11/14 13:34:29 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.7 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -44,7 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.6 2006/11/14 13:34:29 elad Exp $" #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_unistd.c b/sys/compat/linux32/common/linux32_unistd.c index 2f02389ded5..fa2d39877a1 100644 --- a/sys/compat/linux32/common/linux32_unistd.c +++ b/sys/compat/linux32/common/linux32_unistd.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_unistd.c,v 1.4 2006/09/13 19:55:49 manu Exp $ */ +/* $NetBSD: linux32_unistd.c,v 1.5 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.4 2006/09/13 19:55:49 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.5 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.4 2006/09/13 19:55:49 manu Exp #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_utsname.c b/sys/compat/linux32/common/linux32_utsname.c index 2e063f5287d..c0e0356af0c 100644 --- a/sys/compat/linux32/common/linux32_utsname.c +++ b/sys/compat/linux32/common/linux32_utsname.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_utsname.c,v 1.1 2006/02/09 19:18:57 manu Exp $ */ +/* $NetBSD: linux32_utsname.c,v 1.2 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_utsname.c,v 1.1 2006/02/09 19:18:57 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_utsname.c,v 1.2 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_utsname.c,v 1.1 2006/02/09 19:18:57 manu Exp #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/linux32/common/linux32_wait.c b/sys/compat/linux32/common/linux32_wait.c index 906dabd7784..9cfbbd92d3b 100644 --- a/sys/compat/linux32/common/linux32_wait.c +++ b/sys/compat/linux32/common/linux32_wait.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_wait.c,v 1.1 2006/02/09 19:18:57 manu Exp $ */ +/* $NetBSD: linux32_wait.c,v 1.2 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_wait.c,v 1.1 2006/02/09 19:18:57 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_wait.c,v 1.2 2007/02/09 21:55:21 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_wait.c,v 1.1 2006/02/09 19:18:57 manu Exp $" #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/select.h> -#include <sys/sa.h> #include <sys/proc.h> #include <sys/ucred.h> #include <sys/swap.h> diff --git a/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_syscalls.c b/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_syscalls.c index 38016f0c745..948a0209db8 100644 --- a/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_syscalls.c +++ b/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_fasttraps_syscalls.c,v 1.11 2005/12/11 12:20:21 christos Exp $ */ +/* $NetBSD: mach_fasttraps_syscalls.c,v 1.12 2007/02/09 21:55:22 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_syscalls.c,v 1.11 2005/12/11 12:20:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_syscalls.c,v 1.12 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include <sys/param.h> @@ -16,7 +16,6 @@ __KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_syscalls.c,v 1.11 2005/12/11 12:20:21 #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> #include <compat/mach/arch/powerpc/fasttraps/mach_fasttraps_syscallargs.h> diff --git a/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_sysent.c b/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_sysent.c index 3dd32e0528d..55ccc67a7bd 100644 --- a/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_sysent.c +++ b/sys/compat/mach/arch/powerpc/fasttraps/mach_fasttraps_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_fasttraps_sysent.c,v 1.11 2005/12/11 12:20:21 christos Exp $ */ +/* $NetBSD: mach_fasttraps_sysent.c,v 1.12 2007/02/09 21:55:22 ad Exp $ */ /* * System call switch table. @@ -8,14 +8,13 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_sysent.c,v 1.11 2005/12/11 12:20:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_sysent.c,v 1.12 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> #include <compat/mach/arch/powerpc/fasttraps/mach_fasttraps_syscallargs.h> diff --git a/sys/compat/mach/arch/powerpc/fasttraps/syscalls.master b/sys/compat/mach/arch/powerpc/fasttraps/syscalls.master index fbf32c6ba9f..8b217c10799 100644 --- a/sys/compat/mach/arch/powerpc/fasttraps/syscalls.master +++ b/sys/compat/mach/arch/powerpc/fasttraps/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.6 2005/12/11 12:20:21 christos Exp $ + $NetBSD: syscalls.master,v 1.7 2007/02/09 21:55:22 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -37,7 +37,6 @@ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> diff --git a/sys/compat/mach/arch/powerpc/ppccalls/mach_ppccalls_syscalls.c b/sys/compat/mach/arch/powerpc/ppccalls/mach_ppccalls_syscalls.c index 37591671a6c..69f21cf0f4e 100644 --- a/sys/compat/mach/arch/powerpc/ppccalls/mach_ppccalls_syscalls.c +++ b/sys/compat/mach/arch/powerpc/ppccalls/mach_ppccalls_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_ppccalls_syscalls.c,v 1.6 2005/12/11 12:20:22 christos Exp $ */ +/* $NetBSD: mach_ppccalls_syscalls.c,v 1.7 2007/02/09 21:55:22 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_ppccalls_syscalls.c,v 1.6 2005/12/11 12:20:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_ppccalls_syscalls.c,v 1.7 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include <sys/param.h> @@ -16,7 +16,6 @@ __KERNEL_RCSID(0, "$NetBSD: mach_ppccalls_syscalls.c,v 1.6 2005/12/11 12:20:22 c #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> #include <compat/mach/mach_message.h> diff --git a/sys/compat/mach/arch/powerpc/ppccalls/mach_ppccalls_sysent.c b/sys/compat/mach/arch/powerpc/ppccalls/mach_ppccalls_sysent.c index daa3280e63c..393dbe883fb 100644 --- a/sys/compat/mach/arch/powerpc/ppccalls/mach_ppccalls_sysent.c +++ b/sys/compat/mach/arch/powerpc/ppccalls/mach_ppccalls_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_ppccalls_sysent.c,v 1.6 2005/12/11 12:20:22 christos Exp $ */ +/* $NetBSD: mach_ppccalls_sysent.c,v 1.7 2007/02/09 21:55:22 ad Exp $ */ /* * System call switch table. @@ -8,14 +8,13 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_ppccalls_sysent.c,v 1.6 2005/12/11 12:20:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_ppccalls_sysent.c,v 1.7 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> #include <compat/mach/mach_message.h> diff --git a/sys/compat/mach/arch/powerpc/ppccalls/syscalls.master b/sys/compat/mach/arch/powerpc/ppccalls/syscalls.master index 8710a3346c2..4ec3cb924fa 100644 --- a/sys/compat/mach/arch/powerpc/ppccalls/syscalls.master +++ b/sys/compat/mach/arch/powerpc/ppccalls/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.4 2005/12/11 12:20:22 christos Exp $ + $NetBSD: syscalls.master,v 1.5 2007/02/09 21:55:22 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -37,7 +37,6 @@ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> diff --git a/sys/compat/mach/mach_exception.c b/sys/compat/mach/mach_exception.c index 4c4c8c513bb..58990eae936 100644 --- a/sys/compat/mach/mach_exception.c +++ b/sys/compat/mach/mach_exception.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_exception.c,v 1.8 2006/03/07 03:32:06 thorpej Exp $ */ +/* $NetBSD: mach_exception.c,v 1.9 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_exception.c,v 1.8 2006/03/07 03:32:06 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_exception.c,v 1.9 2007/02/09 21:55:21 ad Exp $"); #include "opt_compat_darwin.h" @@ -75,9 +75,7 @@ static void mach_siginfo_to_exception(const struct ksiginfo *, int *); * mach_trapinfo1 and handle signals if it gets a non zero return value. */ void -mach_trapsignal(l, ksi) - struct lwp *l; - const struct ksiginfo *ksi; +mach_trapsignal(struct lwp *l, struct ksiginfo *ksi) { if (mach_trapsignal1(l, ksi) != 0) trapsignal(l, ksi); @@ -85,9 +83,7 @@ mach_trapsignal(l, ksi) } int -mach_trapsignal1(l, ksi) - struct lwp *l; - const struct ksiginfo *ksi; +mach_trapsignal1(struct lwp *l, struct ksiginfo *ksi) { struct proc *p = l->l_proc; struct mach_emuldata *med; @@ -161,18 +157,17 @@ mach_exception(exc_l, exc, code) * the process at the time it dies. */ if (mach_exception_hang) { - int s; struct proc *p = exc_l->l_proc; - sigminusset(&contsigmask, &p->p_sigctx.ps_siglist); - SCHED_LOCK(s); + sigminusset(&contsigmask, &exc_l->l_sigpendset->sp_set); + lwp_lock(exc_l); p->p_pptr->p_nstopchild++; p->p_stat = SSTOP; exc_l->l_stat = LSSTOP; p->p_nrlwps--; + KERNEL_UNLOCK_ALL(exc_l, &exc_l->l_biglocks); mi_switch(exc_l, NULL); - SCHED_ASSERT_UNLOCKED(); - splx(s); + KERNEL_LOCK(exc_l->l_biglocks, exc_l); } /* @@ -223,8 +218,8 @@ mach_exception(exc_l, exc, code) * a dying parent, a signal is sent instead of the * notification, this fixes the problem. */ - if ((exc_l->l_proc->p_flag & P_TRACED) && - (exc_l->l_proc->p_pptr->p_flag & P_WEXIT)) { + if ((exc_l->l_proc->p_slflag & PSL_TRACED) && + (exc_l->l_proc->p_pptr->p_sflag & PS_WEXIT)) { #ifdef DEBUG_MACH printf("mach_exception: deadlock avoided\n"); #endif diff --git a/sys/compat/mach/mach_exception.h b/sys/compat/mach/mach_exception.h index c3a1c9c017f..281964c9617 100644 --- a/sys/compat/mach/mach_exception.h +++ b/sys/compat/mach/mach_exception.h @@ -1,4 +1,4 @@ -/* $NetBSD: mach_exception.h,v 1.6 2005/12/11 12:20:20 christos Exp $ */ +/* $NetBSD: mach_exception.h,v 1.7 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -159,8 +159,8 @@ struct mach_exc_info { int mei_behavior; }; -void mach_trapsignal(struct lwp *, const struct ksiginfo *); -int mach_trapsignal1(struct lwp *, const struct ksiginfo *); +void mach_trapsignal(struct lwp *, struct ksiginfo *); +int mach_trapsignal1(struct lwp *, struct ksiginfo *); int mach_exception(struct lwp *, int, int *); #endif /* _MACH_EXCEPTION_H_ */ diff --git a/sys/compat/mach/mach_exec.c b/sys/compat/mach/mach_exec.c index 44082987d3e..16bfe70ac77 100644 --- a/sys/compat/mach/mach_exec.c +++ b/sys/compat/mach/mach_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_exec.c,v 1.61 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: mach_exec.c,v 1.62 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2001-2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_exec.c,v 1.61 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_exec.c,v 1.62 2007/02/09 21:55:21 ad Exp $"); #include "opt_syscall_debug.h" @@ -122,7 +122,7 @@ const struct emul emul_mach = { uvm_default_mapaddr, NULL, /* e_usertrap */ - NULL, /* e_sa */ + 0, /* e_ucsize */ }; /* @@ -204,7 +204,7 @@ mach_e_proc_exec(p, epp) mach_e_proc_init(p, p->p_vmspace); if (p->p_emul != epp->ep_es->es_emul) - mach_e_lwp_fork(NULL, proc_representative_lwp(p)); + mach_e_lwp_fork(NULL, proc_representative_lwp(p, NULL, 1)); return; } @@ -367,7 +367,7 @@ mach_e_proc_exit(p) int i; /* There is only one lwp remaining... */ - mach_e_lwp_exit(proc_representative_lwp(p)); + mach_e_lwp_exit(proc_representative_lwp(p, NULL, 1)); med = (struct mach_emuldata *)p->p_emuldata; diff --git a/sys/compat/mach/mach_message.c b/sys/compat/mach/mach_message.c index bc7f2402df7..daaa6466850 100644 --- a/sys/compat/mach/mach_message.c +++ b/sys/compat/mach/mach_message.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_message.c,v 1.49 2006/09/23 03:34:19 jmcneill Exp $ */ +/* $NetBSD: mach_message.c,v 1.50 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2002-2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_message.c,v 1.49 2006/09/23 03:34:19 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_message.c,v 1.50 2007/02/09 21:55:21 ad Exp $"); #include "opt_ktrace.h" #include "opt_compat_mach.h" /* For COMPAT_MACH in <sys/ktrace.h> */ @@ -710,7 +710,7 @@ mach_get_target_task(l, mp) switch (mp->mp_datatype) { case MACH_MP_PROC: tp = (struct proc *)mp->mp_data; - tl = proc_representative_lwp(tp); + tl = proc_representative_lwp(tp, NULL, 1); break; case MACH_MP_LWP: diff --git a/sys/compat/mach/mach_misc.c b/sys/compat/mach/mach_misc.c index f9bb264ffdf..8fac6d107ff 100644 --- a/sys/compat/mach/mach_misc.c +++ b/sys/compat/mach/mach_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_misc.c,v 1.24 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: mach_misc.c,v 1.25 2007/02/09 21:55:21 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_misc.c,v 1.24 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_misc.c,v 1.25 2007/02/09 21:55:21 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -76,7 +76,6 @@ __KERNEL_RCSID(0, "$NetBSD: mach_misc.c,v 1.24 2006/11/16 01:32:44 christos Exp #include <sys/signalvar.h> #include <netinet/in.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <miscfs/specfs/specdev.h> diff --git a/sys/compat/mach/mach_syscalls.c b/sys/compat/mach/mach_syscalls.c index 9acb1a12f37..684e002b03a 100644 --- a/sys/compat/mach/mach_syscalls.c +++ b/sys/compat/mach/mach_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_syscalls.c,v 1.17 2005/12/11 12:20:20 christos Exp $ */ +/* $NetBSD: mach_syscalls.c,v 1.18 2007/02/09 21:55:22 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_syscalls.c,v 1.17 2005/12/11 12:20:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_syscalls.c,v 1.18 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: mach_syscalls.c,v 1.17 2005/12/11 12:20:20 christos #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> #include <compat/mach/mach_message.h> diff --git a/sys/compat/mach/mach_sysent.c b/sys/compat/mach/mach_sysent.c index 216686dc9cc..0ca9121fbd9 100644 --- a/sys/compat/mach/mach_sysent.c +++ b/sys/compat/mach/mach_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_sysent.c,v 1.18 2005/12/11 12:20:20 christos Exp $ */ +/* $NetBSD: mach_sysent.c,v 1.19 2007/02/09 21:55:22 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_sysent.c,v 1.18 2005/12/11 12:20:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_sysent.c,v 1.19 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: mach_sysent.c,v 1.18 2005/12/11 12:20:20 christos Ex #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> #include <compat/mach/mach_message.h> diff --git a/sys/compat/mach/mach_task.c b/sys/compat/mach/mach_task.c index 70e7d112960..b3c8d4d2832 100644 --- a/sys/compat/mach/mach_task.c +++ b/sys/compat/mach/mach_task.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_task.c,v 1.63 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: mach_task.c,v 1.64 2007/02/09 21:55:22 ad Exp $ */ /*- * Copyright (c) 2002-2003 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include "opt_compat_darwin.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.63 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.64 2007/02/09 21:55:22 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.63 2007/01/29 01:52:44 hubertf Exp $ #include <sys/ktrace.h> #include <sys/resourcevar.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/mount.h> #include <sys/syscallargs.h> #include <sys/kauth.h> @@ -570,14 +569,17 @@ mach_task_suspend(args) case LSSLEEP: case LSSUSPENDED: case LSZOMB: - case LSDEAD: break; default: return mach_msg_error(args, 0); break; } } - proc_stop(tp, 0); + mutex_enter(&proclist_mutex); + mutex_enter(&tp->p_smutex); + proc_stop(tp, 0, SIGSTOP); + mutex_enter(&tp->p_smutex); + mutex_enter(&proclist_mutex); *msglen = sizeof(*rep); mach_set_header(rep, req, *msglen); @@ -611,7 +613,11 @@ mach_task_resume(args) #ifdef DEBUG_MACH printf("resuming pid %d\n", tp->p_pid); #endif + mutex_enter(&proclist_mutex); + mutex_enter(&tp->p_smutex); (void)proc_unstop(tp); + mutex_enter(&tp->p_smutex); + mutex_enter(&proclist_mutex); *msglen = sizeof(*rep); mach_set_header(rep, req, *msglen); diff --git a/sys/compat/mach/mach_thread.c b/sys/compat/mach/mach_thread.c index e3e65b91057..367152e77a0 100644 --- a/sys/compat/mach/mach_thread.c +++ b/sys/compat/mach/mach_thread.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_thread.c,v 1.38 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: mach_thread.c,v 1.39 2007/02/09 21:55:22 ad Exp $ */ /*- * Copyright (c) 2002-2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_thread.c,v 1.38 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_thread.c,v 1.39 2007/02/09 21:55:22 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -49,8 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: mach_thread.c,v 1.38 2006/11/16 01:32:44 christos Ex #include <sys/proc.h> #include <sys/resource.h> #include <sys/resourcevar.h> -#include <sys/sa.h> -#include <sys/savar.h> #include <compat/mach/mach_types.h> #include <compat/mach/mach_message.h> @@ -117,22 +115,19 @@ mach_sys_swtch_pri(struct lwp *l, void *v, register_t *retval) syscallarg(int) pri; } */ *uap = v; #endif - int s; /* * Copied from preempt(9). We cannot just call preempt * because we want to return mi_switch(9) return value. */ - SCHED_LOCK(s); - l->l_priority = l->l_usrpri; - l->l_stat = LSRUN; - setrunqueue(l); - l->l_proc->p_stats->p_ru.ru_nivcsw++; + KERNEL_UNLOCK_ALL(l, &l->l_biglocks); + lwp_lock(l); + if (l->l_stat == LSONPROC) { + l->l_priority = l->l_usrpri; + l->l_proc->p_stats->p_ru.ru_nivcsw++; /* XXXSMP */ + } *retval = mi_switch(l, NULL); - SCHED_ASSERT_UNLOCKED(); - splx(s); - if ((l->l_flag & L_SA) != 0 && *retval != 0) - sa_preempt(l); + KERNEL_LOCK(l->l_biglocks, l); return 0; } @@ -192,7 +187,6 @@ mach_thread_create_running(args) int flags; int error; int inmem; - int s; int end_offset; /* Sanity check req_count */ @@ -220,12 +214,14 @@ mach_thread_create_running(args) /* * Make the child runnable. */ - SCHED_LOCK(s); + mutex_enter(&p->p_smutex); + lwp_lock(mctc.mctc_lwp); mctc.mctc_lwp->l_private = 0; mctc.mctc_lwp->l_stat = LSRUN; setrunqueue(mctc.mctc_lwp); p->p_nrlwps++; - SCHED_UNLOCK(s); + lwp_unlock(mctc.mctc_lwp); + mutex_exit(&p->p_smutex); /* * Get the child's kernel port @@ -410,9 +406,13 @@ mach_thread_suspend(args) size_t *msglen = args->rsize; struct lwp *l = args->l; struct lwp *tl = args->tl; + struct proc *p = tl->l_proc; int error; + mutex_enter(&p->p_mutex); + lwp_lock(tl); error = lwp_suspend(l, tl); + mutex_exit(&p->p_mutex); *msglen = sizeof(*rep); mach_set_header(rep, req, *msglen); @@ -430,8 +430,12 @@ mach_thread_resume(args) mach_thread_resume_reply_t *rep = args->rmsg; size_t *msglen = args->rsize; struct lwp *tl = args->tl; + struct proc *p = tl->l_proc; + mutex_enter(&p->p_mutex); + lwp_lock(tl); lwp_continue(tl); + mutex_exit(&p->p_mutex); *msglen = sizeof(*rep); mach_set_header(rep, req, *msglen); diff --git a/sys/compat/mach/mach_vm.c b/sys/compat/mach/mach_vm.c index 4f0223656d0..6329c8e41c0 100644 --- a/sys/compat/mach/mach_vm.c +++ b/sys/compat/mach/mach_vm.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_vm.c,v 1.53 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: mach_vm.c,v 1.54 2007/02/09 21:55:22 ad Exp $ */ /*- * Copyright (c) 2002-2003 The NetBSD Foundation, Inc. @@ -39,14 +39,13 @@ #include "opt_ktrace.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mach_vm.c,v 1.53 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_vm.c,v 1.54 2007/02/09 21:55:22 ad Exp $"); #include <sys/types.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/mount.h> #include <sys/proc.h> -#include <sys/sa.h> #include <sys/mman.h> #include <sys/malloc.h> #include <sys/vnode.h> diff --git a/sys/compat/mach/syscalls.master b/sys/compat/mach/syscalls.master index 87b25c6c5d2..f0c860db2fa 100644 --- a/sys/compat/mach/syscalls.master +++ b/sys/compat/mach/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.8 2005/12/11 12:20:20 christos Exp $ + $NetBSD: syscalls.master,v 1.9 2007/02/09 21:55:22 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -42,7 +42,6 @@ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/mach/mach_types.h> diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index d2fc39865b0..1279f4c03bd 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.60.2.5 2005/04/01 17:14:20 wpaul Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: kern_ndis.c,v 1.8 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_ndis.c,v 1.9 2007/02/09 21:55:22 ad Exp $"); #endif #include <sys/param.h> @@ -938,11 +938,11 @@ ndis_thsuspend(p, m, timo) */ if (m != NULL) { //mtx_unlock(m); - error = ltsleep(&p->p_siglist, curlwp->l_priority, + error = ltsleep(&p->p_sigpend.sp_set, curlwp->l_priority, "ndissp", timo, m); //mtx_lock(m); } else { - error = ltsleep(&p->p_siglist, curlwp->l_priority/*|PNORELOCK*/, + error = ltsleep(&p->p_sigpend.sp_set, curlwp->l_priority/*|PNORELOCK*/, "ndissp", timo, 0 /*&p->p_lock*/); } @@ -955,7 +955,7 @@ void ndis_thresume(p) struct proc *p; { - wakeup(&p->p_siglist); + wakeup(&p->p_sigpend.sp_set); return; } diff --git a/sys/compat/netbsd32/netbsd32.h b/sys/compat/netbsd32/netbsd32.h index 581ff0a67f5..ca6737c4cf3 100644 --- a/sys/compat/netbsd32/netbsd32.h +++ b/sys/compat/netbsd32/netbsd32.h @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.56 2006/11/21 15:02:18 christos Exp $ */ +/* $NetBSD: netbsd32.h,v 1.57 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -42,7 +42,6 @@ #include <sys/mount.h> #include <sys/stat.h> #include <sys/statvfs.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/ipc.h> #include <sys/shm.h> @@ -291,13 +290,6 @@ struct netbsd32_msqid_ds14 { netbsd32_long msg_pad4[4]; }; -/* from <sys/sa.h> */ -typedef netbsd32_pointer_t netbsd32_sa_upcall_t; -typedef netbsd32_pointer_t netbsd32_sa_upcallp_t; - -void netbsd32_cpu_upcall(struct lwp *, int, int, int, void *, void *, - void *, sa_upcall_t); - /* from <sys/sem.h> */ typedef netbsd32_pointer_t netbsd32_semp_t; diff --git a/sys/compat/netbsd32/netbsd32_compat_09.c b/sys/compat/netbsd32/netbsd32_compat_09.c index e99ec24798b..22486c1b904 100644 --- a/sys/compat/netbsd32/netbsd32_compat_09.c +++ b/sys/compat/netbsd32/netbsd32_compat_09.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_09.c,v 1.13 2005/12/11 12:20:22 christos Exp $ */ +/* $NetBSD: netbsd32_compat_09.c,v 1.14 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998 Matthew R. Green @@ -29,12 +29,11 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_09.c,v 1.13 2005/12/11 12:20:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_09.c,v 1.14 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/time.h> diff --git a/sys/compat/netbsd32/netbsd32_compat_10.c b/sys/compat/netbsd32/netbsd32_compat_10.c index 6e94410eacc..1f07d6d49c7 100644 --- a/sys/compat/netbsd32/netbsd32_compat_10.c +++ b/sys/compat/netbsd32/netbsd32_compat_10.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_10.c,v 1.16 2005/11/10 18:47:53 christos Exp $ */ +/* $NetBSD: netbsd32_compat_10.c,v 1.17 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1994 Adam Glass and Charles M. Hannum. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_10.c,v 1.16 2005/11/10 18:47:53 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_10.c,v 1.17 2007/02/09 21:55:22 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_sysv.h" @@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_10.c,v 1.16 2005/11/10 18:47:53 chri #include <sys/malloc.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/netbsd32/netbsd32.h> diff --git a/sys/compat/netbsd32/netbsd32_compat_12.c b/sys/compat/netbsd32/netbsd32_compat_12.c index ec9ca0b6408..6623d37cf59 100644 --- a/sys/compat/netbsd32/netbsd32_compat_12.c +++ b/sys/compat/netbsd32/netbsd32_compat_12.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_12.c,v 1.20 2005/12/11 12:20:22 christos Exp $ */ +/* $NetBSD: netbsd32_compat_12.c,v 1.21 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.20 2005/12/11 12:20:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.21 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.20 2005/12/11 12:20:22 chri #include <sys/proc.h> #include <sys/stat.h> #include <sys/swap.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/stat.h> diff --git a/sys/compat/netbsd32/netbsd32_compat_13.c b/sys/compat/netbsd32/netbsd32_compat_13.c index 8bc8c2cd3df..e0d3b2d4da8 100644 --- a/sys/compat/netbsd32/netbsd32_compat_13.c +++ b/sys/compat/netbsd32/netbsd32_compat_13.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_13.c,v 1.15 2005/12/11 12:20:22 christos Exp $ */ +/* $NetBSD: netbsd32_compat_13.c,v 1.16 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.15 2005/12/11 12:20:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.16 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -37,7 +37,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.15 2005/12/11 12:20:22 chri #include <sys/proc.h> #include <sys/signal.h> #include <sys/signalvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/netbsd32/netbsd32.h> @@ -113,7 +112,6 @@ compat_13_netbsd32_sigprocmask(l, v, retval) void *v; register_t *retval; { - struct proc *p = l->l_proc; struct compat_13_netbsd32_sigprocmask_args /* { syscallarg(int) how; syscallarg(int) mask; @@ -124,7 +122,7 @@ compat_13_netbsd32_sigprocmask(l, v, retval) ness = SCARG(uap, mask); native_sigset13_to_sigset(&ness, &nbss); - error = sigprocmask1(p, SCARG(uap, how), &nbss, &obss); + error = sigprocmask1(l, SCARG(uap, how), &nbss, &obss); if (error) return (error); native_sigset_to_sigset13(&obss, &oess); @@ -146,5 +144,5 @@ compat_13_netbsd32_sigsuspend(l, v, retval) ess = SCARG(uap, mask); native_sigset13_to_sigset(&ess, &bss); - return (sigsuspend1(l->l_proc, &bss)); + return (sigsuspend1(l, &bss)); } diff --git a/sys/compat/netbsd32/netbsd32_compat_14.c b/sys/compat/netbsd32/netbsd32_compat_14.c index a4279919a6e..904abcf943d 100644 --- a/sys/compat/netbsd32/netbsd32_compat_14.c +++ b/sys/compat/netbsd32/netbsd32_compat_14.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_14.c,v 1.13 2006/07/23 22:06:09 ad Exp $ */ +/* $NetBSD: netbsd32_compat_14.c,v 1.14 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1999 Eduardo E. Horvath @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_14.c,v 1.13 2006/07/23 22:06:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_14.c,v 1.14 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/ipc.h> @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_14.c,v 1.13 2006/07/23 22:06:09 ad E #define SYSVSHM #endif -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/netbsd32/netbsd32.h> #include <compat/netbsd32/netbsd32_syscallargs.h> diff --git a/sys/compat/netbsd32/netbsd32_compat_20.c b/sys/compat/netbsd32/netbsd32_compat_20.c index 1e987b6a84d..533b7b12919 100644 --- a/sys/compat/netbsd32/netbsd32_compat_20.c +++ b/sys/compat/netbsd32/netbsd32_compat_20.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_20.c,v 1.6 2006/07/31 16:34:43 martin Exp $ */ +/* $NetBSD: netbsd32_compat_20.c,v 1.7 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_20.c,v 1.6 2006/07/31 16:34:43 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_20.c,v 1.7 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_20.c,v 1.6 2006/07/31 16:34:43 marti #include <sys/file.h> #include <sys/filedesc.h> #include <sys/namei.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/proc.h> #include <sys/dirent.h> diff --git a/sys/compat/netbsd32/netbsd32_compat_30.c b/sys/compat/netbsd32/netbsd32_compat_30.c index 51dae7da782..9adb38afbbc 100644 --- a/sys/compat/netbsd32/netbsd32_compat_30.c +++ b/sys/compat/netbsd32/netbsd32_compat_30.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_30.c,v 1.15 2006/11/14 13:34:29 elad Exp $ */ +/* $NetBSD: netbsd32_compat_30.c,v 1.16 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_30.c,v 1.15 2006/11/14 13:34:29 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_30.c,v 1.16 2007/02/09 21:55:22 ad Exp $"); #include "opt_nfsserver.h" @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_30.c,v 1.15 2006/11/14 13:34:29 elad #include <sys/file.h> #include <sys/filedesc.h> #include <sys/namei.h> -#include <sys/sa.h> #include <sys/statvfs.h> #include <sys/syscallargs.h> #include <sys/proc.h> diff --git a/sys/compat/netbsd32/netbsd32_compat_43.c b/sys/compat/netbsd32/netbsd32_compat_43.c index 5c09d3702d2..8463eb5013e 100644 --- a/sys/compat/netbsd32/netbsd32_compat_43.c +++ b/sys/compat/netbsd32/netbsd32_compat_43.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_43.c,v 1.34 2005/12/11 12:20:22 christos Exp $ */ +/* $NetBSD: netbsd32_compat_43.c,v 1.35 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.34 2005/12/11 12:20:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.35 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_43.h" @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.34 2005/12/11 12:20:22 chri #include <sys/socket.h> #include <sys/proc.h> #include <sys/stat.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/time.h> #include <sys/ucred.h> diff --git a/sys/compat/netbsd32/netbsd32_execve.c b/sys/compat/netbsd32/netbsd32_execve.c index 65b35384bc2..e8cbe5103af 100644 --- a/sys/compat/netbsd32/netbsd32_execve.c +++ b/sys/compat/netbsd32/netbsd32_execve.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_execve.c,v 1.26 2006/03/07 03:32:06 thorpej Exp $ */ +/* $NetBSD: netbsd32_execve.c,v 1.27 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -30,7 +30,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.26 2006/03/07 03:32:06 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.27 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -39,7 +39,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.26 2006/03/07 03:32:06 thorpej #include <sys/vnode.h> #include <sys/file.h> #include <sys/filedesc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/proc.h> #include <sys/exec.h> diff --git a/sys/compat/netbsd32/netbsd32_fs.c b/sys/compat/netbsd32/netbsd32_fs.c index f36dd64ae88..42357596545 100644 --- a/sys/compat/netbsd32/netbsd32_fs.c +++ b/sys/compat/netbsd32/netbsd32_fs.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_fs.c,v 1.34 2006/11/14 13:34:29 elad Exp $ */ +/* $NetBSD: netbsd32_fs.c,v 1.35 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.34 2006/11/14 13:34:29 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.35 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.34 2006/11/14 13:34:29 elad Exp $" #include <sys/file.h> #include <sys/filedesc.h> #include <sys/namei.h> -#include <sys/sa.h> #include <sys/statvfs.h> #include <sys/syscallargs.h> #include <sys/proc.h> diff --git a/sys/compat/netbsd32/netbsd32_ioctl.c b/sys/compat/netbsd32/netbsd32_ioctl.c index ccfd9fb10be..2fe778e9560 100644 --- a/sys/compat/netbsd32/netbsd32_ioctl.c +++ b/sys/compat/netbsd32/netbsd32_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.27 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.28 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.27 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.28 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -50,7 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.27 2007/01/29 01:52:44 hubertf #include <sys/socket.h> #include <sys/ttycom.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #ifdef __sparc__ diff --git a/sys/compat/netbsd32/netbsd32_ipc.c b/sys/compat/netbsd32/netbsd32_ipc.c index dbbd06c3dcc..6ff355caff5 100644 --- a/sys/compat/netbsd32/netbsd32_ipc.c +++ b/sys/compat/netbsd32/netbsd32_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ipc.c,v 1.9 2006/07/23 22:06:09 ad Exp $ */ +/* $NetBSD: netbsd32_ipc.c,v 1.10 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ipc.c,v 1.9 2006/07/23 22:06:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ipc.c,v 1.10 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -44,7 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_ipc.c,v 1.9 2006/07/23 22:06:09 ad Exp $"); #include <sys/mount.h> #include <sys/dirent.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/proc.h> diff --git a/sys/compat/netbsd32/netbsd32_netbsd.c b/sys/compat/netbsd32/netbsd32_netbsd.c index 137359f0652..cf0c9a8a966 100644 --- a/sys/compat/netbsd32/netbsd32_netbsd.c +++ b/sys/compat/netbsd32/netbsd32_netbsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.115 2006/11/21 18:50:01 christos Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.116 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.115 2006/11/21 18:50:01 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.116 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -80,8 +80,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.115 2006/11/21 18:50:01 christ #include <uvm/uvm_extern.h> -#include <sys/sa.h> -#include <sys/savar.h> #include <sys/syscallargs.h> #include <sys/proc.h> #include <sys/acct.h> @@ -94,7 +92,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.115 2006/11/21 18:50:01 christ #include <compat/netbsd32/netbsd32_syscall.h> #include <compat/netbsd32/netbsd32_syscallargs.h> #include <compat/netbsd32/netbsd32_conv.h> -#include <compat/netbsd32/netbsd32_sa.h> #include <machine/frame.h> @@ -121,17 +118,6 @@ struct uvm_object *emul_netbsd32_object; extern struct sysctlnode netbsd32_sysctl_root; -const struct sa_emul saemul_netbsd32 = { - sizeof(ucontext32_t), - sizeof(struct netbsd32_sa_t), - sizeof(netbsd32_sa_tp), - netbsd32_sacopyout, - netbsd32_upcallconv, - netbsd32_cpu_upcall, - (void (*)(struct lwp *, void *))getucontext32, - netbsd32_sa_ucsp -}; - const struct emul emul_netbsd32 = { "netbsd32", "/emul/netbsd32", @@ -175,7 +161,7 @@ const struct emul emul_netbsd32 = { netbsd32_vm_default_addr, NULL, - &saemul_netbsd32, + sizeof(ucontext32_t), }; /* @@ -2326,7 +2312,8 @@ netbsd32_adjust_limits(struct proc *p) struct rlimit val[__arraycount(lm)]; size_t i; int needcopy = 0; - + + mutex_enter(&p->p_mutex); for (i = 0; i < __arraycount(val); i++) { val[i] = p->p_rlimit[lm[i].id]; if (LIMITCHECK(val[i].rlim_cur, lm[i].lim)) { @@ -2339,19 +2326,23 @@ netbsd32_adjust_limits(struct proc *p) } } - if (needcopy == 0) + if (needcopy == 0) { + mutex_exit(&p->p_mutex); return; + } if (p->p_limit->p_refcnt > 1 && (p->p_limit->p_lflags & PL_SHAREMOD) == 0) { struct plimit *oldplim; - p->p_limit = limcopy(oldplim = p->p_limit); + oldplim = p->p_limit; + p->p_limit = limcopy(p); limfree(oldplim); } for (i = 0; i < __arraycount(val); i++) p->p_rlimit[lm[i].id] = val[i]; + mutex_exit(&p->p_mutex); } int diff --git a/sys/compat/netbsd32/netbsd32_sa.c b/sys/compat/netbsd32/netbsd32_sa.c index add38018fda..06169d394f2 100644 --- a/sys/compat/netbsd32/netbsd32_sa.c +++ b/sys/compat/netbsd32/netbsd32_sa.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_sa.c,v 1.2 2006/06/25 08:11:06 yamt Exp $ */ +/* $NetBSD: netbsd32_sa.c,v 1.3 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation. @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_sa.c,v 1.2 2006/06/25 08:11:06 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_sa.c,v 1.3 2007/02/09 21:55:22 ad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -42,89 +42,11 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_sa.c,v 1.2 2006/06/25 08:11:06 yamt Exp $") #include <sys/dirent.h> #include <sys/mount.h> #include <sys/proc.h> -#include <sys/sa.h> -#include <sys/savar.h> #include <sys/syscallargs.h> #include <compat/netbsd32/netbsd32.h> #include <compat/netbsd32/netbsd32_syscallargs.h> #include <compat/netbsd32/netbsd32_conv.h> -#include <compat/netbsd32/netbsd32_sa.h> - -/* SA emulation helpers */ -int -netbsd32_sacopyout(int type, const void *src, void *dst) -{ - switch (type) { - case SAOUT_UCONTEXT: - { - const ucontext_t *u = src; - ucontext32_t u32; - - memset(&u32, 0, sizeof(u32)); - u32.uc_flags = u->uc_flags; - u32.uc_stack.ss_sp = (uintptr_t)u->uc_stack.ss_sp; - u32.uc_stack.ss_size = u->uc_stack.ss_size; - u32.uc_stack.ss_flags = u->uc_stack.ss_flags; - - return copyout(&u32, dst, sizeof(u32)); - } break; - case SAOUT_SA_T: - { - const struct sa_t *sa = src; - struct netbsd32_sa_t sa32; - - sa32.sa_id = sa->sa_id; - sa32.sa_cpu = sa->sa_cpu; - sa32.sa_context = (uintptr_t)sa->sa_context; - - return copyout(&sa32, dst, sizeof(sa32)); - } break; - case SAOUT_SAP_T: - { - void * const *p = src; - netbsd32_pointer_t p32; - - p32 = (uintptr_t)*p; - return copyout(&p32, dst, sizeof(p32)); - } break; - } - return EINVAL; -} - -int -netbsd32_upcallconv(struct lwp *l, int type, size_t *pargsize, void **parg, - void (**pfunc)(void *)) -{ - switch (type & SA_UPCALL_TYPE_MASK) { - case SA_UPCALL_SIGNAL: - case SA_UPCALL_SIGEV: - { - siginfo32_t si32; - siginfo_t *si = *parg; - - netbsd32_si_to_si32(&si32, si); - - /* - * This is so wrong, but assuming - * sizeof(siginfo32_t) < sizeof(siginfo_t) is not - * very dangerous. - */ - memcpy(*parg, &si32, sizeof(si32)); - *pargsize = sizeof(si32); - } - } - - return 0; -} - -void * -netbsd32_sa_ucsp(void *arg) -{ - ucontext32_t *uc32 = arg; - - return NETBSD32PTR64(_UC_MACHINE32_SP(uc32)); -} /* Sycalls conversion */ @@ -206,83 +128,3 @@ netbsd32__lwp_setprivate(struct lwp *l, void *v, register_t *retval) NETBSD32TOP_UAP(ptr, void); return sys__lwp_setprivate(l, &ua, retval); } - -int -netbsd32_sa_register(struct lwp *l, void *v, register_t *retval) -{ - struct netbsd32_sa_register_args /* { - syscallarg(netbsd32_sa_upcall_t) new; - syscallarg(netbsd32_sa_upcallp_t) old; - syscallarg(int) flags; - syscallarg(netbsd32_ssize_t) stackinfo_offset; - } */ *uap = v; - sa_upcall_t prev; - int error; - - error = dosa_register(l, NETBSD32PTR64(SCARG(uap, new)), &prev, - SCARG(uap, flags), SCARG(uap, stackinfo_offset)); - if (error) - return error; - - if (SCARG(uap, old)) { - netbsd32_sa_upcall_t old = (uintptr_t)prev; - return copyout(&old, NETBSD32PTR64(SCARG(uap, old)), - sizeof(old)); - } - - return 0; -} - -static int -netbsd32_sa_copyin_stack(stack_t *stacks, int index, stack_t *dest) -{ - stack32_t s32, *stacks32; - int error; - - stacks32 = (stack32_t *)stacks; - error = copyin(stacks32 + index, &s32, sizeof(s32)); - if (error) - return error; - - dest->ss_sp = NETBSD32PTR64(s32.ss_sp); - dest->ss_size = s32.ss_size; - dest->ss_flags = s32.ss_flags; - - return 0; -} - -int -netbsd32_sa_stacks(struct lwp *l, void *v, register_t *retval) -{ - struct netbsd32_sa_stacks_args /* { - syscallarg(int) num; - syscallarg(netbsd32_stackp_t) stacks; - } */ *uap = v; - - return sa_stacks1(l, retval, SCARG(uap, num), - NETBSD32PTR64(SCARG(uap, stacks)), netbsd32_sa_copyin_stack); -} - -int -netbsd32_sa_setconcurrency(struct lwp *l, void *v, register_t *retval) -{ - struct netbsd32_sa_setconcurrency_args /* { - syscallarg(int) concurrency; - } */ *uap = v; - struct sys_sa_setconcurrency_args ua; - - NETBSD32TO64_UAP(concurrency); - return sys_sa_setconcurrency(l, &ua, retval); -} - -int -netbsd32_sa_preempt(struct lwp *l, void *v, register_t *retval) -{ - struct netbsd32_sa_preempt_args /* { - syscallarg(int) sa_id; - } */ *uap = v; - struct sys_sa_preempt_args ua; - - NETBSD32TO64_UAP(sa_id); - return sys_sa_preempt(l, &ua, retval); -} diff --git a/sys/compat/netbsd32/netbsd32_sem.c b/sys/compat/netbsd32/netbsd32_sem.c index 3813b6e6012..9b0f1111f00 100644 --- a/sys/compat/netbsd32/netbsd32_sem.c +++ b/sys/compat/netbsd32/netbsd32_sem.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_sem.c,v 1.1 2006/03/05 01:28:20 cube Exp $ */ +/* $NetBSD: netbsd32_sem.c,v 1.2 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 2006 The NetBSD Foundation. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_sem.c,v 1.1 2006/03/05 01:28:20 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_sem.c,v 1.2 2007/02/09 21:55:22 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_posix.h" @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_sem.c,v 1.1 2006/03/05 01:28:20 cube Exp $" #include <sys/ksem.h> #include <sys/mount.h> #include <sys/proc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/netbsd32/netbsd32.h> diff --git a/sys/compat/netbsd32/netbsd32_signal.c b/sys/compat/netbsd32/netbsd32_signal.c index 7d82f4c5e77..0962f7d3609 100644 --- a/sys/compat/netbsd32/netbsd32_signal.c +++ b/sys/compat/netbsd32/netbsd32_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_signal.c,v 1.18 2006/11/08 20:18:32 drochner Exp $ */ +/* $NetBSD: netbsd32_signal.c,v 1.19 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.18 2006/11/08 20:18:32 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.19 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -82,7 +82,7 @@ netbsd32_sigaction(l, v, retval) nsa.sa_mask = sa32.netbsd32_sa_mask; nsa.sa_flags = sa32.netbsd32_sa_flags; } - error = sigaction1(l->l_proc, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0, NULL, 0); @@ -126,7 +126,7 @@ netbsd32___sigaltstack14(l, v, retval) nss.ss_size = (size_t)s32.ss_size; nss.ss_flags = s32.ss_flags; } - error = sigaltstack1(l->l_proc, + error = sigaltstack1(l, SCARG(uap, nss) ? &nss : 0, SCARG(uap, oss) ? &oss : 0); if (error) return (error); @@ -167,7 +167,7 @@ netbsd32___sigaction14(l, v, retval) nsa.sa_mask = sa32.netbsd32_sa_mask; nsa.sa_flags = sa32.netbsd32_sa_flags; } - error = sigaction1(l->l_proc, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0, NULL, 0); if (error) @@ -198,7 +198,6 @@ netbsd32___sigaction_sigtramp(l, v, retval) syscallarg(netbsd32_voidp) tramp; syscallarg(int) vers; } */ *uap = v; - struct proc *p = l->l_proc; struct netbsd32_sigaction sa32; struct sigaction nsa, osa; int error; @@ -212,7 +211,7 @@ netbsd32___sigaction_sigtramp(l, v, retval) nsa.sa_mask = sa32.netbsd32_sa_mask; nsa.sa_flags = sa32.netbsd32_sa_flags; } - error = sigaction1(p, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0, NETBSD32PTR64(SCARG(uap, tramp)), SCARG(uap, vers)); if (error) @@ -320,14 +319,14 @@ netbsd32_si_to_si32(siginfo32_t *si32, const siginfo_t *si) void getucontext32(struct lwp *l, ucontext32_t *ucp) { - struct proc *p; + struct proc *p; p = l->l_proc; ucp->uc_flags = 0; ucp->uc_link = (uint32_t)(intptr_t)l->l_ctxlink; - (void)sigprocmask1(p, 0, NULL, &ucp->uc_sigmask); + (void)sigprocmask1(l, 0, NULL, &ucp->uc_sigmask); ucp->uc_flags |= _UC_SIGMASK; /* @@ -335,16 +334,16 @@ getucontext32(struct lwp *l, ucontext32_t *ucp) * in the System V Interface Definition appears to allow returning * the main context stack. */ - if ((p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK) == 0) { + if ((l->l_sigstk.ss_flags & SS_ONSTACK) == 0) { ucp->uc_stack.ss_sp = USRSTACK32; ucp->uc_stack.ss_size = ctob(p->p_vmspace->vm_ssize); ucp->uc_stack.ss_flags = 0; /* XXX, def. is Very Fishy */ } else { /* Simply copy alternate signal execution stack. */ ucp->uc_stack.ss_sp = - (uint32_t)(intptr_t)p->p_sigctx.ps_sigstk.ss_sp; - ucp->uc_stack.ss_size = p->p_sigctx.ps_sigstk.ss_size; - ucp->uc_stack.ss_flags = p->p_sigctx.ps_sigstk.ss_flags; + (uint32_t)(intptr_t)l->l_sigstk.ss_sp; + ucp->uc_stack.ss_size = l->l_sigstk.ss_size; + ucp->uc_stack.ss_flags = l->l_sigstk.ss_flags; } ucp->uc_flags |= _UC_STACK; @@ -369,10 +368,8 @@ netbsd32_getcontext(struct lwp *l, void *v, register_t *retval) int setucontext32(struct lwp *l, const ucontext32_t *ucp) { - struct proc *p; int error; - p = l->l_proc; if ((error = cpu_setmcontext32(l, &ucp->uc_mcontext, ucp->uc_flags)) != 0) return (error); @@ -382,7 +379,7 @@ setucontext32(struct lwp *l, const ucontext32_t *ucp) * don't; see the comment in getucontext(). */ if ((ucp->uc_flags & _UC_SIGMASK) != 0) - sigprocmask1(p, SIG_SETMASK, &ucp->uc_sigmask, NULL); + sigprocmask1(l, SIG_SETMASK, &ucp->uc_sigmask, NULL); return 0; } diff --git a/sys/compat/netbsd32/netbsd32_socket.c b/sys/compat/netbsd32/netbsd32_socket.c index 4b583f0c598..e647535d6f9 100644 --- a/sys/compat/netbsd32/netbsd32_socket.c +++ b/sys/compat/netbsd32/netbsd32_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_socket.c,v 1.19 2006/03/19 22:39:28 matt Exp $ */ +/* $NetBSD: netbsd32_socket.c,v 1.20 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.19 2006/03/19 22:39:28 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.20 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.19 2006/03/19 22:39:28 matt Ex #include <sys/ktrace.h> #include <sys/file.h> #include <sys/filedesc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/proc.h> #include <sys/dirent.h> diff --git a/sys/compat/netbsd32/netbsd32_syscall.h b/sys/compat/netbsd32/netbsd32_syscall.h index 89b9b4c5145..af1656543a0 100644 --- a/sys/compat/netbsd32/netbsd32_syscall.h +++ b/sys/compat/netbsd32/netbsd32_syscall.h @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.61 2006/11/09 14:10:21 cube Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.62 2007/02/09 21:55:22 ad Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.54 2006/11/09 14:09:37 cube Exp + * created from NetBSD: syscalls.master,v 1.53.2.1 2006/11/18 21:39:14 ad Exp */ #ifndef _netbsd32_SYS_SYSCALL_H_ @@ -906,24 +906,12 @@ /* syscall: "netbsd32__lwp_setprivate" ret: "void" args: "netbsd32_voidp" */ #define netbsd32_SYS_netbsd32__lwp_setprivate 317 -/* syscall: "netbsd32_sa_register" ret: "int" args: "netbsd32_sa_upcall_t" "netbsd32_sa_upcallp_t" "int" "netbsd32_ssize_t" */ -#define netbsd32_SYS_netbsd32_sa_register 330 - -/* syscall: "netbsd32_sa_stacks" ret: "int" args: "int" "netbsd32_stackp_t" */ -#define netbsd32_SYS_netbsd32_sa_stacks 331 - -/* syscall: "sa_enable" ret: "int" args: */ -#define netbsd32_SYS_sa_enable 332 - -/* syscall: "netbsd32_sa_setconcurrency" ret: "int" args: "int" */ -#define netbsd32_SYS_netbsd32_sa_setconcurrency 333 - -/* syscall: "sa_yield" ret: "int" args: */ -#define netbsd32_SYS_sa_yield 334 - -/* syscall: "netbsd32_sa_preempt" ret: "int" args: "int" */ -#define netbsd32_SYS_netbsd32_sa_preempt 335 - + /* 330 is obsolete netbsd32_sa_register */ + /* 331 is obsolete netbsd32_sa_stacks */ + /* 332 is obsolete sys_sa_enable */ + /* 333 is obsolete netbsd32_sa_setconcurrency */ + /* 334 is obsolete sys_sa_yield */ + /* 335 is obsolete netbsd32_sa_preempt */ /* 336 is obsolete sys_sa_unblockyield */ /* syscall: "netbsd32___sigaction_sigtramp" ret: "int" args: "int" "const netbsd32_sigactionp_t" "netbsd32_sigactionp_t" "netbsd32_voidp" "int" */ #define netbsd32_SYS_netbsd32___sigaction_sigtramp 340 diff --git a/sys/compat/netbsd32/netbsd32_syscallargs.h b/sys/compat/netbsd32/netbsd32_syscallargs.h index af8241b4a8f..f5c11944dfe 100644 --- a/sys/compat/netbsd32/netbsd32_syscallargs.h +++ b/sys/compat/netbsd32/netbsd32_syscallargs.h @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.61 2006/11/09 14:10:21 cube Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.62 2007/02/09 21:55:22 ad Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.54 2006/11/09 14:09:37 cube Exp + * created from NetBSD: syscalls.master,v 1.53.2.1 2006/11/18 21:39:14 ad Exp */ #ifndef _netbsd32_SYS_SYSCALLARGS_H_ @@ -1376,26 +1376,6 @@ struct netbsd32__lwp_setprivate_args { syscallarg(netbsd32_voidp) ptr; }; -struct netbsd32_sa_register_args { - syscallarg(netbsd32_sa_upcall_t) new; - syscallarg(netbsd32_sa_upcallp_t) old; - syscallarg(int) flags; - syscallarg(netbsd32_ssize_t) stackinfo_offset; -}; - -struct netbsd32_sa_stacks_args { - syscallarg(int) num; - syscallarg(netbsd32_stackp_t) stacks; -}; - -struct netbsd32_sa_setconcurrency_args { - syscallarg(int) concurrency; -}; - -struct netbsd32_sa_preempt_args { - syscallarg(int) sa_id; -}; - struct netbsd32___sigaction_sigtramp_args { syscallarg(int) signum; syscallarg(const netbsd32_sigactionp_t) nsa; @@ -2284,18 +2264,6 @@ int sys__lwp_getprivate(struct lwp *, void *, register_t *); int netbsd32__lwp_setprivate(struct lwp *, void *, register_t *); -int netbsd32_sa_register(struct lwp *, void *, register_t *); - -int netbsd32_sa_stacks(struct lwp *, void *, register_t *); - -int sys_sa_enable(struct lwp *, void *, register_t *); - -int netbsd32_sa_setconcurrency(struct lwp *, void *, register_t *); - -int sys_sa_yield(struct lwp *, void *, register_t *); - -int netbsd32_sa_preempt(struct lwp *, void *, register_t *); - int netbsd32___sigaction_sigtramp(struct lwp *, void *, register_t *); int netbsd32_rasctl(struct lwp *, void *, register_t *); diff --git a/sys/compat/netbsd32/netbsd32_syscalls.c b/sys/compat/netbsd32/netbsd32_syscalls.c index 0bf100f7e77..ce50c7de80d 100644 --- a/sys/compat/netbsd32/netbsd32_syscalls.c +++ b/sys/compat/netbsd32/netbsd32_syscalls.c @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.61 2006/11/09 14:10:21 cube Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.62 2007/02/09 21:55:22 ad Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.54 2006/11/09 14:09:37 cube Exp + * created from NetBSD: syscalls.master,v 1.53.2.1 2006/11/18 21:39:14 ad Exp */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.61 2006/11/09 14:10:21 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.62 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -26,7 +26,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.61 2006/11/09 14:10:21 cube #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/netbsd32/netbsd32.h> #include <compat/netbsd32/netbsd32_syscallargs.h> @@ -453,12 +452,12 @@ const char *const netbsd32_syscallnames[] = { "#327 (unimplemented)", /* 327 = unimplemented */ "#328 (unimplemented)", /* 328 = unimplemented */ "#329 (unimplemented)", /* 329 = unimplemented */ - "netbsd32_sa_register", /* 330 = netbsd32_sa_register */ - "netbsd32_sa_stacks", /* 331 = netbsd32_sa_stacks */ - "sa_enable", /* 332 = sa_enable */ - "netbsd32_sa_setconcurrency", /* 333 = netbsd32_sa_setconcurrency */ - "sa_yield", /* 334 = sa_yield */ - "netbsd32_sa_preempt", /* 335 = netbsd32_sa_preempt */ + "#330 (obsolete netbsd32_sa_register)", /* 330 = obsolete netbsd32_sa_register */ + "#331 (obsolete netbsd32_sa_stacks)", /* 331 = obsolete netbsd32_sa_stacks */ + "#332 (obsolete sys_sa_enable)", /* 332 = obsolete sys_sa_enable */ + "#333 (obsolete netbsd32_sa_setconcurrency)", /* 333 = obsolete netbsd32_sa_setconcurrency */ + "#334 (obsolete sys_sa_yield)", /* 334 = obsolete sys_sa_yield */ + "#335 (obsolete netbsd32_sa_preempt)", /* 335 = obsolete netbsd32_sa_preempt */ "#336 (obsolete sys_sa_unblockyield)", /* 336 = obsolete sys_sa_unblockyield */ "#337 (unimplemented)", /* 337 = unimplemented */ "#338 (unimplemented)", /* 338 = unimplemented */ diff --git a/sys/compat/netbsd32/netbsd32_sysctl.c b/sys/compat/netbsd32/netbsd32_sysctl.c index 322f29b7ede..b86952357fa 100644 --- a/sys/compat/netbsd32/netbsd32_sysctl.c +++ b/sys/compat/netbsd32/netbsd32_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_sysctl.c,v 1.22 2006/09/23 22:12:00 manu Exp $ */ +/* $NetBSD: netbsd32_sysctl.c,v 1.23 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.22 2006/09/23 22:12:00 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.23 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.22 2006/09/23 22:12:00 manu Ex #include <sys/stat.h> #include <sys/time.h> #include <sys/vnode.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/proc.h> #include <sys/sysctl.h> diff --git a/sys/compat/netbsd32/netbsd32_sysent.c b/sys/compat/netbsd32/netbsd32_sysent.c index 08c6d389194..5778949cc6c 100644 --- a/sys/compat/netbsd32/netbsd32_sysent.c +++ b/sys/compat/netbsd32/netbsd32_sysent.c @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_sysent.c,v 1.61 2006/11/09 14:10:21 cube Exp $ */ +/* $NetBSD: netbsd32_sysent.c,v 1.62 2007/02/09 21:55:22 ad Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.54 2006/11/09 14:09:37 cube Exp + * created from NetBSD: syscalls.master,v 1.53.2.1 2006/11/18 21:39:14 ad Exp */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.61 2006/11/09 14:10:21 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.62 2007/02/09 21:55:22 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -25,7 +25,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.61 2006/11/09 14:10:21 cube Ex #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/netbsd32/netbsd32.h> #include <compat/netbsd32/netbsd32_syscallargs.h> @@ -894,18 +893,18 @@ struct sysent netbsd32_sysent[] = { sys_nosys }, /* 328 = unimplemented */ { 0, 0, 0, sys_nosys }, /* 329 = unimplemented */ - { 4, s(struct netbsd32_sa_register_args), 0, - netbsd32_sa_register }, /* 330 = netbsd32_sa_register */ - { 2, s(struct netbsd32_sa_stacks_args), 0, - netbsd32_sa_stacks }, /* 331 = netbsd32_sa_stacks */ - { 0, 0, 0, - sys_sa_enable }, /* 332 = sa_enable */ - { 1, s(struct netbsd32_sa_setconcurrency_args), 0, - netbsd32_sa_setconcurrency }, /* 333 = netbsd32_sa_setconcurrency */ - { 0, 0, 0, - sys_sa_yield }, /* 334 = sa_yield */ - { 1, s(struct netbsd32_sa_preempt_args), 0, - netbsd32_sa_preempt }, /* 335 = netbsd32_sa_preempt */ + { 0, 0, 0, + sys_nosys }, /* 330 = obsolete netbsd32_sa_register */ + { 0, 0, 0, + sys_nosys }, /* 331 = obsolete netbsd32_sa_stacks */ + { 0, 0, 0, + sys_nosys }, /* 332 = obsolete sys_sa_enable */ + { 0, 0, 0, + sys_nosys }, /* 333 = obsolete netbsd32_sa_setconcurrency */ + { 0, 0, 0, + sys_nosys }, /* 334 = obsolete sys_sa_yield */ + { 0, 0, 0, + sys_nosys }, /* 335 = obsolete netbsd32_sa_preempt */ { 0, 0, 0, sys_nosys }, /* 336 = obsolete sys_sa_unblockyield */ { 0, 0, 0, diff --git a/sys/compat/netbsd32/netbsd32_wait.c b/sys/compat/netbsd32/netbsd32_wait.c index 2a66d9ae813..944ee0c8cce 100644 --- a/sys/compat/netbsd32/netbsd32_wait.c +++ b/sys/compat/netbsd32/netbsd32_wait.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_wait.c,v 1.10 2005/12/11 12:20:22 christos Exp $ */ +/* $NetBSD: netbsd32_wait.c,v 1.11 2007/02/09 21:55:22 ad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_wait.c,v 1.10 2005/12/11 12:20:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_wait.c,v 1.11 2007/02/09 21:55:22 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -114,7 +114,9 @@ netbsd32_getrusage(l, v, retval) case RUSAGE_SELF: rup = &p->p_stats->p_ru; - calcru(p, &rup->ru_utime, &rup->ru_stime, NULL); + mutex_enter(&p->p_smutex); + calcru(p, &rup->ru_utime, &rup->ru_stime, NULL, NULL); + mutex_exit(&p->p_smutex); break; case RUSAGE_CHILDREN: diff --git a/sys/compat/netbsd32/syscalls.master b/sys/compat/netbsd32/syscalls.master index 2ae7956250b..7caaa2b12a3 100644 --- a/sys/compat/netbsd32/syscalls.master +++ b/sys/compat/netbsd32/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.54 2006/11/09 14:09:37 cube Exp $ + $NetBSD: syscalls.master,v 1.55 2007/02/09 21:55:22 ad Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -52,7 +52,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/netbsd32/netbsd32.h> @@ -529,14 +528,12 @@ 327 UNIMPL 328 UNIMPL 329 UNIMPL -330 STD { int netbsd32_sa_register(netbsd32_sa_upcall_t new, \ - netbsd32_sa_upcallp_t old, int flags, \ - netbsd32_ssize_t stackinfo_offset); } -331 STD { int netbsd32_sa_stacks(int num, netbsd32_stackp_t stacks); } -332 NOARGS { int sys_sa_enable(void); } -333 STD { int netbsd32_sa_setconcurrency(int concurrency); } -334 NOARGS { int sys_sa_yield(void); } -335 STD { int netbsd32_sa_preempt(int sa_id); } +330 OBSOL netbsd32_sa_register +331 OBSOL netbsd32_sa_stacks +332 OBSOL sys_sa_enable +333 OBSOL netbsd32_sa_setconcurrency +334 OBSOL sys_sa_yield +335 OBSOL netbsd32_sa_preempt 336 OBSOL sys_sa_unblockyield 337 UNIMPL 338 UNIMPL diff --git a/sys/compat/osf1/osf1_cvt.c b/sys/compat/osf1/osf1_cvt.c index f4259cc85aa..2c0a05a0464 100644 --- a/sys/compat/osf1/osf1_cvt.c +++ b/sys/compat/osf1/osf1_cvt.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_cvt.c,v 1.20 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_cvt.c,v 1.21 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_cvt.c,v 1.20 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_cvt.c,v 1.21 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -74,7 +74,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_cvt.c,v 1.20 2005/12/11 12:20:23 christos Exp $ #include <sys/signal.h> #include <sys/signalvar.h> #include <sys/reboot.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/exec.h> #include <sys/vnode.h> diff --git a/sys/compat/osf1/osf1_descrip.c b/sys/compat/osf1/osf1_descrip.c index 651f779b3d6..f637da20d86 100644 --- a/sys/compat/osf1/osf1_descrip.c +++ b/sys/compat/osf1/osf1_descrip.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_descrip.c,v 1.19 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_descrip.c,v 1.20 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_descrip.c,v 1.19 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_descrip.c,v 1.20 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -74,7 +74,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_descrip.c,v 1.19 2005/12/11 12:20:23 christos E #include <sys/signal.h> #include <sys/signalvar.h> #include <sys/reboot.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/exec.h> #include <sys/vnode.h> diff --git a/sys/compat/osf1/osf1_exec_ecoff.c b/sys/compat/osf1/osf1_exec_ecoff.c index 8ffa93f2bfe..80170721634 100644 --- a/sys/compat/osf1/osf1_exec_ecoff.c +++ b/sys/compat/osf1/osf1_exec_ecoff.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_exec_ecoff.c,v 1.14 2006/07/23 22:06:09 ad Exp $ */ +/* $NetBSD: osf1_exec_ecoff.c,v 1.15 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_exec_ecoff.c,v 1.14 2006/07/23 22:06:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_exec_ecoff.c,v 1.15 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -164,7 +164,7 @@ osf1_copyargs(l, pack, arginfo, stackp, argp) a->a_un.a_val |= OSF1_LDR_EXEC_SETUID_F; if (pack->ep_vap->va_mode & S_ISGID) a->a_un.a_val |= OSF1_LDR_EXEC_SETGID_F; - if (l->l_proc->p_flag & P_TRACED) + if (l->l_proc->p_slflag & PSL_TRACED) a->a_un.a_val |= OSF1_LDR_EXEC_PTRACE_F; a++; } diff --git a/sys/compat/osf1/osf1_file.c b/sys/compat/osf1/osf1_file.c index 9c4eb73d66f..342b0306128 100644 --- a/sys/compat/osf1/osf1_file.c +++ b/sys/compat/osf1/osf1_file.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_file.c,v 1.20 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_file.c,v 1.21 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_file.c,v 1.20 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_file.c,v 1.21 2007/02/09 21:55:23 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_syscall_debug.h" @@ -78,7 +78,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_file.c,v 1.20 2005/12/11 12:20:23 christos Exp #include <sys/signal.h> #include <sys/signalvar.h> #include <sys/reboot.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/exec.h> #include <sys/vnode.h> diff --git a/sys/compat/osf1/osf1_generic.c b/sys/compat/osf1/osf1_generic.c index da44018895a..69ab3d13c63 100644 --- a/sys/compat/osf1/osf1_generic.c +++ b/sys/compat/osf1/osf1_generic.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_generic.c,v 1.8 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_generic.c,v 1.9 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_generic.c,v 1.8 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_generic.c,v 1.9 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -69,7 +69,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_generic.c,v 1.8 2005/12/11 12:20:23 christos Ex #include <sys/malloc.h> #include <sys/mman.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/exec.h> diff --git a/sys/compat/osf1/osf1_ioctl.c b/sys/compat/osf1/osf1_ioctl.c index 41b6ba9502b..0a1776c17a5 100644 --- a/sys/compat/osf1/osf1_ioctl.c +++ b/sys/compat/osf1/osf1_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_ioctl.c,v 1.18 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_ioctl.c,v 1.19 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_ioctl.c,v 1.18 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_ioctl.c,v 1.19 2007/02/09 21:55:23 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_43.h" @@ -70,7 +70,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_ioctl.c,v 1.18 2005/12/11 12:20:23 christos Exp #include <sys/ioctl.h> #include <sys/termios.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> diff --git a/sys/compat/osf1/osf1_misc.c b/sys/compat/osf1/osf1_misc.c index 7bbb734b50d..7bae093b265 100644 --- a/sys/compat/osf1/osf1_misc.c +++ b/sys/compat/osf1/osf1_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_misc.c,v 1.73 2006/04/06 15:45:20 drochner Exp $ */ +/* $NetBSD: osf1_misc.c,v 1.74 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_misc.c,v 1.73 2006/04/06 15:45:20 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_misc.c,v 1.74 2007/02/09 21:55:23 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_syscall_debug.h" @@ -78,7 +78,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_misc.c,v 1.73 2006/04/06 15:45:20 drochner Exp #include <sys/signal.h> #include <sys/signalvar.h> #include <sys/reboot.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/exec.h> #include <sys/vnode.h> diff --git a/sys/compat/osf1/osf1_mmap.c b/sys/compat/osf1/osf1_mmap.c index c441dc41513..8eb66cf70ff 100644 --- a/sys/compat/osf1/osf1_mmap.c +++ b/sys/compat/osf1/osf1_mmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_mmap.c,v 1.10 2003/04/01 01:53:40 thorpej Exp $ */ +/* $NetBSD: osf1_mmap.c,v 1.11 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -31,14 +31,13 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_mmap.c,v 1.10 2003/04/01 01:53:40 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_mmap.c,v 1.11 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/proc.h> #include <sys/mman.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm.h> /* XXX see mmap emulation */ diff --git a/sys/compat/osf1/osf1_mount.c b/sys/compat/osf1/osf1_mount.c index 1a6185f0e91..320bd9e0c3e 100644 --- a/sys/compat/osf1/osf1_mount.c +++ b/sys/compat/osf1/osf1_mount.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_mount.c,v 1.30 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_mount.c,v 1.31 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_mount.c,v 1.30 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_mount.c,v 1.31 2007/02/09 21:55:23 ad Exp $"); #if defined(_KERNEL_OPT) #include "fs_nfs.h" @@ -73,7 +73,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_mount.c,v 1.30 2005/12/11 12:20:23 christos Exp #include <sys/kernel.h> #include <sys/mount.h> #include <sys/vnode.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> diff --git a/sys/compat/osf1/osf1_prot.c b/sys/compat/osf1/osf1_prot.c index d9a0780023e..76f58a7d28b 100644 --- a/sys/compat/osf1/osf1_prot.c +++ b/sys/compat/osf1/osf1_prot.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_prot.c,v 1.9 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_prot.c,v 1.10 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,13 +58,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_prot.c,v 1.9 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_prot.c,v 1.10 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/proc.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> diff --git a/sys/compat/osf1/osf1_resource.c b/sys/compat/osf1/osf1_resource.c index ade01996060..3d943ffdaab 100644 --- a/sys/compat/osf1/osf1_resource.c +++ b/sys/compat/osf1/osf1_resource.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_resource.c,v 1.5 2003/01/18 08:32:04 thorpej Exp $ */ +/* $NetBSD: osf1_resource.c,v 1.6 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -31,13 +31,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_resource.c,v 1.5 2003/01/18 08:32:04 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_resource.c,v 1.6 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/proc.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/resource.h> #include <sys/resourcevar.h> diff --git a/sys/compat/osf1/osf1_signal.c b/sys/compat/osf1/osf1_signal.c index fa709c98da5..d8740945086 100644 --- a/sys/compat/osf1/osf1_signal.c +++ b/sys/compat/osf1/osf1_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_signal.c,v 1.27 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_signal.c,v 1.28 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_signal.c,v 1.27 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_signal.c,v 1.28 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_signal.c,v 1.27 2005/12/11 12:20:23 christos Ex #include <sys/signalvar.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> @@ -79,7 +78,6 @@ osf1_sys_sigaction(l, v, retval) register_t *retval; { struct osf1_sys_sigaction_args *uap = v; - struct proc *p = l->l_proc; struct osf1_sigaction *nosa, *oosa, tmposa; struct sigaction nbsa, obsa; int error; @@ -95,7 +93,7 @@ osf1_sys_sigaction(l, v, retval) osf1_cvt_sigaction_to_native(&tmposa, &nbsa); } - if ((error = sigaction1(p, + if ((error = sigaction1(l, osf1_to_native_signo[SCARG(uap, signum)], (nosa ? &nbsa : NULL), (oosa ? &obsa : NULL), @@ -331,19 +329,25 @@ osf1_sys_sigprocmask(l, v, retval) osf1_cvt_sigset_to_native(&oss, &bss); - (void) splsched(); /* XXXSMP */ + mutex_enter(&p->p_smutex); switch (SCARG(uap, how)) { case OSF1_SIG_BLOCK: - p->p_sigmask |= bss & ~sigcantmask; + *l->l_sigmask |= bss & ~sigcantmask; break; case OSF1_SIG_UNBLOCK: - p->p_sigmask &= ~bss; + *l->l_sigmask &= ~bss; + lwp_lock(l); + l->l_flag |= L_PENDSIG; + lwp_unlock(l); break; case OSF1_SIG_SETMASK: - p->p_sigmask = bss & ~sigcantmask; + *l->l_sigmask = bss & ~sigcantmask; + lwp_lock(l); + l->l_flag |= L_PENDSIG; + lwp_unlock(l); break; default: @@ -351,7 +355,7 @@ osf1_sys_sigprocmask(l, v, retval) break; } - (void) spl0(); + mutex_exit(&p->p_smutex); return error; } diff --git a/sys/compat/osf1/osf1_socket.c b/sys/compat/osf1/osf1_socket.c index d38b6251f8d..d0287ca4433 100644 --- a/sys/compat/osf1/osf1_socket.c +++ b/sys/compat/osf1/osf1_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_socket.c,v 1.14 2006/06/26 21:23:57 mrg Exp $ */ +/* $NetBSD: osf1_socket.c,v 1.15 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.14 2006/06/26 21:23:57 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.15 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -66,7 +66,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.14 2006/06/26 21:23:57 mrg Exp $") #include <sys/proc.h> #include <sys/file.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/socket.h> #include <sys/socketvar.h> diff --git a/sys/compat/osf1/osf1_syscalls.c b/sys/compat/osf1/osf1_syscalls.c index 9162c3e7b17..69fcc8f8b10 100644 --- a/sys/compat/osf1/osf1_syscalls.c +++ b/sys/compat/osf1/osf1_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_syscalls.c,v 1.53 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_syscalls.c,v 1.54 2007/02/09 21:55:23 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_syscalls.c,v 1.53 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_syscalls.c,v 1.54 2007/02/09 21:55:23 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_syscalls.c,v 1.53 2005/12/11 12:20:23 christos #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> #include <compat/osf1/osf1_syscallargs.h> diff --git a/sys/compat/osf1/osf1_sysent.c b/sys/compat/osf1/osf1_sysent.c index 707986cb169..f2f5350116c 100644 --- a/sys/compat/osf1/osf1_sysent.c +++ b/sys/compat/osf1/osf1_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_sysent.c,v 1.55 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_sysent.c,v 1.56 2007/02/09 21:55:23 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_sysent.c,v 1.55 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_sysent.c,v 1.56 2007/02/09 21:55:23 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_43.h" @@ -18,7 +18,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_sysent.c,v 1.55 2005/12/11 12:20:23 christos Ex #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> #include <compat/osf1/osf1_syscallargs.h> diff --git a/sys/compat/osf1/osf1_sysv_ipc.c b/sys/compat/osf1/osf1_sysv_ipc.c index 67ae6f06152..6b6d054af50 100644 --- a/sys/compat/osf1/osf1_sysv_ipc.c +++ b/sys/compat/osf1/osf1_sysv_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_sysv_ipc.c,v 1.4 2003/01/18 08:32:05 thorpej Exp $ */ +/* $NetBSD: osf1_sysv_ipc.c,v 1.5 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_sysv_ipc.c,v 1.4 2003/01/18 08:32:05 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_sysv_ipc.c,v 1.5 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -39,7 +39,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_sysv_ipc.c,v 1.4 2003/01/18 08:32:05 thorpej Ex #include <sys/proc.h> #include <sys/file.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> diff --git a/sys/compat/osf1/osf1_time.c b/sys/compat/osf1/osf1_time.c index 12599183166..ed3921e3a5b 100644 --- a/sys/compat/osf1/osf1_time.c +++ b/sys/compat/osf1/osf1_time.c @@ -1,4 +1,4 @@ -/* $NetBSD: osf1_time.c,v 1.10 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: osf1_time.c,v 1.11 2007/02/09 21:55:23 ad Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osf1_time.c,v 1.10 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osf1_time.c,v 1.11 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -39,7 +39,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_time.c,v 1.10 2005/12/11 12:20:23 christos Exp #include <sys/proc.h> #include <sys/file.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> diff --git a/sys/compat/osf1/syscalls.master b/sys/compat/osf1/syscalls.master index 21d5c8aa6e2..f25e4881ad7 100644 --- a/sys/compat/osf1/syscalls.master +++ b/sys/compat/osf1/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.43 2005/12/11 12:20:23 christos Exp $ + $NetBSD: syscalls.master,v 1.44 2007/02/09 21:55:23 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -40,7 +40,6 @@ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/osf1/osf1.h> diff --git a/sys/compat/ossaudio/ossaudio.c b/sys/compat/ossaudio/ossaudio.c index 2f507129572..4cb3c7b3aa2 100644 --- a/sys/compat/ossaudio/ossaudio.c +++ b/sys/compat/ossaudio/ossaudio.c @@ -1,4 +1,4 @@ -/* $NetBSD: ossaudio.c,v 1.53 2006/09/03 20:58:26 christos Exp $ */ +/* $NetBSD: ossaudio.c,v 1.54 2007/02/09 21:55:23 ad Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.53 2006/09/03 20:58:26 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.54 2007/02/09 21:55:23 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -48,7 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.53 2006/09/03 20:58:26 christos Exp $ #include <sys/audioio.h> #include <sys/midiio.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ossaudio/ossaudio.h> diff --git a/sys/compat/pecoff/pecoff_emul.c b/sys/compat/pecoff/pecoff_emul.c index f7e5111663e..d95a07c69fb 100644 --- a/sys/compat/pecoff/pecoff_emul.c +++ b/sys/compat/pecoff/pecoff_emul.c @@ -1,4 +1,4 @@ -/* $NetBSD: pecoff_emul.c,v 1.16 2006/06/20 14:11:56 oki Exp $ */ +/* $NetBSD: pecoff_emul.c,v 1.17 2007/02/09 21:55:24 ad Exp $ */ /* * Copyright (c) 2000 Masaru OKI @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pecoff_emul.c,v 1.16 2006/06/20 14:11:56 oki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pecoff_emul.c,v 1.17 2007/02/09 21:55:24 ad Exp $"); /*#define DEBUG_PECOFF*/ @@ -47,8 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: pecoff_emul.c,v 1.16 2006/06/20 14:11:56 oki Exp $") #include <sys/param.h> #include <sys/proc.h> -#include <sys/sa.h> -#include <sys/savar.h> #include <sys/malloc.h> #include <sys/namei.h> #include <sys/vnode.h> @@ -82,17 +80,6 @@ struct uvm_object *emul_pecoff_object; void syscall(void); #endif -const struct sa_emul saemul_pecoff = { - sizeof(ucontext_t), - sizeof(struct sa_t), - sizeof(struct sa_t *), - NULL, - NULL, - cpu_upcall, - (void (*)(struct lwp *, void *))getucontext, - sa_ucsp -}; - const struct emul emul_pecoff = { "pecoff", "/emul/pecoff", @@ -136,5 +123,5 @@ const struct emul emul_pecoff = { uvm_default_mapaddr, NULL, - &saemul_pecoff, + sizeof(ucontext_t), }; diff --git a/sys/compat/pecoff/pecoff_misc.c b/sys/compat/pecoff/pecoff_misc.c index 1cabdb0de61..7b5bf28c87b 100644 --- a/sys/compat/pecoff/pecoff_misc.c +++ b/sys/compat/pecoff/pecoff_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: pecoff_misc.c,v 1.15 2006/07/13 21:31:31 martin Exp $ */ +/* $NetBSD: pecoff_misc.c,v 1.16 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pecoff_misc.c,v 1.15 2006/07/13 21:31:31 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pecoff_misc.c,v 1.16 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfsserver.h" @@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: pecoff_misc.c,v 1.15 2006/07/13 21:31:31 martin Exp #include <sys/fcntl.h> #include <sys/proc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/common/compat_util.h> diff --git a/sys/compat/pecoff/pecoff_syscall.h b/sys/compat/pecoff/pecoff_syscall.h index 4faa8535d11..7ab19bf6189 100644 --- a/sys/compat/pecoff/pecoff_syscall.h +++ b/sys/compat/pecoff/pecoff_syscall.h @@ -1,4 +1,4 @@ -/* $NetBSD: pecoff_syscall.h,v 1.26 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: pecoff_syscall.h,v 1.27 2007/02/09 21:55:24 ad Exp $ */ /* * System call numbers. @@ -848,24 +848,12 @@ /* syscall: "_lwp_setprivate" ret: "void" args: "void *" */ #define PECOFF_SYS__lwp_setprivate 317 -/* syscall: "sa_register" ret: "int" args: "sa_upcall_t" "sa_upcall_t *" "int" "ssize_t" */ -#define PECOFF_SYS_sa_register 330 - -/* syscall: "sa_stacks" ret: "int" args: "int" "stack_t *" */ -#define PECOFF_SYS_sa_stacks 331 - -/* syscall: "sa_enable" ret: "int" args: */ -#define PECOFF_SYS_sa_enable 332 - -/* syscall: "sa_setconcurrency" ret: "int" args: "int" */ -#define PECOFF_SYS_sa_setconcurrency 333 - -/* syscall: "sa_yield" ret: "int" args: */ -#define PECOFF_SYS_sa_yield 334 - -/* syscall: "sa_preempt" ret: "int" args: "int" */ -#define PECOFF_SYS_sa_preempt 335 - + /* 330 is obsolete sys_sa_register */ + /* 331 is obsolete sys_sa_stacks */ + /* 332 is obsolete sys_sa_enable */ + /* 333 is obsolete sys_sa_setconcurrency */ + /* 334 is obsolete sys_sa_yield */ + /* 335 is obsolete sys_sa_preempt */ /* 336 is obsolete sys_sa_unblockyield */ /* syscall: "__sigaction_sigtramp" ret: "int" args: "int" "const struct sigaction *" "struct sigaction *" "const void *" "int" */ #define PECOFF_SYS___sigaction_sigtramp 340 diff --git a/sys/compat/pecoff/pecoff_syscallargs.h b/sys/compat/pecoff/pecoff_syscallargs.h index 7477d1d0ddf..7f2cb94c220 100644 --- a/sys/compat/pecoff/pecoff_syscallargs.h +++ b/sys/compat/pecoff/pecoff_syscallargs.h @@ -1,4 +1,4 @@ -/* $NetBSD: pecoff_syscallargs.h,v 1.27 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: pecoff_syscallargs.h,v 1.28 2007/02/09 21:55:24 ad Exp $ */ /* * System call argument lists. @@ -798,18 +798,6 @@ int sys__lwp_getprivate(struct lwp *, void *, register_t *); int sys__lwp_setprivate(struct lwp *, void *, register_t *); -int sys_sa_register(struct lwp *, void *, register_t *); - -int sys_sa_stacks(struct lwp *, void *, register_t *); - -int sys_sa_enable(struct lwp *, void *, register_t *); - -int sys_sa_setconcurrency(struct lwp *, void *, register_t *); - -int sys_sa_yield(struct lwp *, void *, register_t *); - -int sys_sa_preempt(struct lwp *, void *, register_t *); - int sys___sigaction_sigtramp(struct lwp *, void *, register_t *); int sys_pmc_get_info(struct lwp *, void *, register_t *); diff --git a/sys/compat/pecoff/pecoff_syscalls.c b/sys/compat/pecoff/pecoff_syscalls.c index 4db341b42a2..723a069c73e 100644 --- a/sys/compat/pecoff/pecoff_syscalls.c +++ b/sys/compat/pecoff/pecoff_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: pecoff_syscalls.c,v 1.26 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: pecoff_syscalls.c,v 1.27 2007/02/09 21:55:24 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pecoff_syscalls.c,v 1.26 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pecoff_syscalls.c,v 1.27 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -26,7 +26,6 @@ __KERNEL_RCSID(0, "$NetBSD: pecoff_syscalls.c,v 1.26 2006/09/01 21:19:45 matt Ex #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/shm.h> #include <sys/syscallargs.h> #include <compat/pecoff/pecoff_syscallargs.h> @@ -503,12 +502,12 @@ const char *const pecoff_syscallnames[] = { "#327 (unimplemented)", /* 327 = unimplemented */ "#328 (unimplemented)", /* 328 = unimplemented */ "#329 (unimplemented)", /* 329 = unimplemented */ - "sa_register", /* 330 = sa_register */ - "sa_stacks", /* 331 = sa_stacks */ - "sa_enable", /* 332 = sa_enable */ - "sa_setconcurrency", /* 333 = sa_setconcurrency */ - "sa_yield", /* 334 = sa_yield */ - "sa_preempt", /* 335 = sa_preempt */ + "#330 (obsolete sys_sa_register)", /* 330 = obsolete sys_sa_register */ + "#331 (obsolete sys_sa_stacks)", /* 331 = obsolete sys_sa_stacks */ + "#332 (obsolete sys_sa_enable)", /* 332 = obsolete sys_sa_enable */ + "#333 (obsolete sys_sa_setconcurrency)", /* 333 = obsolete sys_sa_setconcurrency */ + "#334 (obsolete sys_sa_yield)", /* 334 = obsolete sys_sa_yield */ + "#335 (obsolete sys_sa_preempt)", /* 335 = obsolete sys_sa_preempt */ "#336 (obsolete sys_sa_unblockyield)", /* 336 = obsolete sys_sa_unblockyield */ "#337 (unimplemented)", /* 337 = unimplemented */ "#338 (unimplemented)", /* 338 = unimplemented */ diff --git a/sys/compat/pecoff/pecoff_sysent.c b/sys/compat/pecoff/pecoff_sysent.c index d839ccbb25c..cacb4702adf 100644 --- a/sys/compat/pecoff/pecoff_sysent.c +++ b/sys/compat/pecoff/pecoff_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: pecoff_sysent.c,v 1.27 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: pecoff_sysent.c,v 1.28 2007/02/09 21:55:24 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pecoff_sysent.c,v 1.27 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pecoff_sysent.c,v 1.28 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -25,7 +25,6 @@ __KERNEL_RCSID(0, "$NetBSD: pecoff_sysent.c,v 1.27 2006/09/01 21:19:45 matt Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/shm.h> #include <sys/syscallargs.h> #include <compat/pecoff/pecoff_syscallargs.h> @@ -890,18 +889,18 @@ struct sysent pecoff_sysent[] = { sys_nosys }, /* 328 = unimplemented */ { 0, 0, 0, sys_nosys }, /* 329 = unimplemented */ - { 4, s(struct sys_sa_register_args), 0, - sys_sa_register }, /* 330 = sa_register */ - { 2, s(struct sys_sa_stacks_args), 0, - sys_sa_stacks }, /* 331 = sa_stacks */ - { 0, 0, 0, - sys_sa_enable }, /* 332 = sa_enable */ - { 1, s(struct sys_sa_setconcurrency_args), 0, - sys_sa_setconcurrency }, /* 333 = sa_setconcurrency */ - { 0, 0, 0, - sys_sa_yield }, /* 334 = sa_yield */ - { 1, s(struct sys_sa_preempt_args), 0, - sys_sa_preempt }, /* 335 = sa_preempt */ + { 0, 0, 0, + sys_nosys }, /* 330 = obsolete sys_sa_register */ + { 0, 0, 0, + sys_nosys }, /* 331 = obsolete sys_sa_stacks */ + { 0, 0, 0, + sys_nosys }, /* 332 = obsolete sys_sa_enable */ + { 0, 0, 0, + sys_nosys }, /* 333 = obsolete sys_sa_setconcurrency */ + { 0, 0, 0, + sys_nosys }, /* 334 = obsolete sys_sa_yield */ + { 0, 0, 0, + sys_nosys }, /* 335 = obsolete sys_sa_preempt */ { 0, 0, 0, sys_nosys }, /* 336 = obsolete sys_sa_unblockyield */ { 0, 0, 0, diff --git a/sys/compat/pecoff/syscalls.master b/sys/compat/pecoff/syscalls.master index 5c7322b4c8d..976d25ca639 100644 --- a/sys/compat/pecoff/syscalls.master +++ b/sys/compat/pecoff/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.25 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.26 2007/02/09 21:55:24 ad Exp $ ; based on NetBSD: syscalls.master,v 1.150 2005/11/29 22:52:02 yamt Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -55,7 +55,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/shm.h> #include <sys/syscallargs.h> #include <compat/pecoff/pecoff_syscallargs.h> @@ -709,14 +708,12 @@ 328 UNIMPL 329 UNIMPL ; Scheduler activation syscalls -330 NOARGS { int sys_sa_register(sa_upcall_t new, \ - sa_upcall_t *old, int flags, \ - ssize_t stackinfo_offset); } -331 NOARGS { int sys_sa_stacks(int num, stack_t *stacks); } -332 NOARGS { int sys_sa_enable(void); } -333 NOARGS { int sys_sa_setconcurrency(int concurrency); } -334 NOARGS { int sys_sa_yield(void); } -335 NOARGS { int sys_sa_preempt(int sa_id); } +330 OBSOL sys_sa_register +331 OBSOL sys_sa_stacks +332 OBSOL sys_sa_enable +333 OBSOL sys_sa_setconcurrency +334 OBSOL sys_sa_yield +335 OBSOL sys_sa_preempt 336 OBSOL sys_sa_unblockyield ; ; Syscalls 337-339 are reserved for other scheduler activation syscalls. diff --git a/sys/compat/sunos/sunos_ioctl.c b/sys/compat/sunos/sunos_ioctl.c index 284fb9130e0..6e8af2ed195 100644 --- a/sys/compat/sunos/sunos_ioctl.c +++ b/sys/compat/sunos/sunos_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos_ioctl.c,v 1.51 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: sunos_ioctl.c,v 1.52 2007/02/09 21:55:24 ad Exp $ */ /* * Copyright (c) 1993 Markus Wild. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.51 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.52 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_execfmt.h" @@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.51 2005/12/11 12:20:23 christos Ex #include <sys/vnode.h> #include <sys/mount.h> #include <sys/disklabel.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <miscfs/specfs/specdev.h> diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index dc39b0ae65e..ea032acc82c 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos_misc.c,v 1.143 2006/11/14 13:34:30 elad Exp $ */ +/* $NetBSD: sunos_misc.c,v 1.144 2007/02/09 21:55:24 ad Exp $ */ /* * Copyright (c) 1992, 1993 @@ -50,7 +50,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.143 2006/11/14 13:34:30 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.144 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfsserver.h" @@ -85,7 +85,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.143 2006/11/14 13:34:30 elad Exp $" #include <sys/wait.h> #include <sys/utsname.h> #include <sys/unistd.h> -#include <sys/sa.h> #include <sys/syscall.h> #include <sys/syscallargs.h> #include <sys/conf.h> @@ -450,7 +449,7 @@ sunos_sys_sigpending(l, v, retval) sigset_t ss; int mask; - sigpending1(l->l_proc, &ss); + sigpending1(l, &ss); native_to_sunos_sigset(&ss, &mask); return (copyout((caddr_t)&mask, (caddr_t)SCARG(uap, mask), sizeof(int))); @@ -470,7 +469,7 @@ sunos_sys_sigsuspend(l, v, retval) mask = SCARG(uap, mask); sunos_to_native_sigset(mask, &ss); - return (sigsuspend1(l->l_proc, &ss)); + return (sigsuspend1(l, &ss)); } /* @@ -878,7 +877,8 @@ sunos_sys_open(l, v, retval) SCARG(uap, flags) = nmode; ret = sys_open(l, (struct sys_open_args *)uap, retval); - if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + /* XXXSMP */ + if (!ret && !noctty && SESS_LEADER(p) && !(p->p_lflag & PL_CONTROLT)) { struct filedesc *fdp = p->p_fd; struct file *fp; @@ -1351,7 +1351,7 @@ sunos_sys_sigvec(l, v, retval) compat_43_sigvec_to_sigaction(&nsv, &nsa); } - error = sigaction1(l->l_proc, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0, NULL, 0); diff --git a/sys/compat/sunos/sunos_syscalls.c b/sys/compat/sunos/sunos_syscalls.c index 49c0623a899..fe58c571ee9 100644 --- a/sys/compat/sunos/sunos_syscalls.c +++ b/sys/compat/sunos/sunos_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos_syscalls.c,v 1.75 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: sunos_syscalls.c,v 1.76 2007/02/09 21:55:24 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos_syscalls.c,v 1.75 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos_syscalls.c,v 1.76 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -21,7 +21,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos_syscalls.c,v 1.75 2006/09/01 21:19:45 matt Exp #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sunos/sunos.h> #include <compat/sunos/sunos_syscallargs.h> diff --git a/sys/compat/sunos/sunos_sysent.c b/sys/compat/sunos/sunos_sysent.c index 0a29b41d87c..0f693548f9d 100644 --- a/sys/compat/sunos/sunos_sysent.c +++ b/sys/compat/sunos/sunos_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos_sysent.c,v 1.70 2006/09/01 21:19:45 matt Exp $ */ +/* $NetBSD: sunos_sysent.c,v 1.71 2007/02/09 21:55:24 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos_sysent.c,v 1.70 2006/09/01 21:19:45 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos_sysent.c,v 1.71 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfsserver.h" @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos_sysent.c,v 1.70 2006/09/01 21:19:45 matt Exp $ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sunos/sunos.h> #include <compat/sunos/sunos_syscallargs.h> diff --git a/sys/compat/sunos/syscalls.master b/sys/compat/sunos/syscalls.master index df4ab5bad41..77fb29562ae 100644 --- a/sys/compat/sunos/syscalls.master +++ b/sys/compat/sunos/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.65 2006/09/01 20:58:18 matt Exp $ + $NetBSD: syscalls.master,v 1.66 2007/02/09 21:55:24 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -43,7 +43,6 @@ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sunos/sunos.h> diff --git a/sys/compat/sunos32/sunos32_exec.c b/sys/compat/sunos32/sunos32_exec.c index 3c539190eee..64192fd37ba 100644 --- a/sys/compat/sunos32/sunos32_exec.c +++ b/sys/compat/sunos32/sunos32_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos32_exec.c,v 1.25 2006/10/15 21:12:08 martin Exp $ */ +/* $NetBSD: sunos32_exec.c,v 1.26 2007/02/09 21:55:24 ad Exp $ */ /* * Copyright (c) 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos32_exec.c,v 1.25 2006/10/15 21:12:08 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos32_exec.c,v 1.26 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_syscall_debug.h" @@ -96,5 +96,5 @@ const struct emul emul_sunos = { NULL, uvm_default_mapaddr, NULL, - NULL + 0 }; diff --git a/sys/compat/sunos32/sunos32_ioctl.c b/sys/compat/sunos32/sunos32_ioctl.c index 4af4855a8d2..e56feb60bca 100644 --- a/sys/compat/sunos32/sunos32_ioctl.c +++ b/sys/compat/sunos32/sunos32_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos32_ioctl.c,v 1.16 2005/12/11 12:20:23 christos Exp $ */ +/* $NetBSD: sunos32_ioctl.c,v 1.17 2007/02/09 21:55:24 ad Exp $ */ /* from: NetBSD: sunos_ioctl.c,v 1.35 2001/02/03 22:20:02 mrg Exp */ /* @@ -56,7 +56,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos32_ioctl.c,v 1.16 2005/12/11 12:20:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos32_ioctl.c,v 1.17 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd32.h" @@ -76,7 +76,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos32_ioctl.c,v 1.16 2005/12/11 12:20:23 christos #include <sys/vnode.h> #include <sys/mount.h> #include <sys/disklabel.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <miscfs/specfs/specdev.h> diff --git a/sys/compat/sunos32/sunos32_misc.c b/sys/compat/sunos32/sunos32_misc.c index 99093150fe4..a8525b62d9c 100644 --- a/sys/compat/sunos32/sunos32_misc.c +++ b/sys/compat/sunos32/sunos32_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos32_misc.c,v 1.42 2006/11/14 13:34:30 elad Exp $ */ +/* $NetBSD: sunos32_misc.c,v 1.43 2007/02/09 21:55:24 ad Exp $ */ /* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */ /* @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.42 2006/11/14 13:34:30 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.43 2007/02/09 21:55:24 ad Exp $"); #define COMPAT_SUNOS 1 @@ -118,7 +118,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.42 2006/11/14 13:34:30 elad Exp $ #include <sys/wait.h> #include <sys/utsname.h> #include <sys/unistd.h> -#include <sys/sa.h> #include <sys/syscall.h> #include <sys/syscallargs.h> #include <sys/conf.h> @@ -668,11 +667,10 @@ sunos32_sys_sigpending(l, v, retval) struct sunos32_sys_sigpending_args /* { syscallarg(netbsd32_intp) mask; } */ *uap = v; - struct proc *p = l->l_proc; sigset_t ss; int mask; - sigpending1(p, &ss); + sigpending1(l, &ss); native_to_sunos_sigset(&ss, &mask); return (copyout((caddr_t)(u_long)&mask, (caddr_t)(u_long)SCARG(uap, mask), sizeof(int))); @@ -688,12 +686,11 @@ sunos32_sys_sigsuspend(l, v, retval) syscallarg(int) mask; } */ *uap = v; int mask; - struct proc *p = l->l_proc; sigset_t ss; mask = SCARG(uap, mask); sunos_to_native_sigset(mask, &ss); - return (sigsuspend1(p, &ss)); + return (sigsuspend1(l, &ss)); } /* @@ -1144,7 +1141,8 @@ sunos32_sys_open(l, v, retval) ret = sys_open(l, &ua, retval); - if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + /* XXXSMP unlocked */ + if (!ret && !noctty && SESS_LEADER(p) && !(p->p_lflag & PL_CONTROLT)) { struct filedesc *fdp = p->p_fd; struct file *fp; @@ -1621,7 +1619,6 @@ sunos32_sys_sigvec(l, v, retval) syscallarg(struct sigvec *) nsv; syscallarg(struct sigvec *) osv; } */ *uap = v; - struct proc *p = l->l_proc; struct netbsd32_sigvec sv; struct sigaction nsa, osa; int error; @@ -1642,7 +1639,7 @@ sunos32_sys_sigvec(l, v, retval) sunos32_sigvec_to_sigaction(&sv, &nsa); } - error = sigaction1(p, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0, NULL, 0); diff --git a/sys/compat/sunos32/sunos32_syscalls.c b/sys/compat/sunos32/sunos32_syscalls.c index a19b0335ea0..2c53e6c551b 100644 --- a/sys/compat/sunos32/sunos32_syscalls.c +++ b/sys/compat/sunos32/sunos32_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos32_syscalls.c,v 1.17 2006/07/13 23:40:55 pavel Exp $ */ +/* $NetBSD: sunos32_syscalls.c,v 1.18 2007/02/09 21:55:24 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos32_syscalls.c,v 1.17 2006/07/13 23:40:55 pavel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos32_syscalls.c,v 1.18 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -22,7 +22,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos32_syscalls.c,v 1.17 2006/07/13 23:40:55 pavel #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sunos/sunos.h> #include <compat/sunos/sunos_syscallargs.h> diff --git a/sys/compat/sunos32/sunos32_sysent.c b/sys/compat/sunos32/sunos32_sysent.c index 1144d75e190..bfcbd6027fe 100644 --- a/sys/compat/sunos32/sunos32_sysent.c +++ b/sys/compat/sunos32/sunos32_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos32_sysent.c,v 1.19 2006/07/13 23:40:55 pavel Exp $ */ +/* $NetBSD: sunos32_sysent.c,v 1.20 2007/02/09 21:55:24 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunos32_sysent.c,v 1.19 2006/07/13 23:40:55 pavel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos32_sysent.c,v 1.20 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfsserver.h" @@ -21,7 +21,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunos32_sysent.c,v 1.19 2006/07/13 23:40:55 pavel Ex #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sunos/sunos.h> #include <compat/sunos/sunos_syscallargs.h> diff --git a/sys/compat/sunos32/syscalls.master b/sys/compat/sunos32/syscalls.master index 5f994ab6849..4220838e7f8 100644 --- a/sys/compat/sunos32/syscalls.master +++ b/sys/compat/sunos32/syscalls.master @@ -1,4 +1,4 @@ -; $NetBSD: syscalls.master,v 1.13 2006/07/13 23:38:57 pavel Exp $ +; $NetBSD: syscalls.master,v 1.14 2007/02/09 21:55:24 ad Exp $ ; from :NetBSD: syscalls.master,v 1.57 2000/12/09 07:10:36 mycroft Exp @@ -44,7 +44,6 @@ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sunos/sunos.h> diff --git a/sys/compat/svr4/svr4_exec.c b/sys/compat/svr4/svr4_exec.c index e607a146079..8b8c1cf4e4a 100644 --- a/sys/compat/svr4/svr4_exec.c +++ b/sys/compat/svr4/svr4_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_exec.c,v 1.58 2006/09/03 06:28:16 christos Exp $ */ +/* $NetBSD: svr4_exec.c,v 1.59 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994, 2000 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_exec.c,v 1.58 2006/09/03 06:28:16 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_exec.c,v 1.59 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_syscall_debug.h" @@ -103,5 +103,5 @@ const struct emul emul_svr4 = { uvm_default_mapaddr, NULL, /* e_usertrap */ - NULL, /* e_sa */ + 0, /* e_ucsize */ }; diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index 8b27ac6fea6..40c872a4d2d 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_fcntl.c,v 1.53 2007/01/04 18:27:36 elad Exp $ */ +/* $NetBSD: svr4_fcntl.c,v 1.54 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994, 1997 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_fcntl.c,v 1.53 2007/01/04 18:27:36 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_fcntl.c,v 1.54 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_fcntl.c,v 1.53 2007/01/04 18:27:36 elad Exp $") #include <sys/vnode.h> #include <sys/kauth.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> @@ -388,8 +387,10 @@ svr4_sys_open(l, v, retval) if (error) return error; + /* XXXAD locking */ + if (!(SCARG(&cup, flags) & O_NOCTTY) && SESS_LEADER(p) && - !(p->p_flag & P_CONTROLT)) { + !(p->p_lflag & PL_CONTROLT)) { struct filedesc *fdp = p->p_fd; struct file *fp; diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c index 3c971bddc4c..fa2cf96bf33 100644 --- a/sys/compat/svr4/svr4_filio.c +++ b/sys/compat/svr4/svr4_filio.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_filio.c,v 1.15 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_filio.c,v 1.16 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_filio.c,v 1.15 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_filio.c,v 1.16 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_filio.c,v 1.15 2007/01/29 01:52:44 hubertf Exp #include <net/if.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c index 6577257c108..66c9527a4f7 100644 --- a/sys/compat/svr4/svr4_ioctl.c +++ b/sys/compat/svr4/svr4_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_ioctl.c,v 1.28 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_ioctl.c,v 1.29 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_ioctl.c,v 1.28 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_ioctl.c,v 1.29 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_ioctl.c,v 1.28 2007/01/29 01:52:44 hubertf Exp #include <net/if.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/socket.h> diff --git a/sys/compat/svr4/svr4_ipc.c b/sys/compat/svr4/svr4_ipc.c index d3b24835857..e2d68527d1b 100644 --- a/sys/compat/svr4/svr4_ipc.c +++ b/sys/compat/svr4/svr4_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_ipc.c,v 1.19 2006/07/23 22:06:09 ad Exp $ */ +/* $NetBSD: svr4_ipc.c,v 1.20 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_ipc.c,v 1.19 2006/07/23 22:06:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_ipc.c,v 1.20 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_ipc.c,v 1.19 2006/07/23 22:06:09 ad Exp $"); #include <sys/stat.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4/svr4_lwp.c b/sys/compat/svr4/svr4_lwp.c index d0ff1816c28..bdc55bf5bb9 100644 --- a/sys/compat/svr4/svr4_lwp.c +++ b/sys/compat/svr4/svr4_lwp.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_lwp.c,v 1.13 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: svr4_lwp.c,v 1.14 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.13 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.14 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.13 2006/11/16 01:32:44 christos Exp $ #include <sys/user.h> #include <sys/socket.h> #include <sys/socketvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/un.h> #include <sys/stat.h> diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index f03bbec6f9c..31c852f2402 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_misc.c,v 1.121 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: svr4_misc.c,v 1.122 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.121 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.122 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -77,7 +77,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.121 2006/11/16 01:32:44 christos Exp #include <sys/signalvar.h> #include <netinet/in.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <miscfs/specfs/specdev.h> @@ -105,7 +104,7 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.121 2006/11/16 01:32:44 christos Exp static int svr4_to_bsd_mmap_flags __P((int)); static inline clock_t timeval_to_clock_t __P((struct timeval *)); -static int svr4_setinfo __P((struct proc *, int, svr4_siginfo_t *)); +static void svr4_setinfo __P((struct proc *, int, svr4_siginfo_t *)); struct svr4_hrtcntl_args; static int svr4_hrtcntl __P((struct lwp *, struct svr4_hrtcntl_args *, @@ -1090,60 +1089,57 @@ svr4_sys_hrtsys(l, v, retval) } -static int +static void svr4_setinfo(p, st, s) struct proc *p; int st; svr4_siginfo_t *s; { - svr4_siginfo_t i; int sig; - memset(&i, 0, sizeof(i)); + memset(s, 0, sizeof(*s)); - i.si_signo = SVR4_SIGCHLD; - i.si_errno = 0; /* XXX? */ + s->si_signo = SVR4_SIGCHLD; + s->si_errno = 0; /* XXX? */ if (p) { - i.si_pid = p->p_pid; + s->si_pid = p->p_pid; if (p->p_stat == SZOMB) { - i.si_stime = p->p_ru->ru_stime.tv_sec; - i.si_utime = p->p_ru->ru_utime.tv_sec; + s->si_stime = p->p_ru->ru_stime.tv_sec; + s->si_utime = p->p_ru->ru_utime.tv_sec; } else { - i.si_stime = p->p_stats->p_ru.ru_stime.tv_sec; - i.si_utime = p->p_stats->p_ru.ru_utime.tv_sec; + s->si_stime = p->p_stats->p_ru.ru_stime.tv_sec; + s->si_utime = p->p_stats->p_ru.ru_utime.tv_sec; } } if (WIFEXITED(st)) { - i.si_status = WEXITSTATUS(st); - i.si_code = SVR4_CLD_EXITED; + s->si_status = WEXITSTATUS(st); + s->si_code = SVR4_CLD_EXITED; } else if (WIFSTOPPED(st)) { sig = WSTOPSIG(st); if (sig >= 0 && sig < NSIG) - i.si_status = native_to_svr4_signo[sig]; + s->si_status = native_to_svr4_signo[sig]; - if (i.si_status == SVR4_SIGCONT) - i.si_code = SVR4_CLD_CONTINUED; + if (s->si_status == SVR4_SIGCONT) + s->si_code = SVR4_CLD_CONTINUED; else - i.si_code = SVR4_CLD_STOPPED; + s->si_code = SVR4_CLD_STOPPED; } else { sig = WTERMSIG(st); if (sig >= 0 && sig < NSIG) - i.si_status = native_to_svr4_signo[sig]; + s->si_status = native_to_svr4_signo[sig]; if (WCOREDUMP(st)) - i.si_code = SVR4_CLD_DUMPED; + s->si_code = SVR4_CLD_DUMPED; else - i.si_code = SVR4_CLD_KILLED; + s->si_code = SVR4_CLD_KILLED; } DPRINTF(("siginfo [pid %ld signo %d code %d errno %d status %d]\n", - (long) i.si_pid, - i.si_signo, i.si_code, i.si_errno, i.si_status)); - - return copyout(&i, s, sizeof(i)); + (long) s->si_pid, + s->si_signo, s->si_code, s->si_errno, s->si_status)); } @@ -1154,10 +1150,12 @@ svr4_sys_waitsys(l, v, retval) register_t *retval; { struct svr4_sys_waitsys_args *uap = v; - int options; + int options, status; int error; struct proc *parent = l->l_proc; struct proc *child; + struct rusage *ru; + svr4_siginfo_t i; switch (SCARG(uap, grp)) { case SVR4_P_PID: @@ -1190,32 +1188,42 @@ svr4_sys_waitsys(l, v, retval) SCARG(uap, grp), SCARG(uap, id), SCARG(uap, info), SCARG(uap, options))); - error = find_stopped_child(parent, SCARG(uap, id), options, &child); - if (error != 0) + rw_enter(&proclist_lock, RW_WRITER); + + error = find_stopped_child(parent, SCARG(uap, id), options, &child, + &status); + if (error != 0) { + rw_exit(&proclist_lock); return error; + } *retval = 0; - if (child == NULL) - return svr4_setinfo(NULL, 0, SCARG(uap, info)); + if (child == NULL) { + rw_exit(&proclist_lock); + svr4_setinfo(NULL, 0, &i); + return copyout(&i, SCARG(uap, info), sizeof(i)); + } if (child->p_stat == SZOMB) { DPRINTF(("found %d\n", child->p_pid)); - if ((error = svr4_setinfo(child, child->p_xstat, - SCARG(uap, info))) != 0) - return error; - + svr4_setinfo(child, status, &i); if ((SCARG(uap, options) & SVR4_WNOWAIT)) { DPRINTF(("Don't wait\n")); + rw_exit(&proclist_lock); return 0; } - proc_free(child); - return 0; + /* proc_free() will release the lock. */ + proc_free(child, &ru); + pool_put(&rusage_pool, ru); + return copyout(&i, SCARG(uap, info), sizeof(i)); } DPRINTF(("jobcontrol %d\n", child->p_pid)); - return svr4_setinfo(child, W_STOPCODE(child->p_xstat), - SCARG(uap, info)); + + svr4_setinfo(child, W_STOPCODE(status), &i); + rw_exit(&proclist_lock); + return copyout(&i, SCARG(uap, info), sizeof(i)); } diff --git a/sys/compat/svr4/svr4_net.c b/sys/compat/svr4/svr4_net.c index 207b231c5cf..0a7e7eb25fc 100644 --- a/sys/compat/svr4/svr4_net.c +++ b/sys/compat/svr4/svr4_net.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_net.c,v 1.45 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: svr4_net.c,v 1.46 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_net.c,v 1.45 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_net.c,v 1.46 2007/02/09 21:55:24 ad Exp $"); #define COMPAT_SVR4 1 @@ -68,7 +68,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_net.c,v 1.45 2006/11/16 01:32:44 christos Exp $ #include <sys/conf.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4/svr4_schedctl.c b/sys/compat/svr4/svr4_schedctl.c index fe3b459176d..4ff1d870298 100644 --- a/sys/compat/svr4/svr4_schedctl.c +++ b/sys/compat/svr4/svr4_schedctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_schedctl.c,v 1.4 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: svr4_schedctl.c,v 1.5 2007/02/09 21:55:24 ad Exp $ */ /* * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_schedctl.c,v 1.4 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_schedctl.c,v 1.5 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_schedctl.c,v 1.4 2006/11/16 01:32:44 christos E #include <sys/malloc.h> #include <sys/vnode.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4/svr4_signal.c b/sys/compat/svr4/svr4_signal.c index c2f2641acb2..7d3a339676b 100644 --- a/sys/compat/svr4/svr4_signal.c +++ b/sys/compat/svr4/svr4_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_signal.c,v 1.57 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_signal.c,v 1.58 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.57 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.58 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.57 2007/01/29 01:52:44 hubertf Exp #include <sys/malloc.h> #include <sys/wait.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm_extern.h> @@ -220,7 +219,6 @@ svr4_sys_sigaction(struct lwp *l, void *v, register_t *retval) syscallarg(const struct svr4_sigaction *) nsa; syscallarg(struct svr4_sigaction *) osa; } */ *uap = v; - struct proc *p = l->l_proc; struct svr4_sigaction nssa, ossa; struct sigaction nbsa, obsa; int error; @@ -231,7 +229,7 @@ svr4_sys_sigaction(struct lwp *l, void *v, register_t *retval) return (error); svr4_to_native_sigaction(&nssa, &nbsa); } - error = sigaction1(p, svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))], + error = sigaction1(l, svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))], SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0, NULL, 0); if (error) @@ -262,7 +260,7 @@ svr4_sys_sigaltstack(struct lwp *l, void *v, register_t *retval) return (error); svr4_to_native_sigaltstack(&nsss, &nbss); } - error = sigaltstack1(l->l_proc, + error = sigaltstack1(l, SCARG(uap, nss) ? &nbss : 0, SCARG(uap, oss) ? &obss : 0); if (error) return (error); @@ -288,8 +286,8 @@ svr4_sys_signal(l, v, retval) syscallarg(int) signum; syscallarg(svr4_sig_t) handler; } */ *uap = v; - struct proc *p = l->l_proc; int signum = svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))]; + struct proc *p = l->l_proc; struct sigaction nbsa, obsa; sigset_t ss; int error; @@ -307,7 +305,7 @@ svr4_sys_signal(l, v, retval) nbsa.sa_handler = (sig_t)SCARG(uap, handler); sigemptyset(&nbsa.sa_mask); nbsa.sa_flags = 0; - error = sigaction1(p, signum, &nbsa, &obsa, NULL, 0); + error = sigaction1(l, signum, &nbsa, &obsa, NULL, 0); if (error) return (error); *retval = (u_int)(u_long)obsa.sa_handler; @@ -317,23 +315,29 @@ svr4_sys_signal(l, v, retval) sighold: sigemptyset(&ss); sigaddset(&ss, signum); - return (sigprocmask1(p, SIG_BLOCK, &ss, 0)); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SIG_BLOCK, &ss, 0); + mutex_exit(&p->p_smutex); + return error; case SVR4_SIGRELSE_MASK: sigemptyset(&ss); sigaddset(&ss, signum); - return (sigprocmask1(p, SIG_UNBLOCK, &ss, 0)); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SIG_UNBLOCK, &ss, 0); + mutex_exit(&p->p_smutex); + return error; case SVR4_SIGIGNORE_MASK: nbsa.sa_handler = SIG_IGN; sigemptyset(&nbsa.sa_mask); nbsa.sa_flags = 0; - return (sigaction1(p, signum, &nbsa, 0, NULL, 0)); + return (sigaction1(l, signum, &nbsa, 0, NULL, 0)); case SVR4_SIGPAUSE_MASK: - ss = p->p_sigctx.ps_sigmask; + ss = l->l_sigmask; /* XXXAD locking */ sigdelset(&ss, signum); - return (sigsuspend1(p, &ss)); + return (sigsuspend1(l, &ss)); default: return (ENOSYS); @@ -348,6 +352,7 @@ svr4_sys_sigprocmask(struct lwp *l, void *v, register_t *retval) syscallarg(const svr4_sigset_t *) set; syscallarg(svr4_sigset_t *) oset; } */ *uap = v; + struct proc *p = l->l_proc; svr4_sigset_t nsss, osss; sigset_t nbss, obss; int how; @@ -381,8 +386,10 @@ svr4_sys_sigprocmask(struct lwp *l, void *v, register_t *retval) return error; svr4_to_native_sigset(&nsss, &nbss); } - error = sigprocmask1(l->l_proc, how, + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, how, SCARG(uap, set) ? &nbss : NULL, SCARG(uap, oset) ? &obss : NULL); + mutex_exit(&p->p_smutex); if (error) return error; if (SCARG(uap, oset)) { @@ -406,7 +413,7 @@ svr4_sys_sigpending(struct lwp *l, void *v, register_t *retval) switch (SCARG(uap, what)) { case 1: /* sigpending */ - sigpending1(l->l_proc, &bss); + sigpending1(l, &bss); native_to_svr4_sigset(&bss, &sss); break; @@ -437,14 +444,14 @@ svr4_sys_sigsuspend(struct lwp *l, void *v, register_t *retval) svr4_to_native_sigset(&sss, &bss); } - return (sigsuspend1(l->l_proc, SCARG(uap, set) ? &bss : 0)); + return (sigsuspend1(l, SCARG(uap, set) ? &bss : 0)); } int svr4_sys_pause(struct lwp *l, void *v, register_t *retval) { - return (sigsuspend1(l->l_proc, 0)); + return (sigsuspend1(l, 0)); } int @@ -474,25 +481,25 @@ svr4_getcontext(l, uc) svr4_getmcontext(l, &uc->uc_mcontext, &uc->uc_flags); uc->uc_link = l->l_ctxlink; + /* * The (unsupplied) definition of the `current execution stack' * in the System V Interface Definition appears to allow returning * the main context stack. */ - if ((p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK) == 0) { + if ((l->l_sigstk.ss_flags & SS_ONSTACK) == 0) { uc->uc_stack.ss_sp = (void *)USRSTACK; uc->uc_stack.ss_size = ctob(p->p_vmspace->vm_ssize); uc->uc_stack.ss_flags = 0; /* XXX, def. is Very Fishy */ } else { /* Simply copy alternate signal execution stack. */ - uc->uc_stack.ss_sp = p->p_sigctx.ps_sigstk.ss_sp; - uc->uc_stack.ss_size = p->p_sigctx.ps_sigstk.ss_size; - uc->uc_stack.ss_flags = p->p_sigctx.ps_sigstk.ss_flags; + uc->uc_stack.ss_sp = l->l_sigstk.ss_sp; + uc->uc_stack.ss_size = l->l_sigstk.ss_size; + uc->uc_stack.ss_flags = l->l_sigstk.ss_flags; } + (void)sigprocmask1(l, 0, NULL, &mask); - (void)sigprocmask1(p, 0, NULL, &mask); native_to_svr4_sigset(&mask, &uc->uc_sigmask); - uc->uc_flags |= _UC_SIGMASK | _UC_STACK; } @@ -502,12 +509,14 @@ svr4_setcontext(l, uc) struct lwp *l; struct svr4_ucontext *uc; { - sigset_t mask; struct proc *p = l->l_proc; + sigset_t mask; if (uc->uc_flags & _UC_SIGMASK) { svr4_to_native_sigset(&uc->uc_sigmask, &mask); - sigprocmask1(p, SIG_SETMASK, &mask, NULL); + mutex_enter(&p->p_smutex); + sigprocmask1(l, SIG_SETMASK, &mask, NULL); + mutex_exit(&p->p_smutex); } /* Ignore the stack; see comment in svr4_getcontext. */ diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c index 0ef82e96bf2..18a13ab7e06 100644 --- a/sys/compat/svr4/svr4_socket.c +++ b/sys/compat/svr4/svr4_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_socket.c,v 1.15 2006/08/17 17:11:27 christos Exp $ */ +/* $NetBSD: svr4_socket.c,v 1.16 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_socket.c,v 1.15 2006/08/17 17:11:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_socket.c,v 1.16 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -59,7 +59,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_socket.c,v 1.15 2006/08/17 17:11:27 christos Ex #include <sys/mount.h> #include <sys/socket.h> #include <sys/socketvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/un.h> #include <sys/stat.h> diff --git a/sys/compat/svr4/svr4_sockio.c b/sys/compat/svr4/svr4_sockio.c index 3d2f97c33dc..9bbcc7c7fb9 100644 --- a/sys/compat/svr4/svr4_sockio.c +++ b/sys/compat/svr4/svr4_sockio.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_sockio.c,v 1.27 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_sockio.c,v 1.28 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_sockio.c,v 1.27 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_sockio.c,v 1.28 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_sockio.c,v 1.27 2007/01/29 01:52:44 hubertf Exp #include <net/if.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/socket.h> diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 699b65d0b91..8e492a31665 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_stat.c,v 1.58 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: svr4_stat.c,v 1.59 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.58 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.59 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.58 2006/11/16 01:32:44 christos Exp #include <uvm/uvm_extern.h> #include <sys/sysctl.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index 783aae3976b..2fc32f67999 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_stream.c,v 1.60 2006/11/16 01:32:44 christos Exp $ */ +/* $NetBSD: svr4_stream.c,v 1.61 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.60 2006/11/16 01:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.61 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -67,7 +67,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.60 2006/11/16 01:32:44 christos Ex #include <sys/device.h> #include <sys/stat.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4/svr4_syscalls.c b/sys/compat/svr4/svr4_syscalls.c index 2c4a0bdce46..4dad9e7905d 100644 --- a/sys/compat/svr4/svr4_syscalls.c +++ b/sys/compat/svr4/svr4_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_syscalls.c,v 1.75 2006/05/29 09:46:54 drochner Exp $ */ +/* $NetBSD: svr4_syscalls.c,v 1.76 2007/02/09 21:55:24 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_syscalls.c,v 1.75 2006/05/29 09:46:54 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_syscalls.c,v 1.76 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_syscalls.c,v 1.75 2006/05/29 09:46:54 drochner #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> #include <compat/svr4/svr4_time.h> diff --git a/sys/compat/svr4/svr4_sysent.c b/sys/compat/svr4/svr4_sysent.c index e74cab03394..28e9371ff42 100644 --- a/sys/compat/svr4/svr4_sysent.c +++ b/sys/compat/svr4/svr4_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_sysent.c,v 1.78 2006/05/29 09:46:54 drochner Exp $ */ +/* $NetBSD: svr4_sysent.c,v 1.79 2007/02/09 21:55:24 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_sysent.c,v 1.78 2006/05/29 09:46:54 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_sysent.c,v 1.79 2007/02/09 21:55:24 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_sysent.c,v 1.78 2006/05/29 09:46:54 drochner Ex #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> #include <compat/svr4/svr4_time.h> diff --git a/sys/compat/svr4/svr4_termios.c b/sys/compat/svr4/svr4_termios.c index ed661961f6e..9be54159bd6 100644 --- a/sys/compat/svr4/svr4_termios.c +++ b/sys/compat/svr4/svr4_termios.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_termios.c,v 1.21 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_termios.c,v 1.22 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_termios.c,v 1.21 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_termios.c,v 1.22 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_termios.c,v 1.21 2007/01/29 01:52:44 hubertf Ex #include <net/if.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4/svr4_ttold.c b/sys/compat/svr4/svr4_ttold.c index cdf7d6ebe29..2afd615e372 100644 --- a/sys/compat/svr4/svr4_ttold.c +++ b/sys/compat/svr4/svr4_ttold.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_ttold.c,v 1.27 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_ttold.c,v 1.28 2007/02/09 21:55:24 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_ttold.c,v 1.27 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_ttold.c,v 1.28 2007/02/09 21:55:24 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_ttold.c,v 1.27 2007/01/29 01:52:44 hubertf Exp #include <sys/malloc.h> #include <sys/ioctl_compat.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4/syscalls.master b/sys/compat/svr4/syscalls.master index 03c59c502f2..82dbee73278 100644 --- a/sys/compat/svr4/syscalls.master +++ b/sys/compat/svr4/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.54 2006/05/29 09:44:51 drochner Exp $ + $NetBSD: syscalls.master,v 1.55 2007/02/09 21:55:24 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -41,7 +41,6 @@ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4/svr4_types.h> diff --git a/sys/compat/svr4_32/svr4_32_exec.c b/sys/compat/svr4_32/svr4_32_exec.c index 23356f6ebf2..77b7476b98d 100644 --- a/sys/compat/svr4_32/svr4_32_exec.c +++ b/sys/compat/svr4_32/svr4_32_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_exec.c,v 1.19 2006/10/16 20:12:38 martin Exp $ */ +/* $NetBSD: svr4_32_exec.c,v 1.20 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994, 2000 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_exec.c,v 1.19 2006/10/16 20:12:38 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_exec.c,v 1.20 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_syscall_debug.h" @@ -106,5 +106,5 @@ const struct emul emul_svr4_32 = { svr4_32_vm_default_addr, NULL, - NULL, + 0, }; diff --git a/sys/compat/svr4_32/svr4_32_fcntl.c b/sys/compat/svr4_32/svr4_32_fcntl.c index 059f862f9ee..580501be43c 100644 --- a/sys/compat/svr4_32/svr4_32_fcntl.c +++ b/sys/compat/svr4_32/svr4_32_fcntl.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_fcntl.c,v 1.15 2007/01/04 18:27:36 elad Exp $ */ +/* $NetBSD: svr4_32_fcntl.c,v 1.16 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994, 1997 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_fcntl.c,v 1.15 2007/01/04 18:27:36 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_fcntl.c,v 1.16 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_fcntl.c,v 1.15 2007/01/04 18:27:36 elad Exp #include <sys/vnode.h> #include <sys/kauth.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> @@ -389,8 +388,9 @@ svr4_32_sys_open(l, v, retval) if (error) return error; + /* XXXSMP unlocked */ if (!(SCARG(&cup, flags) & O_NOCTTY) && SESS_LEADER(p) && - !(p->p_flag & P_CONTROLT)) { + !(p->p_lflag & PL_CONTROLT)) { struct filedesc *fdp = p->p_fd; struct file *fp; diff --git a/sys/compat/svr4_32/svr4_32_filio.c b/sys/compat/svr4_32/svr4_32_filio.c index ae2adc42c0b..a701759b060 100644 --- a/sys/compat/svr4_32/svr4_32_filio.c +++ b/sys/compat/svr4_32/svr4_32_filio.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_filio.c,v 1.9 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_32_filio.c,v 1.10 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_filio.c,v 1.9 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_filio.c,v 1.10 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_filio.c,v 1.9 2007/01/29 01:52:44 hubertf Ex #include <net/if.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> diff --git a/sys/compat/svr4_32/svr4_32_ioctl.c b/sys/compat/svr4_32/svr4_32_ioctl.c index e4d981b38b6..7ce7ff89230 100644 --- a/sys/compat/svr4_32/svr4_32_ioctl.c +++ b/sys/compat/svr4_32/svr4_32_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_ioctl.c,v 1.12 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_32_ioctl.c,v 1.13 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.12 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.13 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.12 2007/01/29 01:52:44 hubertf E #include <net/if.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/socket.h> diff --git a/sys/compat/svr4_32/svr4_32_ipc.c b/sys/compat/svr4_32/svr4_32_ipc.c index 5333d55edb4..0c356d2cc40 100644 --- a/sys/compat/svr4_32/svr4_32_ipc.c +++ b/sys/compat/svr4_32/svr4_32_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_ipc.c,v 1.11 2006/07/28 13:02:21 hannken Exp $ */ +/* $NetBSD: svr4_32_ipc.c,v 1.12 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_ipc.c,v 1.11 2006/07/28 13:02:21 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_ipc.c,v 1.12 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_ipc.c,v 1.11 2006/07/28 13:02:21 hannken Exp #include <sys/stat.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> diff --git a/sys/compat/svr4_32/svr4_32_lwp.c b/sys/compat/svr4_32/svr4_32_lwp.c index 374e3ca8044..7b8cfbfde20 100644 --- a/sys/compat/svr4_32/svr4_32_lwp.c +++ b/sys/compat/svr4_32/svr4_32_lwp.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_lwp.c,v 1.7 2005/12/11 12:20:26 christos Exp $ */ +/* $NetBSD: svr4_32_lwp.c,v 1.8 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.7 2005/12/11 12:20:26 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.8 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.7 2005/12/11 12:20:26 christos Exp #include <sys/user.h> #include <sys/socket.h> #include <sys/socketvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/un.h> #include <sys/stat.h> diff --git a/sys/compat/svr4_32/svr4_32_misc.c b/sys/compat/svr4_32/svr4_32_misc.c index b3931c2f551..71c3b31de68 100644 --- a/sys/compat/svr4_32/svr4_32_misc.c +++ b/sys/compat/svr4_32/svr4_32_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_misc.c,v 1.39 2006/10/16 20:18:55 martin Exp $ */ +/* $NetBSD: svr4_32_misc.c,v 1.40 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.39 2006/10/16 20:18:55 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.40 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -77,7 +77,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.39 2006/10/16 20:18:55 martin Exp #include <sys/signalvar.h> #include <netinet/in.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <miscfs/specfs/specdev.h> @@ -1188,7 +1187,7 @@ svr4_32_sys_waitsys(l, v, retval) { struct svr4_32_sys_waitsys_args *uap = v; struct proc *parent = l->l_proc; - int options, error; + int options, error, status; struct proc *child; switch (SCARG(uap, grp)) { @@ -1222,31 +1221,41 @@ svr4_32_sys_waitsys(l, v, retval) if (SCARG(uap, options) & (SVR4_WSTOPPED|SVR4_WCONTINUED)) options |= WUNTRACED; - error = find_stopped_child(parent, SCARG(uap, id), options, &child); - if (error != 0) + rw_enter(&proclist_lock, RW_WRITER); + error = find_stopped_child(parent, SCARG(uap, id), options, &child, + &status); + if (error != 0) { + rw_exit(&proclist_lock); return error; + } *retval = 0; - if (child == NULL) + if (child == NULL) { + rw_exit(&proclist_lock); return svr4_32_setinfo(NULL, 0, SCARG(uap, info)); + } if (child->p_stat == SZOMB) { DPRINTF(("found %d\n", child->p_pid)); - error = svr4_32_setinfo(child, child->p_xstat, SCARG(uap,info)); - if (error) + error = svr4_32_setinfo(child, status, SCARG(uap,info)); + if (error) { + rw_exit(&proclist_lock); return error; + } if ((SCARG(uap, options) & SVR4_WNOWAIT)) { + rw_exit(&proclist_lock); DPRINTF(("Don't wait\n")); return 0; } - proc_free(child); + /* proc_free() will release the lock */ + proc_free(child, NULL); return 0; } DPRINTF(("jobcontrol %d\n", child->p_pid)); - return svr4_32_setinfo(child, W_STOPCODE(child->p_xstat), - SCARG(uap, info)); + rw_exit(&proclist_lock); + return svr4_32_setinfo(child, W_STOPCODE(status), SCARG(uap, info)); } static int diff --git a/sys/compat/svr4_32/svr4_32_net.c b/sys/compat/svr4_32/svr4_32_net.c index 2dd9764bd15..bdd3e85f424 100644 --- a/sys/compat/svr4_32/svr4_32_net.c +++ b/sys/compat/svr4_32/svr4_32_net.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_net.c,v 1.13 2006/10/16 20:18:55 martin Exp $ */ +/* $NetBSD: svr4_32_net.c,v 1.14 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_net.c,v 1.13 2006/10/16 20:18:55 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_net.c,v 1.14 2007/02/09 21:55:26 ad Exp $"); #define COMPAT_SVR4 1 @@ -68,7 +68,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_net.c,v 1.13 2006/10/16 20:18:55 martin Exp #include <sys/conf.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> diff --git a/sys/compat/svr4_32/svr4_32_schedctl.c b/sys/compat/svr4_32/svr4_32_schedctl.c index d691767cd29..8a8f1f86fdf 100644 --- a/sys/compat/svr4_32/svr4_32_schedctl.c +++ b/sys/compat/svr4_32/svr4_32_schedctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_schedctl.c,v 1.3 2005/12/11 12:20:26 christos Exp $ */ +/* $NetBSD: svr4_32_schedctl.c,v 1.4 2007/02/09 21:55:26 ad Exp $ */ /* * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_schedctl.c,v 1.3 2005/12/11 12:20:26 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_schedctl.c,v 1.4 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_schedctl.c,v 1.3 2005/12/11 12:20:26 christo #include <sys/malloc.h> #include <sys/vnode.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> diff --git a/sys/compat/svr4_32/svr4_32_signal.c b/sys/compat/svr4_32/svr4_32_signal.c index 30b30f7c7c0..cf7e24d5016 100644 --- a/sys/compat/svr4_32/svr4_32_signal.c +++ b/sys/compat/svr4_32/svr4_32_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_signal.c,v 1.17 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_32_signal.c,v 1.18 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.17 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.18 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_svr4.h" @@ -56,7 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.17 2007/01/29 01:52:44 hubertf #include <sys/malloc.h> #include <sys/wait.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> @@ -370,7 +369,7 @@ svr4_32_sys_sigaction(l, v, retval) return (error); svr4_32_to_native_sigaction(&nssa, &nbsa); } - error = sigaction1(l->l_proc, + error = sigaction1(l, svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))], SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0, NULL, 0); @@ -398,6 +397,7 @@ svr4_32_sys_sigaltstack(l, v, retval) } */ *uap = v; struct svr4_32_sigaltstack nsss, osss; struct sigaltstack nbss, obss; + struct proc *p; int error; if (SCARG(uap, nss)) { @@ -405,9 +405,12 @@ svr4_32_sys_sigaltstack(l, v, retval) &nsss, sizeof(nsss)); if (error) return (error); + p = l->l_proc; + mutex_enter(&p->p_smutex); svr4_32_to_native_sigaltstack(&nsss, &nbss); + mutex_exit(&p->p_smutex); } - error = sigaltstack1(l->l_proc, + error = sigaltstack1(l, SCARG(uap, nss) ? &nbss : 0, SCARG(uap, oss) ? &obss : 0); if (error) return (error); @@ -453,7 +456,7 @@ svr4_32_sys_signal(l, v, retval) nbsa.sa_handler = (sig_t)SCARG(uap, handler); sigemptyset(&nbsa.sa_mask); nbsa.sa_flags = 0; - error = sigaction1(p, signum, &nbsa, &obsa, NULL, 0); + error = sigaction1(l, signum, &nbsa, &obsa, NULL, 0); if (error) return (error); *retval = (u_int)(u_long)obsa.sa_handler; @@ -463,23 +466,31 @@ svr4_32_sys_signal(l, v, retval) sighold: sigemptyset(&ss); sigaddset(&ss, signum); - return (sigprocmask1(p, SIG_BLOCK, &ss, 0)); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SIG_BLOCK, &ss, 0); + mutex_exit(&p->p_smutex); + return error; case SVR4_SIGRELSE_MASK: sigemptyset(&ss); sigaddset(&ss, signum); - return (sigprocmask1(p, SIG_UNBLOCK, &ss, 0)); + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, SIG_UNBLOCK, &ss, 0); + mutex_exit(&p->p_smutex); + return error; case SVR4_SIGIGNORE_MASK: nbsa.sa_handler = SIG_IGN; sigemptyset(&nbsa.sa_mask); nbsa.sa_flags = 0; - return (sigaction1(p, signum, &nbsa, 0, NULL, 0)); + return (sigaction1(l, signum, &nbsa, 0, NULL, 0)); case SVR4_SIGPAUSE_MASK: - ss = p->p_sigctx.ps_sigmask; + mutex_enter(&p->p_smutex); + ss = l->l_sigmask; + mutex_exit(&p->p_smutex); sigdelset(&ss, signum); - return (sigsuspend1(p, &ss)); + return (sigsuspend1(l, &ss)); default: return (ENOSYS); @@ -497,6 +508,7 @@ svr4_32_sys_sigprocmask(l, v, retval) syscallarg(const svr4_32_sigset_t *) set; syscallarg(svr4_32_sigset_t *) oset; } */ *uap = v; + struct proc *p = l->l_proc; svr4_32_sigset_t nsss, osss; sigset_t nbss, obss; int how; @@ -531,8 +543,10 @@ svr4_32_sys_sigprocmask(l, v, retval) return error; svr4_32_to_native_sigset(&nsss, &nbss); } - error = sigprocmask1(l->l_proc, how, + mutex_enter(&p->p_smutex); + error = sigprocmask1(l, how, SCARG(uap, set) ? &nbss : NULL, SCARG(uap, oset) ? &obss : NULL); + mutex_exit(&p->p_smutex); if (error) return error; if (SCARG(uap, oset)) { @@ -560,7 +574,7 @@ svr4_32_sys_sigpending(l, v, retval) switch (SCARG(uap, what)) { case 1: /* sigpending */ - sigpending1(l->l_proc, &bss); + sigpending1(l, &bss); native_to_svr4_32_sigset(&bss, &sss); break; @@ -594,7 +608,7 @@ svr4_32_sys_sigsuspend(l, v, retval) svr4_32_to_native_sigset(&sss, &bss); } - return (sigsuspend1(l->l_proc, SCARG(uap, set) ? &bss : 0)); + return (sigsuspend1(l, SCARG(uap, set) ? &bss : 0)); } int @@ -604,7 +618,7 @@ svr4_32_sys_pause(l, v, retval) register_t *retval; { - return (sigsuspend1(l->l_proc, 0)); + return (sigsuspend1(l, 0)); } int @@ -650,7 +664,9 @@ svr4_32_getcontext(l, uc, mask) ss->ss_flags = 0; #endif /* get signal mask */ + mutex_enter(&l->l_proc->p_smutex); native_to_svr4_32_sigset(mask, &uc->uc_sigmask); + mutex_exit(&l->l_proc->p_smutex); uc->uc_flags |= SVR4_UC_STACK|SVR4_UC_SIGMASK; } @@ -671,20 +687,22 @@ svr4_32_setcontext(l, uc) /* set link */ l->l_ctxlink = (caddr_t)(u_long)uc->uc_link; + mutex_enter(&p->p_smutex); + /* set signal stack */ - if (uc->uc_flags & SVR4_UC_STACK) { - svr4_32_to_native_sigaltstack(&uc->uc_stack, - &p->p_sigctx.ps_sigstk); - } + if (uc->uc_flags & SVR4_UC_STACK) + svr4_32_to_native_sigaltstack(&uc->uc_stack, &l->l_sigstk); /* set signal mask */ if (uc->uc_flags & SVR4_UC_SIGMASK) { sigset_t mask; svr4_32_to_native_sigset(&uc->uc_sigmask, &mask); - (void)sigprocmask1(p, SIG_SETMASK, &mask, 0); + (void)sigprocmask1(l, SIG_SETMASK, &mask, 0); } + mutex_exit(&p->p_smutex); + return EJUSTRETURN; } @@ -698,7 +716,6 @@ svr4_32_sys_context(l, v, retval) syscallarg(int) func; syscallarg(struct svr4_32_ucontext *) uc; } */ *uap = v; - struct proc *p = l->l_proc; struct svr4_32_ucontext uc; int error; *retval = 0; @@ -706,7 +723,7 @@ svr4_32_sys_context(l, v, retval) switch (SCARG(uap, func)) { case SVR4_GETCONTEXT: DPRINTF(("getcontext(%p)\n", SCARG(uap, uc))); - svr4_32_getcontext(l, &uc, &p->p_sigctx.ps_sigmask); + svr4_32_getcontext(l, &uc, &l->l_sigmask); return copyout(&uc, (caddr_t)(u_long)SCARG(uap, uc), sizeof(uc)); case SVR4_SETCONTEXT: diff --git a/sys/compat/svr4_32/svr4_32_socket.c b/sys/compat/svr4_32/svr4_32_socket.c index fa1ee4ff2a6..6360a6aa76b 100644 --- a/sys/compat/svr4_32/svr4_32_socket.c +++ b/sys/compat/svr4_32/svr4_32_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_socket.c,v 1.8 2006/06/27 09:09:40 pavel Exp $ */ +/* $NetBSD: svr4_32_socket.c,v 1.9 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.8 2006/06/27 09:09:40 pavel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.9 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -59,7 +59,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.8 2006/06/27 09:09:40 pavel Exp #include <sys/mount.h> #include <sys/socket.h> #include <sys/socketvar.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/un.h> #include <sys/stat.h> diff --git a/sys/compat/svr4_32/svr4_32_sockio.c b/sys/compat/svr4_32/svr4_32_sockio.c index d94af85d3e2..4345d3fff17 100644 --- a/sys/compat/svr4_32/svr4_32_sockio.c +++ b/sys/compat/svr4_32/svr4_32_sockio.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_sockio.c,v 1.12 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_32_sockio.c,v 1.13 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.12 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.13 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.12 2007/01/29 01:52:44 hubertf #include <net/if.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sys/socket.h> diff --git a/sys/compat/svr4_32/svr4_32_stat.c b/sys/compat/svr4_32/svr4_32_stat.c index 132c3379d4e..1870fea6302 100644 --- a/sys/compat/svr4_32/svr4_32_stat.c +++ b/sys/compat/svr4_32/svr4_32_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_stat.c,v 1.21 2007/01/04 18:27:36 elad Exp $ */ +/* $NetBSD: svr4_32_stat.c,v 1.22 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.21 2007/01/04 18:27:36 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.22 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -58,7 +58,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.21 2007/01/04 18:27:36 elad Exp $ #include <uvm/uvm_extern.h> #include <sys/sysctl.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> diff --git a/sys/compat/svr4_32/svr4_32_stream.c b/sys/compat/svr4_32/svr4_32_stream.c index 0ecd64e874d..d25bc06cc3f 100644 --- a/sys/compat/svr4_32/svr4_32_stream.c +++ b/sys/compat/svr4_32/svr4_32_stream.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_stream.c,v 1.18 2006/05/20 22:15:20 christos Exp $ */ +/* $NetBSD: svr4_32_stream.c,v 1.19 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_stream.c,v 1.18 2006/05/20 22:15:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_stream.c,v 1.19 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -67,7 +67,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_stream.c,v 1.18 2006/05/20 22:15:20 christos #include <sys/device.h> #include <sys/stat.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> diff --git a/sys/compat/svr4_32/svr4_32_syscalls.c b/sys/compat/svr4_32/svr4_32_syscalls.c index c2a057af331..56e13a6b3d7 100644 --- a/sys/compat/svr4_32/svr4_32_syscalls.c +++ b/sys/compat/svr4_32/svr4_32_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_syscalls.c,v 1.13 2006/05/29 09:46:54 drochner Exp $ */ +/* $NetBSD: svr4_32_syscalls.c,v 1.14 2007/02/09 21:55:26 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_syscalls.c,v 1.13 2006/05/29 09:46:54 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_syscalls.c,v 1.14 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -20,7 +20,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_syscalls.c,v 1.13 2006/05/29 09:46:54 drochn #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> #include <compat/netbsd32/netbsd32_syscallargs.h> diff --git a/sys/compat/svr4_32/svr4_32_sysent.c b/sys/compat/svr4_32/svr4_32_sysent.c index de89f44b79e..398160a4173 100644 --- a/sys/compat/svr4_32/svr4_32_sysent.c +++ b/sys/compat/svr4_32/svr4_32_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_sysent.c,v 1.14 2006/05/29 09:46:54 drochner Exp $ */ +/* $NetBSD: svr4_32_sysent.c,v 1.15 2007/02/09 21:55:26 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_sysent.c,v 1.14 2006/05/29 09:46:54 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_sysent.c,v 1.15 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_sysent.c,v 1.14 2006/05/29 09:46:54 drochner #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> #include <compat/netbsd32/netbsd32_syscallargs.h> diff --git a/sys/compat/svr4_32/svr4_32_termios.c b/sys/compat/svr4_32/svr4_32_termios.c index 29f148ffc7b..b6139baaa65 100644 --- a/sys/compat/svr4_32/svr4_32_termios.c +++ b/sys/compat/svr4_32/svr4_32_termios.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_termios.c,v 1.11 2007/01/29 01:52:44 hubertf Exp $ */ +/* $NetBSD: svr4_32_termios.c,v 1.12 2007/02/09 21:55:26 ad Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svr4_32_termios.c,v 1.11 2007/01/29 01:52:44 hubertf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_termios.c,v 1.12 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_termios.c,v 1.11 2007/01/29 01:52:44 hubertf #include <net/if.h> #include <sys/malloc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> diff --git a/sys/compat/svr4_32/syscalls.master b/sys/compat/svr4_32/syscalls.master index 72f145cec4c..7811a5a3372 100644 --- a/sys/compat/svr4_32/syscalls.master +++ b/sys/compat/svr4_32/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.9 2006/05/29 09:44:51 drochner Exp $ + $NetBSD: syscalls.master,v 1.10 2007/02/09 21:55:26 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -41,7 +41,6 @@ #include <sys/signal.h> #include <sys/mount.h> #include <sys/poll.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/svr4_32/svr4_32_types.h> diff --git a/sys/compat/ultrix/syscalls.master b/sys/compat/ultrix/syscalls.master index b61be7674b1..40873ea347e 100644 --- a/sys/compat/ultrix/syscalls.master +++ b/sys/compat/ultrix/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.42 2006/07/13 23:47:17 pavel Exp $ + $NetBSD: syscalls.master,v 1.43 2007/02/09 21:55:26 ad Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -40,7 +40,6 @@ #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ultrix/ultrix_syscallargs.h> diff --git a/sys/compat/ultrix/ultrix_fs.c b/sys/compat/ultrix/ultrix_fs.c index 8afa728c8cd..ac8ddf98efb 100644 --- a/sys/compat/ultrix/ultrix_fs.c +++ b/sys/compat/ultrix/ultrix_fs.c @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_fs.c,v 1.34 2005/12/11 12:20:30 christos Exp $ */ +/* $NetBSD: ultrix_fs.c,v 1.35 2007/02/09 21:55:26 ad Exp $ */ /* * Copyright (c) 1995, 1997 Jonathan Stone @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.34 2005/12/11 12:20:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.35 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.34 2005/12/11 12:20:30 christos Exp #include <ufs/ufs/quota.h> #include <ufs/ufs/ufsmount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ultrix/ultrix_syscallargs.h> #include <compat/common/compat_util.h> diff --git a/sys/compat/ultrix/ultrix_ioctl.c b/sys/compat/ultrix/ultrix_ioctl.c index 2501e883506..2e679597311 100644 --- a/sys/compat/ultrix/ultrix_ioctl.c +++ b/sys/compat/ultrix/ultrix_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_ioctl.c,v 1.28 2005/12/11 12:20:30 christos Exp $ */ +/* $NetBSD: ultrix_ioctl.c,v 1.29 2007/02/09 21:55:26 ad Exp $ */ /* from : NetBSD: sunos_ioctl.c,v 1.21 1995/10/07 06:27:31 mycroft Exp */ /* @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.28 2005/12/11 12:20:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.29 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_ultrix.h" @@ -50,7 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_ioctl.c,v 1.28 2005/12/11 12:20:30 christos E #include <sys/mount.h> #include <compat/ultrix/ultrix_syscallargs.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/sunos/sunos.h> diff --git a/sys/compat/ultrix/ultrix_misc.c b/sys/compat/ultrix/ultrix_misc.c index f15cf8cff96..875151aec8f 100644 --- a/sys/compat/ultrix/ultrix_misc.c +++ b/sys/compat/ultrix/ultrix_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_misc.c,v 1.104 2005/12/11 12:20:30 christos Exp $ */ +/* $NetBSD: ultrix_misc.c,v 1.105 2007/02/09 21:55:26 ad Exp $ */ /* * Copyright (c) 1995, 1997 Jonathan Stone (hereinafter referred to as the author) @@ -76,7 +76,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.104 2005/12/11 12:20:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.105 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfsserver.h" @@ -121,7 +121,6 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.104 2005/12/11 12:20:30 christos E #include <sys/unistd.h> #include <sys/ipc.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <uvm/uvm_extern.h> @@ -602,7 +601,7 @@ ultrix_sys_sigpending(struct lwp *l, void *v, register_t *retval) sigset_t ss; int mask; - sigpending1(l->l_proc, &ss); + sigpending1(l, &ss); mask = ss.__bits[0]; return (copyout((caddr_t)&mask, (caddr_t)SCARG(uap, mask), sizeof(int))); @@ -640,7 +639,7 @@ ultrix_sys_sigsuspend(struct lwp *l, void *v, register_t *retval) ss.__bits[2] = 0; ss.__bits[3] = 0; - return (sigsuspend1(l->l_proc, &ss)); + return (sigsuspend1(l, &ss)); } #define ULTRIX_SV_ONSTACK 0x0001 /* take signal on signal stack */ @@ -675,7 +674,7 @@ ultrix_sys_sigvec(struct lwp *l, void *v, register_t *retval) #endif native_sigset13_to_sigset(&nsv.sv_mask, &nsa.sa_mask); } - error = sigaction1(l->l_proc, SCARG(uap, signum), + error = sigaction1(l, SCARG(uap, signum), SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0, NULL, 0); if (error) diff --git a/sys/compat/ultrix/ultrix_pathname.c b/sys/compat/ultrix/ultrix_pathname.c index 1f8598991db..9e55fb2b6ab 100644 --- a/sys/compat/ultrix/ultrix_pathname.c +++ b/sys/compat/ultrix/ultrix_pathname.c @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_pathname.c,v 1.24 2005/12/11 12:20:30 christos Exp $ */ +/* $NetBSD: ultrix_pathname.c,v 1.25 2007/02/09 21:55:26 ad Exp $ */ /* * Copyright (c) 1992, 1993 @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.24 2005/12/11 12:20:30 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.25 2007/02/09 21:55:26 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -70,7 +70,6 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_pathname.c,v 1.24 2005/12/11 12:20:30 christo #include <sys/mount.h> #include <sys/stat.h> #include <sys/vnode.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <sys/proc.h> @@ -200,7 +199,8 @@ ultrix_sys_open(struct lwp *l, void *v, register_t *retval) SCARG(uap, flags) = r; ret = sys_open(l, (struct sys_open_args *)uap, retval); - if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { + /* XXXSMP */ + if (!ret && !noctty && SESS_LEADER(p) && !(p->p_lflag & PL_CONTROLT)) { struct filedesc *fdp = p->p_fd; struct file *fp; diff --git a/sys/compat/ultrix/ultrix_syscalls.c b/sys/compat/ultrix/ultrix_syscalls.c index 1a2fa1e41fe..ecec65b52a0 100644 --- a/sys/compat/ultrix/ultrix_syscalls.c +++ b/sys/compat/ultrix/ultrix_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_syscalls.c,v 1.50 2006/07/13 23:48:08 pavel Exp $ */ +/* $NetBSD: ultrix_syscalls.c,v 1.51 2007/02/09 21:55:26 ad Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ultrix_syscalls.c,v 1.50 2006/07/13 23:48:08 pavel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ultrix_syscalls.c,v 1.51 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -19,7 +19,6 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_syscalls.c,v 1.50 2006/07/13 23:48:08 pavel E #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ultrix/ultrix_syscallargs.h> #endif /* _KERNEL_OPT */ diff --git a/sys/compat/ultrix/ultrix_sysent.c b/sys/compat/ultrix/ultrix_sysent.c index 4f23b97c7a2..fdc2865c26a 100644 --- a/sys/compat/ultrix/ultrix_sysent.c +++ b/sys/compat/ultrix/ultrix_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_sysent.c,v 1.53 2006/07/13 23:48:08 pavel Exp $ */ +/* $NetBSD: ultrix_sysent.c,v 1.54 2007/02/09 21:55:26 ad Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ultrix_sysent.c,v 1.53 2006/07/13 23:48:08 pavel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ultrix_sysent.c,v 1.54 2007/02/09 21:55:26 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfsserver.h" @@ -18,7 +18,6 @@ __KERNEL_RCSID(0, "$NetBSD: ultrix_sysent.c,v 1.53 2006/07/13 23:48:08 pavel Exp #include <sys/systm.h> #include <sys/signal.h> #include <sys/mount.h> -#include <sys/sa.h> #include <sys/syscallargs.h> #include <compat/ultrix/ultrix_syscallargs.h> |
