aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2017-08-14 23:09:52 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-08-14 23:09:52 +0000
commitb74700a1be0a5c6b91f4202f21bd58cc60aa5afc (patch)
tree1ec53a4d6bdde1f8367f2f92ad8d365a17691f0b
parentf1f0b344b87262414940021627cd310c3d53f788 (diff)
parente3dfca160a49320c8fc3219981597f66bc136d59 (diff)
downloadv4.4-b74700a1be0a5c6b91f4202f21bd58cc60aa5afc.tar.gz
UPSTREAM: arm64: assembler: introduce ldr_this_cpu am: 1cdfc007f3
am: e3dfca160a Change-Id: I8c2d15866d79ae2c2653ebd2713325fb84cb1ce1
-rw-r--r--arch/arm64/include/asm/assembler.h19
-rw-r--r--arch/arm64/kernel/entry.S2
2 files changed, 16 insertions, 5 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index d8855ca6068a..e450bb6d21bd 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -223,14 +223,25 @@ lr .req x30 // link register
.endm
/*
+ * @dst: Result of per_cpu(sym, smp_processor_id())
* @sym: The name of the per-cpu variable
- * @reg: Result of per_cpu(sym, smp_processor_id())
* @tmp: scratch register
*/
- .macro this_cpu_ptr, sym, reg, tmp
- adr_l \reg, \sym
+ .macro adr_this_cpu, dst, sym, tmp
+ adr_l \dst, \sym
mrs \tmp, tpidr_el1
- add \reg, \reg, \tmp
+ add \dst, \dst, \tmp
+ .endm
+
+ /*
+ * @dst: Result of READ_ONCE(per_cpu(sym, smp_processor_id()))
+ * @sym: The name of the per-cpu variable
+ * @tmp: scratch register
+ */
+ .macro ldr_this_cpu dst, sym, tmp
+ adr_l \dst, \sym
+ mrs \tmp, tpidr_el1
+ ldr \dst, [\dst, \tmp]
.endm
/*
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 3f9d78612e57..ed2df0570cc8 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -266,7 +266,7 @@ alternative_endif
cmp x25, tsk
b.ne 9998f
- this_cpu_ptr irq_stack, x25, x26
+ adr_this_cpu x25, irq_stack, x26
mov x26, #IRQ_STACK_START_SP
add x26, x25, x26