bug.h 721 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _SPARC_BUG_H
  2. #define _SPARC_BUG_H
  3. /* Only use the inline asm until a gcc release that can handle __builtin_trap
  4. * -rob 2003-06-25
  5. *
  6. * gcc-3.3.1 and later will be OK -DaveM
  7. */
  8. #if (__GNUC__ > 3) || \
  9. (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \
  10. (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
  11. #define __bug_trap() __builtin_trap()
  12. #else
  13. #define __bug_trap() \
  14. __asm__ __volatile__ ("t 0x5\n\t" : : )
  15. #endif
  16. #ifdef CONFIG_DEBUG_BUGVERBOSE
  17. extern void do_BUG(const char *file, int line);
  18. #define BUG() do { \
  19. do_BUG(__FILE__, __LINE__); \
  20. __bug_trap(); \
  21. } while (0)
  22. #else
  23. #define BUG() __bug_trap()
  24. #endif
  25. #define HAVE_ARCH_BUG
  26. #include <asm-generic/bug.h>
  27. #endif