Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[powerpc.git] / arch / powerpc / kernel / ptrace.c
index dea75d7..f4f391c 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/user.h>
@@ -526,34 +525,34 @@ static void do_syscall_trace(void)
 
 void do_syscall_trace_enter(struct pt_regs *regs)
 {
-#ifdef CONFIG_PPC64
        secure_computing(regs->gpr[0]);
-#endif
 
        if (test_thread_flag(TIF_SYSCALL_TRACE)
            && (current->ptrace & PT_PTRACED))
                do_syscall_trace();
 
-       if (unlikely(current->audit_context))
-               audit_syscall_entry(
-#ifdef CONFIG_PPC32
-                                   AUDIT_ARCH_PPC,
-#else
-                                   test_thread_flag(TIF_32BIT)?AUDIT_ARCH_PPC:AUDIT_ARCH_PPC64,
+       if (unlikely(current->audit_context)) {
+#ifdef CONFIG_PPC64
+               if (!test_thread_flag(TIF_32BIT))
+                       audit_syscall_entry(AUDIT_ARCH_PPC64,
+                                           regs->gpr[0],
+                                           regs->gpr[3], regs->gpr[4],
+                                           regs->gpr[5], regs->gpr[6]);
+               else
 #endif
-                                   regs->gpr[0],
-                                   regs->gpr[3], regs->gpr[4],
-                                   regs->gpr[5], regs->gpr[6]);
+                       audit_syscall_entry(AUDIT_ARCH_PPC,
+                                           regs->gpr[0],
+                                           regs->gpr[3] & 0xffffffff,
+                                           regs->gpr[4] & 0xffffffff,
+                                           regs->gpr[5] & 0xffffffff,
+                                           regs->gpr[6] & 0xffffffff);
+       }
 }
 
 void do_syscall_trace_leave(struct pt_regs *regs)
 {
-#ifdef CONFIG_PPC32
-       secure_computing(regs->gpr[0]);
-#endif
-
        if (unlikely(current->audit_context))
-               audit_syscall_exit((regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
+               audit_syscall_exit((regs->ccr&0x10000000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
                                   regs->result);
 
        if ((test_thread_flag(TIF_SYSCALL_TRACE)
@@ -561,8 +560,3 @@ void do_syscall_trace_leave(struct pt_regs *regs)
            && (current->ptrace & PT_PTRACED))
                do_syscall_trace();
 }
-
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(do_syscall_trace_enter);
-EXPORT_SYMBOL(do_syscall_trace_leave);
-#endif