blob: 2bae0a513b40ebbcfd23a621c82a0365a4cb5062 [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_TRAPS_H
2#define _ASM_X86_TRAPS_H
Jaswinder Singh6ac8d512008-07-15 21:09:13 +05303
Andy Lutomirski5cec93c2011-06-05 13:50:24 -04004#include <linux/kprobes.h>
5
Srinivasa Dse8d3f452008-09-23 15:23:52 +05306#include <asm/debugreg.h>
Ingo Molnara2bcd472009-03-29 23:47:48 +02007#include <asm/siginfo.h> /* TRAP_TRACE, ... */
Srinivasa Dse8d3f452008-09-23 15:23:52 +05308
Alexander van Heukelume407d6202008-09-30 18:41:36 +02009#ifdef CONFIG_X86_32
10#define dotraplinkage
11#else
12#define dotraplinkage asmlinkage
13#endif
14
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053015asmlinkage void divide_error(void);
16asmlinkage void debug(void);
17asmlinkage void nmi(void);
18asmlinkage void int3(void);
Jeremy Fitzhardinge6cac5a92009-03-29 19:56:29 -070019asmlinkage void xen_debug(void);
20asmlinkage void xen_int3(void);
21asmlinkage void xen_stack_segment(void);
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053022asmlinkage void overflow(void);
23asmlinkage void bounds(void);
24asmlinkage void invalid_op(void);
25asmlinkage void device_not_available(void);
Alexander van Heukelume407d6202008-09-30 18:41:36 +020026#ifdef CONFIG_X86_64
27asmlinkage void double_fault(void);
28#endif
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053029asmlinkage void coprocessor_segment_overrun(void);
30asmlinkage void invalid_TSS(void);
31asmlinkage void segment_not_present(void);
32asmlinkage void stack_segment(void);
33asmlinkage void general_protection(void);
34asmlinkage void page_fault(void);
Gleb Natapov631bc482010-10-14 11:22:52 +020035asmlinkage void async_page_fault(void);
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053036asmlinkage void spurious_interrupt_bug(void);
Alexander van Heukelume407d6202008-09-30 18:41:36 +020037asmlinkage void coprocessor_error(void);
38asmlinkage void alignment_check(void);
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053039#ifdef CONFIG_X86_MCE
40asmlinkage void machine_check(void);
41#endif /* CONFIG_X86_MCE */
Alexander van Heukelume407d6202008-09-30 18:41:36 +020042asmlinkage void simd_coprocessor_error(void);
Andy Lutomirski5cec93c2011-06-05 13:50:24 -040043asmlinkage void emulate_vsyscall(void);
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053044
Alexander van Heukelume407d6202008-09-30 18:41:36 +020045dotraplinkage void do_divide_error(struct pt_regs *, long);
46dotraplinkage void do_debug(struct pt_regs *, long);
47dotraplinkage void do_nmi(struct pt_regs *, long);
48dotraplinkage void do_int3(struct pt_regs *, long);
49dotraplinkage void do_overflow(struct pt_regs *, long);
50dotraplinkage void do_bounds(struct pt_regs *, long);
51dotraplinkage void do_invalid_op(struct pt_regs *, long);
Brian Gerstaa78bcf2009-02-10 09:51:45 -050052dotraplinkage void do_device_not_available(struct pt_regs *, long);
Alexander van Heukelume407d6202008-09-30 18:41:36 +020053dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long);
54dotraplinkage void do_invalid_TSS(struct pt_regs *, long);
55dotraplinkage void do_segment_not_present(struct pt_regs *, long);
56dotraplinkage void do_stack_segment(struct pt_regs *, long);
Jaswinder Singhd1769d52008-12-19 00:03:56 +053057#ifdef CONFIG_X86_64
58dotraplinkage void do_double_fault(struct pt_regs *, long);
59asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *);
60#endif
Alexander van Heukelume407d6202008-09-30 18:41:36 +020061dotraplinkage void do_general_protection(struct pt_regs *, long);
62dotraplinkage void do_page_fault(struct pt_regs *, unsigned long);
63dotraplinkage void do_spurious_interrupt_bug(struct pt_regs *, long);
64dotraplinkage void do_coprocessor_error(struct pt_regs *, long);
65dotraplinkage void do_alignment_check(struct pt_regs *, long);
66#ifdef CONFIG_X86_MCE
67dotraplinkage void do_machine_check(struct pt_regs *, long);
68#endif
69dotraplinkage void do_simd_coprocessor_error(struct pt_regs *, long);
Andy Lutomirski5cec93c2011-06-05 13:50:24 -040070dotraplinkage void do_emulate_vsyscall(struct pt_regs *, long);
Alexander van Heukelume407d6202008-09-30 18:41:36 +020071#ifdef CONFIG_X86_32
72dotraplinkage void do_iret_error(struct pt_regs *, long);
73#endif
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053074
Srinivasa Dsda654b72008-09-23 15:23:52 +053075static inline int get_si_code(unsigned long condition)
76{
77 if (condition & DR_STEP)
78 return TRAP_TRACE;
79 else if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))
80 return TRAP_HWBKPT;
81 else
82 return TRAP_BRKPT;
83}
84
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053085extern int panic_on_unrecovered_nmi;
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053086
Brian Gerst9b6dba92010-03-21 09:00:44 -040087void math_error(struct pt_regs *, int, int);
Tejun Heod3157602009-02-09 22:17:39 +090088void math_emulate(struct math_emu_info *);
Akinobu Mitafde03122009-07-19 00:09:56 +090089#ifndef CONFIG_X86_32
Jaswinder Singhd1769d52008-12-19 00:03:56 +053090asmlinkage void smp_thermal_interrupt(void);
91asmlinkage void mce_threshold_interrupt(void);
Alexander van Heukelume407d6202008-09-30 18:41:36 +020092#endif
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053093
H. Peter Anvin1965aae2008-10-22 22:26:29 -070094#endif /* _ASM_X86_TRAPS_H */