From 8c2cec00be2e158148cecb1ba4fe5330ffbbf93b Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Sun, 4 Jul 2021 15:50:46 +0200 Subject: [PATCH] Assembly: Use local label syntax for named labels This prevents that they show up in the symbol table. --- 01_wait_forever/src/_arch/aarch64/cpu/boot.s | 5 +++-- 02_runtime_init/README.md | 22 +++++++------------ 02_runtime_init/src/_arch/aarch64/cpu/boot.s | 14 ++++++------ .../src/_arch/aarch64/cpu/boot.s | 14 ++++++------ 04_safe_globals/src/_arch/aarch64/cpu/boot.s | 14 ++++++------ .../src/_arch/aarch64/cpu/boot.s | 14 ++++++------ 06_uart_chainloader/README.md | 18 +++++++-------- .../src/_arch/aarch64/cpu/boot.s | 18 +++++++-------- 07_timestamps/README.md | 18 +++++++-------- 07_timestamps/src/_arch/aarch64/cpu/boot.s | 14 ++++++------ 08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.s | 14 ++++++------ 09_privilege_level/README.md | 4 ++-- .../src/_arch/aarch64/cpu/boot.s | 16 +++++++------- .../src/_arch/aarch64/cpu/boot.s | 16 +++++++------- .../src/_arch/aarch64/cpu/boot.s | 16 +++++++------- .../src/_arch/aarch64/cpu/boot.s | 16 +++++++------- .../src/_arch/aarch64/cpu/boot.s | 16 +++++++------- .../src/_arch/aarch64/cpu/boot.s | 16 +++++++------- .../README.md | 2 +- .../src/_arch/aarch64/cpu/boot.s | 16 +++++++------- .../src/_arch/aarch64/cpu/boot.s | 16 +++++++------- X1_JTAG_boot/src/_arch/aarch64/cpu/boot.s | 14 ++++++------ 22 files changed, 154 insertions(+), 159 deletions(-) diff --git a/01_wait_forever/src/_arch/aarch64/cpu/boot.s b/01_wait_forever/src/_arch/aarch64/cpu/boot.s index fb05382c..a6d8ca56 100644 --- a/01_wait_forever/src/_arch/aarch64/cpu/boot.s +++ b/01_wait_forever/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/02_runtime_init/README.md b/02_runtime_init/README.md index 3dc0b3d3..044a2d09 100644 --- a/02_runtime_init/README.md +++ b/02_runtime_init/README.md @@ -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 diff --git a/02_runtime_init/src/_arch/aarch64/cpu/boot.s b/02_runtime_init/src/_arch/aarch64/cpu/boot.s index f4162c87..28bc1a70 100644 --- a/02_runtime_init/src/_arch/aarch64/cpu/boot.s +++ b/02_runtime_init/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/03_hacky_hello_world/src/_arch/aarch64/cpu/boot.s b/03_hacky_hello_world/src/_arch/aarch64/cpu/boot.s index f4162c87..28bc1a70 100644 --- a/03_hacky_hello_world/src/_arch/aarch64/cpu/boot.s +++ b/03_hacky_hello_world/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/04_safe_globals/src/_arch/aarch64/cpu/boot.s b/04_safe_globals/src/_arch/aarch64/cpu/boot.s index f4162c87..28bc1a70 100644 --- a/04_safe_globals/src/_arch/aarch64/cpu/boot.s +++ b/04_safe_globals/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.s b/05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.s index f4162c87..28bc1a70 100644 --- a/05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.s +++ b/05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/06_uart_chainloader/README.md b/06_uart_chainloader/README.md index 18741f04..a7239e8b 100644 --- a/06_uart_chainloader/README.md +++ b/06_uart_chainloader/README.md @@ -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 diff --git a/06_uart_chainloader/src/_arch/aarch64/cpu/boot.s b/06_uart_chainloader/src/_arch/aarch64/cpu/boot.s index c4ae4219..e88b1886 100644 --- a/06_uart_chainloader/src/_arch/aarch64/cpu/boot.s +++ b/06_uart_chainloader/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/07_timestamps/README.md b/07_timestamps/README.md index 25d08f84..cfaa65d5 100644 --- a/07_timestamps/README.md +++ b/07_timestamps/README.md @@ -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 diff --git a/07_timestamps/src/_arch/aarch64/cpu/boot.s b/07_timestamps/src/_arch/aarch64/cpu/boot.s index f4162c87..28bc1a70 100644 --- a/07_timestamps/src/_arch/aarch64/cpu/boot.s +++ b/07_timestamps/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.s b/08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.s index f4162c87..28bc1a70 100644 --- a/08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.s +++ b/08_hw_debug_JTAG/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/09_privilege_level/README.md b/09_privilege_level/README.md index 7b4c0d3c..42ad905e 100644 --- a/09_privilege_level/README.md +++ b/09_privilege_level/README.md @@ -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 diff --git a/09_privilege_level/src/_arch/aarch64/cpu/boot.s b/09_privilege_level/src/_arch/aarch64/cpu/boot.s index d1666919..fa1984d6 100644 --- a/09_privilege_level/src/_arch/aarch64/cpu/boot.s +++ b/09_privilege_level/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu/boot.s b/10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu/boot.s index d1666919..fa1984d6 100644 --- a/10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu/boot.s +++ b/10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/11_exceptions_part1_groundwork/src/_arch/aarch64/cpu/boot.s b/11_exceptions_part1_groundwork/src/_arch/aarch64/cpu/boot.s index d1666919..fa1984d6 100644 --- a/11_exceptions_part1_groundwork/src/_arch/aarch64/cpu/boot.s +++ b/11_exceptions_part1_groundwork/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/12_integrated_testing/src/_arch/aarch64/cpu/boot.s b/12_integrated_testing/src/_arch/aarch64/cpu/boot.s index d1666919..fa1984d6 100644 --- a/12_integrated_testing/src/_arch/aarch64/cpu/boot.s +++ b/12_integrated_testing/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/boot.s b/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/boot.s index d1666919..fa1984d6 100644 --- a/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/boot.s +++ b/13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.s b/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.s index d1666919..fa1984d6 100644 --- a/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.s +++ b/14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/15_virtual_mem_part3_precomputed_tables/README.md b/15_virtual_mem_part3_precomputed_tables/README.md index b06b222d..c04cb3d2 100644 --- a/15_virtual_mem_part3_precomputed_tables/README.md +++ b/15_virtual_mem_part3_precomputed_tables/README.md @@ -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 + diff --git a/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.s b/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.s index 9e7fc619..6b167d17 100644 --- a/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.s +++ b/15_virtual_mem_part3_precomputed_tables/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.s b/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.s index 32a5c3ff..d37b4623 100644 --- a/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.s +++ b/16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu/boot.s @@ -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 diff --git a/X1_JTAG_boot/src/_arch/aarch64/cpu/boot.s b/X1_JTAG_boot/src/_arch/aarch64/cpu/boot.s index f4162c87..28bc1a70 100644 --- a/X1_JTAG_boot/src/_arch/aarch64/cpu/boot.s +++ b/X1_JTAG_boot/src/_arch/aarch64/cpu/boot.s @@ -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