Blackfin: add support for common FDPIC ptrace requests
The FDPIC arches support a standard set of ptrace requests so rather than define our own custom API, hook up those requests for common code to leverage. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
81c969a8bc
commit
53e18df745
1 changed files with 24 additions and 2 deletions
|
@ -285,9 +285,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
|
||||||
tmp = child->mm->start_data;
|
tmp = child->mm->start_data;
|
||||||
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
||||||
} else if (addr == (sizeof(struct pt_regs) + 12)) {
|
} else if (addr == (sizeof(struct pt_regs) + 12)) {
|
||||||
tmp = child->mm->context.exec_fdpic_loadmap;
|
goto case_PTRACE_GETFDPIC_EXEC;
|
||||||
} else if (addr == (sizeof(struct pt_regs) + 16)) {
|
} else if (addr == (sizeof(struct pt_regs) + 16)) {
|
||||||
tmp = child->mm->context.interp_fdpic_loadmap;
|
goto case_PTRACE_GETFDPIC_INTERP;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
tmp = get_reg(child, addr);
|
tmp = get_reg(child, addr);
|
||||||
|
@ -296,6 +296,28 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
||||||
|
case PTRACE_GETFDPIC: {
|
||||||
|
unsigned long tmp = 0;
|
||||||
|
|
||||||
|
switch (addr) {
|
||||||
|
case_PTRACE_GETFDPIC_EXEC:
|
||||||
|
case PTRACE_GETFDPIC_EXEC:
|
||||||
|
tmp = child->mm->context.exec_fdpic_loadmap;
|
||||||
|
break;
|
||||||
|
case_PTRACE_GETFDPIC_INTERP:
|
||||||
|
case PTRACE_GETFDPIC_INTERP:
|
||||||
|
tmp = child->mm->context.interp_fdpic_loadmap;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = put_user(tmp, datap);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* when I and D space are separate, this will have to be fixed. */
|
/* when I and D space are separate, this will have to be fixed. */
|
||||||
case PTRACE_POKEDATA:
|
case PTRACE_POKEDATA:
|
||||||
pr_debug("ptrace: PTRACE_PEEKDATA\n");
|
pr_debug("ptrace: PTRACE_PEEKDATA\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue