diff options
Diffstat (limited to 'arch/arm/kernel/entry-armv.S')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index b0efbf98d832..8ff82bc75eb1 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -144,20 +144,20 @@ __dabt_svc: | |||
144 | __irq_svc: | 144 | __irq_svc: |
145 | svc_entry irq | 145 | svc_entry irq |
146 | #ifdef CONFIG_PREEMPT | 146 | #ifdef CONFIG_PREEMPT |
147 | get_thread_info r8 | 147 | get_thread_info tsk |
148 | ldr r9, [r8, #TI_PREEMPT] @ get preempt count | 148 | ldr r8, [tsk, #TI_PREEMPT] @ get preempt count |
149 | add r7, r9, #1 @ increment it | 149 | add r7, r8, #1 @ increment it |
150 | str r7, [r8, #TI_PREEMPT] | 150 | str r7, [tsk, #TI_PREEMPT] |
151 | #endif | 151 | #endif |
152 | irq_handler | 152 | irq_handler |
153 | #ifdef CONFIG_PREEMPT | 153 | #ifdef CONFIG_PREEMPT |
154 | ldr r0, [r8, #TI_FLAGS] @ get flags | 154 | ldr r0, [tsk, #TI_FLAGS] @ get flags |
155 | tst r0, #_TIF_NEED_RESCHED | 155 | tst r0, #_TIF_NEED_RESCHED |
156 | blne svc_preempt | 156 | blne svc_preempt |
157 | preempt_return: | 157 | preempt_return: |
158 | ldr r0, [r8, #TI_PREEMPT] @ read preempt value | 158 | ldr r0, [tsk, #TI_PREEMPT] @ read preempt value |
159 | str r8, [tsk, #TI_PREEMPT] @ restore preempt count | ||
159 | teq r0, r7 | 160 | teq r0, r7 |
160 | str r9, [r8, #TI_PREEMPT] @ restore preempt count | ||
161 | strne r0, [r0, -r0] @ bug() | 161 | strne r0, [r0, -r0] @ bug() |
162 | #endif | 162 | #endif |
163 | ldr r0, [sp, #S_PSR] @ irqs are already disabled | 163 | ldr r0, [sp, #S_PSR] @ irqs are already disabled |
@@ -168,7 +168,7 @@ preempt_return: | |||
168 | 168 | ||
169 | #ifdef CONFIG_PREEMPT | 169 | #ifdef CONFIG_PREEMPT |
170 | svc_preempt: | 170 | svc_preempt: |
171 | teq r9, #0 @ was preempt count = 0 | 171 | teq r8, #0 @ was preempt count = 0 |
172 | ldreq r6, .LCirq_stat | 172 | ldreq r6, .LCirq_stat |
173 | movne pc, lr @ no | 173 | movne pc, lr @ no |
174 | ldr r0, [r6, #4] @ local_irq_count | 174 | ldr r0, [r6, #4] @ local_irq_count |
@@ -176,9 +176,9 @@ svc_preempt: | |||
176 | adds r0, r0, r1 | 176 | adds r0, r0, r1 |
177 | movne pc, lr | 177 | movne pc, lr |
178 | mov r7, #0 @ preempt_schedule_irq | 178 | mov r7, #0 @ preempt_schedule_irq |
179 | str r7, [r8, #TI_PREEMPT] @ expects preempt_count == 0 | 179 | str r7, [tsk, #TI_PREEMPT] @ expects preempt_count == 0 |
180 | 1: bl preempt_schedule_irq @ irq en/disable is done inside | 180 | 1: bl preempt_schedule_irq @ irq en/disable is done inside |
181 | ldr r0, [r8, #TI_FLAGS] @ get new tasks TI_FLAGS | 181 | ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS |
182 | tst r0, #_TIF_NEED_RESCHED | 182 | tst r0, #_TIF_NEED_RESCHED |
183 | beq preempt_return @ go again | 183 | beq preempt_return @ go again |
184 | b 1b | 184 | b 1b |
@@ -338,21 +338,18 @@ __dabt_usr: | |||
338 | __irq_usr: | 338 | __irq_usr: |
339 | usr_entry irq | 339 | usr_entry irq |
340 | 340 | ||
341 | get_thread_info tsk | ||
341 | #ifdef CONFIG_PREEMPT | 342 | #ifdef CONFIG_PREEMPT |
342 | get_thread_info r8 | 343 | ldr r8, [tsk, #TI_PREEMPT] @ get preempt count |
343 | ldr r9, [r8, #TI_PREEMPT] @ get preempt count | 344 | add r7, r8, #1 @ increment it |
344 | add r7, r9, #1 @ increment it | 345 | str r7, [tsk, #TI_PREEMPT] |
345 | str r7, [r8, #TI_PREEMPT] | ||
346 | #endif | 346 | #endif |
347 | irq_handler | 347 | irq_handler |
348 | #ifdef CONFIG_PREEMPT | 348 | #ifdef CONFIG_PREEMPT |
349 | ldr r0, [r8, #TI_PREEMPT] | 349 | ldr r0, [tsk, #TI_PREEMPT] |
350 | str r8, [tsk, #TI_PREEMPT] | ||
350 | teq r0, r7 | 351 | teq r0, r7 |
351 | str r9, [r8, #TI_PREEMPT] | ||
352 | strne r0, [r0, -r0] | 352 | strne r0, [r0, -r0] |
353 | mov tsk, r8 | ||
354 | #else | ||
355 | get_thread_info tsk | ||
356 | #endif | 353 | #endif |
357 | mov why, #0 | 354 | mov why, #0 |
358 | b ret_to_user | 355 | b ret_to_user |