bug.h 720 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __ASM_BUG_H
  2. #define __ASM_BUG_H
  3. #include <linux/compiler.h>
  4. #include <asm/sgidefs.h>
  5. #ifdef CONFIG_BUG
  6. #include <asm/break.h>
  7. static inline void __noreturn BUG(void)
  8. {
  9. __asm__ __volatile__("break %0" : : "i" (BRK_BUG));
  10. unreachable();
  11. }
  12. #define HAVE_ARCH_BUG
  13. #if (_MIPS_ISA > _MIPS_ISA_MIPS1)
  14. static inline void __BUG_ON(unsigned long condition)
  15. {
  16. if (__builtin_constant_p(condition)) {
  17. if (condition)
  18. BUG();
  19. else
  20. return;
  21. }
  22. __asm__ __volatile__("tne $0, %0, %1"
  23. : : "r" (condition), "i" (BRK_BUG));
  24. }
  25. #define BUG_ON(C) __BUG_ON((unsigned long)(C))
  26. #define HAVE_ARCH_BUG_ON
  27. #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
  28. #endif
  29. #include <asm-generic/bug.h>
  30. #endif /* __ASM_BUG_H */