diff options
author | Yi Li <yi.li@analog.com> | 2009-09-15 05:24:31 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-09-16 22:10:52 -0400 |
commit | 5bf9cbef9972f851172391a37261b12bba63f733 (patch) | |
tree | 6ca84de9aea486b563c53a0a9f9be0950f74c990 /arch/blackfin | |
parent | 3b67d91b3e2c789952379f5157704c2162330492 (diff) |
Blackfin: update ftrace for latest toolchain
The mcount support that was finally added to the Blackfin gcc port isn't
exactly the same as what ftrace was developed against. Now that the final
gcc version is in place, update the ftrace code to match.
While updating this, fix the swapped arguments to the tracer (signature is
(ip, parent_ip) while we were passing (parent_ip, ip)).
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/include/asm/ftrace.h | 2 | ||||
-rw-r--r-- | arch/blackfin/kernel/ftrace-entry.S | 23 |
2 files changed, 13 insertions, 12 deletions
diff --git a/arch/blackfin/include/asm/ftrace.h b/arch/blackfin/include/asm/ftrace.h index 8643680f0f78..90c9b400ba6d 100644 --- a/arch/blackfin/include/asm/ftrace.h +++ b/arch/blackfin/include/asm/ftrace.h | |||
@@ -8,6 +8,6 @@ | |||
8 | #ifndef __ASM_BFIN_FTRACE_H__ | 8 | #ifndef __ASM_BFIN_FTRACE_H__ |
9 | #define __ASM_BFIN_FTRACE_H__ | 9 | #define __ASM_BFIN_FTRACE_H__ |
10 | 10 | ||
11 | #define MCOUNT_INSN_SIZE 8 /* sizeof mcount call: LINK + CALL */ | 11 | #define MCOUNT_INSN_SIZE 6 /* sizeof "[++sp] = rets; call __mcount;" */ |
12 | 12 | ||
13 | #endif | 13 | #endif |
diff --git a/arch/blackfin/kernel/ftrace-entry.S b/arch/blackfin/kernel/ftrace-entry.S index 6980b7a0615d..76dd4fbcd17a 100644 --- a/arch/blackfin/kernel/ftrace-entry.S +++ b/arch/blackfin/kernel/ftrace-entry.S | |||
@@ -17,8 +17,8 @@ | |||
17 | * only one we can blow away. With pointer registers, we have P0-P2. | 17 | * only one we can blow away. With pointer registers, we have P0-P2. |
18 | * | 18 | * |
19 | * Upon entry, the RETS will point to the top of the current profiled | 19 | * Upon entry, the RETS will point to the top of the current profiled |
20 | * function. And since GCC setup the frame for us, the previous function | 20 | * function. And since GCC pushed the previous RETS for us, the previous |
21 | * will be waiting there. mmmm pie. | 21 | * function will be waiting there. mmmm pie. |
22 | */ | 22 | */ |
23 | ENTRY(__mcount) | 23 | ENTRY(__mcount) |
24 | /* save third function arg early so we can do testing below */ | 24 | /* save third function arg early so we can do testing below */ |
@@ -70,14 +70,14 @@ ENTRY(__mcount) | |||
70 | /* setup the tracer function */ | 70 | /* setup the tracer function */ |
71 | p0 = r3; | 71 | p0 = r3; |
72 | 72 | ||
73 | /* tracer(ulong frompc, ulong selfpc): | 73 | /* function_trace_call(unsigned long ip, unsigned long parent_ip): |
74 | * frompc: the pc that did the call to ... | 74 | * ip: this point was called by ... |
75 | * selfpc: ... this location | 75 | * parent_ip: ... this function |
76 | * the selfpc itself will need adjusting for the mcount call | 76 | * the ip itself will need adjusting for the mcount call |
77 | */ | 77 | */ |
78 | r1 = rets; | 78 | r0 = rets; |
79 | r0 = [fp + 4]; | 79 | r1 = [sp + 16]; /* skip the 4 local regs on stack */ |
80 | r1 += -MCOUNT_INSN_SIZE; | 80 | r0 += -MCOUNT_INSN_SIZE; |
81 | 81 | ||
82 | /* call the tracer */ | 82 | /* call the tracer */ |
83 | call (p0); | 83 | call (p0); |
@@ -106,9 +106,10 @@ ENTRY(_ftrace_graph_caller) | |||
106 | [--sp] = r1; | 106 | [--sp] = r1; |
107 | [--sp] = rets; | 107 | [--sp] = rets; |
108 | 108 | ||
109 | r0 = fp; | 109 | /* prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) */ |
110 | r0 = sp; | ||
110 | r1 = rets; | 111 | r1 = rets; |
111 | r0 += 4; | 112 | r0 += 16; /* skip the 4 local regs on stack */ |
112 | r1 += -MCOUNT_INSN_SIZE; | 113 | r1 += -MCOUNT_INSN_SIZE; |
113 | call _prepare_ftrace_return; | 114 | call _prepare_ftrace_return; |
114 | 115 | ||