Skip to content
Snippets Groups Projects
Commit dae08d22 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Hans de Goede
Browse files

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: default avatarChen-Yu Tsai <wens@csie.org>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 3da9536e
No related branches found
No related tags found
No related merge requests found
...@@ -196,15 +196,15 @@ ENDPROC(psci_cpu_off_common) ...@@ -196,15 +196,15 @@ ENDPROC(psci_cpu_off_common)
@ expects CPU ID in r0 and returns stack top in r0 @ expects CPU ID in r0 and returns stack top in r0
ENTRY(psci_get_cpu_stack_top) ENTRY(psci_get_cpu_stack_top)
mov r5, #0x400 @ 1kB of stack per CPU mov r3, #0x400 @ 1kB of stack per CPU
mul r0, r0, r5 mul r0, r0, r3
ldr r5, =psci_text_end @ end of monitor text ldr r3, =psci_text_end @ end of monitor text
add r5, r5, #0x2000 @ Skip two pages add r3, r3, #0x2000 @ Skip two pages
lsr r5, r5, #12 @ Align to start of page lsr r3, r3, #12 @ Align to start of page
lsl r5, r5, #12 lsl r3, r3, #12
sub r5, r5, #4 @ reserve 1 word for target PC sub r3, r3, #4 @ reserve 1 word for target PC
sub r0, r5, r0 @ here's our stack! sub r0, r3, r0 @ here's our stack!
bx lr bx lr
ENDPROC(psci_get_cpu_stack_top) ENDPROC(psci_get_cpu_stack_top)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment