[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1513810194-8377-3-git-send-email-vgupta@synopsys.com>
Date: Wed, 20 Dec 2017 14:49:54 -0800
From: Vineet Gupta <Vineet.Gupta1@...opsys.com>
To: <linux-snps-arc@...ts.infradead.org>
CC: <linux-kernel@...r.kernel.org>, Arnd Bergmann <arnd@...db.de>,
"Vineet Gupta" <Vineet.Gupta1@...opsys.com>
Subject: [PATCH 2/2] ARC: handle gcc generated __builtin_trap for older compiler
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@...opsys.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
Powered by blists - more mailing lists