From fd8b4427a5a052988cfb0778b779cff1a3e09628 Mon Sep 17 00:00:00 2001 From: luoqi Date: Mon, 11 Oct 1999 20:33:17 +0000 Subject: Add a per-signal flag to mark handlers registered with osigaction, so we can provide the correct context to each signal handler. Fix broken sigsuspend(): don't use p_oldsigmask as a flag, use SAS_OLDMASK as we did before the linuxthreads support merge (submitted by bde). Move ps_sigstk from to p_sigacts to the main proc structure since signal stack should not be shared among threads. Move SAS_OLDMASK and SAS_ALTSTACK flags from sigacts::ps_flags to proc::p_flag. Move PS_NOCLDSTOP and PS_NOCLDWAIT flags from proc::p_flag to procsig::ps_flag. Reviewed by: marcel, jdp, bde --- sys/alpha/linux/linux_sysvec.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'sys/alpha/linux/linux_sysvec.c') diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c index ecaa359..d282439 100644 --- a/sys/alpha/linux/linux_sysvec.c +++ b/sys/alpha/linux/linux_sysvec.c @@ -198,7 +198,7 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) int oonstack; regs = p->p_md.md_regs; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; #ifdef DEBUG printf("Linux-emul(%ld): linux_sendsig(%p, %d, %p, %lu)\n", @@ -207,11 +207,11 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) /* * Allocate space for the signal handler context. */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && + if ((p->p_flag & P_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct linux_sigframe *)(psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size - sizeof(struct linux_sigframe)); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct linux_sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - sizeof(struct linux_sigframe)); + p->p_sigstk.ss_flags |= SS_ONSTACK; } else { fp = (struct linux_sigframe *)regs->tf_esp - 1; } @@ -287,6 +287,7 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) regs->tf_ds = _udatasel; regs->tf_es = _udatasel; regs->tf_fs = _udatasel; + load_gs(_udatasel); regs->tf_ss = _udatasel; } @@ -354,12 +355,9 @@ linux_sigreturn(p, args) return(EINVAL); } - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; - SIGEMPTYSET(p->p_sigmask); - p->p_sigmask.__bits[0] = context.sc_mask; - SIGDELSET(p->p_sigmask, SIGKILL); - SIGDELSET(p->p_sigmask, SIGCONT); - SIGDELSET(p->p_sigmask, SIGSTOP); + p->p_sigstk.ss_flags &= ~SS_ONSTACK; + SIGSETOLD(p->p_sigmask, context.sc_mask); + SIG_CANTMASK(p->p_sigmask); /* * Restore signal context. -- cgit v1.1