Correct a bug in the last FPU optimized bcopy commit. The user FPU state
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 30 Apr 2004 00:59:55 +0000 (00:59 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 30 Apr 2004 00:59:55 +0000 (00:59 +0000)
commit65d6ce10b46ec1abf01282efeea0a318f389ad5f
treebb0d96f5dc3f71b03c98b7e45285fa59ce0de904
parent6a6c02da58364160d366ee2240a2d7fe35f8de32
Correct a bug in the last FPU optimized bcopy commit.  The user FPU state
was being corrupted by interrupts.

Fix the bug by implementing a feature described as a missif in the original
FreeBSD comments... add a pointer to the FP saved state in the thread
structure so routines which 'borrow' the FP unit can simply revector the
pointer temporarily to avoid corruption of the original user FP state.

The MMX_*_BLOCK macros in bcopy.s have also been simplified somewhat.  We
can simplify them even more (in the future) by reserving FPU save space in
the per-cpu structure instead of on the stack.
23 files changed:
sys/i386/gnu/fpemul/fpu_system.h
sys/i386/i386/bcopy.s
sys/i386/i386/genassym.c
sys/i386/i386/math_emu.h
sys/i386/i386/pmap.c
sys/i386/i386/swtch.s
sys/i386/i386/vm86bios.s
sys/i386/i386/vm_machdep.c
sys/i386/include/pcb.h
sys/i386/include/thread.h
sys/i386/isa/npx.c
sys/platform/pc32/gnu/fpemul/fpu_system.h
sys/platform/pc32/i386/bcopy.s
sys/platform/pc32/i386/genassym.c
sys/platform/pc32/i386/math_emu.h
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/i386/swtch.s
sys/platform/pc32/i386/vm86bios.s
sys/platform/pc32/i386/vm_machdep.c
sys/platform/pc32/include/pcb.h
sys/platform/pc32/include/thread.h
sys/platform/pc32/isa/npx.c
sys/platform/vkernel/i386/genassym.c