diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-05-29 02:58:37 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-05-29 02:58:37 +0000 |
commit | b60160771c8feb02c2362beea72cd650c1e4782f (patch) | |
tree | 148fc7d55c6f53e985453277d59ea634b8595fde /sys/i386/isa/npx.c | |
parent | 56e4b3fcb68cec9a5592c6c3908708485c434fe8 (diff) | |
download | FreeBSD-src-b60160771c8feb02c2362beea72cd650c1e4782f.zip FreeBSD-src-b60160771c8feb02c2362beea72cd650c1e4782f.tar.gz |
Backout changes trying to inherit floating-point environment, although
POSIX (susv3) requires this, but it is unclear what should be inherited,
duplicating whole 387 stack for new thread seems to be unnecessary and
dangerous. Revert to previous code, force a new thread to be started with
clean FP state.
Diffstat (limited to 'sys/i386/isa/npx.c')
-rw-r--r-- | sys/i386/isa/npx.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 129a853..bc39629 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -942,41 +942,6 @@ npxsetregs(td, addr) curthread->td_pcb->pcb_flags |= PCB_NPXINITDONE; } -/* - * POSIX requires new thread to inherit floating-point environment. - */ -void -npx_fork_thread(struct thread *td, struct thread *newtd) -{ - union savefpu *state; - 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, state)) - return; - if (cpu_fxsr) { - mxcsr = state->sv_xmm.sv_env.en_mxcsr; - cw = state->sv_xmm.sv_env.en_cw; - } else { - cw = state->sv_87.sv_env.en_cw; - mxcsr = 0; - } - bcopy(&npx_cleanstate, state, sizeof(*state)); - if (cpu_fxsr) { - state->sv_xmm.sv_env.en_cw = cw; - state->sv_xmm.sv_env.en_mxcsr = mxcsr; - } else - state->sv_87.sv_env.en_cw = cw; - newtd->td_pcb->pcb_flags |= PCB_NPXINITDONE; -} - static void fpusave(addr) union savefpu *addr; |