diff options
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a46d5b456765..65cef872c5f2 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -209,14 +209,12 @@ __irq_svc: | |||
209 | 209 | ||
210 | irq_handler | 210 | irq_handler |
211 | #ifdef CONFIG_PREEMPT | 211 | #ifdef CONFIG_PREEMPT |
212 | str r8, [tsk, #TI_PREEMPT] @ restore preempt count | ||
212 | ldr r0, [tsk, #TI_FLAGS] @ get flags | 213 | ldr r0, [tsk, #TI_FLAGS] @ get flags |
214 | teq r8, #0 @ if preempt count != 0 | ||
215 | movne r0, #0 @ force flags to 0 | ||
213 | tst r0, #_TIF_NEED_RESCHED | 216 | tst r0, #_TIF_NEED_RESCHED |
214 | blne svc_preempt | 217 | blne svc_preempt |
215 | preempt_return: | ||
216 | ldr r0, [tsk, #TI_PREEMPT] @ read preempt value | ||
217 | str r8, [tsk, #TI_PREEMPT] @ restore preempt count | ||
218 | teq r0, r7 | ||
219 | strne r0, [r0, -r0] @ bug() | ||
220 | #endif | 218 | #endif |
221 | ldr r0, [sp, #S_PSR] @ irqs are already disabled | 219 | ldr r0, [sp, #S_PSR] @ irqs are already disabled |
222 | msr spsr_cxsf, r0 | 220 | msr spsr_cxsf, r0 |
@@ -230,19 +228,11 @@ preempt_return: | |||
230 | 228 | ||
231 | #ifdef CONFIG_PREEMPT | 229 | #ifdef CONFIG_PREEMPT |
232 | svc_preempt: | 230 | svc_preempt: |
233 | teq r8, #0 @ was preempt count = 0 | 231 | mov r8, lr |
234 | ldreq r6, .LCirq_stat | ||
235 | movne pc, lr @ no | ||
236 | ldr r0, [r6, #4] @ local_irq_count | ||
237 | ldr r1, [r6, #8] @ local_bh_count | ||
238 | adds r0, r0, r1 | ||
239 | movne pc, lr | ||
240 | mov r7, #0 @ preempt_schedule_irq | ||
241 | str r7, [tsk, #TI_PREEMPT] @ expects preempt_count == 0 | ||
242 | 1: bl preempt_schedule_irq @ irq en/disable is done inside | 232 | 1: bl preempt_schedule_irq @ irq en/disable is done inside |
243 | ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS | 233 | ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS |
244 | tst r0, #_TIF_NEED_RESCHED | 234 | tst r0, #_TIF_NEED_RESCHED |
245 | beq preempt_return @ go again | 235 | moveq pc, r8 @ go again |
246 | b 1b | 236 | b 1b |
247 | #endif | 237 | #endif |
248 | 238 | ||
@@ -326,10 +316,6 @@ __pabt_svc: | |||
326 | #endif | 316 | #endif |
327 | .LCfp: | 317 | .LCfp: |
328 | .word fp_enter | 318 | .word fp_enter |
329 | #ifdef CONFIG_PREEMPT | ||
330 | .LCirq_stat: | ||
331 | .word irq_stat | ||
332 | #endif | ||
333 | 319 | ||
334 | /* | 320 | /* |
335 | * User mode handlers | 321 | * User mode handlers |