Skip to content

Commit 8c2cec0

Browse files
committed
Assembly: Use local label syntax for named labels
This prevents that they show up in the symbol table.
1 parent 5d6b68d commit 8c2cec0

File tree

22 files changed

+154
-159
lines changed
  • 01_wait_forever/src/_arch/aarch64/cpu
  • 02_runtime_init
  • 03_hacky_hello_world/src/_arch/aarch64/cpu
  • 04_safe_globals/src/_arch/aarch64/cpu
  • 05_drivers_gpio_uart/src/_arch/aarch64/cpu
  • 06_uart_chainloader
  • 07_timestamps
  • 08_hw_debug_JTAG/src/_arch/aarch64/cpu
  • 09_privilege_level
  • 10_virtual_mem_part1_identity_mapping/src/_arch/aarch64/cpu
  • 11_exceptions_part1_groundwork/src/_arch/aarch64/cpu
  • 12_integrated_testing/src/_arch/aarch64/cpu
  • 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu
  • 14_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu
  • 15_virtual_mem_part3_precomputed_tables
  • 16_virtual_mem_part4_higher_half_kernel/src/_arch/aarch64/cpu
  • X1_JTAG_boot/src/_arch/aarch64/cpu

22 files changed

+154
-159
lines changed

01_wait_forever/src/_arch/aarch64/cpu/boot.s

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
//------------------------------------------------------------------------------
1313
_start:
1414
// Infinitely wait for events (aka "park the core").
15-
1: wfe
16-
b 1b
15+
.L_parking_loop:
16+
wfe
17+
b .L_parking_loop
1718

1819
.size _start, . - _start
1920
.type _start, function

02_runtime_init/README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu/boot.s 02_runtime_init/src/_arch
110110
// Public Code
111111
//--------------------------------------------------------------------------------------------------
112112
.section .text._start
113-
@@ -11,9 +29,38 @@
113+
@@ -11,6 +29,34 @@
114114
// fn _start()
115115
//------------------------------------------------------------------------------
116116
_start:
@@ -119,22 +119,22 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu/boot.s 02_runtime_init/src/_arch
119119
+ and x1, x1, _core_id_mask
120120
+ ldr x2, BOOT_CORE_ID // provided by bsp/__board_name__/cpu.rs
121121
+ cmp x1, x2
122-
+ b.ne parking_loop
122+
+ b.ne .L_parking_loop
123123
+
124124
+ // If execution reaches here, it is the boot core.
125125
+
126126
+ // Initialize DRAM.
127127
+ ADR_REL x0, __bss_start
128128
+ ADR_REL x1, __bss_end_exclusive
129129
+
130-
+bss_init_loop:
130+
+.L_bss_init_loop:
131131
+ cmp x0, x1
132-
+ b.eq prepare_rust
132+
+ b.eq .L_prepare_rust
133133
+ stp xzr, xzr, [x0], #16
134-
+ b bss_init_loop
134+
+ b .L_bss_init_loop
135135
+
136136
+ // Prepare the jump to Rust code.
137-
+prepare_rust:
137+
+.L_prepare_rust:
138138
+ // Set the stack pointer.
139139
+ ADR_REL x0, __boot_core_stack_end_exclusive
140140
+ mov sp, x0
@@ -143,14 +143,8 @@ diff -uNr 01_wait_forever/src/_arch/aarch64/cpu/boot.s 02_runtime_init/src/_arch
143143
+ b _start_rust
144144
+
145145
// Infinitely wait for events (aka "park the core").
146-
-1: wfe
147-
- b 1b
148-
+parking_loop:
149-
+ wfe
150-
+ b parking_loop
151-
152-
.size _start, . - _start
153-
.type _start, function
146+
.L_parking_loop:
147+
wfe
154148

155149
diff -uNr 01_wait_forever/src/_arch/aarch64/cpu.rs 02_runtime_init/src/_arch/aarch64/cpu.rs
156150
--- 01_wait_forever/src/_arch/aarch64/cpu.rs

02_runtime_init/src/_arch/aarch64/cpu/boot.s

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ _start:
3434
and x1, x1, _core_id_mask
3535
ldr x2, BOOT_CORE_ID // provided by bsp/__board_name__/cpu.rs
3636
cmp x1, x2
37-
b.ne parking_loop
37+
b.ne .L_parking_loop
3838

3939
// If execution reaches here, it is the boot core.
4040

4141
// Initialize DRAM.
4242
ADR_REL x0, __bss_start
4343
ADR_REL x1, __bss_end_exclusive
4444

45-
bss_init_loop:
45+
.L_bss_init_loop:
4646
cmp x0, x1
47-
b.eq prepare_rust
47+
b.eq .L_prepare_rust
4848
stp xzr, xzr, [x0], #16
49-
b bss_init_loop
49+
b .L_bss_init_loop
5050

5151
// Prepare the jump to Rust code.
52-
prepare_rust:
52+
.L_prepare_rust:
5353
// Set the stack pointer.
5454
ADR_REL x0, __boot_core_stack_end_exclusive
5555
mov sp, x0
@@ -58,9 +58,9 @@ prepare_rust:
5858
b _start_rust
5959

