aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/include/asm/assembler.h32
-rw-r--r--arch/arm/vfp/entry.S20
-rw-r--r--arch/arm/vfp/vfphw.S14
3 files changed, 37 insertions, 29 deletions
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 9a4965ad6867..b974184f9941 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -23,6 +23,7 @@
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/domain.h> 24#include <asm/domain.h>
25#include <asm/opcodes-virt.h> 25#include <asm/opcodes-virt.h>
26#include <asm/asm-offsets.h>
26 27
27#define IOMEM(x) (x) 28#define IOMEM(x) (x)
28 29
@@ -184,6 +185,37 @@
184 mov \rd, \rd, lsl #13 185 mov \rd, \rd, lsl #13
185 .endm 186 .endm
186 187
188/*
189 * Increment/decrement the preempt count.
190 */
191#ifdef CONFIG_PREEMPT_COUNT
192 .macro inc_preempt_count, ti, tmp
193 ldr \tmp, [\ti, #TI_PREEMPT] @ get preempt count
194 add \tmp, \tmp, #1 @ increment it
195 str \tmp, [\ti, #TI_PREEMPT]
196 .endm
197
198 .macro dec_preempt_count, ti, tmp
199 ldr \tmp, [\ti, #TI_PREEMPT] @ get preempt count
200 sub \tmp, \tmp, #1 @ decrement it
201 str \tmp, [\ti, #TI_PREEMPT]
202 .endm
203
204 .macro dec_preempt_count_ti, ti, tmp
205 get_thread_info \ti
206 dec_preempt_count \ti, \tmp
207 .endm
208#else
209 .macro inc_preempt_count, ti, tmp
210 .endm
211
212 .macro dec_preempt_count, ti, tmp
213 .endm
214
215 .macro dec_preempt_count_ti, ti, tmp
216 .endm
217#endif
218
187#define USER(x...) \ 219#define USER(x...) \
1889999: x; \ 2209999: x; \
189 .pushsection __ex_table,"a"; \ 221 .pushsection __ex_table,"a"; \
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: