Go to the documentation of this file.
4 #include <linux/linkage.h>
6 #define TRAPA_BUG_OPCODE 0xc33e
7 #define BUGFLAG_UNWINDER (1 << 1)
9 #ifdef CONFIG_GENERIC_BUG
11 #define HAVE_ARCH_WARN_ON
25 #ifdef CONFIG_DEBUG_BUGVERBOSE
26 #define _EMIT_BUG_ENTRY \
27 "\t.pushsection __bug_table,\"a\"\n" \
28 "2:\t.long 1b, %O1\n" \
29 "\t.short %O2, %O3\n" \
33 #define _EMIT_BUG_ENTRY \
34 "\t.pushsection __bug_table,\"a\"\n" \
43 __asm__ __volatile__ ( \
47 : "n" (TRAPA_BUG_OPCODE), \
49 "i" (__LINE__), "i" (0), \
50 "i" (sizeof(struct bug_entry))); \
53 #define __WARN_TAINT(taint) \
55 __asm__ __volatile__ ( \
59 : "n" (TRAPA_BUG_OPCODE), \
62 "i" (BUGFLAG_TAINT(taint)), \
63 "i" (sizeof(struct bug_entry))); \
66 #define WARN_ON(x) ({ \
67 int __ret_warn_on = !!(x); \
68 if (__builtin_constant_p(__ret_warn_on)) { \
72 if (unlikely(__ret_warn_on)) \
75 unlikely(__ret_warn_on); \
78 #define UNWINDER_BUG() \
80 __asm__ __volatile__ ( \
84 : "n" (TRAPA_BUG_OPCODE), \
87 "i" (BUGFLAG_UNWINDER), \
88 "i" (sizeof(struct bug_entry))); \
91 #define UNWINDER_BUG_ON(x) ({ \
92 int __ret_unwinder_on = !!(x); \
93 if (__builtin_constant_p(__ret_unwinder_on)) { \
94 if (__ret_unwinder_on) \
97 if (unlikely(__ret_unwinder_on)) \
100 unlikely(__ret_unwinder_on); \
105 #define UNWINDER_BUG BUG
106 #define UNWINDER_BUG_ON BUG_ON