1 /* SPDX-License-Identifier: GPL-2.0 */
6 #include <linux/stringify.h>
8 #ifndef CONFIG_DEBUG_BUGVERBOSE
9 #define _BUGVERBOSE_LOCATION(file, line)
11 #define __BUGVERBOSE_LOCATION(file, line) \
12 .pushsection .rodata.str, "aMS", @progbits, 1; \
13 10002: .string file; \
18 #define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
21 #ifndef CONFIG_GENERIC_BUG
22 #define __BUG_ENTRY(flags)
24 #define __BUG_ENTRY(flags) \
25 .pushsection __bug_table, "aw"; \
27 10000: .long 10001f - .; \
28 _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
34 #define ASM_BUG_FLAGS(flags) \
38 #define ASM_BUG() ASM_BUG_FLAGS(0)
40 #define __BUG_FLAGS(flags) \
41 asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags)));
43 #define __WARN_FLAGS(flags) \
45 instrumentation_begin(); \
46 __BUG_FLAGS(BUGFLAG_WARNING|(flags)); \
47 annotate_reachable(); \
48 instrumentation_end(); \
53 instrumentation_begin(); \
60 #include <asm-generic/bug.h>
62 #endif /* __ASM_BUG_H */