|
|
|
@ -110,7 +110,7 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu/boot.s 02_runtime_init/src/_arch
|
|
|
|
|
// Public Code
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
.section .text._start
|
|
|
|
|
@@ -11,9 +29,38 @@
|
|
|
|
|
@@ -11,6 +29,34 @@
|
|
|
|
|
// fn _start()
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
_start:
|
|
|
|
@ -119,7 +119,7 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu/boot.s 02_runtime_init/src/_arch
|
|
|
|
|
+ and x1, x1, _core_id_mask
|
|
|
|
|
+ ldr x2, BOOT_CORE_ID // provided by bsp/__board_name__/cpu.rs
|
|
|
|
|
+ cmp x1, x2
|
|
|
|
|
+ b.ne parking_loop
|
|
|
|
|
+ b.ne .L_parking_loop
|
|
|
|
|
+
|
|
|
|
|
+ // If execution reaches here, it is the boot core.
|
|
|
|
|
+
|
|
|
|
@ -127,14 +127,14 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu/boot.s 02_runtime_init/src/_arch
|
|
|
|
|
+ ADR_REL x0, __bss_start
|
|
|
|
|
+ ADR_REL x1, __bss_end_exclusive
|
|
|
|
|
+
|
|
|
|
|
+bss_init_loop:
|
|
|
|
|
+.L_bss_init_loop:
|
|
|
|
|
+ cmp x0, x1
|
|
|
|
|
+ b.eq prepare_rust
|
|
|
|
|
+ b.eq .L_prepare_rust
|
|
|
|
|
+ stp xzr, xzr, [x0], #16
|
|
|
|
|
+ b bss_init_loop
|
|
|
|
|
+ b .L_bss_init_loop
|
|
|
|
|
+
|
|
|
|
|
+ // Prepare the jump to Rust code.
|
|
|
|
|
+prepare_rust:
|
|
|
|
|
+.L_prepare_rust:
|
|
|
|
|
+ // Set the stack pointer.
|
|
|
|
|
+ ADR_REL x0, __boot_core_stack_end_exclusive
|
|
|
|
|
+ mov sp, x0
|
|
|
|
@ -143,14 +143,8 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu/boot.s 02_runtime_init/src/_arch
|
|
|
|
|
+ b _start_rust
|
|
|
|
|
+
|
|
|
|
|
// Infinitely wait for events (aka "park the core").
|
|
|
|
|
-1: wfe
|
|
|
|
|
- b 1b
|
|
|
|
|
+parking_loop:
|
|
|
|
|
+ wfe
|
|
|
|
|
+ b parking_loop
|
|
|
|
|
|
|
|
|
|
.size _start, . - _start
|
|
|
|
|
.type _start, function
|
|
|
|
|
.L_parking_loop:
|
|
|
|
|
wfe
|
|
|
|
|
|
|
|
|
|
diff -uNr 01_wait_forever/src/_arch/aarch64/cpu.rs 02_runtime_init/src/_arch/aarch64/cpu.rs
|
|
|
|
|
--- 01_wait_forever/src/_arch/aarch64/cpu.rs
|
|
|
|
|