bug.h 750 B

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