diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-05-26 17:42:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:44 -0400 |
commit | 9c1a125921d146f22cf28ff366ff69fd602a0e9b (patch) | |
tree | 37df1b2ae74c23371de7e8b46427fc0a16727cdb /arch/blackfin/kernel | |
parent | 0ac0c0d0f837c499afd02a802f9cf52d3027fa3b (diff) |
ptrace: unify FDPIC implementations
The Blackfin/FRV/SuperH guys all have the same exact FDPIC ptrace code in
their arch handlers (since they were probably copied & pasted). Since
these ptrace interfaces are an arch independent aspect of the FDPIC code,
unify them in the common ptrace code so new FDPIC ports don't need to copy
and paste this fundamental stuff yet again.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/ptrace.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c index 43eb969405d1..6ec77685df52 100644 --- a/arch/blackfin/kernel/ptrace.c +++ b/arch/blackfin/kernel/ptrace.c | |||
@@ -292,28 +292,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
292 | break; | 292 | break; |
293 | } | 293 | } |
294 | 294 | ||
295 | #ifdef CONFIG_BINFMT_ELF_FDPIC | ||
296 | case PTRACE_GETFDPIC: { | ||
297 | unsigned long tmp = 0; | ||
298 | |||
299 | switch (addr) { | ||
300 | case_PTRACE_GETFDPIC_EXEC: | ||
301 | case PTRACE_GETFDPIC_EXEC: | ||
302 | tmp = child->mm->context.exec_fdpic_loadmap; | ||
303 | break; | ||
304 | case_PTRACE_GETFDPIC_INTERP: | ||
305 | case PTRACE_GETFDPIC_INTERP: | ||
306 | tmp = child->mm->context.interp_fdpic_loadmap; | ||
307 | break; | ||
308 | default: | ||
309 | break; | ||
310 | } | ||
311 | |||
312 | ret = put_user(tmp, datap); | ||
313 | break; | ||
314 | } | ||
315 | #endif | ||
316 | |||
317 | /* when I and D space are separate, this will have to be fixed. */ | 295 | /* when I and D space are separate, this will have to be fixed. */ |
318 | case PTRACE_POKEDATA: | 296 | case PTRACE_POKEDATA: |
319 | pr_debug("ptrace: PTRACE_PEEKDATA\n"); | 297 | pr_debug("ptrace: PTRACE_PEEKDATA\n"); |
@@ -357,8 +335,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
357 | case PTRACE_PEEKUSR: | 335 | case PTRACE_PEEKUSR: |
358 | switch (addr) { | 336 | switch (addr) { |
359 | #ifdef CONFIG_BINFMT_ELF_FDPIC /* backwards compat */ | 337 | #ifdef CONFIG_BINFMT_ELF_FDPIC /* backwards compat */ |
360 | case PT_FDPIC_EXEC: goto case_PTRACE_GETFDPIC_EXEC; | 338 | case PT_FDPIC_EXEC: |
361 | case PT_FDPIC_INTERP: goto case_PTRACE_GETFDPIC_INTERP; | 339 | request = PTRACE_GETFDPIC; |
340 | addr = PTRACE_GETFDPIC_EXEC; | ||
341 | goto case_default; | ||
342 | case PT_FDPIC_INTERP: | ||
343 | request = PTRACE_GETFDPIC; | ||
344 | addr = PTRACE_GETFDPIC_INTERP; | ||
345 | goto case_default; | ||
362 | #endif | 346 | #endif |
363 | default: | 347 | default: |
364 | ret = get_reg(child, addr, datap); | 348 | ret = get_reg(child, addr, datap); |
@@ -385,6 +369,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
385 | 0, sizeof(struct pt_regs), | 369 | 0, sizeof(struct pt_regs), |
386 | (const void __user *)data); | 370 | (const void __user *)data); |
387 | 371 | ||
372 | case_default: | ||
388 | default: | 373 | default: |
389 | ret = ptrace_request(child, request, addr, data); | 374 | ret = ptrace_request(child, request, addr, data); |
390 | break; | 375 | break; |