bug.h 743 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _ASM_X86_BUG_H
  2. #define _ASM_X86_BUG_H
  3. #define HAVE_ARCH_BUG
  4. #ifdef CONFIG_DEBUG_BUGVERBOSE
  5. #ifdef CONFIG_X86_32
  6. # define __BUG_C0 "2:\t.long 1b, %c0\n"
  7. #else
  8. # define __BUG_C0 "2:\t.long 1b - 2b, %c0 - 2b\n"
  9. #endif
  10. #define BUG() \
  11. do { \
  12. asm volatile("1:\tud2\n" \
  13. ".pushsection __bug_table,\"a\"\n" \
  14. __BUG_C0 \
  15. "\t.word %c1, 0\n" \
  16. "\t.org 2b+%c2\n" \
  17. ".popsection" \
  18. : : "i" (__FILE__), "i" (__LINE__), \
  19. "i" (sizeof(struct bug_entry))); \
  20. unreachable(); \
  21. } while (0)
  22. #else
  23. #define BUG() \
  24. do { \
  25. asm volatile("ud2"); \
  26. unreachable(); \
  27. } while (0)
  28. #endif
  29. #include <asm-generic/bug.h>
  30. #endif /* _ASM_X86_BUG_H */