aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/ptrace32.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2007-12-20 06:58:55 -0500
committerPaul Mackerras <paulus@samba.org>2008-02-07 04:40:21 -0500
commit81e695c026eeda9a97e412fa4f458e5cab2f6c85 (patch)
treea81404f170a260a2718064938a5036972da27e93 /arch/powerpc/kernel/ptrace32.c
parent1d48d71c06172c0853e04c334456e64cc006e208 (diff)
[POWERPC] Use generic compat_sys_ptrace
This replaces powerpc's compat_sys_ptrace with a compat_arch_ptrace and enables the new generic definition of compat_sys_ptrace instead. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/ptrace32.c')
-rw-r--r--arch/powerpc/kernel/ptrace32.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 6612304e11e3..0f6eea086a23 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -85,33 +85,13 @@ static long compat_ptrace_old(struct task_struct *child, long request,
85 return ret; 85 return ret;
86} 86}
87 87
88long compat_sys_ptrace(int request, int pid, unsigned long addr, 88long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
89 unsigned long data) 89 compat_ulong_t caddr, compat_ulong_t cdata)
90{ 90{
91 struct task_struct *child; 91 unsigned long addr = caddr;
92 unsigned long data = cdata;
92 int ret; 93 int ret;
93 94
94 lock_kernel();
95 if (request == PTRACE_TRACEME) {
96 ret = ptrace_traceme();
97 goto out;
98 }
99
100 child = ptrace_get_task_struct(pid);
101 if (IS_ERR(child)) {
102 ret = PTR_ERR(child);
103 goto out;
104 }
105
106 if (request == PTRACE_ATTACH) {
107 ret = ptrace_attach(child);
108 goto out_tsk;
109 }
110
111 ret = ptrace_check_attach(child, request == PTRACE_KILL);
112 if (ret < 0)
113 goto out_tsk;
114
115 switch (request) { 95 switch (request) {
116 /* 96 /*
117 * Read 4 bytes of the other process' storage 97 * Read 4 bytes of the other process' storage
@@ -375,9 +355,6 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
375 ret = compat_ptrace_request(child, request, addr, data); 355 ret = compat_ptrace_request(child, request, addr, data);
376 break; 356 break;
377 } 357 }
378out_tsk: 358
379 put_task_struct(child);
380out:
381 unlock_kernel();
382 return ret; 359 return ret;
383} 360}