diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-05-28 04:40:45 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-05-28 04:40:45 +0000 |
commit | 03c7322baeaa4d044e67f0667f74d00deaffca25 (patch) | |
tree | 29ddd8a99f3511bbe777d9eee2fbc81561ed8d55 /sys/i386/isa/npx.c | |
parent | bf6b4844d33a45b13bd4ffe69857c1b47fba93b4 (diff) | |
download | FreeBSD-src-03c7322baeaa4d044e67f0667f74d00deaffca25.zip FreeBSD-src-03c7322baeaa4d044e67f0667f74d00deaffca25.tar.gz |
If parent thread never used FPU, the only work is to clear flag
PCB_NPXINITDONE for new thread and let trap code initialize it.
Diffstat (limited to 'sys/i386/isa/npx.c')
-rw-r--r-- | sys/i386/isa/npx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 7b7f3a5..129a853 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -952,9 +952,14 @@ npx_fork_thread(struct thread *td, struct thread *newtd) u_int32_t mxcsr; u_int32_t cw; + if (!(td->td_pcb->pcb_flags & PCB_NPXINITDONE)) { + newtd->td_pcb->pcb_flags &= ~PCB_NPXINITDONE; + return; + } + state = &newtd->td_pcb->pcb_save; /* get control word */ - if (npxgetregs(td, &newtd->td_pcb->pcb_save)) + if (npxgetregs(td, state)) return; if (cpu_fxsr) { mxcsr = state->sv_xmm.sv_env.en_mxcsr; |