X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-i386%2Fi387.h;h=6747006743f94f49abf8339cdced9f988ce2e359;hb=e922efc342d565a38eed3af377ff403f52148864;hp=e678609bb57ead5c910b50b4e57bf11724ea74d8;hpb=8ed1383fb7b6685968588141d5934e0e6715e954;p=linux-2.6 diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h index e678609bb5..6747006743 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-i386/i387.h @@ -33,7 +33,7 @@ extern void init_fpu(struct task_struct *); "nop ; frstor %1", \ "fxrstor %1", \ X86_FEATURE_FXSR, \ - "m" ((tsk)->thread.i387.fsave)) + "m" ((tsk)->thread.i387.fxsave)) extern void kernel_fpu_begin(void); #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) @@ -43,13 +43,12 @@ extern void kernel_fpu_begin(void); */ static inline void __save_init_fpu( struct task_struct *tsk ) { - if ( cpu_has_fxsr ) { - asm volatile( "fxsave %0 ; fnclex" - : "=m" (tsk->thread.i387.fxsave) ); - } else { - asm volatile( "fnsave %0 ; fwait" - : "=m" (tsk->thread.i387.fsave) ); - } + alternative_input( + "fnsave %1 ; fwait ;" GENERIC_NOP2, + "fxsave %1 ; fnclex", + X86_FEATURE_FXSR, + "m" (tsk->thread.i387.fxsave) + :"memory"); tsk->thread_info->status &= ~TS_USEDFPU; }