aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/mcount.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/mcount.S')
-rw-r--r--arch/mips/kernel/mcount.S36
1 files changed, 22 insertions, 14 deletions
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
index e256bf98249a..d4a00d29c0bf 100644
--- a/arch/mips/kernel/mcount.S
+++ b/arch/mips/kernel/mcount.S
@@ -132,28 +132,34 @@ ftrace_stub:
132#ifdef CONFIG_FUNCTION_GRAPH_TRACER 132#ifdef CONFIG_FUNCTION_GRAPH_TRACER
133 133
134NESTED(ftrace_graph_caller, PT_SIZE, ra) 134NESTED(ftrace_graph_caller, PT_SIZE, ra)
135#ifdef CONFIG_DYNAMIC_FTRACE 135#ifndef CONFIG_DYNAMIC_FTRACE
136 PTR_L a1, PT_R31(sp) /* load the original ra from the stack */
137#ifdef KBUILD_MCOUNT_RA_ADDRESS
138 PTR_L t0, PT_R12(sp) /* load the original t0 from the stack */
139#endif
140#else
141 MCOUNT_SAVE_REGS 136 MCOUNT_SAVE_REGS
142 move a1, ra /* arg2: next ip, selfaddr */
143#endif 137#endif
144 138
139 /* arg1: Get the location of the parent's return address */
145#ifdef KBUILD_MCOUNT_RA_ADDRESS 140#ifdef KBUILD_MCOUNT_RA_ADDRESS
146 bnez t0, 1f /* non-leaf func: t0 saved the location of the return address */ 141#ifdef CONFIG_DYNAMIC_FTRACE
142 PTR_L a0, PT_R12(sp)
143#else
144 move a0, t0
145#endif
146 bnez a0, 1f /* non-leaf func: stored in t0 */
147 nop 147 nop
148 PTR_LA t0, PT_R1(sp) /* leaf func: get the location of at(old ra) from our own stack */ 148#endif
1491: move a0, t0 /* arg1: the location of the return address */ 149 PTR_LA a0, PT_R1(sp) /* leaf func: the location in current stack */
1501:
151
152 /* arg2: Get self return address */
153#ifdef CONFIG_DYNAMIC_FTRACE
154 PTR_L a1, PT_R31(sp)
150#else 155#else
151 PTR_LA a0, PT_R1(sp) /* arg1: &AT -> a0 */ 156 move a1, ra
152#endif 157#endif
153 jal prepare_ftrace_return 158
159 /* arg3: Get frame pointer of current stack */
154#ifdef CONFIG_FRAME_POINTER 160#ifdef CONFIG_FRAME_POINTER
155 move a2, fp /* arg3: frame pointer */ 161 move a2, fp
156#else 162#else /* ! CONFIG_FRAME_POINTER */
157#ifdef CONFIG_64BIT 163#ifdef CONFIG_64BIT
158 PTR_LA a2, PT_SIZE(sp) 164 PTR_LA a2, PT_SIZE(sp)
159#else 165#else
@@ -161,6 +167,8 @@ NESTED(ftrace_graph_caller, PT_SIZE, ra)
161#endif 167#endif
162#endif 168#endif
163 169
170 jal prepare_ftrace_return
171 nop
164 MCOUNT_RESTORE_REGS 172 MCOUNT_RESTORE_REGS
165 RETURN_BACK 173 RETURN_BACK
166 END(ftrace_graph_caller) 174 END(ftrace_graph_caller)