1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/kernel.h> /* for BUGFLAG_TAINT */
8 * Tell the user there is some problem.
9 * The offending file and line are encoded in the __bug_table section.
14 #define HAVE_ARCH_WARN_ON
16 /* the break instruction is used as BUG() marker. */
17 #define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff"
18 #define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */
20 #ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
21 # define __BUG_REL(val) ".word " __stringify(val) " - ."
23 # define __BUG_REL(val) ".word " __stringify(val)
27 #ifdef CONFIG_DEBUG_BUGVERBOSE
31 "1:\t" PARISC_BUG_BREAK_ASM "\n" \
32 "\t.pushsection __bug_table,\"a\"\n" \
34 "2:\t" __BUG_REL(1b) "\n" \
35 "\t" __BUG_REL(%c0) "\n" \
37 "\t.blockz %3-2*4-2*2\n" \
39 : : "i" (__FILE__), "i" (__LINE__), \
40 "i" (0), "i" (sizeof(struct bug_entry)) ); \
47 asm volatile(PARISC_BUG_BREAK_ASM : : ); \
52 #ifdef CONFIG_DEBUG_BUGVERBOSE
53 #define __WARN_FLAGS(flags) \
56 "1:\t" PARISC_BUG_BREAK_ASM "\n" \
57 "\t.pushsection __bug_table,\"a\"\n" \
59 "2:\t" __BUG_REL(1b) "\n" \
60 "\t" __BUG_REL(%c0) "\n" \
62 "\t.blockz %3-2*4-2*2\n" \
64 : : "i" (__FILE__), "i" (__LINE__), \
65 "i" (BUGFLAG_WARNING|(flags)), \
66 "i" (sizeof(struct bug_entry)) ); \
69 #define __WARN_FLAGS(flags) \
72 "1:\t" PARISC_BUG_BREAK_ASM "\n" \
73 "\t.pushsection __bug_table,\"a\"\n" \
75 "2:\t" __BUG_REL(1b) "\n" \
77 "\t.blockz %1-4-2\n" \
79 : : "i" (BUGFLAG_WARNING|(flags)), \
80 "i" (sizeof(struct bug_entry)) ); \
85 #define WARN_ON(x) ({ \
86 int __ret_warn_on = !!(x); \
87 if (__builtin_constant_p(__ret_warn_on)) { \
91 if (unlikely(__ret_warn_on)) \
94 unlikely(__ret_warn_on); \
99 #include <asm-generic/bug.h>