bug.h 577 B

12345678910111213141516171819202122232425
  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. #define HAVE_ARCH_BUG
  16. #define BUG() \
  17. asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \
  18. "i"(__LINE__), "i" (__stringify(__FILE__)))
  19. void out_of_line_bug(void);
  20. #include <asm-generic/bug.h>
  21. #endif