[ARM] 4870/1: fix signal return code when enable CONFIG_OABI_COMPAT
[sfrench/cifs-2.6.git] / arch / arm / kernel / signal.c
index 83a8d3c95eb3ff458631412a96bf5ed6e4f1c742..ef2f86a5e78a2965e0de4c9b9815c23a8e0baf63 100644 (file)
@@ -7,12 +7,12 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
-#include <linux/ptrace.h>
 #include <linux/personality.h>
+#include <linux/freezer.h>
 
+#include <asm/elf.h>
 #include <asm/cacheflush.h>
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
@@ -26,8 +26,8 @@
 /*
  * For ARM syscalls, we encode the syscall number into the instruction.
  */
-#define SWI_SYS_SIGRETURN      (0xef000000|(__NR_sigreturn))
-#define SWI_SYS_RT_SIGRETURN   (0xef000000|(__NR_rt_sigreturn))
+#define SWI_SYS_SIGRETURN      (0xef000000|(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE))
+#define SWI_SYS_RT_SIGRETURN   (0xef000000|(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE))
 
 /*
  * With EABI, the syscall number has to be loaded into r7.
@@ -284,11 +284,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
        if (restore_sigframe(regs, frame))
                goto badframe;
 
-       /* Send SIGTRAP if we're single-stepping */
-       if (current->ptrace & PT_SINGLESTEP) {
-               ptrace_cancel_bpt(current);
-               send_sig(SIGTRAP, current, 1);
-       }
+       single_step_trap(current);
 
        return regs->ARM_r0;
 
@@ -323,11 +319,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
        if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT)
                goto badframe;
 
-       /* Send SIGTRAP if we're single-stepping */
-       if (current->ptrace & PT_SINGLESTEP) {
-               ptrace_cancel_bpt(current);
-               send_sig(SIGTRAP, current, 1);
-       }
+       single_step_trap(current);
 
        return regs->ARM_r0;
 
@@ -643,14 +635,12 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
        if (try_to_freeze())
                goto no_signal;
 
-       if (current->ptrace & PT_SINGLESTEP)
-               ptrace_cancel_bpt(current);
+       single_step_clear(current);
 
        signr = get_signal_to_deliver(&info, &ka, regs, NULL);
        if (signr > 0) {
                handle_signal(signr, &ka, &info, oldset, regs, syscall);
-               if (current->ptrace & PT_SINGLESTEP)
-                       ptrace_set_bpt(current);
+               single_step_set(current);
                return 1;
        }
 
@@ -704,8 +694,7 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
                        restart_syscall(regs);
                }
        }
-       if (current->ptrace & PT_SINGLESTEP)
-               ptrace_set_bpt(current);
+       single_step_set(current);
        return 0;
 }