]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/ptrace.c
r8169: MSI support
[linux-2.6-omap-h63xx.git] / kernel / ptrace.c
index 82a558b655dabb9dc7990aedc804b9b04d8f1525..a73ebd3b9d4ca5019522fcf80c47eac8d5d7fa0c 100644 (file)
@@ -233,6 +233,7 @@ int ptrace_detach(struct task_struct *child, unsigned int data)
 
        /* Architecture-specific hardware disable .. */
        ptrace_disable(child);
+       clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 
        write_lock_irq(&tasklist_lock);
        /* protect against de_thread()->release_task() */
@@ -385,6 +386,9 @@ int ptrace_request(struct task_struct *child, long request,
        case PTRACE_SETSIGINFO:
                ret = ptrace_setsiginfo(child, (siginfo_t __user *) data);
                break;
+       case PTRACE_DETACH:      /* detach a process that was attached. */
+               ret = ptrace_detach(child, data);
+               break;
        default:
                break;
        }
@@ -449,6 +453,10 @@ struct task_struct *ptrace_get_task_struct(pid_t pid)
        return child;
 }
 
+#ifndef arch_ptrace_attach
+#define arch_ptrace_attach(child)      do { } while (0)
+#endif
+
 #ifndef __ARCH_SYS_PTRACE
 asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
 {
@@ -472,6 +480,12 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
 
        if (request == PTRACE_ATTACH) {
                ret = ptrace_attach(child);
+               /*
+                * Some architectures need to do book-keeping after
+                * a ptrace attach.
+                */
+               if (!ret)
+                       arch_ptrace_attach(child);
                goto out_put_task_struct;
        }