summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim/machdep.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2004-01-03 02:02:26 +0000
committerdavidxu <davidxu@FreeBSD.org>2004-01-03 02:02:26 +0000
commitf39653dda8a5ba30d080c073e76f4065a6bf4b48 (patch)
tree14d49d69e2829a6224271d42946d9bec5a5f9ada /sys/powerpc/aim/machdep.c
parent5b9bbee08a34c013ab6b7b6432dd37835012f868 (diff)
downloadFreeBSD-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/powerpc/aim/machdep.c')
-rw-r--r--sys/powerpc/aim/machdep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c
index e009b18..008889d 100644
--- a/sys/powerpc/aim/machdep.c
+++ b/sys/powerpc/aim/machdep.c
@@ -424,8 +424,8 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
*/
memset(&sf, 0, sizeof(sf));
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;
sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0;
@@ -434,10 +434,10 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
/*
* 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 *)((caddr_t)p->p_sigstk.ss_sp +
- p->p_sigstk.ss_size - rndfsize);
+ sfp = (struct sigframe *)((caddr_t)td->td_sigstk.ss_sp +
+ td->td_sigstk.ss_size - rndfsize);
} else {
sfp = (struct sigframe *)(tf->fixreg[1] - rndfsize);
}
OpenPOWER on IntegriCloud