6060
// Infinitely wait for events (aka "park the core").
61-
parking_loop:
61+
.L_parking_loop:
6262
wfe
63-
b parking_loop
63+
b .L_parking_loop
6464

6565
.size _start, . - _start
6666
.type _start, function

03_hacky_hello_world/src/_arch/aarch64/cpu/boot.s

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ _start:
3434
and x1, x1, _core_id_mask
3535
ldr x2, BOOT_CORE_ID // provided by bsp/__board_name__/cpu.rs
3636
cmp x1, x2
37-
b.ne parking_loop
37+
b.ne .L_parking_loop
3838

3939
// If execution reaches here, it is the boot core.
4040

4141
// Initialize DRAM.
4242
ADR_REL x0, __bss_start
4343
ADR_REL x1, __bss_end_exclusive
4444

45-
bss_init_loop:
45+
.L_bss_init_loop:
4646
cmp x0, x1
47-
b.eq prepare_rust
47+
b.eq .L_prepare_rust
4848
stp xzr, xzr, [x0], #16
49-
b bss_init_loop
49+
b .L_bss_init_loop
5050

5151
// Prepare the jump to Rust code.
52-
prepare_rust:
52+
.L_prepare_rust:
5353
// Set the stack pointer.
5454
ADR_REL x0, __boot_core_stack_end_exclusive
5555
mov sp, x0
@@ -58,9 +58,9 @@ prepare_rust:
5858
b _start_rust
5959

6060
// Infinitely wait for events (aka "park the core").
61-
parking_loop:
61+
.L_parking_loop:
6262
wfe
63-
b parking_loop
63+
b .L_parking_loop
6464

6565
.size _start, . - _start
6666
.type _start, function

04_safe_globals/src/_arch/aarch64/cpu/boot.s

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ _start:
3434
and x1, x1, _core_id_mask
3535
ldr x2, BOOT_CORE_ID // provided by bsp/__board_name__/cpu.rs
3636
cmp x1, x2
37-
b.ne parking_loop
37+
b.ne .L_parking_loop
3838

3939
// If execution reaches here, it is the boot core.
4040

4141
// Initialize DRAM.
4242
ADR_REL x0, __bss_start
4343
ADR_REL x1, __bss_end_exclusive
4444

45-
bss_init_loop:
45+
.L_bss_init_loop:
4646
cmp x0, x1
47-
b.eq prepare_rust
47+
b.eq .L_prepare_rust
4848
stp xzr, xzr, [x0], #16
49-
b bss_init_loop
49+
b .L_bss_init_loop
5050

5151
// Prepare the jump to Rust code.
52-
prepare_rust:
52+
.L_prepare_rust:
5353
// Set the stack pointer.
5454
ADR_REL x0, __boot_core_stack_end_exclusive
5555
mov sp, x0
@@ -58,9 +58,9 @@ prepare_rust:
5858
b _start_rust
5959

6060
// Infinitely wait for events (aka "park the core").
61-
parking_loop:
61+
.L_parking_loop:
6262
wfe
63-
b parking_loop
63+
b .L_parking_loop
6464

6565
.size _start, . - _start
6666
.type _start, function

05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.s

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ _start:
3434
and x1, x1, _core_id_mask
3535
ldr x2, BOOT_CORE_ID // provided by bsp/__board_name__/cpu.rs
3636
cmp x1, x2
37-
b.ne parking_loop
37+
b.ne .L_parking_loop
3838

3939
// If execution reaches here, it is the boot core.
4040

4141
// Initialize DRAM.
4242
ADR_REL x0, __bss_start
4343
ADR_REL x1, __bss_end_exclusive
4444

45-
bss_init_loop:
45+
.L_bss_init_loop:
4646
cmp x0, x1
47-
b.eq prepare_rust
47+
b.eq .L_prepare_rust
4848
stp xzr, xzr, [x0], #16
49-
b bss_init_loop
49+
b .L_bss_init_loop
5050

5151
// Prepare the jump to Rust code.
52-
prepare_rust:
52+
.L_prepare_rust:
5353
// Set the stack pointer.
5454
ADR_REL x0, __boot_core_stack_end_exclusive
5555
mov sp, x0
@@ -58,9 +58,9 @@ prepare_rust:
5858
b _start_rust
5959

6060
// Infinitely wait for events (aka "park the core").
61-
parking_loop:
61+
.L_parking_loop:
6262
wfe
63-
b parking_loop
63+
b .L_parking_loop
6464

6565
.size _start, . - _start
6666
.type _start, function

06_uart_chainloader/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,27 +241,27 @@ diff -uNr 05_drivers_gpio_uart/src/_arch/aarch64/cpu/boot.s 06_uart_chainloader/
241241
+ ADR_ABS x0, __bss_start
242242
+ ADR_ABS x1, __bss_end_exclusive
243243

244-
bss_init_loop:
244+
.L_bss_init_loop:
245245
cmp x0, x1
246-
- b.eq prepare_rust
247-
+ b.eq relocate_binary
246+
- b.eq .L_prepare_rust
247+
+ b.eq .L_relocate_binary
248248
stp xzr, xzr, [x0], #16
249-
b bss_init_loop
249+
b .L_bss_init_loop
250250

