aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/entry-common.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/entry-common.S')
-rw-r--r--arch/arm/kernel/entry-common.S47
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 597ed00a08d8..8f79a4789ed4 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -99,6 +99,53 @@ ENTRY(ret_from_fork)
99#undef CALL 99#undef CALL
100#define CALL(x) .long x 100#define CALL(x) .long x
101 101
102#ifdef CONFIG_FTRACE
103#ifdef CONFIG_DYNAMIC_FTRACE
104ENTRY(mcount)
105 stmdb sp!, {r0-r3, lr}
106 mov r0, lr
107
108 .globl mcount_call
109mcount_call:
110 bl ftrace_stub
111 ldmia sp!, {r0-r3, pc}
112
113ENTRY(ftrace_caller)
114 stmdb sp!, {r0-r3, lr}
115 ldr r1, [fp, #-4]
116 mov r0, lr
117
118 .globl ftrace_call
119ftrace_call:
120 bl ftrace_stub
121 ldmia sp!, {r0-r3, pc}
122
123#else
124
125ENTRY(mcount)
126 stmdb sp!, {r0-r3, lr}
127 ldr r0, =ftrace_trace_function
128 ldr r2, [r0]
129 adr r0, ftrace_stub
130 cmp r0, r2
131 bne trace
132 ldmia sp!, {r0-r3, pc}
133
134trace:
135 ldr r1, [fp, #-4]
136 mov r0, lr
137 mov lr, pc
138 mov pc, r2
139 ldmia sp!, {r0-r3, pc}
140
141#endif /* CONFIG_DYNAMIC_FTRACE */
142
143 .globl ftrace_stub
144ftrace_stub:
145 mov pc, lr
146
147#endif /* CONFIG_FTRACE */
148
102/*============================================================================= 149/*=============================================================================
103 * SWI handler 150 * SWI handler
104 *----------------------------------------------------------------------------- 151 *-----------------------------------------------------------------------------