make sendsig/sigreturn work with p_sigctx.

This commit is contained in:
matthias 2001-01-02 19:16:34 +00:00
parent 32e4d7004e
commit 4cefdbee45
2 changed files with 13 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_machdep.c,v 1.1 1998/09/17 02:01:59 thorpej Exp $ */
/* $NetBSD: compat_13_machdep.c,v 1.2 2001/01/02 19:16:35 matthias Exp $ */
/*-
* Copyright (c) 1996 Matthias Pfaller.
@ -99,9 +99,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.116 2000/09/13 15:00:21 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.117 2001/01/02 19:16:34 matthias Exp $ */
/*-
* Copyright (c) 1996 Matthias Pfaller.
@ -325,20 +325,19 @@ sendsig(catcher, sig, mask, code)
struct proc *p = curproc;
struct reg *regs;
struct sigframe *fp, frame;
struct sigacts *psp = p->p_sigacts;
int onstack;
regs = 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 *)regs->r_sp;
fp--;
@ -365,7 +364,7 @@ sendsig(catcher, sig, mask, code)
frame.sf_sc.sc_reg[REG_R0] = regs->r_r0;
/* 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 the signal mask. */
frame.sf_sc.sc_mask = *mask;
@ -393,11 +392,11 @@ sendsig(catcher, sig, mask, code)
* Build context to run handler in.
*/
regs->r_sp = (int)fp;
regs->r_pc = (int)psp->ps_sigcode;
regs->r_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;
}
/*
@ -456,9 +455,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);