Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-drm-fsl-dcu.git] / arch / arm / kernel / ptrace.c
index e591f72bcdeb0abf8d6714e94219de4cdc2d7720..bc9e2f8ae3265de120f28a7939e5c24ca8d2d1d1 100644 (file)
@@ -610,15 +610,12 @@ static int ptrace_setfpregs(struct task_struct *tsk, void __user *ufp)
 static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp)
 {
        struct thread_info *thread = task_thread_info(tsk);
-       void *ptr = &thread->fpstate;
 
        if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
                return -ENODATA;
        iwmmxt_task_disable(thread);  /* force it to ram */
-       /* The iWMMXt state is stored doubleword-aligned.  */
-       if (((long) ptr) & 4)
-               ptr += 4;
-       return copy_to_user(ufp, ptr, 0x98) ? -EFAULT : 0;
+       return copy_to_user(ufp, &thread->fpstate.iwmmxt, IWMMXT_SIZE)
+               ? -EFAULT : 0;
 }
 
 /*
@@ -627,15 +624,12 @@ static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp)
 static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp)
 {
        struct thread_info *thread = task_thread_info(tsk);
-       void *ptr = &thread->fpstate;
 
        if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
                return -EACCES;
        iwmmxt_task_release(thread);  /* force a reload */
-       /* The iWMMXt state is stored doubleword-aligned.  */
-       if (((long) ptr) & 4)
-               ptr += 4;
-       return copy_from_user(ptr, ufp, 0x98) ? -EFAULT : 0;
+       return copy_from_user(&thead->fpstate.iwmmxt, ufp, IWMMXT_SIZE)
+               ? -EFAULT : 0;
 }
 
 #endif
@@ -766,6 +760,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                                       (unsigned long __user *) data);
                        break;
 
+               case PTRACE_SET_SYSCALL:
+                       ret = 0;
+                       child->ptrace_message = data;
+                       break;
+
                default:
                        ret = ptrace_request(child, request, addr, data);
                        break;
@@ -774,14 +773,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
        return ret;
 }
 
-asmlinkage void syscall_trace(int why, struct pt_regs *regs)
+asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
 {
        unsigned long ip;
 
        if (!test_thread_flag(TIF_SYSCALL_TRACE))
-               return;
+               return scno;
        if (!(current->ptrace & PT_PTRACED))
-               return;
+               return scno;
 
        /*
         * Save IP.  IP is used to denote syscall entry/exit:
@@ -790,6 +789,8 @@ asmlinkage void syscall_trace(int why, struct pt_regs *regs)
        ip = regs->ARM_ip;
        regs->ARM_ip = why;
 
+       current->ptrace_message = scno;
+
        /* the 0x80 provides a way for the tracing parent to distinguish
           between a syscall stop and SIGTRAP delivery */
        ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
@@ -804,4 +805,6 @@ asmlinkage void syscall_trace(int why, struct pt_regs *regs)
                current->exit_code = 0;
        }
        regs->ARM_ip = ip;
+
+       return current->ptrace_message;
 }