aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2008-07-11 02:29:12 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-14 22:29:23 -0400
commit7c29217096d83f657e6ee70479af09b46f4275f6 (patch)
tree96fd96226d2998b1f56d7fb8110e27c489dbba89 /arch/powerpc/kernel/process.c
parent01f4b8b8b8db09b88be7df7e51192e4e678b69d3 (diff)
powerpc: fix giveup_vsx to save registers correctly
giveup_vsx didn't save the FPU and VMX regsiters. Change it to be like giveup_fpr/altivec which save these registers. Also update call sites where FPU and VMX are already saved to use the original giveup_vsx (renamed to __giveup_vsx). Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 0a4eb0811590..219f3634115e 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -159,6 +159,13 @@ void enable_kernel_vsx(void)
159EXPORT_SYMBOL(enable_kernel_vsx); 159EXPORT_SYMBOL(enable_kernel_vsx);
160#endif 160#endif
161 161
162void giveup_vsx(struct task_struct *tsk)
163{
164 giveup_fpu(tsk);
165 giveup_altivec(tsk);
166 __giveup_vsx(tsk);
167}
168
162void flush_vsx_to_thread(struct task_struct *tsk) 169void flush_vsx_to_thread(struct task_struct *tsk)
163{ 170{
164 if (tsk->thread.regs) { 171 if (tsk->thread.regs) {
@@ -290,7 +297,8 @@ struct task_struct *__switch_to(struct task_struct *prev,
290#endif /* CONFIG_ALTIVEC */ 297#endif /* CONFIG_ALTIVEC */
291#ifdef CONFIG_VSX 298#ifdef CONFIG_VSX
292 if (prev->thread.regs && (prev->thread.regs->msr & MSR_VSX)) 299 if (prev->thread.regs && (prev->thread.regs->msr & MSR_VSX))
293 giveup_vsx(prev); 300 /* VMX and FPU registers are already save here */
301 __giveup_vsx(prev);
294#endif /* CONFIG_VSX */ 302#endif /* CONFIG_VSX */
295#ifdef CONFIG_SPE 303#ifdef CONFIG_SPE
296 /* 304 /*