diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-24 00:24:57 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-24 00:24:57 +0000 |
commit | 733f2050f9bc39673c915b3da76b2d14cd4932a6 (patch) | |
tree | 65baee70c2418206fcab26b2258fcbb7bdeb2388 /sys/i386 | |
parent | 370523c244e25b28e91d45ebaa7b399d6fc42dc6 (diff) | |
download | FreeBSD-src-733f2050f9bc39673c915b3da76b2d14cd4932a6.zip FreeBSD-src-733f2050f9bc39673c915b3da76b2d14cd4932a6.tar.gz |
- Proc locking.
- Use FreeBSD stackgap_init() semantics.
- Adjust some #ifdef's to hide unused variables.
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/svr4/svr4_machdep.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/sys/i386/svr4/svr4_machdep.c b/sys/i386/svr4/svr4_machdep.c index 018fb74..231a9d8 100644 --- a/sys/i386/svr4/svr4_machdep.c +++ b/sys/i386/svr4/svr4_machdep.c @@ -98,8 +98,14 @@ svr4_getcontext(p, uc, mask, oonstack) svr4_greg_t *r = uc->uc_mcontext.greg; struct svr4_sigaltstack *s = &uc->uc_stack; #if defined(DONE_MORE_SIGALTSTACK_WORK) - struct sigacts *psp = p->p_sigacts; - struct sigaltstack *sf = &p->p_sigstk; + struct sigacts *psp; + struct sigaltstack *sf; +#endif + + PROC_LOCK(p); +#if defined(DONE_MORE_SIGALTSTACK_WORK) + psp = p->p_sigacts; + sf = &p->p_sigstk; #endif memset(uc, 0, sizeof(struct svr4_ucontext)); @@ -154,6 +160,7 @@ svr4_getcontext(p, uc, mask, oonstack) s->ss_size = 16384; s->ss_flags = 0; #endif + PROC_UNLOCK(p); /* * Set the signal mask @@ -182,14 +189,20 @@ svr4_setcontext(p, uc) struct svr4_ucontext *uc; { #if defined(DONE_MORE_SIGALTSTACK_WORK) - struct sigacts *psp = p->p_sigacts; + struct sigacts *psp; #endif register struct trapframe *tf; svr4_greg_t *r = uc->uc_mcontext.greg; struct svr4_sigaltstack *s = &uc->uc_stack; - struct sigaltstack *sf = &p->p_sigstk; + struct sigaltstack *sf; sigset_t mask; + PROC_LOCK(p); +#if defined(DONE_MORE_SIGALTSTACK_WORK) + psp = p->p_sigacts; +#endif + sf = &p->p_sigstk; + /* * XXX: * Should we check the value of flags to determine what to restore? @@ -278,6 +291,7 @@ svr4_setcontext(p, uc) SIG_CANTMASK(mask); p->p_sigmask = mask; } + PROC_UNLOCK(p); return 0; /*EJUSTRETURN;*/ } @@ -396,12 +410,14 @@ svr4_sendsig(catcher, sig, mask, code) register struct proc *p = curproc; register struct trapframe *tf; struct svr4_sigframe *fp, frame; - struct sigacts *psp = p->p_sigacts; + struct sigacts *psp; int oonstack; #if defined(DEBUG_SVR4) printf("svr4_sendsig(%d)\n", sig); #endif + PROC_LOCK(p); + psp = p->p_sigacts; tf = p->p_md.md_regs; oonstack = sigonstack(tf->tf_esp); @@ -417,6 +433,7 @@ svr4_sendsig(catcher, sig, mask, code) } else { fp = (struct svr4_sigframe *)tf->tf_esp - 1; } + PROC_UNLOCK(p); /* * Build the argument list for the signal handler. @@ -487,7 +504,11 @@ svr4_sys_sysarch(p, v) { struct svr4_sys_sysarch_args *uap = v; #ifdef USER_LDT +#if defined(__NetBSD__) caddr_t sg = stackgap_init(p->p_emul); +#else + caddr_t sg = stackgap_init(); +#endif int error; #endif switch (uap->op) { |