mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-21 06:24:12 +00:00
ARM: 9194/1: assembler: simplify ldr_this_cpu for !SMP builds
When CONFIG_SMP is not defined, the CPU offset is always zero, and so we can simplify the sequence to load a per-CPU variable. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
This commit is contained in:
parent
7719a68b2f
commit
952f033163
1 changed files with 10 additions and 4 deletions
|
@ -692,8 +692,12 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
|
||||||
/*
|
/*
|
||||||
* ldr_va - load a 32-bit word from the virtual address of \sym
|
* ldr_va - load a 32-bit word from the virtual address of \sym
|
||||||
*/
|
*/
|
||||||
.macro ldr_va, rd:req, sym:req, cond
|
.macro ldr_va, rd:req, sym:req, cond, tmp
|
||||||
|
.ifnb \tmp
|
||||||
|
__ldst_va ldr, \rd, \tmp, \sym, \cond
|
||||||
|
.else
|
||||||
__ldst_va ldr, \rd, \rd, \sym, \cond
|
__ldst_va ldr, \rd, \rd, \sym, \cond
|
||||||
|
.endif
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -727,9 +731,11 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
|
||||||
* are permitted to overlap with 'rd' if != sp
|
* are permitted to overlap with 'rd' if != sp
|
||||||
*/
|
*/
|
||||||
.macro ldr_this_cpu, rd:req, sym:req, t1:req, t2:req
|
.macro ldr_this_cpu, rd:req, sym:req, t1:req, t2:req
|
||||||
#if __LINUX_ARM_ARCH__ >= 7 || \
|
#ifndef CONFIG_SMP
|
||||||
!defined(CONFIG_ARM_HAS_GROUP_RELOCS) || \
|
ldr_va \rd, \sym, tmp=\t1
|
||||||
(defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS))
|
#elif __LINUX_ARM_ARCH__ >= 7 || \
|
||||||
|
!defined(CONFIG_ARM_HAS_GROUP_RELOCS) || \
|
||||||
|
(defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS))
|
||||||
this_cpu_offset \t1
|
this_cpu_offset \t1
|
||||||
mov_l \t2, \sym
|
mov_l \t2, \sym
|
||||||
ldr \rd, [\t1, \t2]
|
ldr \rd, [\t1, \t2]
|
||||||
|
|
Loading…
Add table
Reference in a new issue