--- 2.4.0-test10-pre3/arch/i386/kernel/i387.c.~1~ Sat Oct 14 19:00:15 2000 +++ 2.4.0-test10-pre3/arch/i386/kernel/i387.c Thu Oct 19 04:02:18 2000 @@ -33,6 +33,21 @@ #endif /* + * The _current_ task is using the FPU for the first time + * so initialize it and set the mxcsr to its default + * value at reset if we support FXSR and then + * remeber the current task has used the FPU. + */ +void init_fpu(void) +{ + __asm__("fninit"); + if ( HAVE_FXSR ) + load_mxcsr(0x1f80); + + current->used_math = 1; +} + +/* * FPU lazy state save handling. */ --- 2.4.0-test10-pre3/arch/i386/kernel/traps.c.~1~ Thu Oct 12 03:04:39 2000 +++ 2.4.0-test10-pre3/arch/i386/kernel/traps.c Thu Oct 19 04:02:56 2000 @@ -741,11 +741,7 @@ if (current->used_math) { restore_fpu(current); } else { - /* - * Our first FPU usage, clean the chip. - */ - __asm__("fninit"); - current->used_math = 1; + init_fpu(); } current->flags |= PF_USEDFPU; /* So we fnsave on switch_to() */ } --- 2.4.0-test10-pre3/include/asm-i386/bugs.h.~1~ Sun Oct 15 17:51:59 2000 +++ 2.4.0-test10-pre3/include/asm-i386/bugs.h Thu Oct 19 04:01:58 2000 @@ -94,7 +94,6 @@ printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... "); set_in_cr4(X86_CR4_OSXMMEXCPT); printk("done.\n"); - load_mxcsr(0x1f80); } #endif --- 2.4.0-test10-pre3/include/asm-i386/i387.h.~1~ Sun Oct 15 17:51:59 2000 +++ 2.4.0-test10-pre3/include/asm-i386/i387.h Thu Oct 19 04:03:19 2000 @@ -16,6 +16,7 @@ #include #include +extern void init_fpu(void); /* * FPU lazy state save handling... */ --- 2.4.0-test10-pre3/include/asm-i386/user.h.~1~ Thu Oct 19 04:11:32 2000 +++ 2.4.0-test10-pre3/include/asm-i386/user.h Thu Oct 19 04:37:44 2000 @@ -48,8 +48,8 @@ long twd; long fip; long fcs; - long fdp; - long fds; + long foo; + long fos; long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ };