x86: sanitize pathes arch/x86/kernel/cpu/Makefile
[deliverable/linux.git] / include / asm-i386 / i387.h
index 7b1f01191e7063df3ab056dfdb17e6de0bcd828f..cdd1e248e3b409529747c7bcd0b68ea032497e5e 100644 (file)
@@ -58,13 +58,13 @@ static inline void __save_init_fpu( struct task_struct *tsk )
        alternative_input(
                "fnsave %[fx] ;fwait;" GENERIC_NOP8 GENERIC_NOP4,
                "fxsave %[fx]\n"
-               "bt $7,%[fsw] ; jc 1f ; fnclex\n1:",
+               "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:",
                X86_FEATURE_FXSR,
                [fx] "m" (tsk->thread.i387.fxsave),
                [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory");
        /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
           is pending.  Clear the x87 state here by setting it to fixed
-          values. __per_cpu_offset[0] is a random variable that should be in L1 */
+          values. safe_address is a random variable that should be in L1 */
        alternative_input(
                GENERIC_NOP8 GENERIC_NOP2,
                "emms\n\t"              /* clear stack tags */
@@ -74,15 +74,18 @@ static inline void __save_init_fpu( struct task_struct *tsk )
        task_thread_info(tsk)->status &= ~TS_USEDFPU;
 }
 
-#define __unlazy_fpu( tsk ) do { \
-       if (task_thread_info(tsk)->status & TS_USEDFPU) \
-               save_init_fpu( tsk ); \
+#define __unlazy_fpu( tsk ) do {                               \
+       if (task_thread_info(tsk)->status & TS_USEDFPU) {       \
+               __save_init_fpu(tsk);                           \
+               stts();                                         \
+       } else                                                  \
+               tsk->fpu_counter = 0;                           \
 } while (0)
 
 #define __clear_fpu( tsk )                                     \
 do {                                                           \
-       if (task_thread_info(tsk)->status & TS_USEDFPU) {               \
-               asm volatile("fnclex ; fwait");                         \
+       if (task_thread_info(tsk)->status & TS_USEDFPU) {       \
+               asm volatile("fnclex ; fwait");                 \
                task_thread_info(tsk)->status &= ~TS_USEDFPU;   \
                stts();                                         \
        }                                                       \
@@ -111,13 +114,14 @@ static inline void save_init_fpu( struct task_struct *tsk )
        __clear_fpu( tsk );     \
        preempt_enable();       \
 } while (0)
-                                       \
+
 /*
  * FPU state interaction...
  */
 extern unsigned short get_fpu_cwd( struct task_struct *tsk );
 extern unsigned short get_fpu_swd( struct task_struct *tsk );
 extern unsigned short get_fpu_mxcsr( struct task_struct *tsk );
+extern asmlinkage void math_state_restore(void);
 
 /*
  * Signal frame handlers...
This page took 0.026579 seconds and 5 git commands to generate.