0001
0002 #ifndef __ASM_BUG_H
0003 #define __ASM_BUG_H
0004
0005 #include <linux/compiler.h>
0006 #include <asm/sgidefs.h>
0007
0008 #ifdef CONFIG_BUG
0009
0010 #include <asm/break.h>
0011
0012 static inline void __noreturn BUG(void)
0013 {
0014 __asm__ __volatile__("break %0" : : "i" (BRK_BUG));
0015 unreachable();
0016 }
0017
0018 #define HAVE_ARCH_BUG
0019
0020 #if (_MIPS_ISA > _MIPS_ISA_MIPS1)
0021
0022 static inline void __BUG_ON(unsigned long condition)
0023 {
0024 if (__builtin_constant_p(condition)) {
0025 if (condition)
0026 BUG();
0027 else
0028 return;
0029 }
0030 __asm__ __volatile__("tne $0, %0, %1"
0031 : : "r" (condition), "i" (BRK_BUG));
0032 }
0033
0034 #define BUG_ON(C) __BUG_ON((unsigned long)(C))
0035
0036 #define HAVE_ARCH_BUG_ON
0037
0038 #endif
0039
0040 #endif
0041
0042 #include <asm-generic/bug.h>
0043
0044 #endif