diff options
author | David Miller <davem@davemloft.net> | 2008-05-14 01:06:59 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-23 16:36:13 -0400 |
commit | d05f5f9906740474eb768823004ffcd775b12ca6 (patch) | |
tree | 50eb1fb79355a076c51962ddb5e8a75b8fb76972 /arch/sparc64/lib | |
parent | aa5e5ceaf52a882a29d9b86531a20733f5116066 (diff) |
sparc64: add ftrace support.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/sparc64/lib')
-rw-r--r-- | arch/sparc64/lib/mcount.S | 58 |
1 files changed, 54 insertions, 4 deletions
diff --git a/arch/sparc64/lib/mcount.S b/arch/sparc64/lib/mcount.S index 9e4534b485c7..7735a7a60533 100644 --- a/arch/sparc64/lib/mcount.S +++ b/arch/sparc64/lib/mcount.S | |||
@@ -28,10 +28,13 @@ ovstack: | |||
28 | .skip OVSTACKSIZE | 28 | .skip OVSTACKSIZE |
29 | #endif | 29 | #endif |
30 | .text | 30 | .text |
31 | .align 32 | 31 | .align 32 |
32 | .globl mcount, _mcount | 32 | .globl _mcount |
33 | mcount: | 33 | .type _mcount,#function |
34 | .globl mcount | ||
35 | .type mcount,#function | ||
34 | _mcount: | 36 | _mcount: |
37 | mcount: | ||
35 | #ifdef CONFIG_STACK_DEBUG | 38 | #ifdef CONFIG_STACK_DEBUG |
36 | /* | 39 | /* |
37 | * Check whether %sp is dangerously low. | 40 | * Check whether %sp is dangerously low. |
@@ -55,6 +58,53 @@ _mcount: | |||
55 | or %g3, %lo(panicstring), %o0 | 58 | or %g3, %lo(panicstring), %o0 |
56 | call prom_halt | 59 | call prom_halt |
57 | nop | 60 | nop |
61 | 1: | ||
62 | #endif | ||
63 | #ifdef CONFIG_FTRACE | ||
64 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
65 | mov %o7, %o0 | ||
66 | .globl mcount_call | ||
67 | mcount_call: | ||
68 | call ftrace_stub | ||
69 | mov %o0, %o7 | ||
70 | #else | ||
71 | sethi %hi(ftrace_trace_function), %g1 | ||
72 | sethi %hi(ftrace_stub), %g2 | ||
73 | ldx [%g1 + %lo(ftrace_trace_function)], %g1 | ||
74 | or %g2, %lo(ftrace_stub), %g2 | ||
75 | cmp %g1, %g2 | ||
76 | be,pn %icc, 1f | ||
77 | mov %i7, %o1 | ||
78 | jmpl %g1, %g0 | ||
79 | mov %o7, %o0 | ||
80 | /* not reached */ | ||
81 | 1: | ||
58 | #endif | 82 | #endif |
59 | 1: retl | 83 | #endif |
84 | retl | ||
60 | nop | 85 | nop |
86 | .size _mcount,.-_mcount | ||
87 | .size mcount,.-mcount | ||
88 | |||
89 | #ifdef CONFIG_FTRACE | ||
90 | .globl ftrace_stub | ||
91 | .type ftrace_stub,#function | ||
92 | ftrace_stub: | ||
93 | retl | ||
94 | nop | ||
95 | .size ftrace_stub,.-ftrace_stub | ||
96 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
97 | .globl ftrace_caller | ||
98 | .type ftrace_caller,#function | ||
99 | ftrace_caller: | ||
100 | mov %i7, %o1 | ||
101 | mov %o7, %o0 | ||
102 | .globl ftrace_call | ||
103 | ftrace_call: | ||
104 | call ftrace_stub | ||
105 | mov %o0, %o7 | ||
106 | retl | ||
107 | nop | ||
108 | .size ftrace_caller,.-ftrace_caller | ||
109 | #endif | ||
110 | #endif | ||