aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/ftrace.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 610c852b92ed..4c75a1c0a5b4 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -31,11 +31,6 @@
31#endif 31#endif
32 32
33#ifdef CONFIG_DYNAMIC_FTRACE 33#ifdef CONFIG_DYNAMIC_FTRACE
34static unsigned int ftrace_calc_offset(long ip, long addr)
35{
36 return (int)(addr - ip);
37}
38
39static unsigned int ftrace_nop_replace(void) 34static unsigned int ftrace_nop_replace(void)
40{ 35{
41 return PPC_NOP_INSTR; 36 return PPC_NOP_INSTR;
@@ -46,17 +41,10 @@ ftrace_call_replace(unsigned long ip, unsigned long addr, int link)
46{ 41{
47 unsigned int op; 42 unsigned int op;
48 43
49 /*
50 * It would be nice to just use create_function_call, but that will
51 * update the code itself. Here we need to just return the
52 * instruction that is going to be modified, without modifying the
53 * code.
54 */
55 addr = GET_ADDR(addr); 44 addr = GET_ADDR(addr);
56 45
57 /* if (link) set op to 'bl' else 'b' */ 46 /* if (link) set op to 'bl' else 'b' */
58 op = 0x48000000 | (link ? 1 : 0); 47 op = create_branch((unsigned int *)ip, addr, link ? 1 : 0);
59 op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);
60 48
61 return op; 49 return op;
62} 50}