diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2009-05-28 15:33:34 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-01 20:36:32 -0400 |
commit | 4a9e3f8e94d6740fbd3f149f2aa4caa82a6427ed (patch) | |
tree | 6c1e3f51142a30b4efc52ca9db3447458b6ed190 /arch/powerpc/kernel/ftrace.c | |
parent | f03cdb3a66901bb301b9d06ac0690de00d99ad39 (diff) |
powerpc/ftrace: Use ppc_function_entry() instead of GET_ADDR
Use ppc_function_entry() from code-patching.h.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/ftrace.c')
-rw-r--r-- | arch/powerpc/kernel/ftrace.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 2d182f119d1d..f7eadf5ddec3 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
@@ -23,12 +23,6 @@ | |||
23 | #include <asm/code-patching.h> | 23 | #include <asm/code-patching.h> |
24 | #include <asm/ftrace.h> | 24 | #include <asm/ftrace.h> |
25 | 25 | ||
26 | #ifdef CONFIG_PPC32 | ||
27 | # define GET_ADDR(addr) addr | ||
28 | #else | ||
29 | /* PowerPC64's functions are data that points to the functions */ | ||
30 | # define GET_ADDR(addr) (*(unsigned long *)addr) | ||
31 | #endif | ||
32 | 26 | ||
33 | #ifdef CONFIG_DYNAMIC_FTRACE | 27 | #ifdef CONFIG_DYNAMIC_FTRACE |
34 | static unsigned int ftrace_nop_replace(void) | 28 | static unsigned int ftrace_nop_replace(void) |
@@ -41,7 +35,7 @@ ftrace_call_replace(unsigned long ip, unsigned long addr, int link) | |||
41 | { | 35 | { |
42 | unsigned int op; | 36 | unsigned int op; |
43 | 37 | ||
44 | addr = GET_ADDR(addr); | 38 | addr = ppc_function_entry((void *)addr); |
45 | 39 | ||
46 | /* if (link) set op to 'bl' else 'b' */ | 40 | /* if (link) set op to 'bl' else 'b' */ |
47 | op = create_branch((unsigned int *)ip, addr, link ? 1 : 0); | 41 | op = create_branch((unsigned int *)ip, addr, link ? 1 : 0); |
@@ -197,7 +191,7 @@ __ftrace_make_nop(struct module *mod, | |||
197 | ptr = ((unsigned long)jmp[0] << 32) + jmp[1]; | 191 | ptr = ((unsigned long)jmp[0] << 32) + jmp[1]; |
198 | 192 | ||
199 | /* This should match what was called */ | 193 | /* This should match what was called */ |
200 | if (ptr != GET_ADDR(addr)) { | 194 | if (ptr != ppc_function_entry((void *)addr)) { |
201 | printk(KERN_ERR "addr does not match %lx\n", ptr); | 195 | printk(KERN_ERR "addr does not match %lx\n", ptr); |
202 | return -EINVAL; | 196 | return -EINVAL; |
203 | } | 197 | } |
@@ -570,7 +564,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
570 | return_hooker = (unsigned long)&mod_return_to_handler; | 564 | return_hooker = (unsigned long)&mod_return_to_handler; |
571 | #endif | 565 | #endif |
572 | 566 | ||
573 | return_hooker = GET_ADDR(return_hooker); | 567 | return_hooker = ppc_function_entry((void *)return_hooker); |
574 | 568 | ||
575 | /* | 569 | /* |
576 | * Protect against fault, even if it shouldn't | 570 | * Protect against fault, even if it shouldn't |