]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/s390/kernel/signal.c
Merge branches 'release', 'misc' and 'misc-2.6.25' into release
[linux-2.6-omap-h63xx.git] / arch / s390 / kernel / signal.c
index 554f9cf7499c9236209e9ebbac7bb866d5b7100a..4449bf32cbf1e976e414518cee77998587ba18a3 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
 #include <linux/errno.h>
@@ -102,9 +101,9 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
 }
 
 asmlinkage long
-sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
-                                       struct pt_regs *regs)
+sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
 {
+       struct pt_regs *regs = task_pt_regs(current);
        return do_sigaltstack(uss, uoss, regs->gprs[15]);
 }
 
@@ -163,8 +162,9 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
        return 0;
 }
 
-asmlinkage long sys_sigreturn(struct pt_regs *regs)
+asmlinkage long sys_sigreturn(void)
 {
+       struct pt_regs *regs = task_pt_regs(current);
        sigframe __user *frame = (sigframe __user *)regs->gprs[15];
        sigset_t set;
 
@@ -189,8 +189,9 @@ badframe:
        return 0;
 }
 
-asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
+asmlinkage long sys_rt_sigreturn(void)
 {
+       struct pt_regs *regs = task_pt_regs(current);
        rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15];
        sigset_t set;
 
@@ -470,6 +471,7 @@ void do_signal(struct pt_regs *regs)
 
        if (signr > 0) {
                /* Whee!  Actually deliver the signal.  */
+               int ret;
 #ifdef CONFIG_COMPAT
                if (test_thread_flag(TIF_31BIT)) {
                        extern int handle_signal32(unsigned long sig,
@@ -477,15 +479,12 @@ void do_signal(struct pt_regs *regs)
                                                   siginfo_t *info,
                                                   sigset_t *oldset,
                                                   struct pt_regs *regs);
-                       if (handle_signal32(
-                                   signr, &ka, &info, oldset, regs) == 0) {
-                               if (test_thread_flag(TIF_RESTORE_SIGMASK))
-                                       clear_thread_flag(TIF_RESTORE_SIGMASK);
-                       }
-                       return;
+                       ret = handle_signal32(signr, &ka, &info, oldset, regs);
                }
+               else
 #endif
-               if (handle_signal(signr, &ka, &info, oldset, regs) == 0) {
+                       ret = handle_signal(signr, &ka, &info, oldset, regs);
+               if (!ret) {
                        /*
                         * A signal was successfully delivered; the saved
                         * sigmask will have been stored in the signal frame,
@@ -494,6 +493,14 @@ void do_signal(struct pt_regs *regs)
                         */
                        if (test_thread_flag(TIF_RESTORE_SIGMASK))
                                clear_thread_flag(TIF_RESTORE_SIGMASK);
+
+                       /*
+                        * If we would have taken a single-step trap
+                        * for a normal instruction, act like we took
+                        * one for the handler setup.
+                        */
+                       if (current->thread.per_info.single_step)
+                               set_thread_flag(TIF_SINGLE_STEP);
                }
                return;
        }