4 #define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */
8 #define HAVE_ARCH_WARN_ON
15 * %4 - sizeof(struct bug_entry)
17 * The trapa opcode itself sits in %0.
18 * The %O notation is used to avoid # generation.
20 * The offending file and line are encoded in the __bug_table section.
22 #ifdef CONFIG_DEBUG_BUGVERBOSE
23 #define _EMIT_BUG_ENTRY \
24 "\t.pushsection __bug_table,\"a\"\n" \
25 "2:\t.long 1b, %O1\n" \
26 "\t.short %O2, %O3\n" \
30 #define _EMIT_BUG_ENTRY \
31 "\t.pushsection __bug_table,\"a\"\n" \
40 __asm__ __volatile__ ( \
44 : "n" (TRAPA_BUG_OPCODE), \
46 "i" (__LINE__), "i" (0), \
47 "i" (sizeof(struct bug_entry))); \
52 __asm__ __volatile__ ( \
56 : "n" (TRAPA_BUG_OPCODE), \
59 "i" (BUGFLAG_WARNING), \
60 "i" (sizeof(struct bug_entry))); \
63 #define WARN_ON(x) ({ \
64 int __ret_warn_on = !!(x); \
65 if (__builtin_constant_p(__ret_warn_on)) { \
69 if (unlikely(__ret_warn_on)) \
72 unlikely(__ret_warn_on); \
77 /* arch/sh/kernel/traps.c */
78 void handle_BUG(struct pt_regs
*);
80 #endif /* CONFIG_BUG */
82 #include <asm-generic/bug.h>
84 #endif /* __ASM_SH_BUG_H */