Skip to content

Commit fd44146

Browse files
fabiobaltierikartben
authored andcommitted
drivers: dp: rework the ARM delay loop
Rework the ARM delay loop to avoid it causing assembler issue in the rest of the code. Link: #90211 (comment) Suggested-by: Mathieu Choplain <[email protected]> Signed-off-by: Fabio Baltieri <[email protected]>
1 parent 6aa8f3f commit fd44146

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/dp/swdp_ll_pin.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ static ALWAYS_INLINE void pin_delay_asm(uint32_t delay)
1212
{
1313
#if defined(CONFIG_CPU_CORTEX_M)
1414
__asm volatile (".syntax unified\n"
15-
"movs r3, %[p]\n"
1615
".start_%=:\n"
17-
"subs r3, #1\n"
16+
"subs %0, #1\n"
1817
"bne .start_%=\n"
18+
: "+l" (delay)
1919
:
20-
: [p] "r" (delay)
21-
: "r3", "cc"
20+
: "cc"
2221
);
2322
#else
2423
#warning "Pin delay is not defined"

0 commit comments

Comments
 (0)