Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[pandora-kernel.git] / arch / xtensa / kernel / ptrace.c
index 4cc8528..8b6d3d0 100644 (file)
@@ -13,7 +13,6 @@
  * Marc Gauthier<marc@tensilica.com> <marc@alumni.uwaterloo.ca>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
@@ -97,7 +96,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                        /* Note:  PS.EXCM is not set while user task is running;
                         * its being set in regs is for exception handling
                         * convenience.  */
-                       tmp = (regs->ps & ~XCHAL_PS_EXCM_MASK);
+                       tmp = (regs->ps & ~(1 << PS_EXCM_BIT));
                        break;
                case REG_WB:
                        tmp = regs->windowbase;
@@ -213,7 +212,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
         */
        case PTRACE_KILL:
                ret = 0;
-               if (child->state == EXIT_ZOMBIE)        /* already dead */
+               if (child->exit_state == EXIT_ZOMBIE)   /* already dead */
                        break;
                child->exit_code = SIGKILL;
                child->ptrace &= ~PT_SINGLESTEP;
@@ -333,12 +332,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 
 void do_syscall_trace(void)
 {
-       if (!test_thread_flag(TIF_SYSCALL_TRACE))
-               return;
-
-       if (!(current->ptrace & PT_PTRACED))
-               return;
-
        /*
         * The 0x80 provides a way for the tracing parent to distinguish
         * between a syscall stop and SIGTRAP delivery
@@ -355,3 +348,23 @@ void do_syscall_trace(void)
                current->exit_code = 0;
        }
 }
+
+void do_syscall_trace_enter(struct pt_regs *regs)
+{
+       if (test_thread_flag(TIF_SYSCALL_TRACE)
+                       && (current->ptrace & PT_PTRACED))
+               do_syscall_trace();
+
+#if 0
+       if (unlikely(current->audit_context))
+               audit_syscall_entry(current, AUDIT_ARCH_XTENSA..);
+#endif
+}
+
+void do_syscall_trace_leave(struct pt_regs *regs)
+{
+       if ((test_thread_flag(TIF_SYSCALL_TRACE))
+                       && (current->ptrace & PT_PTRACED))
+               do_syscall_trace();
+}
+