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 <[email protected]>
Acked-by: Roland McGrath <[email protected]>
Acked-by: David Howells <[email protected]>
Acked-by: Paul Mundt <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Mike Frysinger 2010-05-26 14:42:52 -07:00 • committed by Linus Torvalds
commit 9c1a125921
4 changed files with 29 additions and 67 deletions

View file

@ -435,29 +435,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
REGSET_DSP,
0, sizeof(struct pt_dspregs),
(const void __user *)data);
#endif
#ifdef CONFIG_BINFMT_ELF_FDPIC
case PTRACE_GETFDPIC: {
unsigned long tmp = 0;
switch (addr) {
case PTRACE_GETFDPIC_EXEC:
tmp = child->mm->context.exec_fdpic_loadmap;
break;
case PTRACE_GETFDPIC_INTERP:
tmp = child->mm->context.interp_fdpic_loadmap;
break;
default:
break;
}
ret = 0;
if (put_user(tmp, datap)) {
ret = -EFAULT;
break;
}
break;
}
#endif
default:
ret = ptrace_request(child, request, addr, data);