summaryrefslogtreecommitdiffstats
path: root/sys/i386/svr4
diff options
context:
space:
mode:
authorluoqi <luoqi@FreeBSD.org>1999-10-11 20:33:17 +0000
committerluoqi <luoqi@FreeBSD.org>1999-10-11 20:33:17 +0000
commitfd8b4427a5a052988cfb0778b779cff1a3e09628 (patch)
tree7cad9d7dad8a4c0a9a157153dada2dbbd270e491 /sys/i386/svr4
parent031a7ae6a88dcce6c4d95badfd6b19cbe5520d38 (diff)
downloadFreeBSD-src-fd8b4427a5a052988cfb0778b779cff1a3e09628.zip
FreeBSD-src-fd8b4427a5a052988cfb0778b779cff1a3e09628.tar.gz
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
Diffstat (limited to 'sys/i386/svr4')
-rw-r--r--sys/i386/svr4/svr4_locore.s12
-rw-r--r--sys/i386/svr4/svr4_machdep.c17
2 files changed, 13 insertions, 16 deletions
diff --git a/sys/i386/svr4/svr4_locore.s b/sys/i386/svr4/svr4_locore.s
index 6c3b0ae..f6fb4ee 100644
--- a/sys/i386/svr4/svr4_locore.s
+++ b/sys/i386/svr4/svr4_locore.s
@@ -9,20 +9,16 @@ NON_GPROF_ENTRY(svr4_sigcode)
call SVR4_SIGF_HANDLER(%esp)
leal SVR4_SIGF_UC(%esp),%eax # ucp (the call may have clobbered the
# copy at SIGF_UCP(%esp))
-#if defined(NOTYET)
#ifdef VM86
testl $PSL_VM,SVR4_UC_EFLAGS(%eax)
jnz 1f
#endif
-#endif
- movl SVR4_UC_GS(%eax),%edx
- movl %dx,%gs
-1: pushl %eax # fake return address
- pushl $1 # pointer to ucontext
+ movl SVR4_UC_GS(%eax),%gs
+1: pushl %eax # pointer to ucontext
+ pushl $1 # set context
movl $_svr4_sys_context,%eax
int $0x80 # enter kernel with args on stack
- movl $exit,%eax
- int $0x80 # exit if sigreturn fails
+0: jmp 0b
ALIGN_TEXT
svr4_esigcode:
diff --git a/sys/i386/svr4/svr4_machdep.c b/sys/i386/svr4/svr4_machdep.c
index bc2e469..dc8e681 100644
--- a/sys/i386/svr4/svr4_machdep.c
+++ b/sys/i386/svr4/svr4_machdep.c
@@ -112,7 +112,7 @@ svr4_getcontext(p, uc, mask, oonstack)
struct svr4_sigaltstack *s = &uc->uc_stack;
#ifdef DONE_MORE_SIGALTSTACK_WORK
struct sigacts *psp = p->p_sigacts;
- struct sigaltstack *sf = &psp->ps_sigstk;
+ struct sigaltstack *sf = &p->p_sigstk;
#endif
memset(uc, 0, sizeof(struct svr4_ucontext));
@@ -199,7 +199,7 @@ svr4_setcontext(p, uc)
register struct trapframe *tf;
svr4_greg_t *r = uc->uc_mcontext.greg;
struct svr4_sigaltstack *s = &uc->uc_stack;
- struct sigaltstack *sf = &psp->ps_sigstk;
+ struct sigaltstack *sf = &p->p_sigstk;
sigset_t mask;
/*
@@ -276,8 +276,8 @@ svr4_setcontext(p, uc)
*/
if (uc->uc_flags & SVR4_UC_SIGMASK) {
svr4_to_bsd_sigset(&uc->uc_sigmask, &mask);
+ SIG_CANTMASK(mask);
p->p_sigmask = mask;
- SIG_CANTMASK(p->p_sigmask);
}
return 0; /*EJUSTRETURN;*/
@@ -401,16 +401,16 @@ svr4_sendsig(catcher, sig, mask, code)
int oonstack;
tf = p->p_md.md_regs;
- oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
+ oonstack = p->p_sigstk.ss_flags & SS_ONSTACK;
/*
* 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 svr4_sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
- psp->ps_sigstk.ss_size - sizeof(struct svr4_sigframe));
- psp->ps_sigstk.ss_flags |= SS_ONSTACK;
+ fp = (struct svr4_sigframe *)((caddr_t)p->p_sigstk.ss_sp +
+ p->p_sigstk.ss_size - sizeof(struct svr4_sigframe));
+ p->p_sigstk.ss_flags |= SS_ONSTACK;
} else {
fp = (struct svr4_sigframe *)tf->tf_esp - 1;
}
@@ -466,6 +466,7 @@ svr4_sendsig(catcher, sig, mask, code)
tf->tf_ds = _udatasel;
tf->tf_es = _udatasel;
tf->tf_fs = _udatasel;
+ load_gs(_udatasel);
tf->tf_ss = _udatasel;
#endif
}
OpenPOWER on IntegriCloud