bug.h 653 B

1234567891011121314151617181920212223242526272829
  1. #ifndef __ASM_X8664_BUG_H
  2. #define __ASM_X8664_BUG_H 1
  3. #include <linux/stringify.h>
  4. /*
  5. * Tell the user there is some problem. The exception handler decodes
  6. * this frame.
  7. */
  8. struct bug_frame {
  9. unsigned char ud2[2];
  10. /* should use 32bit offset instead, but the assembler doesn't
  11. like it */
  12. char *filename;
  13. unsigned short line;
  14. } __attribute__((packed));
  15. #ifdef CONFIG_BUG
  16. #define HAVE_ARCH_BUG
  17. #define BUG() \
  18. asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \
  19. "i"(__LINE__), "i" (__stringify(__FILE__)))
  20. void out_of_line_bug(void);
  21. #else
  22. static inline void out_of_line_bug(void) { }
  23. #endif
  24. #include <asm-generic/bug.h>
  25. #endif