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)
This commit is contained in:
Alan Cox 2002-04-10 20:08:07 +00:00
parent 102b06f844
commit eac84263c4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94383
2 changed files with 18 additions and 10 deletions

View File

@ -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;

View File

@ -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;