Skip to content

Commit 952f033

Browse files
ardbiesheuvelRussell King (Oracle)
authored andcommitted
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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 7719a68 commit 952f033

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

arch/arm/include/asm/assembler.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,12 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
692692
/*
693693
* ldr_va - load a 32-bit word from the virtual address of \sym
694694
*/
695-
.macro ldr_va, rd:req, sym:req, cond
695+
.macro ldr_va, rd:req, sym:req, cond, tmp
696+
.ifnb \tmp
697+
__ldst_va ldr, \rd, \tmp, \sym, \cond
698+
.else
696699
__ldst_va ldr, \rd, \rd, \sym, \cond
700+
.endif
697701
.endm
698702

699703
/*
@@ -727,9 +731,11 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
727731
* are permitted to overlap with 'rd' if != sp
728732
*/
729733
.macro ldr_this_cpu, rd:req, sym:req, t1:req, t2:req
730-
#if __LINUX_ARM_ARCH__ >= 7 || \
731-
!defined(CONFIG_ARM_HAS_GROUP_RELOCS) || \
732-
(defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS))
734+
#ifndef CONFIG_SMP
735+
ldr_va \rd, \sym, tmp=\t1
736+
#elif __LINUX_ARM_ARCH__ >= 7 || \
737+
!defined(CONFIG_ARM_HAS_GROUP_RELOCS) || \
738+
(defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS))
733739
this_cpu_offset \t1
734740
mov_l \t2, \sym
735741
ldr \rd, [\t1, \t2]

0 commit comments

Comments
 (0)