aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2006-05-28 04:40:45 +0000
committerDavid Xu <davidxu@FreeBSD.org>2006-05-28 04:40:45 +0000
commit40310f021dcc3d82235e0dd9debb9a50d2ddf1fe (patch)
tree29ddd8a99f3511bbe777d9eee2fbc81561ed8d55 /sys/i386
parent38fd748725dcbeabf82d6f82c16d0307e849f1ea (diff)
downloadsrc-40310f021dcc3d82235e0dd9debb9a50d2ddf1fe.tar.gz
src-40310f021dcc3d82235e0dd9debb9a50d2ddf1fe.zip
If parent thread never used FPU, the only work is to clear flag
PCB_NPXINITDONE for new thread and let trap code initialize it.
Notes
Notes: svn path=/head/; revision=158996
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/isa/npx.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 7b7f3a5c670d..129a853f20ed 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;