commit 0da2c868d8878b793b4c0a496831d068e2c9e83b
parent 5061404358fd6f0e642871691ee59aadfe6867f9
Author: Dimitris Papastamos <dimitris.papastamos@arm.com>
Date: Fri, 12 Oct 2018 16:20:37 +0100
[arm64/crt] Various fixes
- Set x0 to point to rvbar_el3 in the trapframe
- Pass the SP as the first argument to main()
- Reset sp to the trapframe pointer in swtch()
Change-Id: I1a5c624d974f662b3ca9aed154d0541e0d38f3cf
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/arm64/arch.s b/arch/arm64/arch.s
@@ -59,6 +59,7 @@ wfe: wfe
ret
swtch:
+ mov sp,x0
ldp x1,x0,[sp],#16
msr S3_6_C6_C0_6,x1 /* FAR_R */
msr S3_6_C5_C2_6,x0 /* ESR_R */
diff --git a/arch/arm64/crt-none.s b/arch/arm64/crt-none.s
@@ -1,4 +1,5 @@
.include "macros.s"
+ .include "frame.inc"
/* TODO: extract data section address from RSCB */
BSS = 0x2E00F000
@@ -35,6 +36,9 @@ _start:
mov sp,x1
mrs x0,rvbar_el3
+ str x0,[sp,#FR_X0_OFF]
+
+ mov x0,sp
bl main
ldr x0,=outsync
b panic