Assembly: Use local label syntax for named labels

This prevents that they show up in the symbol table.
pull/115/head
Andre Richter 3 years ago
parent 5d6b68d710
commit 8c2cec00be
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -12,8 +12,9 @@
//------------------------------------------------------------------------------
_start:
// Infinitely wait for events (aka "park the core").
1: wfe
b 1b
.L_parking_loop:
wfe
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -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

@ -34,7 +34,7 @@ _start:
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.
@ -42,14 +42,14 @@ _start:
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
@ -58,9 +58,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -34,7 +34,7 @@ _start:
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.
@ -42,14 +42,14 @@ _start:
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
@ -58,9 +58,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -34,7 +34,7 @@ _start:
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.
@ -42,14 +42,14 @@ _start:
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
@ -58,9 +58,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -34,7 +34,7 @@ _start:
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.
@ -42,14 +42,14 @@ _start:
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
@ -58,9 +58,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -241,27 +241,27 @@ diff -uNr 05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.s 06_uart_chainloader/
+ ADR_ABS x0, __bss_start
+ ADR_ABS x1, __bss_end_exclusive
bss_init_loop:
.L_bss_init_loop:
cmp x0, x1
- b.eq prepare_rust
+ b.eq relocate_binary
- b.eq .L_prepare_rust
+ b.eq .L_relocate_binary
stp xzr, xzr, [x0], #16
b bss_init_loop
b .L_bss_init_loop
+ // Next, relocate the binary.
+relocate_binary:
+.L_relocate_binary:
+ ADR_REL x0, __binary_nonzero_start // The address the binary got loaded to.
+ ADR_ABS x1, __binary_nonzero_start // The address the binary was linked to.
+ ADR_ABS x2, __binary_nonzero_end_exclusive
+
+copy_loop:
+.L_copy_loop:
+ ldr x3, [x0], #8
+ str x3, [x1], #8
+ cmp x1, x2
+ b.lo copy_loop
+ b.lo .L_copy_loop
+
// Prepare the jump to Rust code.
-prepare_rust:
-.L_prepare_rust:
// Set the stack pointer.
- ADR_REL x0, __boot_core_stack_end_exclusive
+ ADR_ABS x0, __boot_core_stack_end_exclusive
@ -274,7 +274,7 @@ diff -uNr 05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.s 06_uart_chainloader/
+ br x1
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
diff -uNr 05_drivers_gpio_uart/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs 06_uart_chainloader/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs
--- 05_drivers_gpio_uart/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs

@ -45,7 +45,7 @@ _start:
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.
@ -53,23 +53,23 @@ _start:
ADR_ABS x0, __bss_start
ADR_ABS x1, __bss_end_exclusive
bss_init_loop:
.L_bss_init_loop:
cmp x0, x1
b.eq relocate_binary
b.eq .L_relocate_binary
stp xzr, xzr, [x0], #16
b bss_init_loop
b .L_bss_init_loop
// Next, relocate the binary.
relocate_binary:
.L_relocate_binary:
ADR_REL x0, __binary_nonzero_start // The address the binary got loaded to.
ADR_ABS x1, __binary_nonzero_start // The address the binary was linked to.
ADR_ABS x2, __binary_nonzero_end_exclusive
copy_loop:
.L_copy_loop:
ldr x3, [x0], #8
str x3, [x1], #8
cmp x1, x2
b.lo copy_loop
b.lo .L_copy_loop
// Prepare the jump to Rust code.
// Set the stack pointer.
@ -81,9 +81,9 @@ copy_loop:
br x1
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -163,27 +163,27 @@ diff -uNr 06_uart_chainloader/src/_arch/aarch64/cpu/boot.s 07_timestamps/src/_ar
+ ADR_REL x0, __bss_start
+ ADR_REL x1, __bss_end_exclusive
bss_init_loop:
.L_bss_init_loop:
cmp x0, x1
- b.eq relocate_binary
+ b.eq prepare_rust
- b.eq .L_relocate_binary
+ b.eq .L_prepare_rust
stp xzr, xzr, [x0], #16
b bss_init_loop
b .L_bss_init_loop
- // Next, relocate the binary.
-relocate_binary:
-.L_relocate_binary:
- ADR_REL x0, __binary_nonzero_start // The address the binary got loaded to.
- ADR_ABS x1, __binary_nonzero_start // The address the binary was linked to.
- ADR_ABS x2, __binary_nonzero_end_exclusive
-
-copy_loop:
-.L_copy_loop:
- ldr x3, [x0], #8
- str x3, [x1], #8
- cmp x1, x2
- b.lo copy_loop
- b.lo .L_copy_loop
-
// Prepare the jump to Rust code.
+prepare_rust:
+.L_prepare_rust:
// Set the stack pointer.
- ADR_ABS x0, __boot_core_stack_end_exclusive
+ ADR_REL x0, __boot_core_stack_end_exclusive
@ -196,7 +196,7 @@ diff -uNr 06_uart_chainloader/src/_arch/aarch64/cpu/boot.s 07_timestamps/src/_ar
+ b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
diff -uNr 06_uart_chainloader/src/_arch/aarch64/cpu.rs 07_timestamps/src/_arch/aarch64/cpu.rs
--- 06_uart_chainloader/src/_arch/aarch64/cpu.rs

