[PATCH 2/2] ARC: handle gcc generated __builtin_trap for older compiler
Vineet Gupta
Vineet.Gupta1 at synopsys.com
Wed Dec 20 14:49:54 PST 2017
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 at 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
More information about the linux-snps-arc
mailing list