bug.h 825 B

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