aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/Kconfig1
-rw-r--r--arch/sparc/lib/mcount.S22
2 files changed, 16 insertions, 7 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 6db513674050..035304c30ab4 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -37,6 +37,7 @@ config SPARC64
37 def_bool 64BIT 37 def_bool 64BIT
38 select ARCH_SUPPORTS_MSI 38 select ARCH_SUPPORTS_MSI
39 select HAVE_FUNCTION_TRACER 39 select HAVE_FUNCTION_TRACER
40 select HAVE_FUNCTION_TRACE_MCOUNT_TEST
40 select HAVE_KRETPROBES 41 select HAVE_KRETPROBES
41 select HAVE_KPROBES 42 select HAVE_KPROBES
42 select HAVE_LMB 43 select HAVE_LMB
diff --git a/arch/sparc/lib/mcount.S b/arch/sparc/lib/mcount.S
index 24b8b12deed2..7047997be0eb 100644
--- a/arch/sparc/lib/mcount.S
+++ b/arch/sparc/lib/mcount.S
@@ -96,13 +96,12 @@ mcount:
96#endif 96#endif
97#ifdef CONFIG_FUNCTION_TRACER 97#ifdef CONFIG_FUNCTION_TRACER
98#ifdef CONFIG_DYNAMIC_FTRACE 98#ifdef CONFIG_DYNAMIC_FTRACE
99 mov %o7, %o0 99 /* Do nothing, the retl/nop below is all we need. */
100 .globl mcount_call
101mcount_call:
102 call ftrace_stub
103 mov %o0, %o7
104#else 100#else
105 sethi %hi(ftrace_trace_function), %g1 101 sethi %hi(function_trace_stop), %g1
102 lduw [%g1 + %lo(function_trace_stop)], %g2
103 brnz,pn %g2, 1f
104 sethi %hi(ftrace_trace_function), %g1
106 sethi %hi(ftrace_stub), %g2 105 sethi %hi(ftrace_stub), %g2
107 ldx [%g1 + %lo(ftrace_trace_function)], %g1 106 ldx [%g1 + %lo(ftrace_trace_function)], %g1
108 or %g2, %lo(ftrace_stub), %g2 107 or %g2, %lo(ftrace_stub), %g2
@@ -131,14 +130,23 @@ ftrace_stub:
131 .globl ftrace_caller 130 .globl ftrace_caller
132 .type ftrace_caller,#function 131 .type ftrace_caller,#function
133ftrace_caller: 132ftrace_caller:
133 sethi %hi(function_trace_stop), %g1
134 mov %i7, %o1 134 mov %i7, %o1
135 mov %o7, %o0 135 lduw [%g1 + %lo(function_trace_stop)], %g2
136 brnz,pn %g2, ftrace_stub
137 mov %o7, %o0
136 .globl ftrace_call 138 .globl ftrace_call
137ftrace_call: 139ftrace_call:
140 /* If the final kernel link ever turns on relaxation, we'll need
141 * to do something about this tail call. Otherwise the linker
142 * will rewrite the call into a branch and nop out the move
143 * instruction.
144 */
138 call ftrace_stub 145 call ftrace_stub
139 mov %o0, %o7 146 mov %o0, %o7
140 retl 147 retl
141 nop 148 nop
149 .size ftrace_call,.-ftrace_call
142 .size ftrace_caller,.-ftrace_caller 150 .size ftrace_caller,.-ftrace_caller
143#endif 151#endif
144#endif 152#endif