From 5230429ab1c20c348e17069230c24db8a6b53ca3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 26 Sep 2012 17:44:24 -0400 Subject: [PATCH] sparc64: take fprs_write() and friends to start_thread() Signed-off-by: Al Viro --- arch/sparc/include/asm/processor_64.h | 9 +++++++++ arch/sparc/kernel/process_64.c | 6 ------ arch/sparc/kernel/sys_sparc32.c | 7 ------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h index 5d81ff6b6933..0305d56d9b1a 100644 --- a/arch/sparc/include/asm/processor_64.h +++ b/arch/sparc/include/asm/processor_64.h @@ -94,6 +94,7 @@ struct thread_struct { #ifndef __ASSEMBLY__ #include +#include /* 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. */ diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index e37512319296..55aa68da213b 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c @@ -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; } diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index c3239811a1b5..2f116ff46b11 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c @@ -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; } -- 2.39.5