diff options
author | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2009-04-08 11:35:47 +0000 |
---|---|---|
committer | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2009-04-08 11:35:47 +0000 |
commit | 30a8aaf0dfeabfaf486c024b4811de1b5414904e (patch) | |
tree | 676b998750f1e98e85f8e1c02f93897b04cf74dc /sys/pc98 | |
parent | 4970b8ae0a11110e7ef72f0c8dc13898ea3c0af7 (diff) | |
download | src-30a8aaf0dfeabfaf486c024b4811de1b5414904e.tar.gz src-30a8aaf0dfeabfaf486c024b4811de1b5414904e.zip |
MFi386: revision 190617
Fill the fsbase and gsbase fields of the mcontext structure on i386.
Notes
Notes:
svn path=/head/; revision=190840
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/pc98/machdep.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index a2d43e6bc37e..4fb29a4a7a71 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -525,6 +525,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) struct sigacts *psp; char *sp; struct trapframe *regs; + struct segment_descriptor *sdp; int sig; int oonstack; @@ -561,6 +562,15 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); + /* + * Unconditionally fill the fsbase and gsbase into the mcontext. + */ + sdp = &td->td_pcb->pcb_gsd; + sf.sf_uc.uc_mcontext.mc_fsbase = sdp->sd_hibase << 24 | + sdp->sd_lobase; + sdp = &td->td_pcb->pcb_fsd; + sf.sf_uc.uc_mcontext.mc_gsbase = sdp->sd_hibase << 24 | + sdp->sd_lobase; /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && @@ -2410,6 +2420,7 @@ int get_mcontext(struct thread *td, mcontext_t *mcp, int flags) { struct trapframe *tp; + struct segment_descriptor *sdp; tp = td->td_frame; @@ -2441,6 +2452,11 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int flags) mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); get_fpcontext(td, mcp); + sdp = &td->td_pcb->pcb_gsd; + mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; + sdp = &td->td_pcb->pcb_fsd; + mcp->mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; + return (0); } |