x86: unify TASK_ALIGN definitions
[cascardo/linux.git] / include / asm-x86 / i387_64.h
index 0217b74..12edb9f 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-x86_64/i387.h
- *
  * Copyright (C) 1994 Linus Torvalds
  *
  * Pentium III FXSR, SSE support
@@ -203,6 +201,11 @@ static inline void save_init_fpu(struct task_struct *tsk)
  */
 static inline int restore_i387(struct _fpstate __user *buf)
 {
+       set_used_math();
+       if (!(task_thread_info(current)->status & TS_USEDFPU)) {
+               clts();
+               task_thread_info(current)->status |= TS_USEDFPU;
+       }
        return restore_fpu_checking((__force struct i387_fxsave_struct *)buf);
 }