|
|
@ -2,8 +2,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
.section .text.boot
|
|
|
|
.section .text.boot
|
|
|
|
|
|
|
|
|
|
|
|
.global _start
|
|
|
|
boot:
|
|
|
|
_start:
|
|
|
|
|
|
|
|
# read cpu affinity, start core 0, halt rest
|
|
|
|
# read cpu affinity, start core 0, halt rest
|
|
|
|
mrs x1, mpidr_el1
|
|
|
|
mrs x1, mpidr_el1
|
|
|
|
and x1, x1, #3
|
|
|
|
and x1, x1, #3
|
|
|
@ -16,7 +15,7 @@ halt:
|
|
|
|
|
|
|
|
|
|
|
|
setup:
|
|
|
|
setup:
|
|
|
|
# store the desired EL1 stack pointer in x1
|
|
|
|
# store the desired EL1 stack pointer in x1
|
|
|
|
adr x1, _start
|
|
|
|
ldr x1, =_start
|
|
|
|
|
|
|
|
|
|
|
|
# use SP_ELx for Exception level ELx
|
|
|
|
# use SP_ELx for Exception level ELx
|
|
|
|
msr SPsel, #1
|
|
|
|
msr SPsel, #1
|
|
|
@ -99,12 +98,17 @@ zero_bss:
|
|
|
|
|
|
|
|
|
|
|
|
zero_bss_loop:
|
|
|
|
zero_bss_loop:
|
|
|
|
# zero out the BSS section, 64-bits at a time
|
|
|
|
# zero out the BSS section, 64-bits at a time
|
|
|
|
cbz x2, go_kmain
|
|
|
|
cbz x2, zero_bss_loop_end
|
|
|
|
str xzr, [x1], #8
|
|
|
|
str xzr, [x1], #8
|
|
|
|
sub x2, x2, #8
|
|
|
|
sub x2, x2, #8
|
|
|
|
cbnz x2, zero_bss_loop
|
|
|
|
cbnz x2, zero_bss_loop
|
|
|
|
|
|
|
|
|
|
|
|
go_kmain:
|
|
|
|
zero_bss_loop_end:
|
|
|
|
|
|
|
|
b _start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.section .text.entry
|
|
|
|
|
|
|
|
.globl _start
|
|
|
|
|
|
|
|
_start:
|
|
|
|
# jump to rust_main, which shouldn't return. halt if it does
|
|
|
|
# jump to rust_main, which shouldn't return. halt if it does
|
|
|
|
bl rust_main
|
|
|
|
bl rust_main
|
|
|
|
b halt
|
|
|
|
b halt
|
|
|
|