aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/kprobes.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/kprobes.c')
-rw-r--r--arch/powerpc/kernel/kprobes.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index 0c96611f02f4..440f5a87271f 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -492,6 +492,13 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
492 return ret; 492 return ret;
493} 493}
494 494
495#ifdef CONFIG_PPC64
496unsigned long arch_deref_entry_point(void *entry)
497{
498 return (unsigned long)(((func_descr_t *)entry)->entry);
499}
500#endif
501
495int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 502int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
496{ 503{
497 struct jprobe *jp = container_of(p, struct jprobe, kp); 504 struct jprobe *jp = container_of(p, struct jprobe, kp);
@@ -500,11 +507,9 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
500 memcpy(&kcb->jprobe_saved_regs, regs, sizeof(struct pt_regs)); 507 memcpy(&kcb->jprobe_saved_regs, regs, sizeof(struct pt_regs));
501 508
502 /* setup return addr to the jprobe handler routine */ 509 /* setup return addr to the jprobe handler routine */
510 regs->nip = arch_deref_entry_point(jp->entry);
503#ifdef CONFIG_PPC64 511#ifdef CONFIG_PPC64
504 regs->nip = (unsigned long)(((func_descr_t *)jp->entry)->entry);
505 regs->gpr[2] = (unsigned long)(((func_descr_t *)jp->entry)->toc); 512 regs->gpr[2] = (unsigned long)(((func_descr_t *)jp->entry)->toc);
506#else
507 regs->nip = (unsigned long)jp->entry;
508#endif 513#endif
509 514
510 return 1; 515 return 1;