[PATCH] x86-64: Avoid unnecessary double bouncing for swiotlb
[linux/fpc-iii.git] / include / asm-x86_64 / bug.h
blobeed785667289fa34b0e287ba7240db98ab9866d3
1 #ifndef __ASM_X8664_BUG_H
2 #define __ASM_X8664_BUG_H 1
4 #include <linux/stringify.h>
6 /*
7 * Tell the user there is some problem. The exception handler decodes
8 * this frame.
9 */
10 struct bug_frame {
11 unsigned char ud2[2];
12 unsigned char mov;
13 /* should use 32bit offset instead, but the assembler doesn't
14 like it */
15 char *filename;
16 unsigned char ret;
17 unsigned short line;
18 } __attribute__((packed));
20 #ifdef CONFIG_BUG
21 #define HAVE_ARCH_BUG
22 /* We turn the bug frame into valid instructions to not confuse
23 the disassembler. Thanks to Jan Beulich & Suresh Siddha
24 for nice instruction selection.
25 The magic numbers generate mov $64bitimm,%eax ; ret $offset. */
26 #define BUG() \
27 asm volatile( \
28 "ud2 ; .byte 0xa3 ; .quad %c1 ; .byte 0xc2 ; .short %c0" :: \
29 "i"(__LINE__), "i" (__stringify(__FILE__)))
30 void out_of_line_bug(void);
31 #else
32 static inline void out_of_line_bug(void) { }
33 #endif
35 #include <asm-generic/bug.h>
36 #endif