Adapt to newlock2.
This commit is contained in:
parent
42a7dff463
commit
069c9702dd
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sig_machdep.c,v 1.29 2007/02/09 21:55:02 ad Exp $ */
|
||||
/* $NetBSD: sig_machdep.c,v 1.30 2007/02/18 20:05:20 briggs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1998 Mark Brinicombe.
|
||||
|
@ -45,7 +45,7 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.29 2007/02/09 21:55:02 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.30 2007/02/18 20:05:20 briggs Exp $");
|
||||
|
||||
#include <sys/mount.h> /* XXX only needed by syscallargs.h */
|
||||
#include <sys/proc.h>
|
||||
|
@ -69,14 +69,13 @@ void *
|
|||
getframe(struct lwp *l, int sig, int *onstack)
|
||||
{
|
||||
struct proc *p = l->l_proc;
|
||||
struct sigctx *ctx = &p->p_sigctx;
|
||||
struct trapframe *tf = process_frame(l);
|
||||
|
||||
/* Do we need to jump onto the signal stack? */
|
||||
*onstack = (ctx->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0
|
||||
*onstack = (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0
|
||||
&& (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
|
||||
if (*onstack)
|
||||
return (char *)ctx->ps_sigstk.ss_sp + ctx->ps_sigstk.ss_size;
|
||||
return (char *)l->l_sigstk.ss_sp + l->l_sigstk.ss_size;
|
||||
return (void *)tf->tf_usr_sp;
|
||||
}
|
||||
|
||||
|
@ -130,7 +129,7 @@ sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
|
|||
frame.sf_uc.uc_flags = _UC_SIGMASK;
|
||||
frame.sf_uc.uc_sigmask = *mask;
|
||||
frame.sf_uc.uc_link = NULL;
|
||||
frame.sf_uc.uc_flags |= (p->p_sigctx.ps_sigstk.ss_flags & SS_ONSTACK)
|
||||
frame.sf_uc.uc_flags |= (l->l_sigstk.ss_flags & SS_ONSTACK)
|
||||
? _UC_SETSTACK : _UC_CLRSTACK;
|
||||
memset(&frame.sf_uc.uc_stack, 0, sizeof(frame.sf_uc.uc_stack));
|
||||
cpu_getmcontext(l, &frame.sf_uc.uc_mcontext, &frame.sf_uc.uc_flags);
|
||||
|
@ -169,7 +168,7 @@ sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
|
|||
|
||||
/* Remember that we're now on the signal stack. */
|
||||
if (onstack)
|
||||
p->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
|
||||
l->l_sigstk.ss_flags |= SS_ONSTACK;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -266,9 +265,9 @@ cpu_setmcontext(l, mcp, flags)
|
|||
}
|
||||
#endif
|
||||
if (flags & _UC_SETSTACK)
|
||||
l->l_proc->p_sigctx.ps_sigstk.ss_flags |= SS_ONSTACK;
|
||||
l->l_sigstk.ss_flags |= SS_ONSTACK;
|
||||
if (flags & _UC_CLRSTACK)
|
||||
l->l_proc->p_sigctx.ps_sigstk.ss_flags &= ~SS_ONSTACK;
|
||||
l->l_sigstk.ss_flags &= ~SS_ONSTACK;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue