summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/signal_64.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-14 21:55:15 +1100
committerPaul Mackerras <paulus@samba.org>2005-11-15 11:11:32 +1100
commitcc657f53928997c65bf2409c45166c6ceee8d306 (patch)
tree247e16076381a947b4305bb6467acde1189f3918 /arch/powerpc/kernel/signal_64.c
parent493f25ef4087395891c99fcfe2c72e62e293e89f (diff)
downloadlwn-cc657f53928997c65bf2409c45166c6ceee8d306.tar.gz
lwn-cc657f53928997c65bf2409c45166c6ceee8d306.zip
powerpc: Fix clearing of the FPSCR when invoking a signal handler
As pointed out by Gary Byers, we were clearing the image of the FPSCR (floating point status and control register) in the thread_struct before copying it to the user stack when invoking a signal. Thus the task would see its FPSCR getting cleared when it took a signal. While fixing it I noticed that our swapcontext system call was also clearing FPSCR. It shouldn't, so I fixed that too. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/signal_64.c')
-rw-r--r--arch/powerpc/kernel/signal_64.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 58194e150711..1decf2785530 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -131,9 +131,6 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
flush_fp_to_thread(current);
- /* Make sure signal doesn't get spurrious FP exceptions */
- current->thread.fpscr.val = 0;
-
#ifdef CONFIG_ALTIVEC
err |= __put_user(v_regs, &sc->v_regs);
@@ -423,6 +420,9 @@ static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
if (err)
goto badframe;
+ /* Make sure signal handler doesn't get spurious FP exceptions */
+ current->thread.fpscr.val = 0;
+
/* Set up to return from userspace. */
if (vdso64_rt_sigtramp && current->thread.vdso_base) {
regs->link = current->thread.vdso_base + vdso64_rt_sigtramp;