251251
+ // Next, relocate the binary.
252-
+relocate_binary:
252+
+.L_relocate_binary:
253253
+ ADR_REL x0, __binary_nonzero_start // The address the binary got loaded to.
254254
+ ADR_ABS x1, __binary_nonzero_start // The address the binary was linked to.
255255
+ ADR_ABS x2, __binary_nonzero_end_exclusive
256256
+
257-
+copy_loop:
257+
+.L_copy_loop:
258258
+ ldr x3, [x0], #8
259259
+ str x3, [x1], #8
260260
+ cmp x1, x2
261-
+ b.lo copy_loop
261+
+ b.lo .L_copy_loop
262262
+
263263
// Prepare the jump to Rust code.
264-
-prepare_rust:
264+
-.L_prepare_rust:
265265
// Set the stack pointer.
266266
- ADR_REL x0, __boot_core_stack_end_exclusive
267267
+ 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/
274274
+ br x1
275275

276276
// Infinitely wait for events (aka "park the core").
277-
parking_loop:
277+
.L_parking_loop:
278278

279279
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
280280
--- 05_drivers_gpio_uart/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs

06_uart_chainloader/src/_arch/aarch64/cpu/boot.s

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,31 @@ _start:
4545
and x1, x1, _core_id_mask
4646
ldr x2, BOOT_CORE_ID // provided by bsp/__board_name__/cpu.rs
4747
cmp x1, x2
48-
b.ne parking_loop
48+
b.ne .L_parking_loop
4949

5050
// If execution reaches here, it is the boot core.
5151

5252
// Initialize DRAM.
5353
ADR_ABS x0, __bss_start
5454
ADR_ABS x1, __bss_end_exclusive
5555

56-
bss_init_loop:
56+
.L_bss_init_loop:
5757
cmp x0, x1
58-
b.eq relocate_binary
58+
b.eq .L_relocate_binary
5959
stp xzr, xzr, [x0], #16
60-
b bss_init_loop
60+
b .L_bss_init_loop
6161

6262
// Next, relocate the binary.
63-
relocate_binary:
63+
.L_relocate_binary:
6464
ADR_REL x0, __binary_nonzero_start // The address the binary got loaded to.
6565
ADR_ABS x1, __binary_nonzero_start // The address the binary was linked to.
6666
ADR_ABS x2, __binary_nonzero_end_exclusive
6767

68-
copy_loop:
68+
.L_copy_loop:
6969
ldr x3, [x0], #8
7070
str x3, [x1], #8
7171
cmp x1, x2
72-
b.lo copy_loop
72+
b.lo .L_copy_loop
7373

7474
// Prepare the jump to Rust code.
7575
// Set the stack pointer.
@@ -81,9 +81,9 @@ copy_loop:
8181
br x1
8282

8383
// Infinitely wait for events (aka "park the core").
84-
parking_loop:
84+
.L_parking_loop:
8585
wfe
86-
b parking_loop
86+
b .L_parking_loop
8787

8888
.size _start, . - _start
8989
.type _start, function

07_timestamps/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,27 +163,27 @@ diff -uNr 06_uart_chainloader/src/_arch/aarch64/cpu/boot.s 07_timestamps/src/_ar
163163
+ ADR_REL x0, __bss_start
164164
+ ADR_REL x1, __bss_end_exclusive
165165

166-
bss_init_loop:
166+
.L_bss_init_loop:
167167
cmp x0, x1
168-
- b.eq relocate_binary
169-
+ b.eq prepare_rust
168+
- b.eq .L_relocate_binary
169+
+ b.eq .L_prepare_rust
170170
stp xzr, xzr, [x0], #16
171-
b bss_init_loop
171+
b .L_bss_init_loop
172172

173173
- // Next, relocate the binary.
174-
-relocate_binary:
174+
-.L_relocate_binary:
175175
- ADR_REL x0, __binary_nonzero_start // The address the binary got loaded to.
176176
- ADR_ABS x1, __binary_nonzero_start // The address the binary was linked to.
177177
- ADR_ABS x2, __binary_nonzero_end_exclusive
178178
-
179-
-copy_loop:
179+
-.L_copy_loop:
180180
- ldr x3, [x0], #8
181181
- str x3, [x1], #8
182182
- cmp x1, x2
183-
- b.lo copy_loop
183+
- b.lo .L_copy_loop
184184
-
185185
// Prepare the jump to Rust code.
186-
+prepare_rust:
186+
+.L_prepare_rust:
187187
// Set the stack pointer.
188188
- ADR_ABS x0, __boot_core_stack_end_exclusive
189189
+ 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
196196
+ b _start_rust
197197

198198
// Infinitely wait for events (aka "park the core").
199-
parking_loop:
199+
.L_parking_loop:
200200

201201
diff -uNr 06_uart_chainloader/src/_arch/aarch64/cpu.rs 07_timestamps/src/_arch/aarch64/cpu.rs
202202
--- 06_uart_chainloader/src/_arch/aarch64/cpu.rs

0 commit comments

Comments
 (0)