diff options
| author | Roland McGrath <roland@redhat.com> | 2007-12-20 06:58:49 -0500 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2008-02-07 04:40:20 -0500 |
| commit | 1d48d71c06172c0853e04c334456e64cc006e208 (patch) | |
| tree | 7d7c78dbf86940a6c480d7380d6fc57235ef38b9 | |
| parent | c034243504b8396c4293abdc63aa3fc336a7d870 (diff) | |
[POWERPC] Use generic compat_ptrace_request
This removes some duplicated code by calling the new generic
compat_ptrace_request from powerpc's compat_sys_ptrace.
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
| -rw-r--r-- | arch/powerpc/kernel/ptrace32.c | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c index fea6206ff90f..6612304e11e3 100644 --- a/arch/powerpc/kernel/ptrace32.c +++ b/arch/powerpc/kernel/ptrace32.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/user.h> | 27 | #include <linux/user.h> |
| 28 | #include <linux/security.h> | 28 | #include <linux/security.h> |
| 29 | #include <linux/signal.h> | 29 | #include <linux/signal.h> |
| 30 | #include <linux/compat.h> | ||
| 30 | 31 | ||
| 31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
| 32 | #include <asm/page.h> | 33 | #include <asm/page.h> |
| @@ -112,20 +113,6 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr, | |||
| 112 | goto out_tsk; | 113 | goto out_tsk; |
| 113 | 114 | ||
| 114 | switch (request) { | 115 | switch (request) { |
| 115 | /* when I and D space are separate, these will need to be fixed. */ | ||
| 116 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | ||
| 117 | case PTRACE_PEEKDATA: { | ||
| 118 | unsigned int tmp; | ||
| 119 | int copied; | ||
| 120 | |||
| 121 | copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); | ||
| 122 | ret = -EIO; | ||
| 123 | if (copied != sizeof(tmp)) | ||
| 124 | break; | ||
| 125 | ret = put_user(tmp, (u32 __user *)data); | ||
| 126 | break; | ||
| 127 | } | ||
| 128 | |||
| 129 | /* | 116 | /* |
| 130 | * Read 4 bytes of the other process' storage | 117 | * Read 4 bytes of the other process' storage |
| 131 | * data is a pointer specifying where the user wants the | 118 | * data is a pointer specifying where the user wants the |
| @@ -225,19 +212,6 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr, | |||
| 225 | break; | 212 | break; |
| 226 | } | 213 | } |
| 227 | 214 | ||
| 228 | /* If I and D space are separate, this will have to be fixed. */ | ||
| 229 | case PTRACE_POKETEXT: /* write the word at location addr. */ | ||
| 230 | case PTRACE_POKEDATA: { | ||
| 231 | unsigned int tmp; | ||
| 232 | tmp = data; | ||
| 233 | ret = 0; | ||
| 234 | if (access_process_vm(child, addr, &tmp, sizeof(tmp), 1) | ||
| 235 | == sizeof(tmp)) | ||
| 236 | break; | ||
| 237 | ret = -EIO; | ||
| 238 | break; | ||
| 239 | } | ||
| 240 | |||
| 241 | /* | 215 | /* |
| 242 | * Write 4 bytes into the other process' storage | 216 | * Write 4 bytes into the other process' storage |
| 243 | * data is the 4 bytes that the user wants written | 217 | * data is the 4 bytes that the user wants written |
| @@ -337,10 +311,6 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr, | |||
| 337 | break; | 311 | break; |
| 338 | } | 312 | } |
| 339 | 313 | ||
| 340 | case PTRACE_GETEVENTMSG: | ||
| 341 | ret = put_user(child->ptrace_message, (unsigned int __user *) data); | ||
| 342 | break; | ||
| 343 | |||
| 344 | case PTRACE_GETREGS: { /* Get all pt_regs from the child. */ | 314 | case PTRACE_GETREGS: { /* Get all pt_regs from the child. */ |
| 345 | int ui; | 315 | int ui; |
| 346 | if (!access_ok(VERIFY_WRITE, (void __user *)data, | 316 | if (!access_ok(VERIFY_WRITE, (void __user *)data, |
| @@ -402,7 +372,7 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr, | |||
| 402 | break; | 372 | break; |
| 403 | 373 | ||
| 404 | default: | 374 | default: |
| 405 | ret = ptrace_request(child, request, addr, data); | 375 | ret = compat_ptrace_request(child, request, addr, data); |
| 406 | break; | 376 | break; |
| 407 | } | 377 | } |
| 408 | out_tsk: | 378 | out_tsk: |
