Commit eecdf19b authored by Jeenu Viswambharan's avatar Jeenu Viswambharan
Browse files

FVP: Fix AArch32 stack functions to be ABI-compliant



plat_get_my_stack is called from C, so it can't expect argument
registers to be preserved. Stash registers temporarily onto the stack
instead.

plat_set_my_stack is called during early init, when there exists no
stack. Use any register other than argument registers to stash temporary
values.

Change-Id: I98052e20671d0933201d45ec7a5affccd71ce08c
Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
parent 5e2cbb36
......@@ -19,9 +19,9 @@
* -----------------------------------------------------
*/
func plat_get_my_stack
mov r3, lr
push {r4, lr}
get_my_mp_stack platform_normal_stacks, PLATFORM_STACK_SIZE
bx r3
pop {r4, pc}
endfunc plat_get_my_stack
/* -----------------------------------------------------
......@@ -32,10 +32,10 @@ endfunc plat_get_my_stack
* -----------------------------------------------------
*/
func plat_set_my_stack
mov r3, lr
mov r4, lr
get_my_mp_stack platform_normal_stacks, PLATFORM_STACK_SIZE
mov sp, r0
bx r3
bx r4
endfunc plat_set_my_stack
/* -----------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment