split off thread specific stuff from struct sigacts to struct sigctx, leaving

only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
This commit is contained in:
jdolecek 2000-12-22 22:58:52 +00:00
parent ce0a5e58ed
commit e9e91a0fb5
50 changed files with 491 additions and 515 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.8 2000/11/22 08:39:46 thorpej Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.9 2000/12/22 22:58:52 jdolecek Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.8 2000/11/22 08:39:46 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.9 2000/12/22 22:58:52 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -100,9 +100,9 @@ compat_13_sys_sigreturn(p, v, retval)
/* Restore signal stack. */
if (ksc.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/*
* Restore signal mask. Note the mask is a "long" in the stack

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.227 2000/11/24 03:59:07 chs Exp $ */
/* $NetBSD: machdep.c,v 1.228 2000/12/22 22:58:52 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.227 2000/11/24 03:59:07 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.228 2000/12/22 22:58:52 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1484,23 +1484,22 @@ sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct sigcontext *scp, ksc;
struct trapframe *frame;
struct sigacts *psp = p->p_sigacts;
int onstack, fsize, rndfsize;
frame = p->p_md.md_tf;
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
/* Allocate space for the signal handler context. */
fsize = sizeof(ksc);
rndfsize = ((fsize + 15) / 16) * 16;
if (onstack)
scp = (struct sigcontext *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
scp = (struct sigcontext *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
scp = (struct sigcontext *)(alpha_pal_rdusp());
scp = (struct sigcontext *)((caddr_t)scp - rndfsize);
@ -1531,7 +1530,7 @@ sendsig(catcher, sig, mask, code)
bzero(ksc.sc_xxx, sizeof ksc.sc_xxx); /* XXX */
/* Save signal stack. */
ksc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
ksc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
ksc.sc_mask = *mask;
@ -1578,7 +1577,7 @@ sendsig(catcher, sig, mask, code)
#endif
/* Set up the registers to return to sigcode. */
frame->tf_regs[FRAME_PC] = (u_int64_t)psp->ps_sigcode;
frame->tf_regs[FRAME_PC] = (u_int64_t)p->p_sigctx.ps_sigcode;
frame->tf_regs[FRAME_A0] = sig;
frame->tf_regs[FRAME_A1] = code;
frame->tf_regs[FRAME_A2] = (u_int64_t)scp;
@ -1587,7 +1586,7 @@ sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if (sigdebug & SDB_FOLLOW)
@ -1657,9 +1656,9 @@ sys___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (ksc.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &ksc.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.6 2000/08/22 21:22:51 bjh21 Exp $ */
/* $NetBSD: vm_machdep.c,v 1.7 2000/12/22 22:58:53 jdolecek Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
@ -66,7 +66,7 @@
#include <sys/param.h>
__RCSID("$NetBSD: vm_machdep.c,v 1.6 2000/08/22 21:22:51 bjh21 Exp $");
__RCSID("$NetBSD: vm_machdep.c,v 1.7 2000/12/22 22:58:53 jdolecek Exp $");
#include <sys/buf.h>
#include <sys/exec.h>
@ -194,20 +194,19 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
struct proc *p = curproc;
struct trapframe *tf;
struct sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
tf = p->p_addr->u_pcb.pcb_tf;
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)tf->tf_r13;
fp--;
@ -237,7 +236,7 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
frame.sf_sc.sc_r15 = tf->tf_r15;
/* Save signal stack. */
frame.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
frame.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
frame.sf_sc.sc_mask = *mask;
@ -259,11 +258,11 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
tf->tf_r2 = (int)frame.sf_scp;
tf->tf_r3 = (int)frame.sf_handler;
tf->tf_r13 = (int)fp;
tf->tf_r15 = (int)psp->ps_sigcode;
tf->tf_r15 = (int)p->p_sigctx.ps_sigcode;
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
/*
@ -321,9 +320,9 @@ sys___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (context.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &context.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.1 1998/09/13 08:19:49 thorpej Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.2 2000/12/22 22:58:53 jdolecek Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -95,9 +95,9 @@ compat_13_sys_sigreturn(p, v, retval)
/* Restore signal stack. */
if (context.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
native_sigset13_to_sigset(&context.sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.83 2000/09/24 12:32:33 jdolecek Exp $ */
/* $NetBSD: machdep.c,v 1.84 2000/12/22 22:58:53 jdolecek Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -600,20 +600,19 @@ sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct trapframe *tf;
struct sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
tf = p->p_md.md_regs;
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)tf->tf_usr_sp;
fp--;
@ -645,7 +644,7 @@ sendsig(catcher, sig, mask, code)
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_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
frame.sf_sc.sc_mask = *mask;
@ -677,12 +676,12 @@ sendsig(catcher, sig, mask, code)
tf->tf_r2 = (int)frame.sf_scp;
tf->tf_r3 = (int)frame.sf_handler;
tf->tf_usr_sp = (int)fp;
tf->tf_pc = (int)psp->ps_sigcode;
tf->tf_pc = (int)p->p_sigctx.ps_sigcode;
cpu_cache_syncI();
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
@ -744,9 +743,9 @@ sys___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (context.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &context.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.4 2000/12/11 17:36:03 mycroft Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.5 2000/12/22 22:58:53 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -116,9 +116,9 @@ compat_13_sys_sigreturn(p, v, retval)
/* Restore signal stack. */
if (context.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
native_sigset13_to_sigset(&context.sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: freebsd_machdep.c,v 1.25 2000/12/11 17:36:03 mycroft Exp $ */
/* $NetBSD: freebsd_machdep.c,v 1.26 2000/12/22 22:58:53 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -95,20 +95,19 @@ freebsd_sendsig(catcher, sig, mask, code)
register struct proc *p = curproc;
register struct trapframe *tf;
struct freebsd_sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
tf = p->p_md.md_regs;
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 freebsd_sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct freebsd_sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct freebsd_sigframe *)tf->tf_esp;
fp--;
@ -148,7 +147,7 @@ freebsd_sendsig(catcher, sig, mask, code)
frame.sf_sc.sc_ss = tf->tf_ss;
/* Save signal stack. */
frame.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
frame.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
native_sigset_to_sigset13(mask, &frame.sf_sc.sc_mask);
@ -167,7 +166,7 @@ freebsd_sendsig(catcher, sig, mask, code)
*/
tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_eip = (int)psp->ps_sigcode;
tf->tf_eip = (int)p->p_sigctx.ps_sigcode;
tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL);
tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC);
tf->tf_esp = (int)fp;
@ -175,7 +174,7 @@ freebsd_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
/*
@ -252,9 +251,9 @@ freebsd_sys_sigreturn(p, v, retval)
/* Restore signal stack. */
if (context.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
native_sigset13_to_sigset(&context.sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_machdep.c,v 1.12 2000/12/11 17:36:03 mycroft Exp $ */
/* $NetBSD: ibcs2_machdep.c,v 1.13 2000/12/22 22:58:53 jdolecek Exp $ */
/*-
* Copyright (c) 1997, 2000 The NetBSD Foundation, Inc.
@ -101,20 +101,19 @@ ibcs2_sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct trapframe *tf;
struct sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
tf = p->p_md.md_regs;
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)tf->tf_esp;
fp--;
@ -158,7 +157,7 @@ ibcs2_sendsig(catcher, sig, mask, code)
frame.sf_sc.sc_err = tf->tf_err;
/* Save signal stack. */
frame.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
frame.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
frame.sf_sc.sc_mask = *mask;
@ -179,7 +178,7 @@ ibcs2_sendsig(catcher, sig, mask, code)
__asm("movl %w0,%%fs" : : "r" (GSEL(GUDATA_SEL, SEL_UPL)));
tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_eip = (int)psp->ps_sigcode;
tf->tf_eip = (int)p->p_sigctx.ps_sigcode;
tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL);
tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC);
tf->tf_esp = (int)fp;
@ -187,7 +186,7 @@ ibcs2_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.424 2000/12/21 05:20:24 enami Exp $ */
/* $NetBSD: machdep.c,v 1.425 2000/12/22 22:58:53 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -1160,20 +1160,19 @@ sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct trapframe *tf;
struct sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
tf = p->p_md.md_regs;
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION_PS(psp, sig).sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)tf->tf_esp;
fp--;
@ -1217,7 +1216,7 @@ sendsig(catcher, sig, mask, code)
frame.sf_sc.sc_err = tf->tf_err;
/* Save signal stack. */
frame.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
frame.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
frame.sf_sc.sc_mask = *mask;
@ -1248,7 +1247,7 @@ sendsig(catcher, sig, mask, code)
__asm("movl %w0,%%fs" : : "r" (GSEL(GUDATA_SEL, SEL_UPL)));
tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_eip = (int)psp->ps_sigcode;
tf->tf_eip = (int)p->p_sigctx.ps_sigcode;
tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL);
tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC);
tf->tf_esp = (int)fp;
@ -1256,7 +1255,7 @@ sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
/*
@ -1334,9 +1333,9 @@ sys___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (context.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &context.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.49 2000/12/11 17:36:03 mycroft Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.50 2000/12/22 22:58:54 jdolecek Exp $ */
/*-
* Copyright (c) 1994, 2000 The NetBSD Foundation, Inc.
@ -369,20 +369,19 @@ svr4_sendsig(catcher, sig, mask, code)
register struct proc *p = curproc;
register struct trapframe *tf;
struct svr4_sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
tf = p->p_md.md_regs;
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 svr4_sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct svr4_sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct svr4_sigframe *)tf->tf_esp;
fp--;
@ -424,7 +423,7 @@ svr4_sendsig(catcher, sig, mask, code)
*/
tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_eip = (int)psp->ps_sigcode;
tf->tf_eip = (int)p->p_sigctx.ps_sigcode;
tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL);
tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC);
tf->tf_esp = (int)fp;
@ -432,7 +431,7 @@ svr4_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm86.c,v 1.22 1998/10/26 19:11:57 sommerfe Exp $ */
/* $NetBSD: vm86.c,v 1.23 2000/12/22 22:58:54 jdolecek Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -235,7 +235,7 @@ vm86_return(p, retval)
* since it's used to jump to the signal handler. Instead we
* let sendsig() pull in the vm86_eflags bits.
*/
if (sigismember(&p->p_sigmask, SIGURG)) {
if (sigismember(&p->p_sigctx.ps_sigmask, SIGURG)) {
#ifdef DIAGNOSTIC
printf("pid %d killed on VM86 protocol screwup (SIGURG blocked)\n",
p->p_pid);
@ -430,7 +430,7 @@ i386_vm86(p, args, retval)
#undef DOREG
/* Going into vm86 mode jumps off the signal stack. */
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
set_vflags(p, vm86s.regs.vmsc.sc_eflags | PSL_VM);

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.2 1999/08/16 02:59:23 simonb Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.3 2000/12/22 22:58:54 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -125,9 +125,9 @@ compat_13_sys_sigreturn(p, v, retval)
/* Restore signal stack. */
if (scp->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
native_sigset13_to_sigset(&scp->sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig_machdep.c,v 1.13 1999/08/16 02:59:23 simonb Exp $ */
/* $NetBSD: sig_machdep.c,v 1.14 2000/12/22 22:58:54 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -85,7 +85,6 @@ sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct sigframe *fp, kf;
struct frame *frame;
struct sigacts *psp = p->p_sigacts;
short ft;
int onstack, fsize;
@ -94,14 +93,14 @@ sendsig(catcher, sig, mask, code)
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
/* Allocate space for the signal handler context. */
fsize = sizeof(struct sigframe);
if (onstack)
fp = (struct sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)(frame->f_regs[SP]);
fp--;
@ -175,7 +174,7 @@ sendsig(catcher, sig, mask, code)
kf.sf_sc.sc_ps = frame->f_sr;
/* Save signal stack. */
kf.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
kf.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
kf.sf_sc.sc_mask = *mask;
@ -212,11 +211,11 @@ sendsig(catcher, sig, mask, code)
/* Set up the registers to return to sigcode. */
frame->f_regs[SP] = (int)fp;
frame->f_pc = (int)psp->ps_sigcode;
frame->f_pc = (int)p->p_sigctx.ps_sigcode;
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
@ -356,9 +355,9 @@ sys___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (scp->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &scp->sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_machdep.c,v 1.19 1999/08/16 02:59:23 simonb Exp $ */
/* $NetBSD: sunos_machdep.c,v 1.20 2000/12/22 22:58:54 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -103,7 +103,6 @@ sunos_sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct sunos_sigframe *fp, kf;
struct frame *frame;
struct sigacts *psp = p->p_sigacts;
short ft;
int onstack, fsize;
@ -112,8 +111,8 @@ sunos_sendsig(catcher, sig, mask, code)
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
/*
* if this is a hardware fault (ft >= FMT9), sunos_sendsig
@ -121,10 +120,10 @@ sunos_sendsig(catcher, sig, mask, code)
* have the process die unconditionally.
*/
if (ft >= FMT9) {
psp->ps_sigact[sig].sa_handler = SIG_DFL;
sigdelset(&p->p_sigignore, sig);
sigdelset(&p->p_sigcatch, sig);
sigdelset(&p->p_sigmask, sig);
SIGACTION(p, sig).sa_handler = SIG_DFL;
sigdelset(&p->p_sigctx.ps_sigignore, sig);
sigdelset(&p->p_sigctx.ps_sigcatch, sig);
sigdelset(&p->p_sigctx.ps_sigmask, sig);
psignal(p, sig);
return;
}
@ -132,8 +131,8 @@ sunos_sendsig(catcher, sig, mask, code)
/* Allocate space for the signal handler context. */
fsize = sizeof(struct sunos_sigframe);
if (onstack)
fp = (struct sunos_sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sunos_sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sunos_sigframe *)(frame->f_regs[SP]);
fp--;
@ -156,7 +155,7 @@ sunos_sendsig(catcher, sig, mask, code)
kf.sf_sc.sc_ps = frame->f_sr;
/* Save signal stack. */
kf.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
kf.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
native_sigset_to_sigset13(mask, &kf.sf_sc.sc_mask);
@ -187,7 +186,7 @@ sunos_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
@ -245,9 +244,9 @@ sunos_sys_sigreturn(p, v, retval)
/* Restore signal stack. */
if (scp->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
native_sigset13_to_sigset(&scp->sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.3 2000/06/29 08:13:52 mrg Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.4 2000/12/22 22:58:54 jdolecek Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -253,19 +253,18 @@ svr4_sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct frame *frame;
struct svr4_sigframe *sfp, sf;
struct sigacts *psp = p->p_sigacts;
int onstack;
frame = (struct frame *)p->p_md.md_regs;
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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)
sfp = (struct svr4_sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
sfp = (struct svr4_sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
sfp = (struct svr4_sigframe *)frame->f_regs[SP];
sfp--;
@ -296,10 +295,10 @@ svr4_sendsig(catcher, sig, mask, code)
/* Set up the registers to return to sigcode. */
frame->f_regs[SP] = (int)sfp;
frame->f_pc = (int)psp->ps_sigcode;
frame->f_pc = (int)p->p_sigctx.ps_sigcode;
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.87 2000/12/19 21:09:56 scw Exp $ */
/* $NetBSD: trap.c,v 1.88 2000/12/22 22:58:54 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -419,10 +419,10 @@ copyfault:
printf("pid %d: kernel %s exception\n", p->p_pid,
type==T_COPERR ? "coprocessor" : "format");
type |= T_USER;
p->p_sigacts->ps_sigact[SIGILL].sa_handler = SIG_DFL;
sigdelset(&p->p_sigignore, SIGILL);
sigdelset(&p->p_sigcatch, SIGILL);
sigdelset(&p->p_sigmask, SIGILL);
SIGACTION(p, SIGILL).sa_handler = SIG_DFL;
sigdelset(&p->p_sigctx.ps_sigignore, SIGILL);
sigdelset(&p->p_sigctx.ps_sigcatch, SIGILL);
sigdelset(&p->p_sigctx.ps_sigmask, SIGILL);
i = SIGILL;
ucode = frame.f_format; /* XXX was ILL_RESAD_FAULT */
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.7 1999/04/24 08:10:38 simonb Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.8 2000/12/22 22:58:55 jdolecek Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
@ -15,7 +15,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.7 1999/04/24 08:10:38 simonb Exp $");
__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.8 2000/12/22 22:58:55 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -78,9 +78,9 @@ compat_13_sys_sigreturn(p, v, retval)
/* Restore signal stack. */
if (ksc.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
native_sigset13_to_sigset(&ksc.sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mips_machdep.c,v 1.109 2000/12/20 05:48:06 jeffs Exp $ */
/* $NetBSD: mips_machdep.c,v 1.110 2000/12/22 22:58:55 jdolecek Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -52,7 +52,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.109 2000/12/20 05:48:06 jeffs Exp $");
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.110 2000/12/22 22:58:55 jdolecek Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_ultrix.h"
@ -766,7 +766,6 @@ sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct sigframe *fp;
struct frame *f;
struct sigacts *psp = p->p_sigacts;
int onstack;
struct sigcontext ksc;
@ -774,13 +773,13 @@ sendsig(catcher, sig, mask, code)
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
/* cast for _MIPS_BSD_API == _MIPS_BSD_API_LP32_64CLEAN case */
fp = (struct sigframe *)(u_int32_t)f->f_regs[SP];
@ -813,7 +812,7 @@ sendsig(catcher, sig, mask, code)
}
/* Save signal stack. */
ksc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
ksc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
ksc.sc_mask = *mask;
@ -854,11 +853,11 @@ sendsig(catcher, sig, mask, code)
f->f_regs[SP] = (int)fp;
/* Signal trampoline code is at base of user stack. */
f->f_regs[RA] = (int)psp->ps_sigcode;
f->f_regs[RA] = (int)p->p_sigctx.ps_sigcode;
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sigdebug & SDB_FOLLOW) ||
@ -920,9 +919,9 @@ sys___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (ksc.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &ksc.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.1 1998/09/13 09:15:52 thorpej Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.2 2000/12/22 22:58:55 jdolecek Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -71,9 +71,9 @@ compat_13_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_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
native_sigset13_to_sigset(&sc.sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig_machdep.c,v 1.3 2000/04/03 10:23:24 tsubai Exp $ */
/* $NetBSD: sig_machdep.c,v 1.4 2000/12/22 22:58:55 jdolecek Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -53,20 +53,19 @@ sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct trapframe *tf;
struct sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
tf = trapframe(p);
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)tf->fixreg[1];
fp = (struct sigframe *)((int)(fp - 1) & ~0xf);
@ -79,7 +78,7 @@ sendsig(catcher, sig, mask, code)
bcopy(tf, &frame.sf_sc.sc_frame, sizeof *tf);
/* Save signal stack. */
frame.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
frame.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
frame.sf_sc.sc_mask = *mask;
@ -111,11 +110,11 @@ sendsig(catcher, sig, mask, code)
tf->fixreg[3] = (int)sig;
tf->fixreg[4] = (int)code;
tf->fixreg[5] = (int)&fp->sf_sc;
tf->srr0 = (int)psp->ps_sigcode;
tf->srr0 = (int)p->p_sigctx.ps_sigcode;
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
/*
@ -150,9 +149,9 @@ sys___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (sc.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &sc.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.1 1999/09/13 10:31:27 itojun Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.2 2000/12/22 22:58:55 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -105,9 +105,9 @@ compat_13_sys_sigreturn(p, v, retval)
/* Restore signal stack. */
if (context.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
native_sigset13_to_sigset(&context.sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sh3_machdep.c,v 1.9 2000/09/13 15:00:22 thorpej Exp $ */
/* $NetBSD: sh3_machdep.c,v 1.10 2000/12/22 22:58:55 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -229,20 +229,19 @@ sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct trapframe *tf;
struct sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
tf = p->p_md.md_regs;
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)tf->tf_r15;
fp--;
@ -279,7 +278,7 @@ sendsig(catcher, sig, mask, code)
#endif
/* Save signal stack. */
frame.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
frame.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
/* Save signal mask. */
frame.sf_sc.sc_mask = *mask;
@ -306,7 +305,7 @@ sendsig(catcher, sig, mask, code)
/*
* Build context to run handler in.
*/
tf->tf_spc = (int)psp->ps_sigcode;
tf->tf_spc = (int)p->p_sigctx.ps_sigcode;
#ifdef TODO
tf->tf_ssr &= ~(PSL_T|PSL_VM|PSL_AC);
#endif
@ -314,7 +313,7 @@ sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
/*
@ -386,9 +385,9 @@ sys___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (context.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &context.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.1 1998/09/13 20:33:33 pk Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.2 2000/12/22 22:58:55 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -100,9 +100,9 @@ compat_13_sys_sigreturn(p, v, retval)
tf->tf_out[6] = scp->sc_sp;
if (scp->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask */
native_sigset13_to_sigset(&scp->sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.171 2000/09/13 15:00:22 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.172 2000/12/22 22:58:55 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -425,7 +425,6 @@ sendsig(catcher, sig, mask, code)
u_long code;
{
struct proc *p = curproc;
struct sigacts *psp = p->p_sigacts;
struct sigframe *fp;
struct trapframe *tf;
int addr, onstack, oldsp, newsp;
@ -439,12 +438,12 @@ sendsig(catcher, sig, mask, code)
* one signal frame, and align.
*/
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
if (onstack)
fp = (struct sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)oldsp;
@ -468,7 +467,7 @@ sendsig(catcher, sig, mask, code)
/*
* Build the signal context to be used by sigreturn.
*/
sf.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
sf.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
sf.sf_sc.sc_mask = *mask;
#ifdef COMPAT_13
/*
@ -519,7 +518,7 @@ sendsig(catcher, sig, mask, code)
* Arrange to continue execution at the code copied out in exec().
* It needs the function to call in %g1, and a new stack pointer.
*/
addr = (int)psp->ps_sigcode;
addr = (int)p->p_sigctx.ps_sigcode;
tf->tf_global[1] = (int)catcher;
tf->tf_pc = addr;
tf->tf_npc = addr + 4;
@ -527,7 +526,7 @@ sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
@ -589,9 +588,9 @@ sys___sigreturn14(p, v, retval)
tf->tf_out[6] = scp->sc_sp;
if (scp->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask */
(void) sigprocmask1(p, SIG_SETMASK, &scp->sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_machdep.c,v 1.7 1998/09/17 02:30:02 thorpej Exp $ */
/* $NetBSD: sunos_machdep.c,v 1.8 2000/12/22 22:58:56 jdolecek Exp $ */
/*
* Copyright (c) 1995 Matthew R. Green
@ -70,7 +70,6 @@ sunos_sendsig(catcher, sig, mask, code)
u_long code;
{
struct proc *p = curproc;
struct sigacts *psp = p->p_sigacts;
struct sunos_sigframe *fp;
struct trapframe *tf;
int addr, onstack, oldsp, newsp;
@ -84,12 +83,12 @@ sunos_sendsig(catcher, sig, mask, code)
* one signal frame, and align.
*/
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
if (onstack)
fp = (struct sunos_sigframe *)
((caddr_t)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size);
((caddr_t)p->p_sigctx.ps_sigstk.ss_sp + p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sunos_sigframe *)oldsp;
@ -113,7 +112,7 @@ sunos_sendsig(catcher, sig, mask, code)
/*
* Build the signal context to be used by sigreturn.
*/
sf.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
sf.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
native_sigset_to_sigset13(mask, &sf.sf_sc.sc_mask);
sf.sf_sc.sc_sp = oldsp;
sf.sf_sc.sc_pc = tf->tf_pc;
@ -162,7 +161,7 @@ sunos_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sunos_sigdebug & SDB_KSTACK) && p->p_pid == sunos_sigpid)

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.39 2000/05/26 21:20:19 thorpej Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.40 2000/12/22 22:58:56 jdolecek Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -455,7 +455,6 @@ svr4_sendsig(catcher, sig, mask, code)
register struct proc *p = curproc;
register struct trapframe *tf;
struct svr4_sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack, oldsp, newsp, addr;
tf = (struct trapframe *)p->p_md.md_tf;
@ -463,15 +462,15 @@ svr4_sendsig(catcher, sig, mask, code)
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 svr4_sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct svr4_sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct svr4_sigframe *)oldsp;
fp = (struct svr4_sigframe *) ((int) (fp - 1) & ~7);
@ -516,7 +515,7 @@ svr4_sendsig(catcher, sig, mask, code)
/*
* Build context to run handler in.
*/
addr = (int)psp->ps_sigcode;
addr = (int)p->p_sigctx.ps_sigcode;
tf->tf_pc = addr;
tf->tf_npc = addr + 4;
tf->tf_global[1] = (int)catcher;
@ -524,7 +523,7 @@ svr4_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.10 2000/12/17 21:54:20 pk Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.11 2000/12/22 22:58:56 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -152,9 +152,9 @@ compat_13_sys_sigreturn(p, v, retval)
#endif
if (scp->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask */
native_sigset13_to_sigset(&scp->sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.95 2000/12/21 22:19:21 eeh Exp $ */
/* $NetBSD: machdep.c,v 1.96 2000/12/22 22:58:56 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -507,7 +507,6 @@ sendsig(catcher, sig, mask, code)
u_long code;
{
struct proc *p = curproc;
struct sigacts *psp = p->p_sigacts;
struct sigframe *fp;
struct trapframe64 *tf;
vaddr_t addr;
@ -526,12 +525,12 @@ sendsig(catcher, sig, mask, code)
* one signal frame, and align.
*/
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
if (onstack)
fp = (struct sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sigframe *)oldsp;
/* Allocate an aligned sigframe */
@ -563,7 +562,7 @@ sendsig(catcher, sig, mask, code)
/*
* Build the signal context to be used by sigreturn.
*/
sf.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
sf.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
sf.sf_sc.sc_mask = *mask;
#ifdef COMPAT_13
/*
@ -631,7 +630,7 @@ sendsig(catcher, sig, mask, code)
* Arrange to continue execution at the code copied out in exec().
* It needs the function to call in %g1, and a new stack pointer.
*/
addr = (vaddr_t)psp->ps_sigcode;
addr = (vaddr_t)p->p_sigctx.ps_sigcode;
tf->tf_global[1] = (vaddr_t)catcher;
tf->tf_pc = addr;
tf->tf_npc = addr + 4;
@ -639,7 +638,7 @@ sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) {
@ -754,9 +753,9 @@ printf("sigreturn14: pid %d nsaved %d\n",
/* Restore signal stack. */
if (sc.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &sc.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.10 2000/09/28 19:56:14 eeh Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.11 2000/12/22 22:58:56 jdolecek Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@ -131,7 +131,6 @@ netbsd32_sendsig(catcher, sig, mask, code)
u_long code;
{
register struct proc *p = curproc;
register struct sigacts *psp = p->p_sigacts;
register struct sparc32_sigframe *fp;
register struct trapframe64 *tf;
register int addr, onstack;
@ -145,12 +144,12 @@ netbsd32_sendsig(catcher, sig, mask, code)
oldsp = (struct rwindow32 *)(u_long)(u_int)tf->tf_out[6];
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
if (onstack) {
fp = (struct sparc32_sigframe *)((char *)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
fp = (struct sparc32_sigframe *)((char *)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
} else
fp = (struct sparc32_sigframe *)oldsp;
fp = (struct sparc32_sigframe *)((long)(fp - 1) & ~7);
@ -239,7 +238,7 @@ netbsd32_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) {
@ -328,9 +327,9 @@ compat_13_netbsd32_sigreturn(p, v, retval)
}
#endif
if (scp->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask */
native_sigset13_to_sigset(&scp->sc_mask, &mask);
@ -422,9 +421,9 @@ netbsd32___sigreturn14(p, v, retval)
/* Restore signal stack. */
if (sc.sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &sc.sc_mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_machdep.c,v 1.12 2000/12/06 01:47:50 mrg Exp $ */
/* $NetBSD: sunos_machdep.c,v 1.13 2000/12/22 22:58:56 jdolecek Exp $ */
/*
* Copyright (c) 1995 Matthew R. Green
@ -86,7 +86,6 @@ sunos_sendsig(catcher, sig, mask, code)
u_long code;
{
register struct proc *p = curproc;
register struct sigacts *psp = p->p_sigacts;
register struct sunos_sigframe *fp;
register struct trapframe64 *tf;
register int addr, onstack;
@ -101,12 +100,12 @@ sunos_sendsig(catcher, sig, mask, code)
* one signal frame, and align.
*/
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
if (onstack)
fp = (struct sunos_sigframe *)((char *)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct sunos_sigframe *)((char *)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct sunos_sigframe *)oldsp;
fp = (struct sunos_sigframe *)((long)(fp - 1) & ~7);
@ -134,7 +133,7 @@ sunos_sendsig(catcher, sig, mask, code)
/*
* Build the signal context to be used by sigreturn.
*/
sf.sf_sc.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
sf.sf_sc.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
native_sigset_to_sigset13(mask, &sf.sf_sc.sc_mask);
sf.sf_sc.sc_sp = (long)oldsp;
sf.sf_sc.sc_pc = tf->tf_pc;
@ -271,9 +270,9 @@ sunos_sys_sigreturn(p, v, retval)
#endif
if (scp->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask */
native_sigset13_to_sigset(&scp->sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_machdep.c,v 1.15 2000/12/14 10:24:42 martin Exp $ */
/* $NetBSD: svr4_machdep.c,v 1.16 2000/12/22 22:58:56 jdolecek Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -465,7 +465,6 @@ svr4_sendsig(catcher, sig, mask, code)
register struct proc *p = curproc;
register struct trapframe64 *tf;
struct svr4_sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
vaddr_t oldsp, newsp, addr;
@ -474,15 +473,15 @@ svr4_sendsig(catcher, sig, mask, code)
/* Do we need to jump onto the signal stack? */
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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 svr4_sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
fp = (struct svr4_sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
fp = (struct svr4_sigframe *)oldsp;
fp = (struct svr4_sigframe *) ((long) (fp - 1) & ~7);
@ -552,7 +551,7 @@ svr4_sendsig(catcher, sig, mask, code)
/*
* Build context to run handler in.
*/
addr = (vaddr_t)psp->ps_sigcode;
addr = (vaddr_t)p->p_sigctx.ps_sigcode;
tf->tf_pc = addr;
tf->tf_npc = addr + 4;
tf->tf_global[1] = (vaddr_t)catcher;
@ -560,7 +559,7 @@ svr4_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) {
printf("svr4_sendsig: about to return to catcher %p thru %p\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.109 2000/10/18 21:38:52 matt Exp $ */
/* $NetBSD: machdep.c,v 1.110 2000/12/22 22:58:56 jdolecek Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
@ -333,9 +333,9 @@ compat_13_sys_sigreturn(p, v, retval)
return (EINVAL);
}
if (cntx->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
native_sigset13_to_sigset(&cntx->sc_mask, &mask);
(void) sigprocmask1(p, SIG_SETMASK, &mask, 0);
@ -373,9 +373,9 @@ sys___sigreturn14(p, v, retval)
return (EINVAL);
}
if (cntx->sc_onstack & 01)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &cntx->sc_mask, 0);
@ -406,7 +406,6 @@ sendsig(catcher, sig, mask, code)
u_long code;
{
struct proc *p = curproc;
struct sigacts *psp = p->p_sigacts;
struct trapframe *syscf;
struct sigcontext *sigctx, gsigctx;
struct trampframe *trampf, gtrampf;
@ -416,12 +415,12 @@ sendsig(catcher, sig, mask, code)
syscf = p->p_addr->u_pcb.framep;
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
(p->p_sigctx.ps_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)
cursp = ((int)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size);
cursp = ((int)p->p_sigctx.ps_sigstk.ss_sp + p->p_sigctx.ps_sigstk.ss_size);
else
cursp = syscf->sp;
@ -445,7 +444,7 @@ sendsig(catcher, sig, mask, code)
gsigctx.sc_ap = syscf->ap;
gsigctx.sc_fp = syscf->fp;
gsigctx.sc_sp = syscf->sp;
gsigctx.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
gsigctx.sc_onstack = p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK;
gsigctx.sc_mask = *mask;
#if defined(COMPAT_13) || defined(COMPAT_ULTRIX)
@ -456,13 +455,13 @@ sendsig(catcher, sig, mask, code)
copyout(&gsigctx, sigctx, sizeof(gsigctx)))
sigexit(p, SIGILL);
syscf->pc = (int)psp->ps_sigcode;
syscf->pc = (int)p->p_sigctx.ps_sigcode;
syscf->psl = PSL_U | PSL_PREVU;
syscf->ap = cursp;
syscf->sp = cursp;
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
int waittime = -1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: coda_psdev.c,v 1.13 2000/03/30 11:24:16 augustss Exp $ */
/* $NetBSD: coda_psdev.c,v 1.14 2000/12/22 22:58:57 jdolecek Exp $ */
/*
*
@ -494,7 +494,7 @@ coda_call(mntinfo, inSize, outSize, buffer)
struct proc *p = curproc;
sigset_t psig_omask;
int i;
psig_omask = p->p_siglist; /* array assignment */
psig_omask = p->p_sigctx.ps_siglist; /* array assignment */
#endif
if (mntinfo == NULL) {
/* Unlikely, but could be a race condition with a dying warden */
@ -556,33 +556,33 @@ coda_call(mntinfo, inSize, outSize, buffer)
#ifdef CODA_VERBOSE
printf("coda_call: tsleep TIMEOUT %d sec\n", 2+2*i);
#endif
} else if (sigismember(&p->p_siglist, SIGIO)) {
sigaddset(&p->p_sigmask, SIGIO);
} else if (sigismember(&p->p_sigctx.ps_siglist, SIGIO)) {
sigaddset(&p->p_sigctx.ps_sigmask, SIGIO);
#ifdef CODA_VERBOSE
printf("coda_call: tsleep returns %d SIGIO, cnt %d\n", error, i);
#endif
} else if (sigismember(&p->p_siglist, SIGALRM)) {
sigaddset(&p->p_sigmask, SIGALRM);
} else if (sigismember(&p->p_sigctx.ps_siglist, SIGALRM)) {
sigaddset(&p->p_sigctx.ps_sigmask, SIGALRM);
#ifdef CODA_VERBOSE
printf("coda_call: tsleep returns %d SIGALRM, cnt %d\n", error, i);
#endif
} else {
sigset_t tmp;
tmp = p->p_siglist; /* array assignment */
sigminusset(&p->p_sigmask, &tmp);
tmp = p->p_sigctx.ps_siglist; /* array assignment */
sigminusset(&p->p_sigctx.ps_sigmask, &tmp);
#ifdef CODA_VERBOSE
printf("coda_call: tsleep returns %d, cnt %d\n", error, i);
printf("coda_call: siglist = %x.%x.%x.%x, sigmask = %x.%x.%x.%x, mask %x.%x.%x.%x\n",
p->p_siglist.__bits[0], p->p_siglist.__bits[1],
p->p_siglist.__bits[2], p->p_siglist.__bits[3],
p->p_sigmask.__bits[0], p->p_sigmask.__bits[1],
p->p_sigmask.__bits[2], p->p_sigmask.__bits[3],
p->p_sigctx.ps_siglist.__bits[0], p->p_sigctx.ps_siglist.__bits[1],
p->p_sigctx.ps_siglist.__bits[2], p->p_sigctx.ps_siglist.__bits[3],
p->p_sigctx.ps_sigmask.__bits[0], p->p_sigctx.ps_sigmask.__bits[1],
p->p_sigctx.ps_sigmask.__bits[2], p->p_sigctx.ps_sigmask.__bits[3],
tmp.__bits[0], tmp.__bits[1], tmp.__bits[2], tmp.__bits[3]);
#endif
break;
#ifdef notyet
sigminusset(&p->p_sigmask, &p->p_siglist);
sigminusset(&p->p_sigctx.ps_sigmask, &p->p_sigctx.ps_siglist);
printf("coda_call: siglist = %x.%x.%x.%x, sigmask = %x.%x.%x.%x\n",
p->p_siglist.__bits[0], p->p_siglist.__bits[1],
p->p_siglist.__bits[2], p->p_siglist.__bits[3],
@ -591,7 +591,7 @@ coda_call(mntinfo, inSize, outSize, buffer)
#endif
}
} while (error && i++ < 128 && VC_OPEN(vcp));
p->p_siglist = psig_omask; /* array assignment */
p->p_sigctx.ps_siglist = psig_omask; /* array assignment */
#else
(void) tsleep(&vmp->vm_sleep, coda_call_sleep, "coda_call", 0);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_signal.c,v 1.11 2000/03/30 11:27:16 augustss Exp $ */
/* $NetBSD: ibcs2_signal.c,v 1.12 2000/12/22 22:58:57 jdolecek Exp $ */
/*
* Copyright (c) 1995 Scott Bartram
@ -360,7 +360,7 @@ ibcs2_sys_sigsys(p, v, retval)
return (sigaction1(p, signum, &nbsa, 0));
case IBCS2_SIGPAUSE_MASK:
ss = p->p_sigmask;
ss = p->p_sigctx.ps_sigmask;
sigdelset(&ss, signum);
return (sigsuspend1(p, &ss));

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.12 2000/11/29 22:05:36 jdolecek Exp $ */
/* $NetBSD: linux_machdep.c,v 1.13 2000/12/22 22:58:57 jdolecek Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -109,14 +109,13 @@ void setup_linux_rt_sigframe(tf, sig, mask)
{
struct proc *p = curproc;
struct linux_rt_sigframe *sfp, sigframe;
struct sigacts *psp = p->p_sigacts;
int onstack;
int fsize, rndfsize;
extern char linux_rt_sigcode[], linux_rt_esigcode[];
/* Do we need to jump onto the signal stack? */
onstack = (psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
onstack = (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
/* Allocate space for the signal handler context. */
fsize = sizeof(struct linux_rt_sigframe);
@ -124,8 +123,8 @@ void setup_linux_rt_sigframe(tf, sig, mask)
if (onstack)
sfp = (struct linux_rt_sigframe *)
((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
sfp = (struct linux_rt_sigframe *)(alpha_pal_rdusp());
sfp = (struct linux_rt_sigframe *)((caddr_t)sfp - rndfsize);
@ -204,7 +203,7 @@ void setup_linux_rt_sigframe(tf, sig, mask)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
void setup_linux_sigframe(tf, sig, mask)
@ -214,14 +213,13 @@ void setup_linux_sigframe(tf, sig, mask)
{
struct proc *p = curproc;
struct linux_sigframe *sfp, sigframe;
struct sigacts *psp = p->p_sigacts;
int onstack;
int fsize, rndfsize;
extern char linux_sigcode[], linux_esigcode[];
/* Do we need to jump onto the signal stack? */
onstack = (psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
onstack = (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
/* Allocate space for the signal handler context. */
fsize = sizeof(struct linux_sigframe);
@ -229,8 +227,8 @@ void setup_linux_sigframe(tf, sig, mask)
if (onstack)
sfp = (struct linux_sigframe *)
((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
p->p_sigctx.ps_sigstk.ss_size);
else
sfp = (struct linux_sigframe *)(alpha_pal_rdusp());
sfp = (struct linux_sigframe *)((caddr_t)sfp - rndfsize);
@ -292,7 +290,7 @@ void setup_linux_sigframe(tf, sig, mask)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
}
/*
@ -373,9 +371,9 @@ linux_restore_sigcontext(struct proc *p, struct linux_sigcontext context,
* an onstack member. This could be needed in the future.
*/
if (context.sc_onstack & LINUX_SA_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Reset the signal mask */
(void) sigprocmask1(p, SIG_SETMASK, mask, 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.55 2000/12/18 14:47:38 fvdl Exp $ */
/* $NetBSD: linux_machdep.c,v 1.56 2000/12/22 22:58:57 jdolecek Exp $ */
/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@ -150,7 +150,6 @@ linux_sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct trapframe *tf;
struct linux_sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
tf = p->p_md.md_regs;
@ -214,7 +213,7 @@ linux_sendsig(catcher, sig, mask, code)
*/
tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_eip = (int)psp->ps_sigcode;
tf->tf_eip = (int)p->p_sigctx.ps_sigcode;
tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL);
tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC);
tf->tf_esp = (int)fp;
@ -306,7 +305,7 @@ linux_sys_sigreturn(p, v, retval)
tf->tf_ss = context.sc_ss;
/* Restore signal stack. */
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
linux_old_to_native_sigset(&context.sc_mask, &mask);

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.5 2000/12/16 22:59:32 scw Exp $ */
/* $NetBSD: linux_machdep.c,v 1.6 2000/12/22 22:58:57 jdolecek Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -81,7 +81,7 @@ extern int sigpid;
void setup_linux_sigframe __P((struct frame *frame, int sig, sigset_t *mask,
caddr_t usp));
void setup_linux_rt_sigframe __P((struct frame *frame, int sig, sigset_t *mask,
caddr_t usp, struct sigacts *psp));
caddr_t usp, struct proc *p));
/*
* Deal with some m68k-specific things in the Linux emulation code.
@ -264,14 +264,13 @@ setup_linux_sigframe(frame, sig, mask, usp)
* Setup signal frame for new RT signal interface.
*/
void
setup_linux_rt_sigframe(frame, sig, mask, usp, psp)
setup_linux_rt_sigframe(frame, sig, mask, usp, p)
struct frame *frame;
int sig;
sigset_t *mask;
caddr_t usp;
struct sigacts *psp;
struct proc *p;
{
struct proc *p = curproc;
struct linux_rt_sigframe *fp, kf;
short ft;
@ -404,11 +403,11 @@ setup_linux_rt_sigframe(frame, sig, mask, usp, psp)
/* Build the signal context to be used by sigreturn. */
native_to_linux_sigset(mask, &kf.sf_uc.uc_sigmask);
kf.sf_uc.uc_stack.ss_sp = psp->ps_sigstk.ss_sp;
kf.sf_uc.uc_stack.ss_sp = p->p_sigctx.ps_sigstk.ss_sp;
kf.sf_uc.uc_stack.ss_flags =
(psp->ps_sigstk.ss_flags & SS_ONSTACK ? LINUX_SS_ONSTACK : 0) |
(psp->ps_sigstk.ss_flags & SS_DISABLE ? LINUX_SS_DISABLE : 0);
kf.sf_uc.uc_stack.ss_size = psp->ps_sigstk.ss_size;
(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;
if (copyout(&kf, fp, sizeof(struct linux_rt_sigframe))) {
#ifdef DEBUG
@ -454,25 +453,25 @@ linux_sendsig(catcher, sig, mask, code)
{
struct proc *p = curproc;
struct frame *frame;
struct sigacts *psp = p->p_sigacts;
caddr_t usp; /* user stack for signal context */
int onstack;
frame = (struct frame *)p->p_md.md_regs;
/* Do we need to jump onto the signal stack? */
onstack = (psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
onstack = (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
/* Determine user stack for the signal handler context. */
if (onstack)
usp = (caddr_t)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size;
usp = (caddr_t)p->p_sigctx.ps_sigstk.ss_sp
+ p->p_sigctx.ps_sigstk.ss_size;
else
usp = (caddr_t)frame->f_regs[SP];
/* Setup the signal frame (and part of the trapframe). */
if (p->p_sigacts->ps_sigact[sig].sa_flags & SA_SIGINFO)
setup_linux_rt_sigframe(frame, sig, mask, usp, psp);
if (SIGACTION(p, sig).sa_flags & SA_SIGINFO)
setup_linux_rt_sigframe(frame, sig, mask, usp, p);
else
setup_linux_sigframe(frame, sig, mask, usp);
@ -481,7 +480,7 @@ linux_sendsig(catcher, sig, mask, code)
/* Remember that we're now on the signal stack. */
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
@ -563,7 +562,7 @@ bad: sigexit(p, SIGSEGV);
#endif
/* Restore signal stack. */
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
#if LINUX__NSIG_WORDS > 1
@ -667,7 +666,6 @@ linux_sys_rt_sigreturn(p, v, retval)
struct linux_ucontext *ucp; /* ucontext in user space */
struct linux_ucontext tuc; /* copy of *ucp */
sigset_t mask;
struct sigacts *psp;
int sz = 0; /* extra frame size */
/*
@ -715,9 +713,8 @@ bad: sigexit(p, SIGSEGV);
goto bad;
/* Restore signal stack. */
psp = p->p_sigacts;
psp->ps_sigstk.ss_flags =
(psp->ps_sigstk.ss_flags & ~SS_ONSTACK) |
p->p_sigctx.ps_sigstk.ss_flags =
(p->p_sigctx.ps_sigstk.ss_flags & ~SS_ONSTACK) |
(tuc.uc_stack.ss_flags & LINUX_SS_ONSTACK ? SS_ONSTACK : 0);
/* Restore signal mask. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.79 2000/12/21 20:19:22 thorpej Exp $ */
/* $NetBSD: linux_misc.c,v 1.80 2000/12/22 22:58:58 jdolecek Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@ -199,7 +199,7 @@ linux_sys_wait4(p, v, retval)
if ((error = sys_wait4(p, &w4a, retval)))
return error;
sigdelset(&p->p_siglist, SIGCHLD);
sigdelset(&p->p_sigctx.ps_siglist, SIGCHLD);
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc_notalpha.c,v 1.59 2000/12/01 12:28:33 jdolecek Exp $ */
/* $NetBSD: linux_misc_notalpha.c,v 1.60 2000/12/22 22:58:58 jdolecek Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -283,7 +283,7 @@ linux_sys_waitpid(p, v, retval)
if ((error = sys_wait4(p, &w4a, retval)))
return error;
sigdelset(&p->p_siglist, SIGCHLD);
sigdelset(&p->p_sigctx.ps_siglist, SIGCHLD);
if (status != NULL) {
if ((error = copyin(status, &tstat, sizeof tstat)))

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_netbsd.c,v 1.46 2000/12/12 08:00:26 mycroft Exp $ */
/* $NetBSD: netbsd32_netbsd.c,v 1.47 2000/12/22 22:58:59 jdolecek Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@ -2042,7 +2042,7 @@ netbsd32_execve(p, v, retval)
/* copy out the process's signal trapoline code */
if (szsigcode) {
if (copyout((char *)pack.ep_es->es_emul->e_sigcode,
p->p_sigacts->ps_sigcode = (char *)p->p_psstr - szsigcode,
p->p_sigctx.ps_sigcode = (char *)p->p_psstr - szsigcode,
szsigcode)) {
#ifdef DEBUG
printf("execve: sig trampoline copyout failed\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_signal.c,v 1.39 2000/07/27 14:00:56 mrg Exp $ */
/* $NetBSD: svr4_signal.c,v 1.40 2000/12/22 22:58:59 jdolecek Exp $ */
/*-
* Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@ -396,7 +396,7 @@ svr4_sys_signal(p, v, retval)
return (sigaction1(p, signum, &nbsa, 0));
case SVR4_SIGPAUSE_MASK:
ss = p->p_sigmask;
ss = p->p_sigctx.ps_sigmask;
sigdelset(&ss, signum);
return (sigsuspend1(p, &ss));
@ -590,7 +590,7 @@ svr4_setcontext(p, uc)
/* set signal stack */
if (uc->uc_flags & SVR4_UC_STACK) {
svr4_to_native_sigaltstack(&uc->uc_stack,
&p->p_sigacts->ps_sigstk);
&p->p_sigctx.ps_sigstk);
}
/* set signal mask */
@ -621,7 +621,7 @@ svr4_sys_context(p, v, retval)
switch (SCARG(uap, func)) {
case SVR4_GETCONTEXT:
DPRINTF(("getcontext(%p)\n", SCARG(uap, uc)));
svr4_getcontext(p, &uc, &p->p_sigmask);
svr4_getcontext(p, &uc, &p->p_sigctx.ps_sigmask);
return copyout(&uc, SCARG(uap, uc), sizeof(uc));
case SVR4_SETCONTEXT:

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_exec.c,v 1.133 2000/12/11 05:29:02 mycroft Exp $ */
/* $NetBSD: kern_exec.c,v 1.134 2000/12/22 22:58:59 jdolecek Exp $ */
/*-
* Copyright (C) 1993, 1994, 1996 Christopher G. Demetriou
@ -541,7 +541,7 @@ sys_execve(struct proc *p, void *v, register_t *retval)
/* copy out the process's signal trapoline code */
if (szsigcode) {
if (copyout((char *)pack.ep_es->es_emul->e_sigcode,
p->p_sigacts->ps_sigcode = (char *)p->p_psstr - szsigcode,
p->p_sigctx.ps_sigcode = (char *)p->p_psstr - szsigcode,
szsigcode)) {
#ifdef DEBUG
printf("execve: sig trampoline copyout failed\n");
@ -550,7 +550,7 @@ sys_execve(struct proc *p, void *v, register_t *retval)
}
#ifdef PMAP_NEED_PROCWR
/* This is code. Let the pmap do what is needed. */
pmap_procwr(p, (vaddr_t)p->p_sigacts->ps_sigcode, szsigcode);
pmap_procwr(p, (vaddr_t)p->p_sigctx.ps_sigcode, szsigcode);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_exit.c,v 1.86 2000/11/07 12:41:52 jdolecek Exp $ */
/* $NetBSD: kern_exit.c,v 1.87 2000/12/22 22:59:00 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -165,9 +165,9 @@ exit1(struct proc *p, int rv)
p->p_flag &= ~P_PPWAIT;
wakeup((caddr_t)p->p_pptr);
}
sigfillset(&p->p_sigignore);
sigemptyset(&p->p_siglist);
p->p_sigcheck = 0;
sigfillset(&p->p_sigctx.ps_sigignore);
sigemptyset(&p->p_sigctx.ps_siglist);
p->p_sigctx.ps_sigcheck = 0;
callout_stop(&p->p_realit_ch);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_fork.c,v 1.80 2000/12/11 15:35:42 tsutsui Exp $ */
/* $NetBSD: kern_fork.c,v 1.81 2000/12/22 22:59:00 jdolecek Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -264,10 +264,7 @@ fork1(struct proc *p1, int flags, int exitsig, void *stack, size_t stacksize,
/*
* Create signal actions for the child process.
*/
if (flags & FORK_SHARESIGS)
sigactsshare(p1, p2);
else
p2->p_sigacts = sigactsinit(p1);
sigactsinit(p2, p1, flags & FORK_SHARESIGS);
/*
* If emulation has process fork hook, call it now.

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig.c,v 1.108 2000/11/05 15:37:09 jdolecek Exp $ */
/* $NetBSD: kern_sig.c,v 1.109 2000/12/22 22:59:00 jdolecek Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -104,59 +104,59 @@ struct pool sigacts_pool; /* memory pool for sigacts structures */
void
signal_init()
{
pool_init(&sigacts_pool, sizeof(struct sigacts), 0, 0, 0, "sigapl",
0, pool_page_alloc_nointr, pool_page_free_nointr, M_SUBPROC);
}
/*
* Create an initial sigacts structure, using the same signal state
* as p.
* Create an initial sigctx structure, using the same signal state
* as p. If 'share' is set, share the sigctx_proc part, otherwise just
* copy it from parent.
*/
struct sigacts *
sigactsinit(p)
struct proc *p;
void
sigactsinit(np, pp, share)
struct proc *np; /* new process */
struct proc *pp; /* parent process */
int share;
{
struct sigacts *ps;
ps = pool_get(&sigacts_pool, PR_WAITOK);
memcpy(ps, p->p_sigacts, sizeof(struct sigacts));
ps->ps_refcnt = 1;
return (ps);
if (share) {
np->p_sigacts = pp->p_sigacts;
pp->p_sigacts->sa_refcnt++;
} else {
ps = pool_get(&sigacts_pool, PR_WAITOK);
if (pp)
memcpy(ps, pp->p_sigacts, sizeof(struct sigacts));
else
memset(ps, '\0', sizeof(struct sigacts));
ps->sa_refcnt = 1;
np->p_sigacts = ps;
}
}
/*
* Make p2 share p1's sigacts.
*/
void
sigactsshare(p1, p2)
struct proc *p1, *p2;
{
p2->p_sigacts = p1->p_sigacts;
p1->p_sigacts->ps_refcnt++;
}
/*
* Make this process not share its sigacts, maintaining all
* Make this process not share its sigctx, maintaining all
* signal state.
*/
void
sigactsunshare(p)
struct proc *p;
{
struct sigacts *newps;
struct sigacts *oldps;
if (p->p_sigacts->ps_refcnt == 1)
if (p->p_sigacts->sa_refcnt == 1)
return;
newps = sigactsinit(p);
sigactsfree(p);
p->p_sigacts = newps;
oldps = p->p_sigacts;
sigactsinit(p, NULL, 0);
if (--oldps->sa_refcnt == 0)
pool_put(&sigacts_pool, oldps);
}
/*
* Release a sigacts structure.
* Release a sigctx structure.
*/
void
sigactsfree(p)
@ -164,11 +164,9 @@ sigactsfree(p)
{
struct sigacts *ps = p->p_sigacts;
if (--ps->ps_refcnt > 0)
if (--ps->sa_refcnt > 0)
return;
p->p_sigacts = NULL;
pool_put(&sigacts_pool, ps);
}
@ -186,7 +184,7 @@ sigaction1(p, signum, nsa, osa)
return (EINVAL);
if (osa)
*osa = ps->ps_sigact[signum];
*osa = SIGACTION_PS(ps, signum);
if (nsa) {
if (nsa->sa_flags & ~SA_ALLBITS)
@ -197,10 +195,10 @@ sigaction1(p, signum, nsa, osa)
return (EINVAL);
(void) splsched(); /* XXXSMP */
ps->ps_sigact[signum] = *nsa;
sigminusset(&sigcantmask, &ps->ps_sigact[signum].sa_mask);
SIGACTION_PS(ps, signum) = *nsa;
sigminusset(&sigcantmask, &SIGACTION_PS(ps, signum).sa_mask);
if ((prop & SA_NORESET) != 0)
ps->ps_sigact[signum].sa_flags &= ~SA_RESETHAND;
SIGACTION_PS(ps, signum).sa_flags &= ~SA_RESETHAND;
if (signum == SIGCHLD) {
if (nsa->sa_flags & SA_NOCLDSTOP)
p->p_flag |= P_NOCLDSTOP;
@ -221,27 +219,27 @@ sigaction1(p, signum, nsa, osa)
p->p_flag &= ~P_NOCLDWAIT;
}
if ((nsa->sa_flags & SA_NODEFER) == 0)
sigaddset(&ps->ps_sigact[signum].sa_mask, signum);
sigaddset(&SIGACTION_PS(ps, signum).sa_mask, signum);
else
sigdelset(&ps->ps_sigact[signum].sa_mask, signum);
sigdelset(&SIGACTION_PS(ps, signum).sa_mask, signum);
/*
* Set bit in p_sigignore for signals that are set to SIG_IGN,
* Set bit in p_sigctx.ps_sigignore for signals that are set to SIG_IGN,
* and for signals set to SIG_DFL where the default is to ignore.
* However, don't put SIGCONT in p_sigignore,
* However, don't put SIGCONT in p_sigctx.ps_sigignore,
* as we have to restart the process.
*/
if (nsa->sa_handler == SIG_IGN ||
(nsa->sa_handler == SIG_DFL && (prop & SA_IGNORE) != 0)) {
sigdelset(&p->p_siglist, signum); /* never to be seen again */
sigdelset(&p->p_sigctx.ps_siglist, signum); /* never to be seen again */
if (signum != SIGCONT)
sigaddset(&p->p_sigignore, signum); /* easier in psignal */
sigdelset(&p->p_sigcatch, signum);
sigaddset(&p->p_sigctx.ps_sigignore, signum); /* easier in psignal */
sigdelset(&p->p_sigctx.ps_sigcatch, signum);
} else {
sigdelset(&p->p_sigignore, signum);
sigdelset(&p->p_sigctx.ps_sigignore, signum);
if (nsa->sa_handler == SIG_DFL)
sigdelset(&p->p_sigcatch, signum);
sigdelset(&p->p_sigctx.ps_sigcatch, signum);
else
sigaddset(&p->p_sigcatch, signum);
sigaddset(&p->p_sigctx.ps_sigcatch, signum);
}
(void) spl0();
}
@ -306,22 +304,22 @@ siginit(p)
if (prop & SA_CANTMASK)
sigaddset(&sigcantmask, signum);
if (prop & SA_IGNORE && signum != SIGCONT)
sigaddset(&p->p_sigignore, signum);
sigemptyset(&ps->ps_sigact[signum].sa_mask);
ps->ps_sigact[signum].sa_flags = SA_RESTART;
sigaddset(&p->p_sigctx.ps_sigignore, signum);
sigemptyset(&SIGACTION_PS(ps, signum).sa_mask);
SIGACTION_PS(ps, signum).sa_flags = SA_RESTART;
}
sigemptyset(&p->p_sigcatch);
sigemptyset(&p->p_sigctx.ps_sigcatch);
p->p_flag &= ~P_NOCLDSTOP;
/*
* Reset stack state to the user stack.
*/
ps->ps_sigstk.ss_flags = SS_DISABLE;
ps->ps_sigstk.ss_size = 0;
ps->ps_sigstk.ss_sp = 0;
p->p_sigctx.ps_sigstk.ss_flags = SS_DISABLE;
p->p_sigctx.ps_sigstk.ss_size = 0;
p->p_sigctx.ps_sigstk.ss_sp = 0;
/* One reference. */
ps->ps_refcnt = 1;
ps->sa_refcnt = 1;
}
/*
@ -337,31 +335,31 @@ execsigs(p)
/*
* Reset caught signals. Held signals remain held
* through p_sigmask (unless they were caught,
* through p_sigctx.ps_sigmask (unless they were caught,
* and are now ignored by default).
*/
for (signum = 1; signum < NSIG; signum++) {
if (sigismember(&p->p_sigcatch, signum)) {
if (sigismember(&p->p_sigctx.ps_sigcatch, signum)) {
prop = sigprop[signum];
if (prop & SA_IGNORE) {
if ((prop & SA_CONT) == 0)
sigaddset(&p->p_sigignore, signum);
sigdelset(&p->p_siglist, signum);
sigaddset(&p->p_sigctx.ps_sigignore, signum);
sigdelset(&p->p_sigctx.ps_siglist, signum);
}
ps->ps_sigact[signum].sa_handler = SIG_DFL;
SIGACTION_PS(ps, signum).sa_handler = SIG_DFL;
}
sigemptyset(&ps->ps_sigact[signum].sa_mask);
ps->ps_sigact[signum].sa_flags = SA_RESTART;
sigemptyset(&SIGACTION_PS(ps, signum).sa_mask);
SIGACTION_PS(ps, signum).sa_flags = SA_RESTART;
}
sigemptyset(&p->p_sigcatch);
sigemptyset(&p->p_sigctx.ps_sigcatch);
p->p_flag &= ~P_NOCLDSTOP;
/*
* Reset stack state to the user stack.
*/
ps->ps_sigstk.ss_flags = SS_DISABLE;
ps->ps_sigstk.ss_size = 0;
ps->ps_sigstk.ss_sp = 0;
p->p_sigctx.ps_sigstk.ss_flags = SS_DISABLE;
p->p_sigctx.ps_sigstk.ss_size = 0;
p->p_sigctx.ps_sigstk.ss_sp = 0;
}
int
@ -373,27 +371,27 @@ sigprocmask1(p, how, nss, oss)
{
if (oss)
*oss = p->p_sigmask;
*oss = p->p_sigctx.ps_sigmask;
if (nss) {
(void)splsched(); /* XXXSMP */
switch (how) {
case SIG_BLOCK:
sigplusset(nss, &p->p_sigmask);
sigplusset(nss, &p->p_sigctx.ps_sigmask);
break;
case SIG_UNBLOCK:
sigminusset(nss, &p->p_sigmask);
p->p_sigcheck = 1;
sigminusset(nss, &p->p_sigctx.ps_sigmask);
p->p_sigctx.ps_sigcheck = 1;
break;
case SIG_SETMASK:
p->p_sigmask = *nss;
p->p_sigcheck = 1;
p->p_sigctx.ps_sigmask = *nss;
p->p_sigctx.ps_sigcheck = 1;
break;
default:
(void)spl0(); /* XXXSMP */
return (EINVAL);
}
sigminusset(&sigcantmask, &p->p_sigmask);
sigminusset(&sigcantmask, &p->p_sigctx.ps_sigmask);
(void)spl0(); /* XXXSMP */
}
@ -443,8 +441,8 @@ sigpending1(p, ss)
sigset_t *ss;
{
*ss = p->p_siglist;
sigminusset(&p->p_sigmask, ss);
*ss = p->p_sigctx.ps_siglist;
sigminusset(&p->p_sigctx.ps_sigmask, ss);
}
/* ARGSUSED */
@ -475,15 +473,15 @@ sigsuspend1(p, ss)
* When returning from sigpause, we want
* the old mask to be restored after the
* signal handler has finished. Thus, we
* save it here and mark the sigacts structure
* save it here and mark the sigctx structure
* to indicate this.
*/
ps->ps_oldmask = p->p_sigmask;
ps->ps_flags |= SAS_OLDMASK;
p->p_sigctx.ps_oldmask = p->p_sigctx.ps_sigmask;
p->p_sigctx.ps_flags |= SAS_OLDMASK;
(void) splsched(); /* XXXSMP */
p->p_sigmask = *ss;
p->p_sigcheck = 1;
sigminusset(&sigcantmask, &p->p_sigmask);
p->p_sigctx.ps_sigmask = *ss;
p->p_sigctx.ps_sigcheck = 1;
sigminusset(&sigcantmask, &p->p_sigctx.ps_sigmask);
(void) spl0(); /* XXXSMP */
}
@ -526,23 +524,21 @@ sigaltstack1(p, nss, oss)
const struct sigaltstack *nss;
struct sigaltstack *oss;
{
struct sigacts *ps = p->p_sigacts;
if (oss)
*oss = ps->ps_sigstk;
*oss = p->p_sigctx.ps_sigstk;
if (nss) {
if (nss->ss_flags & ~SS_ALLBITS)
return (EINVAL);
if (nss->ss_flags & SS_DISABLE) {
if (ps->ps_sigstk.ss_flags & SS_ONSTACK)
if (p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK)
return (EINVAL);
} else {
if (nss->ss_size < MINSIGSTKSZ)
return (ENOMEM);
}
ps->ps_sigstk = *nss;
p->p_sigctx.ps_sigstk = *nss;
}
return (0);
@ -711,29 +707,29 @@ trapsignal(p, signum, code)
struct sigacts *ps = p->p_sigacts;
if ((p->p_flag & P_TRACED) == 0 &&
sigismember(&p->p_sigcatch, signum) &&
!sigismember(&p->p_sigmask, signum)) {
sigismember(&p->p_sigctx.ps_sigcatch, signum) &&
!sigismember(&p->p_sigctx.ps_sigmask, signum)) {
p->p_stats->p_ru.ru_nsignals++;
#ifdef KTRACE
if (KTRPOINT(p, KTR_PSIG))
ktrpsig(p, signum,
ps->ps_sigact[signum].sa_handler, &p->p_sigmask,
code);
SIGACTION_PS(ps, signum).sa_handler,
&p->p_sigctx.ps_sigmask, code);
#endif
(*p->p_emul->e_sendsig)(ps->ps_sigact[signum].sa_handler,
signum, &p->p_sigmask, code);
(*p->p_emul->e_sendsig)(SIGACTION_PS(ps, signum).sa_handler,
signum, &p->p_sigctx.ps_sigmask, code);
(void) splsched(); /* XXXSMP */
sigplusset(&ps->ps_sigact[signum].sa_mask, &p->p_sigmask);
if (ps->ps_sigact[signum].sa_flags & SA_RESETHAND) {
sigdelset(&p->p_sigcatch, signum);
sigplusset(&SIGACTION_PS(ps, signum).sa_mask, &p->p_sigctx.ps_sigmask);
if (SIGACTION_PS(ps, signum).sa_flags & SA_RESETHAND) {
sigdelset(&p->p_sigctx.ps_sigcatch, signum);
if (signum != SIGCONT && sigprop[signum] & SA_IGNORE)
sigaddset(&p->p_sigignore, signum);
ps->ps_sigact[signum].sa_handler = SIG_DFL;
sigaddset(&p->p_sigctx.ps_sigignore, signum);
SIGACTION_PS(ps, signum).sa_handler = SIG_DFL;
}
(void) spl0(); /* XXXSMP */
} else {
ps->ps_code = code; /* XXX for core dump/debugger */
ps->ps_sig = signum; /* XXX to verify code */
p->p_sigctx.ps_code = code; /* XXX for core dump/debugger */
p->p_sigctx.ps_sig = signum; /* XXX to verify code */
psignal(p, signum);
}
}
@ -783,15 +779,15 @@ psignal1(p, signum, dolock)
/*
* If the signal is being ignored,
* then we forget about it immediately.
* (Note: we don't set SIGCONT in p_sigignore,
* (Note: we don't set SIGCONT in p_sigctx.ps_sigignore,
* and if it is set to SIG_IGN,
* action will be SIG_DFL here.)
*/
if (sigismember(&p->p_sigignore, signum))
if (sigismember(&p->p_sigctx.ps_sigignore, signum))
return;
if (sigismember(&p->p_sigmask, signum))
if (sigismember(&p->p_sigctx.ps_sigmask, signum))
action = SIG_HOLD;
else if (sigismember(&p->p_sigcatch, signum))
else if (sigismember(&p->p_sigctx.ps_sigcatch, signum))
action = SIG_CATCH;
else {
action = SIG_DFL;
@ -811,13 +807,13 @@ psignal1(p, signum, dolock)
}
if (prop & SA_CONT)
sigminusset(&stopsigmask, &p->p_siglist);
sigminusset(&stopsigmask, &p->p_sigctx.ps_siglist);
if (prop & SA_STOP)
sigminusset(&contsigmask, &p->p_siglist);
sigminusset(&contsigmask, &p->p_sigctx.ps_siglist);
sigaddset(&p->p_siglist, signum);
p->p_sigcheck = 1;
sigaddset(&p->p_sigctx.ps_siglist, signum);
p->p_sigctx.ps_sigcheck = 1;
/*
* Defer further processing for signals which are held,
@ -853,7 +849,7 @@ psignal1(p, signum, dolock)
* be awakened.
*/
if ((prop & SA_CONT) && action == SIG_DFL) {
sigdelset(&p->p_siglist, signum);
sigdelset(&p->p_sigctx.ps_siglist, signum);
goto out;
}
/*
@ -867,7 +863,7 @@ psignal1(p, signum, dolock)
*/
if (p->p_flag & P_PPWAIT)
goto out;
sigdelset(&p->p_siglist, signum);
sigdelset(&p->p_sigctx.ps_siglist, signum);
p->p_xstat = signum;
if ((p->p_pptr->p_flag & P_NOCLDSTOP) == 0) {
/*
@ -903,16 +899,16 @@ psignal1(p, signum, dolock)
if (prop & SA_CONT) {
/*
* If SIGCONT is default (or ignored), we continue the
* process but don't leave the signal in p_siglist, as
* process but don't leave the signal in p_sigctx.ps_siglist, as
* it has no further action. If SIGCONT is held, we
* continue the process and leave the signal in
* p_siglist. If the process catches SIGCONT, let it
* p_sigctx.ps_siglist. If the process catches SIGCONT, let it
* handle the signal itself. If it isn't waiting on
* an event, then it goes back to run state.
* Otherwise, process goes back to sleep state.
*/
if (action == SIG_DFL)
sigdelset(&p->p_siglist, signum);
sigdelset(&p->p_sigctx.ps_siglist, signum);
if (action == SIG_CATCH)
goto runfast;
if (p->p_wchan == 0)
@ -926,7 +922,7 @@ psignal1(p, signum, dolock)
* Already stopped, don't need to stop again.
* (If we did the shell could get confused.)
*/
sigdelset(&p->p_siglist, signum);
sigdelset(&p->p_sigctx.ps_siglist, signum);
goto out;
}
@ -1024,16 +1020,16 @@ issignal(p)
sigminusset(&stopsigmask, &ss);
signum = firstsig(&ss);
if (signum == 0) { /* no signal to send */
p->p_sigcheck = 0;
p->p_sigctx.ps_sigcheck = 0;
return (0);
}
sigdelset(&p->p_siglist, signum); /* take the signal! */
sigdelset(&p->p_sigctx.ps_siglist, signum); /* take the signal! */
/*
* We should see pending but ignored signals
* only if P_TRACED was on when they were posted.
*/
if (sigismember(&p->p_sigignore, signum) &&
if (sigismember(&p->p_sigctx.ps_sigignore, signum) &&
(p->p_flag & P_TRACED) == 0)
continue;
@ -1065,10 +1061,10 @@ issignal(p)
* signals.
*/
signum = p->p_xstat;
/* `p->p_siglist |= mask' is done in setrunnable(). */
if (sigismember(&p->p_sigmask, signum))
/* `p->p_sigctx.ps_siglist |= mask' is done in setrunnable(). */
if (sigismember(&p->p_sigctx.ps_sigmask, signum))
continue;
sigdelset(&p->p_siglist, signum); /* take the signal! */
sigdelset(&p->p_sigctx.ps_siglist, signum); /* take the signal! */
}
prop = sigprop[signum];
@ -1078,7 +1074,7 @@ issignal(p)
* Return the signal's number, or fall through
* to clear it from the pending mask.
*/
switch ((long)p->p_sigacts->ps_sigact[signum].sa_handler) {
switch ((long)SIGACTION(p, signum).sa_handler) {
case (long)SIG_DFL:
/*
@ -1148,8 +1144,8 @@ issignal(p)
/* NOTREACHED */
keep:
sigaddset(&p->p_siglist, signum); /* leave the signal for later */
p->p_sigcheck = 1;
sigaddset(&p->p_sigctx.ps_siglist, signum); /* leave the signal for later */
p->p_sigctx.ps_sigcheck = 1;
return (signum);
}
@ -1191,13 +1187,13 @@ postsig(signum)
KERNEL_PROC_LOCK(p);
sigdelset(&p->p_siglist, signum);
action = ps->ps_sigact[signum].sa_handler;
sigdelset(&p->p_sigctx.ps_siglist, signum);
action = SIGACTION_PS(ps, signum).sa_handler;
#ifdef KTRACE
if (KTRPOINT(p, KTR_PSIG))
ktrpsig(p,
signum, action, ps->ps_flags & SAS_OLDMASK ?
&ps->ps_oldmask : &p->p_sigmask, 0);
signum, action, p->p_sigctx.ps_flags & SAS_OLDMASK ?
&p->p_sigctx.ps_oldmask : &p->p_sigctx.ps_sigmask, 0);
#endif
if (action == SIG_DFL) {
/*
@ -1211,7 +1207,7 @@ postsig(signum)
* If we get here, the signal must be caught.
*/
#ifdef DIAGNOSTIC
if (action == SIG_IGN || sigismember(&p->p_sigmask, signum))
if (action == SIG_IGN || sigismember(&p->p_sigctx.ps_sigmask, signum))
panic("postsig action");
#endif
/*
@ -1223,27 +1219,27 @@ postsig(signum)
* mask from before the sigpause is what we want
* restored after the signal processing is completed.
*/
if (ps->ps_flags & SAS_OLDMASK) {
returnmask = &ps->ps_oldmask;
ps->ps_flags &= ~SAS_OLDMASK;
if (p->p_sigctx.ps_flags & SAS_OLDMASK) {
returnmask = &p->p_sigctx.ps_oldmask;
p->p_sigctx.ps_flags &= ~SAS_OLDMASK;
} else
returnmask = &p->p_sigmask;
returnmask = &p->p_sigctx.ps_sigmask;
p->p_stats->p_ru.ru_nsignals++;
if (ps->ps_sig != signum) {
if (p->p_sigctx.ps_sig != signum) {
code = 0;
} else {
code = ps->ps_code;
ps->ps_code = 0;
ps->ps_sig = 0;
code = p->p_sigctx.ps_code;
p->p_sigctx.ps_code = 0;
p->p_sigctx.ps_sig = 0;
}
(*p->p_emul->e_sendsig)(action, signum, returnmask, code);
(void) splsched(); /* XXXSMP */
sigplusset(&ps->ps_sigact[signum].sa_mask, &p->p_sigmask);
if (ps->ps_sigact[signum].sa_flags & SA_RESETHAND) {
sigdelset(&p->p_sigcatch, signum);
sigplusset(&SIGACTION_PS(ps, signum).sa_mask, &p->p_sigctx.ps_sigmask);
if (SIGACTION_PS(ps, signum).sa_flags & SA_RESETHAND) {
sigdelset(&p->p_sigctx.ps_sigcatch, signum);
if (signum != SIGCONT && sigprop[signum] & SA_IGNORE)
sigaddset(&p->p_sigignore, signum);
ps->ps_sigact[signum].sa_handler = SIG_DFL;
sigaddset(&p->p_sigctx.ps_sigignore, signum);
SIGACTION_PS(ps, signum).sa_handler = SIG_DFL;
}
(void) spl0(); /* XXXSMP */
}
@ -1295,7 +1291,7 @@ sigexit(p, signum)
p->p_acflag |= AXSIG;
if (sigprop[signum] & SA_CORE) {
p->p_sigacts->ps_sig = signum;
p->p_sigctx.ps_sig = signum;
if ((error = coredump(p)) == 0)
exitsig |= WCOREFLAG;
@ -1400,8 +1396,8 @@ coredump(p)
core.c_midmag = 0;
strncpy(core.c_name, p->p_comm, MAXCOMLEN);
core.c_nseg = 0;
core.c_signo = p->p_sigacts->ps_sig;
core.c_ucode = p->p_sigacts->ps_code;
core.c_signo = p->p_sigctx.ps_sig;
core.c_ucode = p->p_sigctx.ps_code;
core.c_cpusize = 0;
core.c_tsize = (u_long)ctob(vm->vm_tsize);
core.c_dsize = (u_long)ctob(vm->vm_dsize);
@ -1478,8 +1474,8 @@ coredump32(p, vp)
core.c_midmag = 0;
strncpy(core.c_name, p->p_comm, MAXCOMLEN);
core.c_nseg = 0;
core.c_signo = p->p_sigacts->ps_sig;
core.c_ucode = p->p_sigacts->ps_code;
core.c_signo = p->p_sigctx.ps_sig;
core.c_ucode = p->p_sigctx.ps_code;
core.c_cpusize = 0;
core.c_tsize = (u_long)ctob(vm->vm_tsize);
core.c_dsize = (u_long)ctob(vm->vm_dsize);
@ -1595,6 +1591,6 @@ sigismasked(p, sig)
struct proc *p;
int sig;
{
return sigismember(&p->p_sigignore, SIGTTOU)
|| sigismember(&p->p_sigmask, SIGTTOU);
return sigismember(&p->p_sigctx.ps_sigignore, SIGTTOU)
|| sigismember(&p->p_sigctx.ps_sigmask, SIGTTOU);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_synch.c,v 1.98 2000/11/12 18:17:56 jdolecek Exp $ */
/* $NetBSD: kern_synch.c,v 1.99 2000/12/22 22:59:00 jdolecek Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -914,8 +914,8 @@ setrunnable(struct proc *p)
* while we were stopped), check for a signal from the debugger.
*/
if ((p->p_flag & P_TRACED) != 0 && p->p_xstat != 0) {
sigaddset(&p->p_siglist, p->p_xstat);
p->p_sigcheck = 1;
sigaddset(&p->p_sigctx.ps_siglist, p->p_xstat);
p->p_sigctx.ps_sigcheck = 1;
}
case SSLEEP:
unsleep(p); /* e.g. when sending signals */

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sysctl.c,v 1.85 2000/11/20 01:46:56 simonb Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.86 2000/12/22 22:59:00 jdolecek Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -1620,10 +1620,10 @@ fill_kproc2(p, ki)
ki->p_holdcnt = p->p_holdcnt;
memcpy(&ki->p_siglist, &p->p_siglist, sizeof(ki_sigset_t));
memcpy(&ki->p_sigmask, &p->p_sigmask, sizeof(ki_sigset_t));
memcpy(&ki->p_sigignore, &p->p_sigignore, sizeof(ki_sigset_t));
memcpy(&ki->p_sigcatch, &p->p_sigcatch, sizeof(ki_sigset_t));
memcpy(&ki->p_siglist, &p->p_sigctx.ps_siglist, sizeof(ki_sigset_t));
memcpy(&ki->p_sigmask, &p->p_sigctx.ps_sigmask, sizeof(ki_sigset_t));
memcpy(&ki->p_sigignore, &p->p_sigctx.ps_sigignore,sizeof(ki_sigset_t));
memcpy(&ki->p_sigcatch, &p->p_sigctx.ps_sigcatch, sizeof(ki_sigset_t));
ki->p_stat = p->p_stat;
ki->p_priority = p->p_priority;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty.c,v 1.124 2000/11/15 01:47:14 enami Exp $ */
/* $NetBSD: tty.c,v 1.125 2000/12/22 22:59:00 jdolecek Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1991, 1993
@ -1356,8 +1356,8 @@ loop: lflag = tp->t_lflag;
* Hang process if it's in the background.
*/
if (isbackground(p, tp)) {
if (sigismember(&p->p_sigignore, SIGTTIN) ||
sigismember(&p->p_sigmask, SIGTTIN) ||
if (sigismember(&p->p_sigctx.ps_sigignore, SIGTTIN) ||
sigismember(&p->p_sigctx.ps_sigmask, SIGTTIN) ||
p->p_flag & P_PPWAIT || p->p_pgrp->pg_jobc == 0)
return (EIO);
pgsignal(p->p_pgrp, SIGTTIN, 1);
@ -1606,8 +1606,8 @@ loop:
p = curproc;
if (isbackground(p, tp) &&
ISSET(tp->t_lflag, TOSTOP) && (p->p_flag & P_PPWAIT) == 0 &&
!sigismember(&p->p_sigignore, SIGTTOU) &&
!sigismember(&p->p_sigmask, SIGTTOU)) {
!sigismember(&p->p_sigctx.ps_sigignore, SIGTTOU) &&
!sigismember(&p->p_sigctx.ps_sigmask, SIGTTOU)) {
if (p->p_pgrp->pg_jobc == 0) {
error = EIO;
goto out;

View File

@ -1,4 +1,4 @@
/* $NetBSD: proc.h,v 1.117 2000/12/19 22:08:36 scw Exp $ */
/* $NetBSD: proc.h,v 1.118 2000/12/22 22:59:01 jdolecek Exp $ */
/*-
* Copyright (c) 1986, 1989, 1991, 1993
@ -54,6 +54,7 @@
#include <sys/lock.h>
#include <sys/queue.h>
#include <sys/callout.h>
#include <sys/signalvar.h>
/*
* One structure allocated per session.
@ -138,7 +139,7 @@ struct proc {
struct pstats *p_stats; /* Accounting/statistics (PROC ONLY). */
struct plimit *p_limit; /* Process limits. */
struct vmspace *p_vmspace; /* Address space. */
struct sigacts *p_sigacts; /* Signal actions, state (PROC ONLY). */
struct sigacts *p_sigacts; /* Process sigactions (state is below)*/
#define p_ucred p_cred->pc_ucred
#define p_rlimit p_limit->pl_rlimit
@ -184,9 +185,6 @@ struct proc {
int p_traceflag; /* Kernel trace points. */
struct file *p_tracep; /* Trace to file */
sigset_t p_siglist; /* Signals arrived but not delivered. */
char p_sigcheck; /* May have deliverable signals. */
struct vnode *p_textvp; /* Vnode of executable. */
int p_locks; /* DEBUG: lockmgr count of held locks */
@ -200,11 +198,9 @@ struct proc {
#define p_endzero p_startcopy
/* The following fields are all copied upon creation in fork. */
#define p_startcopy p_sigmask
#define p_startcopy p_sigctx.ps_startcopy
sigset_t p_sigmask; /* Current signal mask. */
sigset_t p_sigignore; /* Signals being ignored. */
sigset_t p_sigcatch; /* Signals being caught by user. */
struct sigctx p_sigctx; /* Signal state. */
u_char p_priority; /* Process priority. */
u_char p_usrpri; /* User-priority based on p_cpu and p_nice. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: signalvar.h,v 1.26 2000/11/15 21:13:58 jdolecek Exp $ */
/* $NetBSD: signalvar.h,v 1.27 2000/12/22 22:59:01 jdolecek Exp $ */
/*
* Copyright (c) 1991, 1993
@ -44,18 +44,33 @@
*/
/*
* Process signal actions and state, needed only within the process
* (not necessarily resident).
* Process signal actions, possibly shared between threads.
*/
struct sigacts {
struct sigaction ps_sigact[NSIG]; /* disposition of signals */
struct sigacts {
struct sigaction sa_sigact[NSIG]; /* disposition of signals */
int sa_refcnt; /* reference count */
};
/*
* Process signal state.
*/
struct sigctx {
/* This needs to be zeroed on fork */
sigset_t ps_siglist; /* Signals arrived but not delivered. */
char ps_sigcheck; /* May have deliverable signals. */
/* This should be copied on fork */
#define ps_startcopy ps_sigstk
struct sigaltstack ps_sigstk; /* sp & on stack state variable */
sigset_t ps_oldmask; /* saved mask from before sigpause */
int ps_flags; /* signal flags, below */
int ps_sig; /* for core dump/debugger XXX */
long ps_code; /* for core dump/debugger XXX */
void *ps_sigcode; /* address of signal trampoline */
int ps_refcnt; /* reference count */
sigset_t ps_sigmask; /* Current signal mask. */
sigset_t ps_sigignore; /* Signals being ignored. */
sigset_t ps_sigcatch; /* Signals being caught by user. */
};
/* signal flags */
@ -68,20 +83,20 @@ struct sigacts {
/*
* get signal action for process and signal; currently only for current process
*/
#define SIGACTION(p, sig) (p->p_sigacts->ps_sigact[(sig)])
#define SIGACTION_PS(ps, sig) (ps->ps_sigact[(sig)])
#define SIGACTION(p, sig) (p->p_sigacts->sa_sigact[(sig)])
#define SIGACTION_PS(ps, sig) (ps->sa_sigact[(sig)])
/*
* Determine signal that should be delivered to process p, the current
* process, 0 if none. If there is a pending stop signal with default
* action, the process stops in issignal().
*/
#define CURSIG(p) (p->p_sigcheck ? issignal(p) : 0)
#define CURSIG(p) (p->p_sigctx.ps_sigcheck ? issignal(p) : 0)
/*
* Clear a pending signal from a process.
*/
#define CLRSIG(p, sig) sigdelset(&p->p_siglist, sig)
#define CLRSIG(p, sig) sigdelset(&p->p_sigctx.ps_siglist, sig)
/*
* Signal properties and actions.
@ -169,8 +184,7 @@ int sigismasked __P((struct proc *, int));
void signal_init __P((void));
struct sigacts *sigactsinit __P((struct proc *));
void sigactsshare __P((struct proc *, struct proc *));
void sigactsinit __P((struct proc *, struct proc *, int));
void sigactsunshare __P((struct proc *));
void sigactsfree __P((struct proc *));