1 /* SPDX-License-Identifier: GPL-2.0 */
6 #include <linux/stringify.h>
7 #include <linux/objtool.h>
9 #ifndef CONFIG_DEBUG_BUGVERBOSE
10 #define _BUGVERBOSE_LOCATION(file, line)
12 #define __BUGVERBOSE_LOCATION(file, line) \
13 .pushsection .rodata.str, "aMS", @progbits, 1; \
14 10002: .string file; \
19 #define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
22 #ifndef CONFIG_GENERIC_BUG
23 #define __BUG_ENTRY(flags)
25 #define __BUG_ENTRY(flags) \
26 .pushsection __bug_table, "aw"; \
28 10000: .long 10001f - .; \
29 _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
35 #define ASM_BUG_FLAGS(flags) \
39 #define ASM_BUG() ASM_BUG_FLAGS(0)
41 #define __BUG_FLAGS(flags, extra) \
42 asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)) \
45 #define __WARN_FLAGS(flags) \
47 instrumentation_begin(); \
48 __BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b));\
49 instrumentation_end(); \
54 instrumentation_begin(); \
61 #include <asm-generic/bug.h>
63 #endif /* __ASM_BUG_H */