ARC: handle gcc generated __builtin_trap for older compiler
authorVineet Gupta <vgupta@synopsys.com>
Fri, 8 Dec 2017 16:45:57 +0000 (08:45 -0800)
committerVineet Gupta <vgupta@synopsys.com>
Wed, 3 Jan 2018 08:31:27 +0000 (00:31 -0800)
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.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/kernel/traps.c

index 004f4e4a4c10f6ca9390317f001228868331b4da..133a4dae41fe7d73b07b0d2365a899b943bc4779 100644 (file)
@@ -161,3 +161,11 @@ 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");
+}