diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-03-28 08:57:40 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-04-03 11:50:13 -0400 |
commit | 9b56febea22003c424f11248908b534eba0f1eeb (patch) | |
tree | 136baa2d07413295ac71a873d4a10701a971d083 /arch/arm/kernel | |
parent | 651e94995ed5c10d77adcf19edb9de7d6f0cac3e (diff) |
ARM: entry: move IRQ tracing exit into svc_exit
The IRQ tracing exit path is much the same between all SVC mode
exits, so move this into the svc_exit macro. Use a macro parameter
to identify the IRQ case, which is the only different case there is.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 27 | ||||
-rw-r--r-- | arch/arm/kernel/entry-header.S | 32 |
2 files changed, 31 insertions, 28 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 0f82098c9bfe..68e41defef9d 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -197,13 +197,6 @@ __dabt_svc: | |||
197 | @ IRQs off again before pulling preserved data off the stack | 197 | @ IRQs off again before pulling preserved data off the stack |
198 | @ | 198 | @ |
199 | disable_irq_notrace | 199 | disable_irq_notrace |
200 | |||
201 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
202 | tst r5, #PSR_I_BIT | ||
203 | bleq trace_hardirqs_on | ||
204 | tst r5, #PSR_I_BIT | ||
205 | blne trace_hardirqs_off | ||
206 | #endif | ||
207 | svc_exit r5 @ return from exception | 200 | svc_exit r5 @ return from exception |
208 | UNWIND(.fnend ) | 201 | UNWIND(.fnend ) |
209 | ENDPROC(__dabt_svc) | 202 | ENDPROC(__dabt_svc) |
@@ -223,12 +216,7 @@ __irq_svc: | |||
223 | blne svc_preempt | 216 | blne svc_preempt |
224 | #endif | 217 | #endif |
225 | 218 | ||
226 | #ifdef CONFIG_TRACE_IRQFLAGS | 219 | svc_exit r5, irq = 1 @ return from exception |
227 | @ The parent context IRQs must have been enabled to get here in | ||
228 | @ the first place, so there's no point checking the PSR I bit. | ||
229 | bl trace_hardirqs_on | ||
230 | #endif | ||
231 | svc_exit r5 @ return from exception | ||
232 | UNWIND(.fnend ) | 220 | UNWIND(.fnend ) |
233 | ENDPROC(__irq_svc) | 221 | ENDPROC(__irq_svc) |
234 | 222 | ||
@@ -305,12 +293,6 @@ __und_svc_finish: | |||
305 | @ restore SPSR and restart the instruction | 293 | @ restore SPSR and restart the instruction |
306 | @ | 294 | @ |
307 | ldr r5, [sp, #S_PSR] @ Get SVC cpsr | 295 | ldr r5, [sp, #S_PSR] @ Get SVC cpsr |
308 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
309 | tst r5, #PSR_I_BIT | ||
310 | bleq trace_hardirqs_on | ||
311 | tst r5, #PSR_I_BIT | ||
312 | blne trace_hardirqs_off | ||
313 | #endif | ||
314 | svc_exit r5 @ return from exception | 296 | svc_exit r5 @ return from exception |
315 | UNWIND(.fnend ) | 297 | UNWIND(.fnend ) |
316 | ENDPROC(__und_svc) | 298 | ENDPROC(__und_svc) |
@@ -325,13 +307,6 @@ __pabt_svc: | |||
325 | @ IRQs off again before pulling preserved data off the stack | 307 | @ IRQs off again before pulling preserved data off the stack |
326 | @ | 308 | @ |
327 | disable_irq_notrace | 309 | disable_irq_notrace |
328 | |||
329 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
330 | tst r5, #PSR_I_BIT | ||
331 | bleq trace_hardirqs_on | ||
332 | tst r5, #PSR_I_BIT | ||
333 | blne trace_hardirqs_off | ||
334 | #endif | ||
335 | svc_exit r5 @ return from exception | 310 | svc_exit r5 @ return from exception |
336 | UNWIND(.fnend ) | 311 | UNWIND(.fnend ) |
337 | ENDPROC(__pabt_svc) | 312 | ENDPROC(__pabt_svc) |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 9a8531eadd3d..0bf15e5c40a2 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -74,7 +74,21 @@ | |||
74 | .endm | 74 | .endm |
75 | 75 | ||
76 | #ifndef CONFIG_THUMB2_KERNEL | 76 | #ifndef CONFIG_THUMB2_KERNEL |
77 | .macro svc_exit, rpsr | 77 | .macro svc_exit, rpsr, irq = 0 |
78 | .if \irq != 0 | ||
79 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
80 | @ The parent context IRQs must have been enabled to get here in | ||
81 | @ the first place, so there's no point checking the PSR I bit. | ||
82 | bl trace_hardirqs_on | ||
83 | #endif | ||
84 | .else | ||
85 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
86 | tst \rpsr, #PSR_I_BIT | ||
87 | bleq trace_hardirqs_on | ||
88 | tst \rpsr, #PSR_I_BIT | ||
89 | blne trace_hardirqs_off | ||
90 | #endif | ||
91 | .endif | ||
78 | msr spsr_cxsf, \rpsr | 92 | msr spsr_cxsf, \rpsr |
79 | #if defined(CONFIG_CPU_V6) | 93 | #if defined(CONFIG_CPU_V6) |
80 | ldr r0, [sp] | 94 | ldr r0, [sp] |
@@ -120,7 +134,21 @@ | |||
120 | mov pc, \reg | 134 | mov pc, \reg |
121 | .endm | 135 | .endm |
122 | #else /* CONFIG_THUMB2_KERNEL */ | 136 | #else /* CONFIG_THUMB2_KERNEL */ |
123 | .macro svc_exit, rpsr | 137 | .macro svc_exit, rpsr, irq = 0 |
138 | .if \irq != 0 | ||
139 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
140 | @ The parent context IRQs must have been enabled to get here in | ||
141 | @ the first place, so there's no point checking the PSR I bit. | ||
142 | bl trace_hardirqs_on | ||
143 | #endif | ||
144 | .else | ||
145 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
146 | tst \rpsr, #PSR_I_BIT | ||
147 | bleq trace_hardirqs_on | ||
148 | tst \rpsr, #PSR_I_BIT | ||
149 | blne trace_hardirqs_off | ||
150 | #endif | ||
151 | .endif | ||
124 | ldr lr, [sp, #S_SP] @ top of the stack | 152 | ldr lr, [sp, #S_SP] @ top of the stack |
125 | ldrd r0, r1, [sp, #S_LR] @ calling lr and pc | 153 | ldrd r0, r1, [sp, #S_LR] @ calling lr and pc |
126 | clrex @ clear the exclusive monitor | 154 | clrex @ clear the exclusive monitor |