Skip to content

Commit ee3eaee

Browse files
Nicolas PitreRussell King
authored andcommitted
ARM: 8704/1: semihosting: use proper instruction on v7m processors
The svc instruction doesn't exist on v7m processors. Semihosting ops are invoked with the bkpt instruction instead. Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
1 parent 6042b8c commit ee3eaee

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

arch/arm/boot/compressed/debug.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ ENTRY(putc)
2323
strb r0, [r1]
2424
mov r0, #0x03 @ SYS_WRITEC
2525
ARM( svc #0x123456 )
26+
#ifdef CONFIG_CPU_V7M
27+
THUMB( bkpt #0xab )
28+
#else
2629
THUMB( svc #0xab )
30+
#endif
2731
mov pc, lr
2832
.align 2
2933
1: .word _GLOBAL_OFFSET_TABLE_ - .

arch/arm/kernel/debug.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ ENTRY(printascii)
115115
mov r1, r0
116116
mov r0, #0x04 @ SYS_WRITE0
117117
ARM( svc #0x123456 )
118+
#ifdef CONFIG_CPU_V7M
119+
THUMB( bkpt #0xab )
120+
#else
118121
THUMB( svc #0xab )
122+
#endif
119123
ret lr
120124
ENDPROC(printascii)
121125

@@ -124,7 +128,11 @@ ENTRY(printch)
124128
strb r0, [r1]
125129
mov r0, #0x03 @ SYS_WRITEC
126130
ARM( svc #0x123456 )
131+
#ifdef CONFIG_CPU_V7M
132+
THUMB( bkpt #0xab )
133+
#else
127134
THUMB( svc #0xab )
135+
#endif
128136
ret lr
129137
ENDPROC(printch)
130138

0 commit comments

Comments
 (0)