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>
This commit is contained in:
parent
39ad04ccd6
commit
0b1f68e836
|
@ -23,6 +23,7 @@
|
||||||
#include <asm/ptrace.h>
|
#include <asm/ptrace.h>
|
||||||
#include <asm/domain.h>
|
#include <asm/domain.h>
|
||||||
#include <asm/opcodes-virt.h>
|
#include <asm/opcodes-virt.h>
|
||||||
|
#include <asm/asm-offsets.h>
|
||||||
|
|
||||||
#define IOMEM(x) (x)
|
#define IOMEM(x) (x)
|
||||||
|
|
||||||
|
@ -184,6 +185,37 @@
|
||||||
mov \rd, \rd, lsl #13
|
mov \rd, \rd, lsl #13
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Increment/decrement the preempt count.
|
||||||
|
*/
|
||||||
|
#ifdef CONFIG_PREEMPT_COUNT
|
||||||
|
.macro inc_preempt_count, ti, tmp
|
||||||
|
ldr \tmp, [\ti, #TI_PREEMPT] @ get preempt count
|
||||||
|
add \tmp, \tmp, #1 @ increment it
|
||||||
|
str \tmp, [\ti, #TI_PREEMPT]
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro dec_preempt_count, ti, tmp
|
||||||
|
ldr \tmp, [\ti, #TI_PREEMPT] @ get preempt count
|
||||||
|
sub \tmp, \tmp, #1 @ decrement it
|
||||||
|
str \tmp, [\ti, #TI_PREEMPT]
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro dec_preempt_count_ti, ti, tmp
|
||||||
|
get_thread_info \ti
|
||||||
|
dec_preempt_count \ti, \tmp
|
||||||
|
.endm
|
||||||
|
#else
|
||||||
|
.macro inc_preempt_count, ti, tmp
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro dec_preempt_count, ti, tmp
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro dec_preempt_count_ti, ti, tmp
|
||||||
|
.endm
|
||||||
|
#endif
|
||||||
|
|
||||||
#define USER(x...) \
|
#define USER(x...) \
|
||||||
9999: x; \
|
9999: x; \
|
||||||
.pushsection __ex_table,"a"; \
|
.pushsection __ex_table,"a"; \
|
||||||
|
|
|
@ -25,11 +25,7 @@
|
||||||
@ IRQs disabled.
|
@ IRQs disabled.
|
||||||
@
|
@
|
||||||
ENTRY(do_vfp)
|
ENTRY(do_vfp)
|
||||||
#ifdef CONFIG_PREEMPT_COUNT
|
inc_preempt_count r10, r4
|
||||||
ldr r4, [r10, #TI_PREEMPT] @ get preempt count
|
|
||||||
add r11, r4, #1 @ increment it
|
|
||||||
str r11, [r10, #TI_PREEMPT]
|
|
||||||
#endif
|
|
||||||
enable_irq
|
enable_irq
|
||||||
ldr r4, .LCvfp
|
ldr r4, .LCvfp
|
||||||
ldr r11, [r10, #TI_CPU] @ CPU number
|
ldr r11, [r10, #TI_CPU] @ CPU number
|
||||||
|
@ -38,12 +34,7 @@ ENTRY(do_vfp)
|
||||||
ENDPROC(do_vfp)
|
ENDPROC(do_vfp)
|
||||||
|
|
||||||
ENTRY(vfp_null_entry)
|
ENTRY(vfp_null_entry)
|
||||||
#ifdef CONFIG_PREEMPT_COUNT
|
dec_preempt_count_ti r10, r4
|
||||||
get_thread_info r10
|
|
||||||
ldr r4, [r10, #TI_PREEMPT] @ get preempt count
|
|
||||||
sub r11, r4, #1 @ decrement it
|
|
||||||
str r11, [r10, #TI_PREEMPT]
|
|
||||||
#endif
|
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
ENDPROC(vfp_null_entry)
|
ENDPROC(vfp_null_entry)
|
||||||
|
|
||||||
|
@ -56,12 +47,7 @@ ENDPROC(vfp_null_entry)
|
||||||
|
|
||||||
__INIT
|
__INIT
|
||||||
ENTRY(vfp_testing_entry)
|
ENTRY(vfp_testing_entry)
|
||||||
#ifdef CONFIG_PREEMPT_COUNT
|
dec_preempt_count_ti r10, r4
|
||||||
get_thread_info r10
|
|
||||||
ldr r4, [r10, #TI_PREEMPT] @ get preempt count
|
|
||||||
sub r11, r4, #1 @ decrement it
|
|
||||||
str r11, [r10, #TI_PREEMPT]
|
|
||||||
#endif
|
|
||||||
ldr r0, VFP_arch_address
|
ldr r0, VFP_arch_address
|
||||||
str r0, [r0] @ set to non-zero value
|
str r0, [r0] @ set to non-zero value
|
||||||
mov pc, r9 @ we have handled the fault
|
mov pc, r9 @ we have handled the fault
|
||||||
|
|
|
@ -182,12 +182,7 @@ vfp_hw_state_valid:
|
||||||
@ else it's one 32-bit instruction, so
|
@ else it's one 32-bit instruction, so
|
||||||
@ always subtract 4 from the following
|
@ always subtract 4 from the following
|
||||||
@ instruction address.
|
@ instruction address.
|
||||||
#ifdef CONFIG_PREEMPT_COUNT
|
dec_preempt_count_ti r10, r4
|
||||||
get_thread_info r10
|
|
||||||
ldr r4, [r10, #TI_PREEMPT] @ get preempt count
|
|
||||||
sub r11, r4, #1 @ decrement it
|
|
||||||
str r11, [r10, #TI_PREEMPT]
|
|
||||||
#endif
|
|
||||||
mov pc, r9 @ we think we have handled things
|
mov pc, r9 @ we think we have handled things
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,12 +201,7 @@ look_for_VFP_exceptions:
|
||||||
@ not recognised by VFP
|
@ not recognised by VFP
|
||||||
|
|
||||||
DBGSTR "not VFP"
|
DBGSTR "not VFP"
|
||||||
#ifdef CONFIG_PREEMPT_COUNT
|
dec_preempt_count_ti r10, r4
|
||||||
get_thread_info r10
|
|
||||||
ldr r4, [r10, #TI_PREEMPT] @ get preempt count
|
|
||||||
sub r11, r4, #1 @ decrement it
|
|
||||||
str r11, [r10, #TI_PREEMPT]
|
|
||||||
#endif
|
|
||||||
mov pc, lr
|
mov pc, lr
|
||||||
|
|
||||||
process_exception:
|
process_exception:
|
||||||
|
|
Loading…
Reference in New Issue