bug.h 778 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /* Fool GCC into thinking the function doesn't return. */
  11. while (1)
  12. ;
  13. }
  14. #define HAVE_ARCH_BUG
  15. #if (_MIPS_ISA > _MIPS_ISA_MIPS1)
  16. static inline void __BUG_ON(unsigned long condition)
  17. {
  18. if (__builtin_constant_p(condition)) {
  19. if (condition)
  20. BUG();
  21. else
  22. return;
  23. }
  24. __asm__ __volatile__("tne $0, %0, %1"
  25. : : "r" (condition), "i" (BRK_BUG));
  26. }
  27. #define BUG_ON(C) __BUG_ON((unsigned long)(C))
  28. #define HAVE_ARCH_BUG_ON
  29. #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
  30. #endif
  31. #include <asm-generic/bug.h>
  32. #endif /* __ASM_BUG_H */