]> git.karo-electronics.de Git - linux-beck.git/commitdiff
sparc64: take fprs_write() and friends to start_thread()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 26 Sep 2012 21:44:24 +0000 (17:44 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 14 Oct 2012 23:26:53 +0000 (19:26 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/sparc/include/asm/processor_64.h
arch/sparc/kernel/process_64.c
arch/sparc/kernel/sys_sparc32.c

index 5d81ff6b69338638d63ed9d272296ac1429c50cc..0305d56d9b1ab7b924c237035936e313f032dfd0 100644 (file)
@@ -94,6 +94,7 @@ struct thread_struct {
 #ifndef __ASSEMBLY__
 
 #include <linux/types.h>
+#include <asm/fpumacro.h>
 
 /* Return saved PC of a blocked thread. */
 struct task_struct;
@@ -143,6 +144,10 @@ do { \
        : \
        : "r" (regs), "r" (sp - sizeof(struct reg_window) - STACK_BIAS), \
          "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \
+       fprs_write(0);  \
+       current_thread_info()->xfsr[0] = 0;     \
+       current_thread_info()->fpsaved[0] = 0;  \
+       regs->tstate &= ~TSTATE_PEF;    \
 } while (0)
 
 #define start_thread32(regs, pc, sp) \
@@ -183,6 +188,10 @@ do { \
        : \
        : "r" (regs), "r" (sp - sizeof(struct reg_window32)), \
          "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \
+       fprs_write(0);  \
+       current_thread_info()->xfsr[0] = 0;     \
+       current_thread_info()->fpsaved[0] = 0;  \
+       regs->tstate &= ~TSTATE_PEF;    \
 } while (0)
 
 /* Free all resources held by a thread. */
index e37512319296f407f27624b9007d372e541a2393..55aa68da213b9cebe89d79a8edcd59431689a1bf 100644 (file)
@@ -692,12 +692,6 @@ asmlinkage int sparc_execve(struct pt_regs *regs)
                          (const char __user *const __user *)
                          regs->u_regs[base + UREG_I2], regs);
        putname(filename);
-       if (!error) {
-               fprs_write(0);
-               current_thread_info()->xfsr[0] = 0;
-               current_thread_info()->fpsaved[0] = 0;
-               regs->tstate &= ~TSTATE_PEF;
-       }
 out:
        return error;
 }
index c3239811a1b5775903c77e64057e78d01130fdd0..2f116ff46b113527a8f157bb1535bedcd2e461cd 100644 (file)
@@ -421,13 +421,6 @@ asmlinkage long sparc32_execve(struct pt_regs *regs)
                                 compat_ptr(regs->u_regs[base + UREG_I2]), regs);
 
        putname(filename);
-
-       if (!error) {
-               fprs_write(0);
-               current_thread_info()->xfsr[0] = 0;
-               current_thread_info()->fpsaved[0] = 0;
-               regs->tstate &= ~TSTATE_PEF;
-       }
 out:
        return error;
 }