From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: semihosting: use proper instruction on v7m processors
Date: Sun, 1 Oct 2017 22:06:17 -0400 [thread overview]
Message-ID: <20171002020618.23924-3-nicolas.pitre@linaro.org> (raw)
In-Reply-To: <20171002020618.23924-1-nicolas.pitre@linaro.org>
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>
---
arch/arm/boot/compressed/debug.S | 4 ++++
arch/arm/kernel/debug.S | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/arch/arm/boot/compressed/debug.S b/arch/arm/boot/compressed/debug.S
index 5392ee6333..8f6e37177d 100644
--- a/arch/arm/boot/compressed/debug.S
+++ b/arch/arm/boot/compressed/debug.S
@@ -23,7 +23,11 @@ ENTRY(putc)
strb r0, [r1]
mov r0, #0x03 @ SYS_WRITEC
ARM( svc #0x123456 )
+#ifdef CONFIG_CPU_V7M
+ THUMB( bkpt #0xab )
+#else
THUMB( svc #0xab )
+#endif
mov pc, lr
.align 2
1: .word _GLOBAL_OFFSET_TABLE_ - .
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index 423f443258..35145b618c 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -121,7 +121,11 @@ ENTRY(printascii)
mov r1, r0
mov r0, #0x04 @ SYS_WRITE0
ARM( svc #0x123456 )
+#ifdef CONFIG_CPU_V7M
+ THUMB( bkpt #0xab )
+#else
THUMB( svc #0xab )
+#endif
ret lr
ENDPROC(printascii)
@@ -132,7 +136,11 @@ ENTRY(printch)
strb r0, [r1]
mov r0, #0x03 @ SYS_WRITEC
ARM( svc #0x123456 )
+#ifdef CONFIG_CPU_V7M
+ THUMB( bkpt #0xab )
+#else
THUMB( svc #0xab )
+#endif
ret lr
ENDPROC(printch)
--
2.9.5
next prev parent reply other threads:[~2017-10-02 2:06 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 2:06 [PATCH 0/3] a few debug_ll fixes and improvements Nicolas Pitre
2017-10-02 2:06 ` [PATCH 1/3] ARM: debug.S: move hexbuf to a writable section Nicolas Pitre
2017-10-02 2:06 ` Nicolas Pitre [this message]
2017-10-02 2:06 ` [PATCH 3/3] ARM: early_printk: use printascii() rather than printch() Nicolas Pitre
2017-10-02 5:20 ` Uwe Kleine-König
2017-10-02 14:09 ` Nicolas Pitre
2017-10-31 11:28 ` Chris Brandt
2017-10-31 16:22 ` Nicolas Pitre
2017-10-31 16:38 ` Robin Murphy
2017-10-31 17:06 ` Nicolas Pitre
2017-10-31 17:16 ` Russell King - ARM Linux
2017-10-31 17:48 ` Nicolas Pitre
2017-10-31 17:53 ` Russell King - ARM Linux
2017-10-31 18:15 ` Nicolas Pitre
2017-10-31 18:20 ` Russell King - ARM Linux
2017-10-31 18:35 ` Nicolas Pitre
2017-10-31 19:12 ` Chris Brandt
2017-10-31 19:28 ` Nicolas Pitre
2017-10-31 21:50 ` Russell King - ARM Linux
2017-10-31 23:35 ` Nicolas Pitre
2017-10-31 23:50 ` Russell King - ARM Linux
2017-11-02 0:09 ` Russell King - ARM Linux
2017-11-02 3:59 ` Nicolas Pitre
2017-11-02 4:16 ` Nicolas Pitre
2017-11-02 11:09 ` Russell King - ARM Linux
2017-11-02 15:12 ` Nicolas Pitre
2017-11-02 11:06 ` Chris Brandt
2017-11-02 11:20 ` Russell King - ARM Linux
2017-11-02 11:28 ` Chris Brandt
2017-11-02 13:04 ` Russell King - ARM Linux
2017-11-02 15:04 ` Nicolas Pitre
2017-11-02 15:18 ` Robin Murphy
2017-11-02 15:22 ` Russell King - ARM Linux
2017-11-02 15:25 ` Chris Brandt
2017-11-02 15:23 ` Chris Brandt
2017-11-02 15:35 ` Nicolas Pitre
2017-11-02 16:06 ` Nicolas Pitre
2017-11-02 16:38 ` Chris Brandt
2017-11-02 17:10 ` Russell King - ARM Linux
2017-11-02 17:20 ` Nicolas Pitre
2017-11-02 17:28 ` Chris Brandt
2017-11-02 18:29 ` Robin Murphy
2017-11-02 21:46 ` syntax unified, was " Nicolas Pitre
2017-11-02 15:48 ` Russell King - ARM Linux
2017-11-02 16:30 ` Chris Brandt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171002020618.23924-3-nicolas.pitre@linaro.org \
--to=nicolas.pitre@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).