Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nicolas Pitre and committed by
Russell King
ee3eaee6 6042b8c7

+12
+4
arch/arm/boot/compressed/debug.S
··· 23 23 strb r0, [r1] 24 24 mov r0, #0x03 @ SYS_WRITEC 25 25 ARM( svc #0x123456 ) 26 + #ifdef CONFIG_CPU_V7M 27 + THUMB( bkpt #0xab ) 28 + #else 26 29 THUMB( svc #0xab ) 30 + #endif 27 31 mov pc, lr 28 32 .align 2 29 33 1: .word _GLOBAL_OFFSET_TABLE_ - .
+8
arch/arm/kernel/debug.S
··· 115 115 mov r1, r0 116 116 mov r0, #0x04 @ SYS_WRITE0 117 117 ARM( svc #0x123456 ) 118 + #ifdef CONFIG_CPU_V7M 119 + THUMB( bkpt #0xab ) 120 + #else 118 121 THUMB( svc #0xab ) 122 + #endif 119 123 ret lr 120 124 ENDPROC(printascii) 121 125 ··· 128 124 strb r0, [r1] 129 125 mov r0, #0x03 @ SYS_WRITEC 130 126 ARM( svc #0x123456 ) 127 + #ifdef CONFIG_CPU_V7M 128 + THUMB( bkpt #0xab ) 129 + #else 131 130 THUMB( svc #0xab ) 131 + #endif 132 132 ret lr 133 133 ENDPROC(printch) 134 134