bug.h 825 字节
Newer Older
H
H. Peter Anvin 已提交
1 2
#ifndef _ASM_X86_BUG_H
#define _ASM_X86_BUG_H
3 4 5 6 7 8

#ifdef CONFIG_BUG
#define HAVE_ARCH_BUG

#ifdef CONFIG_DEBUG_BUGVERBOSE

9
#ifdef CONFIG_X86_32
10
# define __BUG_C0	"2:\t.long 1b, %c0\n"
11
#else
12
# define __BUG_C0	"2:\t.long 1b - 2b, %c0 - 2b\n"
13 14
#endif

15 16 17 18 19 20 21 22 23 24
#define BUG()							\
do {								\
	asm volatile("1:\tud2\n"				\
		     ".pushsection __bug_table,\"a\"\n"		\
		     __BUG_C0					\
		     "\t.word %c1, 0\n"				\
		     "\t.org 2b+%c2\n"				\
		     ".popsection"				\
		     : : "i" (__FILE__), "i" (__LINE__),	\
		     "i" (sizeof(struct bug_entry)));		\
25
	unreachable();						\
26
} while (0)
27 28

#else
29 30 31
#define BUG()							\
do {								\
	asm volatile("ud2");					\
32
	unreachable();						\
33
} while (0)
34 35 36 37 38
#endif

#endif /* !CONFIG_BUG */

#include <asm-generic/bug.h>
39 40 41 42


extern void show_regs_common(void);

H
H. Peter Anvin 已提交
43
#endif /* _ASM_X86_BUG_H */