Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / asm-x86_64 / bug.h
CommitLineData
1da177e4
LT
1#ifndef __ASM_X8664_BUG_H
2#define __ASM_X8664_BUG_H 1
3
4#include <linux/stringify.h>
5
6/*
7 * Tell the user there is some problem. The exception handler decodes
8 * this frame.
9 */
10struct bug_frame {
b6a68a16 11 unsigned char ud2[2];
049cdefe
JB
12 unsigned char push;
13 signed int filename;
b6a68a16 14 unsigned char ret;
1da177e4
LT
15 unsigned short line;
16} __attribute__((packed));
17
c8538a7a 18#ifdef CONFIG_BUG
1da177e4 19#define HAVE_ARCH_BUG
b6a68a16
AK
20/* We turn the bug frame into valid instructions to not confuse
21 the disassembler. Thanks to Jan Beulich & Suresh Siddha
22 for nice instruction selection.
23 The magic numbers generate mov $64bitimm,%eax ; ret $offset. */
24#define BUG() \
25 asm volatile( \
049cdefe
JB
26 "ud2 ; pushq $%c1 ; ret $%c0" :: \
27 "i"(__LINE__), "i" (__FILE__))
1da177e4 28void out_of_line_bug(void);
4f60fdf6
AN
29#else
30static inline void out_of_line_bug(void) { }
c8538a7a 31#endif
1da177e4 32
c8538a7a 33#include <asm-generic/bug.h>
1da177e4 34#endif