asm-generic: rename termios.h, signal.h and mman.h
[safe/jmp/linux-2.6] / arch / mips / kernel / ptrace32.c
index cac56a8..c4f9ac1 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/bootinfo.h>
 
-int ptrace_getregs(struct task_struct *child, __s64 __user *data);
-int ptrace_setregs(struct task_struct *child, __s64 __user *data);
-
-int ptrace_getfpregs(struct task_struct *child, __u32 __user *data);
-int ptrace_setfpregs(struct task_struct *child, __u32 __user *data);
-
 /*
  * Tracing a 32-bit process with a 64-bit strace and vice versa will not
  * work.  I don't know how to fix this.
@@ -55,19 +49,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
        int ret;
 
        switch (request) {
-       /* when I and D space are separate, these will need to be fixed. */
-       case PTRACE_PEEKTEXT: /* read word at location addr. */
-       case PTRACE_PEEKDATA: {
-               unsigned int tmp;
-               int copied;
-
-               copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
-               ret = -EIO;
-               if (copied != sizeof(tmp))
-                       break;
-               ret = put_user(tmp, (unsigned int __user *) (unsigned long) data);
-               break;
-       }
 
        /*
         * Read 4 bytes of the other process' storage
@@ -214,16 +195,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
                break;
        }
 
-       /* when I and D space are separate, this will have to be fixed. */
-       case PTRACE_POKETEXT: /* write the word at location addr. */
-       case PTRACE_POKEDATA:
-               ret = 0;
-               if (access_process_vm(child, addr, &data, sizeof(data), 1)
-                   == sizeof(data))
-                       break;
-               ret = -EIO;
-               break;
-
        /*
         * Write 4 bytes into the other process' storage
         *  data is the 4 bytes that the user wants written
@@ -338,57 +309,28 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
                ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data);
                break;
 
-       case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
-       case PTRACE_CONT: { /* restart after signal. */
-               ret = -EIO;
-               if (!valid_signal(data))
-                       break;
-               if (request == PTRACE_SYSCALL) {
-                       set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               }
-               else {
-                       clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               }
-               child->exit_code = data;
-               wake_up_process(child);
-               ret = 0;
-               break;
-       }
-
-       /*
-        * make the child exit.  Best I can do is send it a sigkill.
-        * perhaps it should be put in the status that it wants to
-        * exit.
-        */
-       case PTRACE_KILL:
-               ret = 0;
-               if (child->exit_state == EXIT_ZOMBIE)   /* already dead */
-                       break;
-               child->exit_code = SIGKILL;
-               wake_up_process(child);
-               break;
-
        case PTRACE_GET_THREAD_AREA:
                ret = put_user(task_thread_info(child)->tp_value,
                                (unsigned int __user *) (unsigned long) data);
                break;
 
-       case PTRACE_DETACH: /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
+       case PTRACE_GET_THREAD_AREA_3264:
+               ret = put_user(task_thread_info(child)->tp_value,
+                               (unsigned long __user *) (unsigned long) data);
                break;
 
-       case PTRACE_GETEVENTMSG:
-               ret = put_user(child->ptrace_message,
-                              (unsigned int __user *) (unsigned long) data);
+       case PTRACE_GET_WATCH_REGS:
+               ret = ptrace_get_watch_regs(child,
+                       (struct pt_watch_regs __user *) (unsigned long) addr);
                break;
 
-       case PTRACE_GET_THREAD_AREA_3264:
-               ret = put_user(task_thread_info(child)->tp_value,
-                               (unsigned long __user *) (unsigned long) data);
+       case PTRACE_SET_WATCH_REGS:
+               ret = ptrace_set_watch_regs(child,
+                       (struct pt_watch_regs __user *) (unsigned long) addr);
                break;
 
        default:
-               ret = ptrace_request(child, request, addr, data);
+               ret = compat_ptrace_request(child, request, addr, data);
                break;
        }
 out: