Skip to content

Commit 5261680

Browse files
ithinuelkartben
authored andcommitted
arch: arm: cortex_m: use local label in ASM code
Regular label are exported in the object file and cause gdb to consider them as function start. Local labels on the other hand are not exported. For example, using `disassemble z_arm_pendsv` after this change will disassemble the whole function rather than stop at the first branch. Signed-off-by: Wilfried Chauveau <[email protected]>
1 parent ecaa303 commit 5261680

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

arch/arm/core/cortex_m/pm_s2ram.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_resume)
221221
bl pm_s2ram_mark_check_and_clear
222222
mov lr, r1
223223
cmp r0, #0x1
224-
beq resume
224+
beq .L_resume
225225
bx lr
226226

227-
resume:
227+
.L_resume:
228228
/*
229229
* Restore the CPU context
230230
*/

arch/arm/core/cortex_m/swap_helper.S

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ SECTION_FUNC(TEXT, z_arm_pendsv)
9898
#ifdef CONFIG_FPU_SHARING
9999
/* Assess whether switched-out thread had been using the FP registers. */
100100
tst lr, #_EXC_RETURN_FTYPE_Msk
101-
bne out_fp_endif
101+
bne .L_out_fp_endif
102102

103103
/* FP context active: set FP state and store callee-saved registers.
104104
* Note: if Lazy FP stacking is enabled, storing the callee-saved
@@ -108,7 +108,7 @@ SECTION_FUNC(TEXT, z_arm_pendsv)
108108
add r0, r2, #_thread_offset_to_preempt_float
109109
vstmia r0, {s16-s31}
110110

111-
out_fp_endif:
111+
.L_out_fp_endif:
112112
/* At this point FPCCR.LSPACT is guaranteed to be cleared,
113113
* regardless of whether the thread has an active FP context.
114114
*/
@@ -204,9 +204,9 @@ out_fp_endif:
204204
* were enabled before irq_lock was called.
205205
*/
206206
cmp r0, #0
207-
bne _thread_irq_disabled
207+
bne .L_thread_irq_disabled
208208
cpsie i
209-
_thread_irq_disabled:
209+
.L_thread_irq_disabled:
210210

211211
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
212212
/* Re-program dynamic memory map */
@@ -259,25 +259,25 @@ _thread_irq_disabled:
259259
#ifdef CONFIG_FPU_SHARING
260260
/* Assess whether switched-in thread had been using the FP registers. */
261261
tst lr, #_EXC_RETURN_FTYPE_Msk
262-
beq in_fp_active
262+
beq .L_in_fp_active
263263
/* FP context inactive for swapped-in thread:
264264
* - reset FPSCR to 0
265265
* - set EXC_RETURN.F_Type (prevents FP frame un-stacking when returning
266266
* from pendSV)
267267
*/
268268
movs.n r3, #0
269269
vmsr fpscr, r3
270-
b in_fp_endif
270+
b .L_in_fp_endif
271271

272-
in_fp_active:
272+
.L_in_fp_active:
273273
/* FP context active:
274274
* - clear EXC_RETURN.F_Type
275275
* - FPSCR and caller-saved registers will be restored automatically
276276
* - restore callee-saved FP registers
277277
*/
278278
add r0, r2, #_thread_offset_to_preempt_float
279279
vldmia r0, {s16-s31}
280-
in_fp_endif:
280+
.L_in_fp_endif:
281281
/* Clear CONTROL.FPCA that may have been set by FP instructions */
282282
mrs r3, CONTROL
283283
bic r3, #_CONTROL_FPCA_Msk
@@ -361,12 +361,12 @@ SECTION_FUNC(TEXT, z_arm_svc)
361361
movs r0, #_EXC_RETURN_SPSEL_Msk
362362
mov r1, lr
363363
tst r1, r0
364-
beq _stack_frame_msp
364+
beq .L_stack_frame_msp
365365
mrs r0, PSP
366-
bne _stack_frame_endif
367-
_stack_frame_msp:
366+
bne .L_stack_frame_endif
367+
.L_stack_frame_msp:
368368
mrs r0, MSP
369-
_stack_frame_endif:
369+
.L_stack_frame_endif:
370370
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
371371
tst lr, #_EXC_RETURN_SPSEL_Msk /* did we come from thread mode ? */
372372
ite eq /* if zero (equal), came from handler mode */
@@ -399,7 +399,7 @@ _stack_frame_endif:
399399
mrs r2, CONTROL
400400

401401
cmp r1, #3
402-
beq _do_syscall
402+
beq .L_do_syscall
403403

404404
/*
405405
* check that we are privileged before invoking other SVCs
@@ -411,12 +411,12 @@ _stack_frame_endif:
411411
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
412412
tst r2, #0x1
413413
#endif
414-
bne _oops
414+
bne .L_oops
415415

416416
#endif /* CONFIG_USERSPACE */
417417

418418
cmp r1, #2
419-
beq _oops
419+
beq .L_oops
420420

421421
#if defined(CONFIG_IRQ_OFFLOAD)
422422
push {r0, lr}
@@ -434,7 +434,7 @@ _stack_frame_endif:
434434

435435
#endif
436436

437-
_oops:
437+
.L_oops:
438438
push {r0, lr}
439439
#if defined(CONFIG_EXTRA_EXCEPTION_INFO)
440440
#if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
@@ -484,7 +484,7 @@ _oops:
484484
* r6 - call_id
485485
* r8 - saved link register
486486
*/
487-
_do_syscall:
487+
.L_do_syscall:
488488
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
489489
movs r3, #24
490490
ldr r1, [r0, r3] /* grab address of PC from stack frame */
@@ -510,15 +510,15 @@ _do_syscall:
510510
/* The supplied syscall_id must be lower than the limit
511511
* (Requires unsigned integer comparison)
512512
*/
513-
blo valid_syscall_id
513+
blo .L_valid_syscall_id
514514

515515
/* bad syscall id. Set arg1 to bad id and set call_id to SYSCALL_BAD */
516516
str r6, [r0]
517517
ldr r6, =K_SYSCALL_BAD
518518

519519
/* Bad syscalls treated as valid syscalls with ID K_SYSCALL_BAD. */
520520

521-
valid_syscall_id:
521+
.L_valid_syscall_id:
522522
ldr r0, =_kernel
523523
ldr r0, [r0, #_kernel_offset_to_current]
524524
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)

0 commit comments

Comments
 (0)