@ -34,7 +34,7 @@ _start:
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.
@ -42,14 +42,14 @@ _start:
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
@ -58,9 +58,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -34,7 +34,7 @@ _start:
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.
@ -42,14 +42,14 @@ _start:
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
@ -58,9 +58,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -300,7 +300,7 @@ diff -uNr 08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.s 09_privilege_level/src/_
+ // Only proceed if the core executes in EL2. Park it otherwise.
+ mrs x0, CurrentEL
+ cmp x0, _EL2
+ b.ne parking_loop
+ b.ne .L_parking_loop
+
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
@ -308,7 +308,7 @@ diff -uNr 08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.s 09_privilege_level/src/_
@@ -50,11 +56,11 @@
// Prepare the jump to Rust code.
prepare_rust:
.L_prepare_rust:
- // Set the stack pointer.
+ // Set the stack pointer. This ensures that any code in EL2 that needs the stack will work.
ADR_REL x0, __boot_core_stack_end_exclusive

@ -33,14 +33,14 @@ _start:
// Only proceed if the core executes in EL2. Park it otherwise.
mrs x0, CurrentEL
cmp x0, _EL2
b.ne parking_loop
b.ne .L_parking_loop
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
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.
@ -48,14 +48,14 @@ _start:
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. This ensures that any code in EL2 that needs the stack will work.
ADR_REL x0, __boot_core_stack_end_exclusive
mov sp, x0
@ -64,9 +64,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -33,14 +33,14 @@ _start:
// Only proceed if the core executes in EL2. Park it otherwise.
mrs x0, CurrentEL
cmp x0, _EL2
b.ne parking_loop
b.ne .L_parking_loop
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
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.
@ -48,14 +48,14 @@ _start:
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. This ensures that any code in EL2 that needs the stack will work.
ADR_REL x0, __boot_core_stack_end_exclusive
mov sp, x0
@ -64,9 +64,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -33,14 +33,14 @@ _start:
// Only proceed if the core executes in EL2. Park it otherwise.
mrs x0, CurrentEL
cmp x0, _EL2
b.ne parking_loop
b.ne .L_parking_loop
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
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.
@ -48,14 +48,14 @@ _start:
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. This ensures that any code in EL2 that needs the stack will work.
ADR_REL x0, __boot_core_stack_end_exclusive
mov sp, x0
@ -64,9 +64,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -33,14 +33,14 @@ _start:
// Only proceed if the core executes in EL2. Park it otherwise.
mrs x0, CurrentEL
cmp x0, _EL2
b.ne parking_loop
b.ne .L_parking_loop
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
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.
@ -48,14 +48,14 @@ _start:
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. This ensures that any code in EL2 that needs the stack will work.
ADR_REL x0, __boot_core_stack_end_exclusive
mov sp, x0
@ -64,9 +64,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -33,14 +33,14 @@ _start:
// Only proceed if the core executes in EL2. Park it otherwise.
mrs x0, CurrentEL
cmp x0, _EL2
b.ne parking_loop
b.ne .L_parking_loop
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
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.
@ -48,14 +48,14 @@ _start:
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. This ensures that any code in EL2 that needs the stack will work.
ADR_REL x0, __boot_core_stack_end_exclusive
mov sp, x0
@ -64,9 +64,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -33,14 +33,14 @@ _start:
// Only proceed if the core executes in EL2. Park it otherwise.
mrs x0, CurrentEL
cmp x0, _EL2
b.ne parking_loop
b.ne .L_parking_loop
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
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.
@ -48,14 +48,14 @@ _start:
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. This ensures that any code in EL2 that needs the stack will work.
ADR_REL x0, __boot_core_stack_end_exclusive
mov sp, x0
@ -64,9 +64,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -832,7 +832,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.s 15_virtua
@@ -56,11 +56,14 @@
// Prepare the jump to Rust code.
prepare_rust:
.L_prepare_rust:
+ // Load the base address of the kernel's translation tables.
+ ldr x0, PHYS_KERNEL_TABLES_BASE_ADDR // provided by bsp/__board_name__/memory/mmu.rs
+

@ -33,14 +33,14 @@ _start:
// Only proceed if the core executes in EL2. Park it otherwise.
mrs x0, CurrentEL
cmp x0, _EL2
b.ne parking_loop
b.ne .L_parking_loop
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
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.
@ -48,14 +48,14 @@ _start:
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:
// Load the base address of the kernel's translation tables.
ldr x0, PHYS_KERNEL_TABLES_BASE_ADDR // provided by bsp/__board_name__/memory/mmu.rs
@ -67,9 +67,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -45,14 +45,14 @@ _start:
// Only proceed if the core executes in EL2. Park it otherwise.
mrs x0, CurrentEL
cmp x0, _EL2
b.ne parking_loop
b.ne .L_parking_loop
// Only proceed on the boot core. Park it otherwise.
mrs x1, MPIDR_EL1
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.
@ -60,14 +60,14 @@ _start:
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:
// Load the base address of the kernel's translation tables.
ldr x0, PHYS_KERNEL_TABLES_BASE_ADDR // provided by bsp/__board_name__/memory/mmu.rs
@ -91,9 +91,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

@ -34,7 +34,7 @@ _start:
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.
@ -42,14 +42,14 @@ _start:
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
@ -58,9 +58,9 @@ prepare_rust:
b _start_rust
// Infinitely wait for events (aka "park the core").
parking_loop:
.L_parking_loop:
wfe
b parking_loop
b .L_parking_loop
.size _start, . - _start
.type _start, function

Loading…
Cancel
Save