bug.h 919 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef __ASM_SH_BUG_H
  2. #define __ASM_SH_BUG_H
  3. #ifdef CONFIG_BUG
  4. struct bug_frame {
  5. unsigned short opcode;
  6. unsigned short line;
  7. const char *file;
  8. const char *func;
  9. };
  10. struct pt_regs;
  11. extern void handle_BUG(struct pt_regs *);
  12. #define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */
  13. #ifdef CONFIG_DEBUG_BUGVERBOSE
  14. #define BUG() \
  15. do { \
  16. __asm__ __volatile__ ( \
  17. ".align 2\n\t" \
  18. ".short %O0\n\t" \
  19. ".short %O1\n\t" \
  20. ".long %O2\n\t" \
  21. ".long %O3\n\t" \
  22. : \
  23. : "n" (TRAPA_BUG_OPCODE), \
  24. "i" (__LINE__), "X" (__FILE__), \
  25. "X" (__FUNCTION__)); \
  26. } while (0)
  27. #else
  28. #define BUG() \
  29. do { \
  30. __asm__ __volatile__ ( \
  31. ".align 2\n\t" \
  32. ".short %O0\n\t" \
  33. : \
  34. : "n" (TRAPA_BUG_OPCODE)); \
  35. } while (0)
  36. #endif /* CONFIG_DEBUG_BUGVERBOSE */
  37. #define HAVE_ARCH_BUG
  38. #endif /* CONFIG_BUG */
  39. #include <asm-generic/bug.h>
  40. #endif /* __ASM_SH_BUG_H */