summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2016-06-07 10:54:24 +0800
committerHans de Goede <hdegoede@redhat.com>2016-06-20 22:43:59 +0200
commitdae08d228122e4ad296077106520a4db3ca17872 (patch)
treed4b3f5cb90450524a65c3d74afb6fdaae85bf2cf
parent3da9536e8f377d8ec63df930bfd27c700475b68e (diff)
downloadblackbird-obmc-uboot-dae08d228122e4ad296077106520a4db3ca17872.tar.gz
blackbird-obmc-uboot-dae08d228122e4ad296077106520a4db3ca17872.zip
ARM: PSCI: use only r0 and r3 in psci_get_cpu_stack_top()
For psci_get_cpu_stack_top() to be usable in C code, it must adhere to the ARM calling conventions. Since it could be called when the stack is still unavailable, and the entry code to linux also expects r1 and r2 to remain unchanged, stick to r0 and r3. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--arch/arm/cpu/armv7/psci.S18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S
index 87c0c0b6f5..cdd001fe3f 100644
--- a/arch/arm/cpu/armv7/psci.S
+++ b/arch/arm/cpu/armv7/psci.S
@@ -196,15 +196,15 @@ ENDPROC(psci_cpu_off_common)
@ expects CPU ID in r0 and returns stack top in r0
ENTRY(psci_get_cpu_stack_top)
- mov r5, #0x400 @ 1kB of stack per CPU
- mul r0, r0, r5
-
- ldr r5, =psci_text_end @ end of monitor text
- add r5, r5, #0x2000 @ Skip two pages
- lsr r5, r5, #12 @ Align to start of page
- lsl r5, r5, #12
- sub r5, r5, #4 @ reserve 1 word for target PC
- sub r0, r5, r0 @ here's our stack!
+ mov r3, #0x400 @ 1kB of stack per CPU
+ mul r0, r0, r3
+
+ ldr r3, =psci_text_end @ end of monitor text
+ add r3, r3, #0x2000 @ Skip two pages
+ lsr r3, r3, #12 @ Align to start of page
+ lsl r3, r3, #12
+ sub r3, r3, #4 @ reserve 1 word for target PC
+ sub r0, r3, r0 @ here's our stack!
bx lr
ENDPROC(psci_get_cpu_stack_top)
OpenPOWER on IntegriCloud