X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/43487eff262637a59a4c2c0272d7c4a824af3944..dd82b939699fb0b298ccbfd66b84ef0d7a78a53b:/lunaix-os/arch/aarch64/boot/start.S?ds=sidebyside diff --git a/lunaix-os/arch/aarch64/boot/start.S b/lunaix-os/arch/aarch64/boot/start.S index 13878da..05787b6 100644 --- a/lunaix-os/arch/aarch64/boot/start.S +++ b/lunaix-os/arch/aarch64/boot/start.S @@ -1,3 +1,5 @@ +#include + .section .boot.data .align 4 stack_end: @@ -19,6 +21,22 @@ mov sp, x4 mov fp, xzr + mov x19, x0 + bl aarch64_pre_el1_init + + bl aarch64_prepare_el1_transfer + cbz x0, 1f + + /* transfer to EL1 if we are currently not in */ + adr x0, stack_top + msr SP_EL1, x0 /* EL1 stack */ + + adr x0, 1f + msr elr, x0 /* PC to resume at EL1, elr aliased to ELR_ELx */ + + eret + 1: + mov x0, x19 adr x4, aarch64_init bl x4