diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 17:44:24 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-14 19:26:53 -0400 |
commit | 5230429ab1c20c348e17069230c24db8a6b53ca3 (patch) | |
tree | 452f1f33451d0e85136cef1c65ba3da654847acd /arch/sparc | |
parent | 1918c7f548dc5abfb37ab74bb3d036d36c92ba5e (diff) |
sparc64: take fprs_write() and friends to start_thread()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/processor_64.h | 9 | ||||
-rw-r--r-- | arch/sparc/kernel/process_64.c | 6 | ||||
-rw-r--r-- | 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 { | |||
94 | #ifndef __ASSEMBLY__ | 94 | #ifndef __ASSEMBLY__ |
95 | 95 | ||
96 | #include <linux/types.h> | 96 | #include <linux/types.h> |
97 | #include <asm/fpumacro.h> | ||
97 | 98 | ||
98 | /* Return saved PC of a blocked thread. */ | 99 | /* Return saved PC of a blocked thread. */ |
99 | struct task_struct; | 100 | struct task_struct; |
@@ -143,6 +144,10 @@ do { \ | |||
143 | : \ | 144 | : \ |
144 | : "r" (regs), "r" (sp - sizeof(struct reg_window) - STACK_BIAS), \ | 145 | : "r" (regs), "r" (sp - sizeof(struct reg_window) - STACK_BIAS), \ |
145 | "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \ | 146 | "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \ |
147 | fprs_write(0); \ | ||
148 | current_thread_info()->xfsr[0] = 0; \ | ||
149 | current_thread_info()->fpsaved[0] = 0; \ | ||
150 | regs->tstate &= ~TSTATE_PEF; \ | ||
146 | } while (0) | 151 | } while (0) |
147 | 152 | ||
148 | #define start_thread32(regs, pc, sp) \ | 153 | #define start_thread32(regs, pc, sp) \ |
@@ -183,6 +188,10 @@ do { \ | |||
183 | : \ | 188 | : \ |
184 | : "r" (regs), "r" (sp - sizeof(struct reg_window32)), \ | 189 | : "r" (regs), "r" (sp - sizeof(struct reg_window32)), \ |
185 | "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \ | 190 | "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \ |
191 | fprs_write(0); \ | ||
192 | current_thread_info()->xfsr[0] = 0; \ | ||
193 | current_thread_info()->fpsaved[0] = 0; \ | ||
194 | regs->tstate &= ~TSTATE_PEF; \ | ||
186 | } while (0) | 195 | } while (0) |
187 | 196 | ||
188 | /* Free all resources held by a thread. */ | 197 | /* 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) | |||
692 | (const char __user *const __user *) | 692 | (const char __user *const __user *) |
693 | regs->u_regs[base + UREG_I2], regs); | 693 | regs->u_regs[base + UREG_I2], regs); |
694 | putname(filename); | 694 | putname(filename); |
695 | if (!error) { | ||
696 | fprs_write(0); | ||
697 | current_thread_info()->xfsr[0] = 0; | ||
698 | current_thread_info()->fpsaved[0] = 0; | ||
699 | regs->tstate &= ~TSTATE_PEF; | ||
700 | } | ||
701 | out: | 695 | out: |
702 | return error; | 696 | return error; |
703 | } | 697 | } |
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) | |||
421 | compat_ptr(regs->u_regs[base + UREG_I2]), regs); | 421 | compat_ptr(regs->u_regs[base + UREG_I2]), regs); |
422 | 422 | ||
423 | putname(filename); | 423 | putname(filename); |
424 | |||
425 | if (!error) { | ||
426 | fprs_write(0); | ||
427 | current_thread_info()->xfsr[0] = 0; | ||
428 | current_thread_info()->fpsaved[0] = 0; | ||
429 | regs->tstate &= ~TSTATE_PEF; | ||
430 | } | ||
431 | out: | 424 | out: |
432 | return error; | 425 | return error; |
433 | } | 426 | } |