summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux/linux_sysvec.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/i386/linux/linux_sysvec.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/i386/linux/linux_sysvec.c')
-rw-r--r--sys/i386/linux/linux_sysvec.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index dbaea80..5321d21 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -290,10 +290,10 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
/*
* Allocate space for the signal handler context.
*/
- if ((p->p_flag & P_ALTSTACK) && !oonstack &&
+ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
- fp = (struct l_rt_sigframe *)(p->p_sigstk.ss_sp +
- p->p_sigstk.ss_size - sizeof(struct l_rt_sigframe));
+ fp = (struct l_rt_sigframe *)(td->td_sigstk.ss_sp +
+ td->td_sigstk.ss_size - sizeof(struct l_rt_sigframe));
} else
fp = (struct l_rt_sigframe *)regs->tf_esp - 1;
mtx_unlock(&psp->ps_mtx);
@@ -323,9 +323,9 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
frame.sf_sc.uc_flags = 0; /* XXX ??? */
frame.sf_sc.uc_link = NULL; /* XXX ??? */
- frame.sf_sc.uc_stack.ss_sp = p->p_sigstk.ss_sp;
- frame.sf_sc.uc_stack.ss_size = p->p_sigstk.ss_size;
- frame.sf_sc.uc_stack.ss_flags = (p->p_flag & P_ALTSTACK)
+ frame.sf_sc.uc_stack.ss_sp = td->td_sigstk.ss_sp;
+ frame.sf_sc.uc_stack.ss_size = td->td_sigstk.ss_size;
+ frame.sf_sc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK)
? ((oonstack) ? LINUX_SS_ONSTACK : 0) : LINUX_SS_DISABLE;
PROC_UNLOCK(p);
@@ -431,10 +431,10 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
/*
* Allocate space for the signal handler context.
*/
- if ((p->p_flag & P_ALTSTACK) && !oonstack &&
+ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
- fp = (struct l_sigframe *)(p->p_sigstk.ss_sp +
- p->p_sigstk.ss_size - sizeof(struct l_sigframe));
+ fp = (struct l_sigframe *)(td->td_sigstk.ss_sp +
+ td->td_sigstk.ss_size - sizeof(struct l_sigframe));
} else
fp = (struct l_sigframe *)regs->tf_esp - 1;
mtx_unlock(&psp->ps_mtx);
OpenPOWER on IntegriCloud