diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-15 04:52:41 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-15 04:52:41 +0000 |
commit | 71771abcbf45c58af4735979b21a2e7604cb42bf (patch) | |
tree | 1e12c4f7e6473b7549d0bf973e6f96bd314644b8 /sys/arch | |
parent | 847e8a9bf0e99af86e8791ea570d84b9d3bc54f9 (diff) |
Correct the sharing of the signal handling state: stuff that should
be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves
to struct sigacts, wihle stuff that should be per rthread (ps_oldmask,
SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping
state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread
until our locking around coredumping is better.
Oh, and remove the old SunOS-compat ps_usertramp member.
"I like the sound of this" tedu@
Diffstat (limited to 'sys/arch')
24 files changed, 170 insertions, 170 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 9a64256b849..f7c6c247463 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.128 2010/11/28 21:00:03 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.129 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */ /*- @@ -1437,7 +1437,7 @@ sendsig(catcher, sig, mask, code, type, val) siginfo_t *sip, ksi; frame = p->p_md.md_tf; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; fsize = sizeof ksc; rndfsize = ((fsize + 15) / 16) * 16; kscsize = rndfsize; @@ -1453,11 +1453,11 @@ sendsig(catcher, sig, mask, code, type, val) * will fail if the process has not already allocated * the space with a `brk'. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - scp = (struct sigcontext *)(psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size - rndfsize); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + scp = (struct sigcontext *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - rndfsize); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else scp = (struct sigcontext *)(alpha_pal_rdusp() - rndfsize); if ((u_long)scp <= USRSTACK - ptoa(p->p_vmspace->vm_ssize)) @@ -1590,9 +1590,9 @@ sys_sigreturn(p, v, retval) * Restore the user-supplied information */ if (ksc.sc_onstack) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = ksc.sc_mask &~ sigcantmask; p->p_md.md_tf->tf_regs[FRAME_PC] = ksc.sc_pc; diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 078527a1ebd..68e021f11dd 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.137 2011/04/13 02:49:12 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.138 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -553,15 +553,15 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, #endif bcopy(tf, &ksc, sizeof(*tf)); - ksc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + ksc.sc_onstack = p->p_sigstk.ss_flags & SS_ONSTACK; ksc.sc_mask = mask; ksc.sc_fpstate = NULL; /* Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !ksc.sc_onstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !ksc.sc_onstack && (psp->ps_sigonstack & sigmask(sig))) { - sp = (register_t)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size; - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + sp = (register_t)p->p_sigstk.ss_sp + p->p_sigstk.ss_size; + p->p_sigstk.ss_flags |= SS_ONSTACK; } else sp = tf->tf_rsp - 128; @@ -670,9 +670,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) /* Restore signal stack. */ if (ksc.sc_onstack) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = ksc.sc_mask & ~sigcantmask; return (EJUSTRETURN); diff --git a/sys/arch/arm/arm/sig_machdep.c b/sys/arch/arm/arm/sig_machdep.c index fd710f677c6..28106a0857d 100644 --- a/sys/arch/arm/arm/sig_machdep.c +++ b/sys/arch/arm/arm/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.2 2004/02/16 15:40:00 miod Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.3 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: sig_machdep.c,v 1.22 2003/10/08 00:28:41 thorpej Exp $ */ /* @@ -87,7 +87,7 @@ sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, struct trapframe *tf; struct sigframe *fp, frame; struct sigacts *psp = p->p_sigacts; - int oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + int oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; int onstack = 0; tf = process_frame(p); @@ -95,11 +95,11 @@ sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, /* Do we need to jump onto the signal stack? */ /* Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { onstack = 1; - fp = (struct sigframe *)((caddr_t)psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size); + fp = (struct sigframe *)((caddr_t)p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); } else fp = (struct sigframe *)tf->tf_usr_sp; /* make room on the stack */ @@ -135,7 +135,7 @@ sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, frame.sf_sc.sc_spsr = tf->tf_spsr; /* Save signal stack. */ - frame.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + frame.sf_sc.sc_onstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* Save signal mask. */ frame.sf_sc.sc_mask = returnmask; @@ -177,7 +177,7 @@ sendsig(sig_t catcher, int sig, int returnmask, u_long code, int type, /* Remember that we're now on the signal stack. */ if (onstack) - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; } #if 0 @@ -270,9 +270,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) /* Restore signal stack. */ if (context.sc_onstack & SS_ONSTACK) - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - psp->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ #if 0 diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c index 203b2df2bff..17e47f69ad9 100644 --- a/sys/arch/hp300/hp300/trap.c +++ b/sys/arch/hp300/hp300/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.56 2010/07/02 19:57:14 tedu Exp $ */ +/* $OpenBSD: trap.c,v 1.57 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: trap.c,v 1.57 1998/02/16 20:58:31 thorpej Exp $ */ /* @@ -347,8 +347,8 @@ dopanic: type |= T_USER; p->p_sigacts->ps_sigact[SIGILL] = SIG_DFL; i = sigmask(SIGILL); - p->p_sigignore &= ~i; - p->p_sigcatch &= ~i; + p->p_sigacts->ps_sigignore &= ~i; + p->p_sigacts->ps_sigcatch &= ~i; p->p_sigmask &= ~i; i = SIGILL; ucode = frame.f_format; /* XXX was ILL_RESAD_FAULT */ diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index 47eb01af4fc..f2876895b98 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.199 2011/01/14 13:32:43 jsing Exp $ */ +/* $OpenBSD: machdep.c,v 1.200 2011/04/15 04:52:39 guenther Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -1199,15 +1199,15 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, /* Save the FPU context first. */ fpu_proc_save(p); - ksc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + ksc.sc_onstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !ksc.sc_onstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !ksc.sc_onstack && (psp->ps_sigonstack & sigmask(sig))) { - scp = (register_t)psp->ps_sigstk.ss_sp; - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + scp = (register_t)p->p_sigstk.ss_sp; + p->p_sigstk.ss_flags |= SS_ONSTACK; } else scp = (tf->tf_sp + 63) & ~63; @@ -1331,9 +1331,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) return (EINVAL); if (ksc.sc_onstack) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = ksc.sc_mask &~ sigcantmask; tf->tf_t1 = ksc.sc_regs[0]; /* r22 */ diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c index bea912da981..86928fd834c 100644 --- a/sys/arch/hppa64/hppa64/machdep.c +++ b/sys/arch/hppa64/hppa64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.33 2011/04/06 14:45:23 jsing Exp $ */ +/* $OpenBSD: machdep.c,v 1.34 2011/04/15 04:52:39 guenther Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -859,15 +859,15 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, mtctl(0, CR_CCR); } - ksc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + ksc.sc_onstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !ksc.sc_onstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !ksc.sc_onstack && (psp->ps_sigonstack & sigmask(sig))) { - scp = (register_t)psp->ps_sigstk.ss_sp; - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + scp = (register_t)p->p_sigstk.ss_sp; + p->p_sigstk.ss_flags |= SS_ONSTACK; } else scp = (tf->tf_sp + 63) & ~63; @@ -966,9 +966,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) return (EINVAL); if (ksc.sc_onstack) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = ksc.sc_mask &~ sigcantmask; tf->tf_sar = ksc.sc_regs[0]; diff --git a/sys/arch/i386/i386/linux_machdep.c b/sys/arch/i386/i386/linux_machdep.c index 23a4ab92f7c..63694f4fea5 100644 --- a/sys/arch/i386/i386/linux_machdep.c +++ b/sys/arch/i386/i386/linux_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_machdep.c,v 1.37 2011/04/05 13:54:42 pirofti Exp $ */ +/* $OpenBSD: linux_machdep.c,v 1.38 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */ /* @@ -114,16 +114,16 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code, int type, int oonstack; tf = p->p_md.md_regs; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct linux_sigframe *)((char *)psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size - sizeof(struct linux_sigframe)); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct linux_sigframe *)((char *)p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - sizeof(struct linux_sigframe)); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else { fp = (struct linux_sigframe *)tf->tf_esp - 1; } @@ -257,7 +257,7 @@ linux_sys_sigreturn(struct proc *p, void *v, register_t *retval) tf->tf_esp = context.sc_esp_at_signal; tf->tf_ss = context.sc_ss; - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = context.sc_mask & ~sigcantmask; return (EJUSTRETURN); diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 8a82fac962b..679b6dffb53 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.489 2011/03/20 21:44:08 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.490 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -2189,7 +2189,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, struct sigframe *fp, frame; struct sigacts *psp = p->p_sigacts; register_t sp; - int oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + int oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Build the argument list for the signal handler. @@ -2199,10 +2199,10 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, /* * Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - sp = (long)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size; - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + sp = (long)p->p_sigstk.ss_sp + p->p_sigstk.ss_size; + p->p_sigstk.ss_flags |= SS_ONSTACK; } else sp = tf->tf_esp; @@ -2377,9 +2377,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) } if (context.sc_onstack & 01) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = context.sc_mask & ~sigcantmask; return (EJUSTRETURN); diff --git a/sys/arch/i386/i386/svr4_machdep.c b/sys/arch/i386/i386/svr4_machdep.c index 8d33252061d..388e5087123 100644 --- a/sys/arch/i386/i386/svr4_machdep.c +++ b/sys/arch/i386/i386/svr4_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_machdep.c,v 1.26 2008/03/18 14:29:25 kettenis Exp $ */ +/* $OpenBSD: svr4_machdep.c,v 1.27 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: svr4_machdep.c,v 1.24 1996/05/03 19:42:26 christos Exp $ */ /* @@ -66,7 +66,7 @@ svr4_getcontext(struct proc *p, struct svr4_ucontext *uc, int mask, struct sigacts *psp = p->p_sigacts; svr4_greg_t *r = uc->uc_mcontext.greg; struct svr4_sigaltstack *s = &uc->uc_stack; - struct sigaltstack *sf = &psp->ps_sigstk; + struct sigaltstack *sf = &p->p_sigstk; bzero(uc, sizeof(struct svr4_ucontext)); @@ -138,7 +138,7 @@ svr4_setcontext(struct proc *p, struct svr4_ucontext *uc) struct trapframe *tf; svr4_greg_t *r = uc->uc_mcontext.greg; struct svr4_sigaltstack *s = &uc->uc_stack; - struct sigaltstack *sf = &psp->ps_sigstk; + struct sigaltstack *sf = &p->p_sigstk; int mask; /* @@ -316,16 +316,16 @@ svr4_sendsig(sig_t catcher, int sig, int mask, u_long code, int type, int oonstack; tf = p->p_md.md_regs; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct svr4_sigframe *)((char *)psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size - sizeof(struct svr4_sigframe)); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct svr4_sigframe *)((char *)p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - sizeof(struct svr4_sigframe)); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else { fp = (struct svr4_sigframe *)tf->tf_esp - 1; } diff --git a/sys/arch/i386/i386/vm86.c b/sys/arch/i386/i386/vm86.c index e79eb1d60b6..8c2b1aca73e 100644 --- a/sys/arch/i386/i386/vm86.c +++ b/sys/arch/i386/i386/vm86.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm86.c,v 1.18 2008/06/26 05:42:10 ray Exp $ */ +/* $OpenBSD: vm86.c,v 1.19 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: vm86.c,v 1.15 1996/05/03 19:42:33 christos Exp $ */ /*- @@ -427,7 +427,7 @@ i386_vm86(struct proc *p, char *args, register_t *retval) #undef DOREG /* Going into vm86 mode jumps off the signal stack. */ - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; set_vflags(p, vm86s.regs.vmsc.sc_eflags | PSL_VM); diff --git a/sys/arch/m68k/m68k/sig_machdep.c b/sys/arch/m68k/m68k/sig_machdep.c index 6138801bfd7..eedfc32ddf7 100644 --- a/sys/arch/m68k/m68k/sig_machdep.c +++ b/sys/arch/m68k/m68k/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.22 2010/06/27 22:04:01 miod Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.23 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: sig_machdep.c,v 1.3 1997/04/30 23:28:03 gwr Exp $ */ /* @@ -135,7 +135,7 @@ sendsig(catcher, sig, mask, code, type, val) frame = (struct frame *)p->p_md.md_regs; ft = frame->f_format; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate and validate space for the signal handler @@ -145,11 +145,11 @@ sendsig(catcher, sig, mask, code, type, val) * the space with a `brk'. */ fsize = sizeof(struct sigframe); - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)(psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size - fsize); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - fsize); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (struct sigframe *)(frame->f_regs[SP] - fsize); if ((unsigned)fp <= USRSTACK - ptoa(p->p_vmspace->vm_ssize)) @@ -321,9 +321,9 @@ sys_sigreturn(p, v, retval) * Restore the user supplied information */ if (scp->sc_onstack & 1) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = scp->sc_mask &~ sigcantmask; frame = (struct frame *) p->p_md.md_regs; frame->f_regs[SP] = scp->sc_sp; diff --git a/sys/arch/m88k/m88k/sig_machdep.c b/sys/arch/m88k/m88k/sig_machdep.c index 8557ec29145..7818639a416 100644 --- a/sys/arch/m88k/m88k/sig_machdep.c +++ b/sys/arch/m88k/m88k/sig_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sig_machdep.c,v 1.10 2010/06/26 23:24:43 guenther Exp $ */ +/* $OpenBSD: sig_machdep.c,v 1.11 2011/04/15 04:52:39 guenther Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -95,7 +95,7 @@ sendsig(sig_t catcher, int sig, int mask, unsigned long code, int type, vaddr_t addr; tf = p->p_md.md_tf; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate and validate space for the signal handler * context. Note that if the stack is in data space, the @@ -104,12 +104,12 @@ sendsig(sig_t catcher, int sig, int mask, unsigned long code, int type, * the space with a `brk'. */ fsize = sizeof(struct sigframe); - if ((psp->ps_flags & SAS_ALTSTACK) && - (psp->ps_sigstk.ss_flags & SS_ONSTACK) == 0 && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && + (p->p_sigstk.ss_flags & SS_ONSTACK) == 0 && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)(psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size - fsize); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - fsize); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (struct sigframe *)(tf->tf_r[31] - fsize); @@ -222,9 +222,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) * Restore the user supplied information */ if (scp->sc_onstack & SS_ONSTACK) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = scp->sc_mask & ~sigcantmask; /* diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c index b0ffcc19754..42c089aba69 100644 --- a/sys/arch/mac68k/mac68k/trap.c +++ b/sys/arch/mac68k/mac68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.57 2010/07/02 19:57:14 tedu Exp $ */ +/* $OpenBSD: trap.c,v 1.58 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: trap.c,v 1.68 1998/12/22 08:47:07 scottr Exp $ */ /* @@ -402,8 +402,8 @@ copyfault: type |= T_USER; p->p_sigacts->ps_sigact[SIGILL] = SIG_DFL; i = sigmask(SIGILL); - p->p_sigignore &= ~i; - p->p_sigcatch &= ~i; + p->p_sigacts->ps_sigignore &= ~i; + p->p_sigacts->ps_sigcatch &= ~i; p->p_sigmask &= ~i; i = SIGILL; ucode = frame.f_format; /* XXX was ILL_RESAD_FAULT */ diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index dc738063938..9dfd408df65 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.123 2011/01/08 18:10:23 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.124 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -576,17 +576,17 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, frame.sf_signum = sig; tf = trapframe(p); - oldonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oldonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate stack space for signal handler. */ - if ((psp->ps_flags & SAS_ALTSTACK) + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oldonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)(psp->ps_sigstk.ss_sp - + psp->ps_sigstk.ss_size); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (struct sigframe *)tf->fixreg[1]; @@ -642,9 +642,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) return EINVAL; bcopy(&sc.sc_frame, tf, sizeof *tf); if (sc.sc_onstack & 1) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = sc.sc_mask & ~sigcantmask; return EJUSTRETURN; } diff --git a/sys/arch/mips64/mips64/sendsig.c b/sys/arch/mips64/mips64/sendsig.c index 21b925b71e2..117b484677b 100644 --- a/sys/arch/mips64/mips64/sendsig.c +++ b/sys/arch/mips64/mips64/sendsig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendsig.c,v 1.14 2011/04/07 15:30:15 miod Exp $ */ +/* $OpenBSD: sendsig.c,v 1.15 2011/04/15 04:52:39 guenther Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -115,7 +115,7 @@ sendsig(catcher, sig, mask, code, type, val) struct sigcontext ksc; regs = p->p_md.md_regs; - oonstack = psp->ps_sigstk.ss_flags & SA_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SA_ONSTACK; /* * Allocate and validate space for the signal handler * context. Note that if the stack is in data space, the @@ -126,12 +126,12 @@ sendsig(catcher, sig, mask, code, type, val) fsize = sizeof(struct sigframe); if (!(psp->ps_siginfo & sigmask(sig))) fsize -= sizeof(siginfo_t); - if ((psp->ps_flags & SAS_ALTSTACK) && - (psp->ps_sigstk.ss_flags & SA_ONSTACK) == 0 && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && + (p->p_sigstk.ss_flags & SA_ONSTACK) == 0 && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)(psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size - fsize); - psp->ps_sigstk.ss_flags |= SA_ONSTACK; + fp = (struct sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - fsize); + p->p_sigstk.ss_flags |= SA_ONSTACK; } else fp = (struct sigframe *)(regs->sp - fsize); if ((vaddr_t)fp <= USRSTACK - ptoa(p->p_vmspace->vm_ssize)) @@ -255,9 +255,9 @@ sys_sigreturn(p, v, retval) * Restore the user supplied information */ if (scp->sc_onstack & SA_ONSTACK) - p->p_sigacts->ps_sigstk.ss_flags |= SA_ONSTACK; + p->p_sigstk.ss_flags |= SA_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SA_ONSTACK; + p->p_sigstk.ss_flags &= ~SA_ONSTACK; p->p_sigmask = scp->sc_mask &~ sigcantmask; regs->pc = scp->sc_pc; regs->mullo = scp->mullo; diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c index 64288da48d8..9216637bab0 100644 --- a/sys/arch/mvme68k/mvme68k/trap.c +++ b/sys/arch/mvme68k/mvme68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.71 2010/09/20 06:33:47 matthew Exp $ */ +/* $OpenBSD: trap.c,v 1.72 2011/04/15 04:52:39 guenther Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -286,8 +286,8 @@ copyfault: type |= T_USER; p->p_sigacts->ps_sigact[SIGILL] = SIG_DFL; i = sigmask(SIGILL); - p->p_sigignore &= ~i; - p->p_sigcatch &= ~i; + p->p_sigacts->ps_sigignore &= ~i; + p->p_sigacts->ps_sigcatch &= ~i; p->p_sigmask &= ~i; i = SIGILL; ucode = frame.f_format; /* XXX was ILL_RESAD_FAULT */ diff --git a/sys/arch/mvmeppc/mvmeppc/machdep.c b/sys/arch/mvmeppc/mvmeppc/machdep.c index 83841797a7c..754ec737d30 100644 --- a/sys/arch/mvmeppc/mvmeppc/machdep.c +++ b/sys/arch/mvmeppc/mvmeppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.64 2010/12/21 14:56:24 claudio Exp $ */ +/* $OpenBSD: machdep.c,v 1.65 2011/04/15 04:52:39 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -487,17 +487,17 @@ sendsig(catcher, sig, mask, code, type, val) frame.sf_signum = sig; tf = trapframe(p); - oldonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oldonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate stack space for signal handler. */ - if ((psp->ps_flags & SAS_ALTSTACK) + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oldonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)(psp->ps_sigstk.ss_sp - + psp->ps_sigstk.ss_size); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (struct sigframe *)tf->fixreg[1]; @@ -554,9 +554,9 @@ sys_sigreturn(p, v, retval) return EINVAL; bcopy(&sc.sc_frame, tf, sizeof *tf); if (sc.sc_onstack & 1) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = sc.sc_mask & ~sigcantmask; return EJUSTRETURN; } diff --git a/sys/arch/sh/sh/sh_machdep.c b/sys/arch/sh/sh/sh_machdep.c index 25246f954ce..86882ef293a 100644 --- a/sys/arch/sh/sh/sh_machdep.c +++ b/sys/arch/sh/sh/sh_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sh_machdep.c,v 1.27 2009/11/17 17:06:44 kettenis Exp $ */ +/* $OpenBSD: sh_machdep.c,v 1.28 2011/04/15 04:52:40 guenther Exp $ */ /* $NetBSD: sh3_machdep.c,v 1.59 2006/03/04 01:13:36 uwe Exp $ */ /* @@ -471,16 +471,16 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, struct proc *p = curproc; struct sigframe *fp, frame; struct trapframe *tf = p->p_md.md_regs; - struct sigacts *ps = p->p_sigacts; + struct sigacts *psp = p->p_sigacts; siginfo_t *sip; int onstack; - onstack = ps->ps_sigstk.ss_flags & SS_ONSTACK; - if ((ps->ps_flags & SAS_ALTSTACK) && onstack == 0 && - (ps->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)((vaddr_t)ps->ps_sigstk.ss_sp + - ps->ps_sigstk.ss_size); - ps->ps_sigstk.ss_flags |= SS_ONSTACK; + onstack = p->p_sigstk.ss_flags & SS_ONSTACK; + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && onstack == 0 && + (psp->ps_sigonstack & sigmask(sig))) { + fp = (struct sigframe *)((vaddr_t)p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (void *)p->p_md.md_regs->tf_r15; --fp; @@ -488,7 +488,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, bzero(&frame, sizeof(frame)); - if (ps->ps_siginfo & sigmask(sig)) { + if (psp->ps_siginfo & sigmask(sig)) { initsiginfo(&frame.sf_si, sig, code, type, val); sip = &fp->sf_si; } else @@ -608,9 +608,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) /* Restore signal stack. */ if (context.sc_onstack) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ p->p_sigmask = context.sc_mask & ~sigcantmask; diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c index 626faed79ff..953792648e7 100644 --- a/sys/arch/socppc/socppc/machdep.c +++ b/sys/arch/socppc/socppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.27 2011/01/08 18:10:22 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.28 2011/04/15 04:52:40 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -901,17 +901,17 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, frame.sf_signum = sig; tf = trapframe(p); - oldonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oldonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate stack space for signal handler. */ - if ((psp->ps_flags & SAS_ALTSTACK) + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oldonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)(psp->ps_sigstk.ss_sp - + psp->ps_sigstk.ss_size); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (struct sigframe *)tf->fixreg[1]; @@ -965,9 +965,9 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval) return EINVAL; bcopy(&sc.sc_frame, tf, sizeof *tf); if (sc.sc_onstack & 1) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = sc.sc_mask & ~sigcantmask; return EJUSTRETURN; } diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c index 07d7372962a..82b241e1b80 100644 --- a/sys/arch/solbourne/solbourne/machdep.c +++ b/sys/arch/solbourne/solbourne/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.16 2010/07/02 19:57:14 tedu Exp $ */ +/* $OpenBSD: machdep.c,v 1.17 2011/04/15 04:52:40 guenther Exp $ */ /* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */ /* @@ -382,16 +382,16 @@ sendsig(catcher, sig, mask, code, type, val) tf = p->p_md.md_tf; oldsp = tf->tf_out[6]; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Compute new user stack addresses, subtract off * one signal frame, and align. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)(psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (struct sigframe *)oldsp; fp = (struct sigframe *)((int)(fp - 1) & ~7); @@ -522,9 +522,9 @@ sys_sigreturn(p, v, retval) tf->tf_out[0] = ksc.sc_o0; tf->tf_out[6] = ksc.sc_sp; if (ksc.sc_onstack & 1) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = ksc.sc_mask & ~sigcantmask; return (EJUSTRETURN); } diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index d0f7f23502d..2e1cda76f1d 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.132 2011/04/07 15:30:16 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.133 2011/04/15 04:52:40 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -395,16 +395,16 @@ sendsig(catcher, sig, mask, code, type, val) tf = p->p_md.md_tf; oldsp = tf->tf_out[6]; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Compute new user stack addresses, subtract off * one signal frame, and align. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)(psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (struct sigframe *)oldsp; fp = (struct sigframe *)((int)(fp - 1) & ~7); @@ -535,9 +535,9 @@ sys_sigreturn(p, v, retval) tf->tf_out[0] = ksc.sc_o0; tf->tf_out[6] = ksc.sc_sp; if (ksc.sc_onstack & 1) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; p->p_sigmask = ksc.sc_mask & ~sigcantmask; return (EJUSTRETURN); } diff --git a/sys/arch/sparc/sparc/svr4_machdep.c b/sys/arch/sparc/sparc/svr4_machdep.c index 1228ea135a0..ac557916175 100644 --- a/sys/arch/sparc/sparc/svr4_machdep.c +++ b/sys/arch/sparc/sparc/svr4_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_machdep.c,v 1.14 2010/06/26 23:24:44 guenther Exp $ */ +/* $OpenBSD: svr4_machdep.c,v 1.15 2011/04/15 04:52:40 guenther Exp $ */ /* $NetBSD: svr4_machdep.c,v 1.24 1997/07/29 10:04:45 fair Exp $ */ /* @@ -220,7 +220,7 @@ svr4_setcontext(p, uc) register struct trapframe *tf; svr4_greg_t *r = uc->uc_mcontext.greg; struct svr4_sigaltstack *s = &uc->uc_stack; - struct sigaltstack *sf = &psp->ps_sigstk; + struct sigaltstack *sf = &p->p_sigstk; int mask; #ifdef FPU_CONTEXT svr4_fregset_t *f = &uc->uc_mcontext.freg; @@ -462,16 +462,16 @@ svr4_sendsig(catcher, sig, mask, code, type, val) tf = (struct trapframe *)p->p_md.md_tf; oldsp = tf->tf_out[6]; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* * Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !oonstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct svr4_sigframe *)(psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct svr4_sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else { fp = (struct svr4_sigframe *)oldsp; } diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 29aa600588f..6893712ba50 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.129 2011/04/07 15:30:16 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.130 2011/04/15 04:52:40 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -460,13 +460,13 @@ sendsig(catcher, sig, mask, code, type, val) * Compute new user stack addresses, subtract off * one signal frame, and align. */ - onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + onstack = p->p_sigstk.ss_flags & SS_ONSTACK; - if ((psp->ps_flags & SAS_ALTSTACK) && !onstack && + if ((p->p_sigstk.ss_flags & SS_DISABLE) == 0 && !onstack && (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct sigframe *)((caddr_t)psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct sigframe *)((caddr_t)p->p_sigstk.ss_sp + + p->p_sigstk.ss_size); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else fp = (struct sigframe *)oldsp; /* Allocate an aligned sigframe */ @@ -612,9 +612,9 @@ sys_sigreturn(p, v, retval) /* Restore signal stack. */ if (sc.sc_onstack & SS_ONSTACK) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ p->p_sigmask = scp->sc_mask & ~sigcantmask; diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index ac4a9c2f61d..507891e2695 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.111 2010/12/21 14:56:24 claudio Exp $ */ +/* $OpenBSD: machdep.c,v 1.112 2011/04/15 04:52:40 guenther Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -409,9 +409,9 @@ sys_sigreturn(p, v, retval) return (EINVAL); } if (ksc.sc_onstack & 01) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; + p->p_sigstk.ss_flags &= ~SS_ONSTACK; /* Restore signal mask. */ p->p_sigmask = ksc.sc_mask & ~sigcantmask; @@ -467,11 +467,11 @@ sendsig(catcher, sig, mask, code, type, val) int onstack; syscf = p->p_addr->u_pcb.framep; - onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + onstack = p->p_sigstk.ss_flags & SS_ONSTACK; /* Allocate space for the signal handler context. */ if (onstack) - cursp = ((int)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size); + cursp = ((int)p->p_sigstk.ss_sp + p->p_sigstk.ss_size); else cursp = syscf->sp; @@ -489,7 +489,7 @@ sendsig(catcher, sig, mask, code, type, val) initsiginfo(&gsigf.sf_si, sig, code, type, val); } - gsigf.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + gsigf.sf_sc.sc_onstack = p->p_sigstk.ss_flags & SS_ONSTACK; gsigf.sf_sc.sc_mask = mask; gsigf.sf_sc.sc_sp = syscf->sp; gsigf.sf_sc.sc_fp = syscf->fp; @@ -524,7 +524,7 @@ sendsig(catcher, sig, mask, code, type, val) syscf->ap = (unsigned)sigf + offsetof(struct sigframe, sf_pc); if (onstack) - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + p->p_sigstk.ss_flags |= SS_ONSTACK; } int waittime = -1; |