1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_S390_BUG_H
3 #define _ASM_S390_BUG_H
5 #include <linux/kernel.h>
9 #ifdef CONFIG_DEBUG_BUGVERBOSE
11 #define __EMIT_BUG(x) do { \
12 asm_inline volatile( \
14 ".section .rodata.str,\"aMS\",@progbits,1\n" \
15 "1: .asciz \""__FILE__"\"\n" \
17 ".section __bug_table,\"awM\",@progbits,%2\n" \
18 "2: .long 0b-2b,1b-2b\n" \
24 "i" (sizeof(struct bug_entry))); \
27 #else /* CONFIG_DEBUG_BUGVERBOSE */
29 #define __EMIT_BUG(x) do { \
30 asm_inline volatile( \
32 ".section __bug_table,\"awM\",@progbits,%1\n" \
38 "i" (sizeof(struct bug_entry))); \
41 #endif /* CONFIG_DEBUG_BUGVERBOSE */
48 #define __WARN_FLAGS(flags) do { \
49 __EMIT_BUG(BUGFLAG_WARNING|(flags)); \
52 #define WARN_ON(x) ({ \
53 int __ret_warn_on = !!(x); \
54 if (__builtin_constant_p(__ret_warn_on)) { \
58 if (unlikely(__ret_warn_on)) \
61 unlikely(__ret_warn_on); \
65 #define HAVE_ARCH_WARN_ON
66 #endif /* CONFIG_BUG */
68 #include <asm-generic/bug.h>
70 #endif /* _ASM_S390_BUG_H */