aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/signal_32.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2008-06-25 00:07:17 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 21:28:42 -0400
commit9e7511861c4f8d35852a3721c5bcd92661cb4c9f (patch)
tree4d4a72ad915fc04e9750af0ca3ae91062644f1c9 /arch/powerpc/kernel/signal_32.c
parent9b09c6d909dfd8de96b99b9b9c808b94b0a71614 (diff)
powerpc: Fix MSR setting in 32 bit signal code
If we set the SPE MSR bit in save_user_regs we can blow away the VEC bit. This doesn't matter in reality as they are in fact the same bit but looks bad. Also, when we add VSX in a later patch, we need to be able to set two separate MSR bits here. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/signal_32.c')
-rw-r--r--arch/powerpc/kernel/signal_32.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 4ae16d179803..b057e6852a7d 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -336,6 +336,8 @@ struct rt_sigframe {
336static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, 336static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
337 int sigret) 337 int sigret)
338{ 338{
339 unsigned long msr = regs->msr;
340
339 /* Make sure floating point registers are stored in regs */ 341 /* Make sure floating point registers are stored in regs */
340 flush_fp_to_thread(current); 342 flush_fp_to_thread(current);
341 343
@@ -354,8 +356,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
354 return 1; 356 return 1;
355 /* set MSR_VEC in the saved MSR value to indicate that 357 /* set MSR_VEC in the saved MSR value to indicate that
356 frame->mc_vregs contains valid data */ 358 frame->mc_vregs contains valid data */
357 if (__put_user(regs->msr | MSR_VEC, &frame->mc_gregs[PT_MSR])) 359 msr |= MSR_VEC;
358 return 1;
359 } 360 }
360 /* else assert((regs->msr & MSR_VEC) == 0) */ 361 /* else assert((regs->msr & MSR_VEC) == 0) */
361 362
@@ -377,8 +378,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
377 return 1; 378 return 1;
378 /* set MSR_SPE in the saved MSR value to indicate that 379 /* set MSR_SPE in the saved MSR value to indicate that
379 frame->mc_vregs contains valid data */ 380 frame->mc_vregs contains valid data */
380 if (__put_user(regs->msr | MSR_SPE, &frame->mc_gregs[PT_MSR])) 381 msr |= MSR_SPE;
381 return 1;
382 } 382 }
383 /* else assert((regs->msr & MSR_SPE) == 0) */ 383 /* else assert((regs->msr & MSR_SPE) == 0) */
384 384
@@ -387,6 +387,8 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
387 return 1; 387 return 1;
388#endif /* CONFIG_SPE */ 388#endif /* CONFIG_SPE */
389 389
390 if (__put_user(msr, &frame->mc_gregs[PT_MSR]))
391 return 1;
390 if (sigret) { 392 if (sigret) {
391 /* Set up the sigreturn trampoline: li r0,sigret; sc */ 393 /* Set up the sigreturn trampoline: li r0,sigret; sc */
392 if (__put_user(0x38000000UL + sigret, &frame->tramp[0]) 394 if (__put_user(0x38000000UL + sigret, &frame->tramp[0])