mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
MFi386: revision 208604
Clarify a potential issue in get_fpcontext() use.
This commit is contained in:
parent
c1564db05d
commit
c80244db64
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208632
@ -563,6 +563,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
||||
sf.sf_uc.uc_mcontext.mc_gs = rgs();
|
||||
bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs));
|
||||
sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */
|
||||
|
||||
/*
|
||||
* The get_fpcontext() call must be placed before assignments
|
||||
* to mc_fsbase and mc_gsbase due to the alignment-override
|
||||
* code in get_fpcontext() that possibly clobbers 12 bytes of
|
||||
* mcontext after mc_fpstate.
|
||||
*/
|
||||
get_fpcontext(td, &sf.sf_uc.uc_mcontext);
|
||||
fpstate_drop(td);
|
||||
/*
|
||||
@ -2455,6 +2462,13 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int flags)
|
||||
mcp->mc_esp = tp->tf_esp;
|
||||
mcp->mc_ss = tp->tf_ss;
|
||||
mcp->mc_len = sizeof(*mcp);
|
||||
|
||||
/*
|
||||
* The get_fpcontext() call must be placed before assignments
|
||||
* to mc_fsbase and mc_gsbase due to the alignment-override
|
||||
* code in get_fpcontext() that possibly clobbers 12 bytes of
|
||||
* mcontext after mc_fpstate.
|
||||
*/
|
||||
get_fpcontext(td, mcp);
|
||||
sdp = &td->td_pcb->pcb_gsd;
|
||||
mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase;
|
||||
|
Loading…
Reference in New Issue
Block a user