2007-04-27 22:01:42 +08:00
|
|
|
#ifndef _ASM_S390_BUG_H
|
|
|
|
#define _ASM_S390_BUG_H
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
|
2005-05-01 23:59:01 +08:00
|
|
|
#ifdef CONFIG_BUG
|
2006-03-24 19:15:16 +08:00
|
|
|
|
2007-04-27 22:01:42 +08:00
|
|
|
#ifdef CONFIG_64BIT
|
|
|
|
#define S390_LONG ".quad"
|
2006-07-12 22:39:42 +08:00
|
|
|
#else
|
2007-04-27 22:01:42 +08:00
|
|
|
#define S390_LONG ".long"
|
2006-07-12 22:39:42 +08:00
|
|
|
#endif
|
|
|
|
|
2007-04-27 22:01:42 +08:00
|
|
|
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
|
|
|
|
|
|
|
#define __EMIT_BUG(x) do { \
|
|
|
|
asm volatile( \
|
|
|
|
"0: j 0b+2\n" \
|
|
|
|
"1:\n" \
|
|
|
|
".section .rodata.str,\"aMS\",@progbits,1\n" \
|
|
|
|
"2: .asciz \""__FILE__"\"\n" \
|
|
|
|
".previous\n" \
|
|
|
|
".section __bug_table,\"a\"\n" \
|
|
|
|
"3:\t" S390_LONG "\t1b,2b\n" \
|
|
|
|
" .short %0,%1\n" \
|
|
|
|
" .org 3b+%2\n" \
|
|
|
|
".previous\n" \
|
|
|
|
: : "i" (__LINE__), \
|
|
|
|
"i" (x), \
|
|
|
|
"i" (sizeof(struct bug_entry))); \
|
2005-04-17 06:20:36 +08:00
|
|
|
} while (0)
|
|
|
|
|
2007-04-27 22:01:42 +08:00
|
|
|
#else /* CONFIG_DEBUG_BUGVERBOSE */
|
|
|
|
|
|
|
|
#define __EMIT_BUG(x) do { \
|
|
|
|
asm volatile( \
|
|
|
|
"0: j 0b+2\n" \
|
|
|
|
"1:\n" \
|
|
|
|
".section __bug_table,\"a\"\n" \
|
|
|
|
"2:\t" S390_LONG "\t1b\n" \
|
|
|
|
" .short %0\n" \
|
|
|
|
" .org 2b+%1\n" \
|
|
|
|
".previous\n" \
|
|
|
|
: : "i" (x), \
|
|
|
|
"i" (sizeof(struct bug_entry))); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#endif /* CONFIG_DEBUG_BUGVERBOSE */
|
|
|
|
|
|
|
|
#define BUG() __EMIT_BUG(0)
|
|
|
|
|
|
|
|
#define WARN_ON(x) ({ \
|
|
|
|
typeof(x) __ret_warn_on = (x); \
|
|
|
|
if (__builtin_constant_p(__ret_warn_on)) { \
|
|
|
|
if (__ret_warn_on) \
|
|
|
|
__EMIT_BUG(BUGFLAG_WARNING); \
|
|
|
|
} else { \
|
|
|
|
if (unlikely(__ret_warn_on)) \
|
|
|
|
__EMIT_BUG(BUGFLAG_WARNING); \
|
|
|
|
} \
|
|
|
|
unlikely(__ret_warn_on); \
|
|
|
|
})
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#define HAVE_ARCH_BUG
|
2007-04-27 22:01:42 +08:00
|
|
|
#define HAVE_ARCH_WARN_ON
|
|
|
|
#endif /* CONFIG_BUG */
|
2005-05-01 23:59:01 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm-generic/bug.h>
|
|
|
|
|
2007-04-27 22:01:42 +08:00
|
|
|
#endif /* _ASM_S390_BUG_H */
|