diff options
| -rw-r--r-- | arch/powerpc/include/asm/uprobes.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/kernel/uprobes.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/uprobes.h b/arch/powerpc/include/asm/uprobes.h index b532060d0916..23016020915e 100644 --- a/arch/powerpc/include/asm/uprobes.h +++ b/arch/powerpc/include/asm/uprobes.h | |||
| @@ -51,4 +51,5 @@ extern int arch_uprobe_post_xol(struct arch_uprobe *aup, struct pt_regs *regs); | |||
| 51 | extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk); | 51 | extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk); |
| 52 | extern int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data); | 52 | extern int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data); |
| 53 | extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs); | 53 | extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs); |
| 54 | extern unsigned long arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs *regs); | ||
| 54 | #endif /* _ASM_UPROBES_H */ | 55 | #endif /* _ASM_UPROBES_H */ |
diff --git a/arch/powerpc/kernel/uprobes.c b/arch/powerpc/kernel/uprobes.c index 2ecdbe304f46..59f419b935f2 100644 --- a/arch/powerpc/kernel/uprobes.c +++ b/arch/powerpc/kernel/uprobes.c | |||
| @@ -192,3 +192,16 @@ bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) | |||
| 192 | 192 | ||
| 193 | return false; | 193 | return false; |
| 194 | } | 194 | } |
| 195 | |||
| 196 | unsigned long | ||
| 197 | arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs *regs) | ||
| 198 | { | ||
| 199 | unsigned long orig_ret_vaddr; | ||
| 200 | |||
| 201 | orig_ret_vaddr = regs->link; | ||
| 202 | |||
| 203 | /* Replace the return addr with trampoline addr */ | ||
| 204 | regs->link = trampoline_vaddr; | ||
| 205 | |||
| 206 | return orig_ret_vaddr; | ||
| 207 | } | ||
