Files
mkrtos-real/mkrtos_bootstrap/bsp/AARCH64_QEMU/start.S
2024-03-31 16:06:11 +00:00

37 lines
642 B
ArmAsm
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* 8字节对齐否则会出错*/
.align 3
.globl sp_addr
.section ".data.boot"
sp_addr:
.quad stack + 4096 - 8 //pt regs is 320 bytes.
.align 3
.globl knl_entry
.section ".data.boot"
knl_entry:
.quad 0
.section ".text.boot"
.globl _start
_start:
msr daifset, #0xf //
//
mrs x0, mpidr_el1 // id
and x0, x0,#0xFF // Check processor id
cbz x0, master // Hang for all non-primary CPU
//spin table
ldr x1, = knl_entry
spin_jump:
ldr x3, [x1, #0]
cbz x3, spin_jump
br x3
b .
master:
ldr x8, = sp_addr
ldr x9, [x8]
mov sp, x9
bl main
b .