aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/vfp
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2014-04-02 05:57:49 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-04-09 08:08:08 -0400
commit0b1f68e836bcf1ca2861f95066985c57ecfb2f1a (patch)
tree2cc6151c12ad8629834eefa35fc1f68442a16f73 /arch/arm/vfp
parent39ad04ccd6e1b235601e9ac5a7f508d05728a97a (diff)
ARM: 8018/1: Add {inc,dec}_preempt_count asm macros
The patch adds asm macros for inc_preempt_count and dec_preempt_count_ti (which also gets the current thread_info) instead of open-coding them in arch/arm/vfp/*.S files. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Tested-by: Arun KS <getarunks@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/vfp')
-rw-r--r--arch/arm/vfp/entry.S20
-rw-r--r--arch/arm/vfp/vfphw.S14
2 files changed, 5 insertions, 29 deletions
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
index 9cc290ae4e3b..f0759e70fb86 100644
--- a/arch/arm/vfp/entry.S
+++ b/arch/arm/vfp/entry.S
@@ -25,11 +25,7 @@
25@ IRQs disabled. 25@ IRQs disabled.
26@ 26@
27ENTRY(do_vfp) 27ENTRY(do_vfp)
28#ifdef CONFIG_PREEMPT_COUNT 28 inc_preempt_count r10, r4
29 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
30 add r11, r4, #1 @ increment it
31 str r11, [r10, #TI_PREEMPT]
32#endif
33 enable_irq 29 enable_irq
34 ldr r4, .LCvfp 30 ldr r4, .LCvfp
35 ldr r11, [r10, #TI_CPU] @ CPU number 31 ldr r11, [r10, #TI_CPU] @ CPU number
@@ -38,12 +34,7 @@ ENTRY(do_vfp)
38ENDPROC(do_vfp) 34ENDPROC(do_vfp)
39 35
40ENTRY(vfp_null_entry) 36ENTRY(vfp_null_entry)
41#ifdef CONFIG_PREEMPT_COUNT 37 dec_preempt_count_ti r10, r4
42 get_thread_info r10
43 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
44 sub r11, r4, #1 @ decrement it
45 str r11, [r10, #TI_PREEMPT]
46#endif
47 mov pc, lr 38 mov pc, lr
48ENDPROC(vfp_null_entry) 39ENDPROC(vfp_null_entry)
49 40
@@ -56,12 +47,7 @@ ENDPROC(vfp_null_entry)
56 47
57 __INIT 48 __INIT
58ENTRY(vfp_testing_entry) 49ENTRY(vfp_testing_entry)
59#ifdef CONFIG_PREEMPT_COUNT 50 dec_preempt_count_ti r10, r4
60 get_thread_info r10
61 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
62 sub r11, r4, #1 @ decrement it
63 str r11, [r10, #TI_PREEMPT]
64#endif
65 ldr r0, VFP_arch_address 51 ldr r0, VFP_arch_address
66 str r0, [r0] @ set to non-zero value 52 str r0, [r0] @ set to non-zero value
67 mov pc, r9 @ we have handled the fault 53 mov pc, r9 @ we have handled the fault
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index 98f6246c9002..be807625ed8c 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -182,12 +182,7 @@ vfp_hw_state_valid:
182 @ else it's one 32-bit instruction, so 182 @ else it's one 32-bit instruction, so
183 @ always subtract 4 from the following 183 @ always subtract 4 from the following
184 @ instruction address. 184 @ instruction address.
185#ifdef CONFIG_PREEMPT_COUNT 185 dec_preempt_count_ti r10, r4
186 get_thread_info r10
187 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
188 sub r11, r4, #1 @ decrement it
189 str r11, [r10, #TI_PREEMPT]
190#endif
191 mov pc, r9 @ we think we have handled things 186 mov pc, r9 @ we think we have handled things
192 187
193 188
@@ -206,12 +201,7 @@ look_for_VFP_exceptions:
206 @ not recognised by VFP 201 @ not recognised by VFP
207 202
208 DBGSTR "not VFP" 203 DBGSTR "not VFP"
209#ifdef CONFIG_PREEMPT_COUNT 204 dec_preempt_count_ti r10, r4
210 get_thread_info r10
211 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
212 sub r11, r4, #1 @ decrement it
213 str r11, [r10, #TI_PREEMPT]
214#endif
215 mov pc, lr 205 mov pc, lr
216 206
217process_exception: 207process_exception: