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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index 90fab64d911d..2f72af82513c 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -32,6 +32,7 @@
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/kdebug.h> 33#include <linux/kdebug.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <asm/code-patching.h>
35#include <asm/cacheflush.h> 36#include <asm/cacheflush.h>
36#include <asm/sstep.h> 37#include <asm/sstep.h>
37#include <asm/uaccess.h> 38#include <asm/uaccess.h>
@@ -491,12 +492,10 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
491 return ret; 492 return ret;
492} 493}
493 494
494#ifdef CONFIG_PPC64
495unsigned long arch_deref_entry_point(void *entry) 495unsigned long arch_deref_entry_point(void *entry)
496{ 496{
497 return ((func_descr_t *)entry)->entry; 497 return ppc_global_function_entry(entry);
498} 498}
499#endif
500 499
501int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 500int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
502{ 501{
@@ -508,8 +507,12 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
508 /* setup return addr to the jprobe handler routine */ 507 /* setup return addr to the jprobe handler routine */
509 regs->nip = arch_deref_entry_point(jp->entry); 508 regs->nip = arch_deref_entry_point(jp->entry);
510#ifdef CONFIG_PPC64 509#ifdef CONFIG_PPC64
510#if defined(_CALL_ELF) && _CALL_ELF == 2
511 regs->gpr[12] = (unsigned long)jp->entry;
512#else
511 regs->gpr[2] = (unsigned long)(((func_descr_t *)jp->entry)->toc); 513 regs->gpr[2] = (unsigned long)(((func_descr_t *)jp->entry)->toc);
512#endif 514#endif
515#endif
513 516
514 return 1; 517 return 1;
515} 518}