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,\"aw\"\n" \
32 "2:\t" ASM_WORD_INSN "1b, %c0\n" \
33 "\t.short %c1, %c2\n" \
36 : : "i" (__FILE__), "i" (__LINE__), \
37 "i" (0), "i" (sizeof(struct bug_entry)) ); \
44 asm volatile(PARISC_BUG_BREAK_ASM : : ); \
49 #ifdef CONFIG_DEBUG_BUGVERBOSE
50 #define __WARN_FLAGS(flags) \
53 "1:\t" PARISC_BUG_BREAK_ASM "\n" \
54 "\t.pushsection __bug_table,\"aw\"\n" \
55 "2:\t" ASM_WORD_INSN "1b, %c0\n" \
56 "\t.short %c1, %c2\n" \
59 : : "i" (__FILE__), "i" (__LINE__), \
60 "i" (BUGFLAG_WARNING|(flags)), \
61 "i" (sizeof(struct bug_entry)) ); \
64 #define __WARN_FLAGS(flags) \
67 "1:\t" PARISC_BUG_BREAK_ASM "\n" \
68 "\t.pushsection __bug_table,\"aw\"\n" \
69 "2:\t" ASM_WORD_INSN "1b\n" \
73 : : "i" (BUGFLAG_WARNING|(flags)), \
74 "i" (sizeof(struct bug_entry)) ); \
79 #define WARN_ON(x) ({ \
80 int __ret_warn_on = !!(x); \
81 if (__builtin_constant_p(__ret_warn_on)) { \
85 if (unlikely(__ret_warn_on)) \
88 unlikely(__ret_warn_on); \
93 #include <asm-generic/bug.h>