raspberry3_bare/crt0.S

28 lines
400 B
ArmAsm
Raw Normal View History

2022-03-14 07:46:32 +01:00
.section .text.boot
.global __start
.type __start, %function
__start:
//Use core 0 only
mrs x7, mpidr_el1
and x7, x7, #3
cbz x7, __start_master
0: wfe
b 0b
__start_master:
//Setup stack pointer
ldr x2, = __stack_start
mov sp, x2
//Clear BSS
ldr w0, = __bss_start
ldr w1, = __bss_size
1: cbz x1, 2f
str xzr, [x0], #8
sub x1, x1, #1
cbnz x1, 1b
2:
bl kernelmain
b 0b