vserver 2.0-rc4
[linux-2.6.git] / arch / sparc64 / kernel / ptrace.c
index 8e5e098..bff6ee7 100644 (file)
@@ -50,7 +50,7 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value)
 }
 
 static inline void
-pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
+pt_succ_return_linux(struct pt_regs *regs, unsigned long value, void __user *addr)
 {
        if (test_thread_flag(TIF_32BIT)) {
                if (put_user(value, (unsigned int __user *) addr)) {
@@ -70,7 +70,7 @@ pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
 }
 
 static void
-pt_os_succ_return (struct pt_regs *regs, unsigned long val, long *addr)
+pt_os_succ_return (struct pt_regs *regs, unsigned long val, void __user *addr)
 {
        if (current->personality == PER_SUNOS)
                pt_succ_return (regs, val);
@@ -230,7 +230,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
                if (res < 0)
                        pt_error_return(regs, -res);
                else
-                       pt_os_succ_return(regs, tmp64, (long *) data);
+                       pt_os_succ_return(regs, tmp64, (void __user *) data);
                goto flush_and_out;
        }
 
@@ -518,25 +518,6 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
                        pt_error_return(regs, EIO);
                        goto out_tsk;
                }
-               if (addr != 1) {
-                       unsigned long pc_mask = ~0UL;
-
-                       if ((child->thread_info->flags & _TIF_32BIT) != 0)
-                               pc_mask = 0xffffffff;
-
-                       if (addr & 3) {
-                               pt_error_return(regs, EINVAL);
-                               goto out_tsk;
-                       }
-#ifdef DEBUG_PTRACE
-                       printk ("Original: %016lx %016lx\n",
-                               child->thread_info->kregs->tpc,
-                               child->thread_info->kregs->tnpc);
-                       printk ("Continuing with %016lx %016lx\n", addr, addr+4);
-#endif
-                       child->thread_info->kregs->tpc = (addr & pc_mask);
-                       child->thread_info->kregs->tnpc = ((addr + 4) & pc_mask);
-               }
 
                if (request == PTRACE_SYSCALL) {
                        set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
@@ -563,7 +544,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
  * exit.
  */
        case PTRACE_KILL: {
-               if (child->state == TASK_ZOMBIE) {      /* already dead */
+               if (child->exit_state == EXIT_ZOMBIE) { /* already dead */
                        pt_succ_return(regs, 0);
                        goto out_tsk;
                }
@@ -631,11 +612,8 @@ asmlinkage void syscall_trace(void)
                return;
        if (!(current->ptrace & PT_PTRACED))
                return;
-       current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
-                                       ? 0x80 : 0);
-       current->state = TASK_STOPPED;
-       notify_parent(current, SIGCHLD);
-       schedule();
+       ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
+                                ? 0x80 : 0));
 
        /*
         * this isn't the same as continuing with a signal, but it will do