From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: <linux-snps-arc@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de>,
"Vineet Gupta" <Vineet.Gupta1@synopsys.com>
Subject: [PATCH 2/2] ARC: handle gcc generated __builtin_trap for older compiler
Date: Wed, 20 Dec 2017 14:49:54 -0800 [thread overview]
Message-ID: <1513810194-8377-3-git-send-email-vgupta@synopsys.com> (raw)
In-Reply-To: <1513810194-8377-1-git-send-email-vgupta@synopsys.com>
ARC gcc prior to GNU 2018.03 release didn't have a target specific
__builtin_trap() implementation, generating default abort() call.
Implement the abort() call - emulating what newer gcc does for the same,
as suggested by Arnd.
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
arch/arc/kernel/traps.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arc/kernel/traps.c b/arch/arc/kernel/traps.c
index 004f4e4a4c10..51a55b06cb2a 100644
--- a/arch/arc/kernel/traps.c
+++ b/arch/arc/kernel/traps.c
@@ -161,3 +161,12 @@ void do_insterror_or_kprobe(unsigned long address, struct pt_regs *regs)
insterror_is_error(address, regs);
}
+
+/*
+ * abort() call generated by older gcc for __builtin_trap()
+ */
+void abort(void)
+{
+ __asm__ __volatile__("trap_s 5\n");
+}
+EXPORT_SYMBOL(abort);
--
2.7.4
next prev parent reply other threads:[~2017-12-20 22:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 22:49 [PATCH 0/2] ARC __builtin_trap handling Vineet Gupta
2017-12-20 22:49 ` [PATCH 1/2] ARC: handle gcc generated __builtin_trap() Vineet Gupta
2017-12-20 22:49 ` Vineet Gupta [this message]
2017-12-21 8:09 ` [PATCH 2/2] ARC: handle gcc generated __builtin_trap for older compiler Arnd Bergmann
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=1513810194-8377-3-git-send-email-vgupta@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@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).