]> err.no Git - linux-2.6/blobdiff - arch/ppc64/kernel/signal.c
[PATCH] powerpc: Fix handling of fpscr on 64-bit
[linux-2.6] / arch / ppc64 / kernel / signal.c
index bf782276984c69147411c7aa5f513ab4cc545cda..ec9d0984b6a09118f89abeb7f95675247c293f9f 100644 (file)
@@ -133,7 +133,7 @@ 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 = 0;
+       current->thread.fpscr.val = 0;
 
 #ifdef CONFIG_ALTIVEC
        err |= __put_user(v_regs, &sc->v_regs);
@@ -481,10 +481,11 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka,
        /* Set up Signal Frame */
        ret = setup_rt_frame(sig, ka, info, oldset, regs);
 
-       if (ret && !(ka->sa.sa_flags & SA_NODEFER)) {
+       if (ret) {
                spin_lock_irq(&current->sighand->siglock);
                sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
-               sigaddset(&current->blocked,sig);
+               if (!(ka->sa.sa_flags & SA_NODEFER))
+                       sigaddset(&current->blocked,sig);
                recalc_sigpending();
                spin_unlock_irq(&current->sighand->siglock);
        }
@@ -549,6 +550,15 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
                /* Whee!  Actually deliver the signal.  */
                if (TRAP(regs) == 0x0C00)
                        syscall_restart(regs, &ka);
+
+               /*
+                * Reenable the DABR before delivering the signal to
+                * user space. The DABR will have been cleared if it
+                * triggered inside the kernel.
+                */
+               if (current->thread.dabr)
+                       set_dabr(current->thread.dabr);
+
                return handle_signal(signr, &ka, &info, oldset, regs);
        }