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 #if defined(CONFIG_64BIT)
21 #define ASM_WORD_INSN ".dword\t"
23 #define ASM_WORD_INSN ".word\t"
26 #ifdef CONFIG_DEBUG_BUGVERBOSE
30 "1:\t" PARISC_BUG_BREAK_ASM "\n" \
31 "\t.pushsection __bug_table,\"a\"\n" \
33 "2:\t" ASM_WORD_INSN "1b, %c0\n" \
35 "\t.blockz %3-2*%4-2*2\n" \
37 : : "i" (__FILE__), "i" (__LINE__), \
38 "i" (0), "i" (sizeof(struct bug_entry)), \
39 "i" (sizeof(long)) ); \
46 asm volatile(PARISC_BUG_BREAK_ASM : : ); \
51 #ifdef CONFIG_DEBUG_BUGVERBOSE
52 #define __WARN_FLAGS(flags) \
55 "1:\t" PARISC_BUG_BREAK_ASM "\n" \
56 "\t.pushsection __bug_table,\"a\"\n" \
58 "2:\t" ASM_WORD_INSN "1b, %c0\n" \
60 "\t.blockz %3-2*%4-2*2\n" \
62 : : "i" (__FILE__), "i" (__LINE__), \
63 "i" (BUGFLAG_WARNING|(flags)), \
64 "i" (sizeof(struct bug_entry)), \
65 "i" (sizeof(long)) ); \
68 #define __WARN_FLAGS(flags) \
71 "1:\t" PARISC_BUG_BREAK_ASM "\n" \
72 "\t.pushsection __bug_table,\"a\"\n" \
74 "2:\t" ASM_WORD_INSN "1b\n" \
76 "\t.blockz %1-%2-2\n" \
78 : : "i" (BUGFLAG_WARNING|(flags)), \
79 "i" (sizeof(struct bug_entry)), \
80 "i" (sizeof(long)) ); \
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>