diff options
author | davidxu <davidxu@FreeBSD.org> | 2004-01-03 02:02:26 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2004-01-03 02:02:26 +0000 |
commit | f39653dda8a5ba30d080c073e76f4065a6bf4b48 (patch) | |
tree | 14d49d69e2829a6224271d42946d9bec5a5f9ada /sys/sparc64 | |
parent | 5b9bbee08a34c013ab6b7b6432dd37835012f868 (diff) | |
download | FreeBSD-src-f39653dda8a5ba30d080c073e76f4065a6bf4b48.zip FreeBSD-src-f39653dda8a5ba30d080c073e76f4065a6bf4b48.tar.gz |
Make sigaltstack as per-threaded, because per-process sigaltstack state
is useless for threaded programs, multiple threads can not share same
stack.
The alternative signal stack is private for thread, no lock is needed,
the orignal P_ALTSTACK is now moved into td_pflags and renamed to
TDP_ALTSTACK.
For single thread or Linux clone() based threaded program, there is no
semantic changed, because those programs only have one kernel thread
in every process.
Reviewed by: deischen, dfr
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/machdep.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index 671bc61..3bc1c82 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -441,15 +441,15 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) bzero(&sf, sizeof(sf)); get_mcontext(td, &sf.sf_uc.uc_mcontext, 0); sf.sf_uc.uc_sigmask = *mask; - sf.sf_uc.uc_stack = p->p_sigstk; - sf.sf_uc.uc_stack.ss_flags = (p->p_flag & P_ALTSTACK) + sf.sf_uc.uc_stack = td->td_sigstk; + sf.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ? ((oonstack) ? SS_ONSTACK : 0) : SS_DISABLE; /* Allocate and validate space for the signal handler context. */ - if ((p->p_flag & P_ALTSTACK) != 0 && !oonstack && + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sfp = (struct sigframe *)(p->p_sigstk.ss_sp + - p->p_sigstk.ss_size - sizeof(struct sigframe)); + sfp = (struct sigframe *)(td->td_sigstk.ss_sp + + td->td_sigstk.ss_size - sizeof(struct sigframe)); } else sfp = (struct sigframe *)sp - 1; mtx_unlock(&psp->ps_mtx); |