summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-04-10 20:08:07 +0000
committeralc <alc@FreeBSD.org>2002-04-10 20:08:07 +0000
commit0357dd9269c650e9287c7fde15e5b77c0faa9977 (patch)
treefc7ff2304f28ef7dd11759664f231b0524eec51b /sys/amd64
parentd6ba2b5d3e20ae7d4318a9293e916f1aae56ae4e (diff)
downloadFreeBSD-src-0357dd9269c650e9287c7fde15e5b77c0faa9977.zip
FreeBSD-src-0357dd9269c650e9287c7fde15e5b77c0faa9977.tar.gz
o In osigreturn(), restore all of the registers in one place.
o Recent changes to osigreturn() and sigreturn() have made them MPSAFE. Add a comment to this effect. Submitted by: bde (bullet #1) Reviewed by: jhb (bullet #2)
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/machdep.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index d54d3d7..a3ad87b 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -528,6 +528,8 @@ sendsig(catcher, sig, mask, code)
* context left by sendsig. Check carefully to
* make sure that the user has not modified the
* state to gain improper privileges.
+ *
+ * MPSAFE
*/
int
osigreturn(td, uap)
@@ -624,6 +626,10 @@ osigreturn(td, uap)
regs->tf_cs = scp->sc_cs;
regs->tf_ss = scp->sc_ss;
regs->tf_isp = scp->sc_isp;
+ regs->tf_ebp = scp->sc_fp;
+ regs->tf_esp = scp->sc_sp;
+ regs->tf_eip = scp->sc_pc;
+ regs->tf_eflags = eflags;
PROC_LOCK(p);
#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
@@ -632,21 +638,19 @@ osigreturn(td, uap)
else
p->p_sigstk.ss_flags &= ~SS_ONSTACK;
#endif
-
SIGSETOLD(p->p_sigmask, scp->sc_mask);
SIG_CANTMASK(p->p_sigmask);
signotify(p);
PROC_UNLOCK(p);
- regs->tf_ebp = scp->sc_fp;
- regs->tf_esp = scp->sc_sp;
- regs->tf_eip = scp->sc_pc;
- regs->tf_eflags = eflags;
return (EJUSTRETURN);
#else /* !COMPAT_43 */
return (ENOSYS);
#endif /* COMPAT_43 */
}
+/*
+ * MPSAFE
+ */
int
sigreturn(td, uap)
struct thread *td;
OpenPOWER on IntegriCloud