blob: 45dee286e45cda98bc1fe20e79c30ccded41ff5d [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
Srinivasa Dse8d3f452008-09-23 15:23:52 +05304#include <asm/debugreg.h>
5
Alexander van Heukelume407d6202008-09-30 18:41:36 +02006#ifdef CONFIG_X86_32
7#define dotraplinkage
8#else
9#define dotraplinkage asmlinkage
10#endif
11
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053012asmlinkage void divide_error(void);
13asmlinkage void debug(void);
14asmlinkage void nmi(void);
15asmlinkage void int3(void);
16asmlinkage void overflow(void);
17asmlinkage void bounds(void);
18asmlinkage void invalid_op(void);
19asmlinkage void device_not_available(void);
Alexander van Heukelume407d6202008-09-30 18:41:36 +020020#ifdef CONFIG_X86_64
21asmlinkage void double_fault(void);
22#endif
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053023asmlinkage void coprocessor_segment_overrun(void);
24asmlinkage void invalid_TSS(void);
25asmlinkage void segment_not_present(void);
26asmlinkage void stack_segment(void);
27asmlinkage void general_protection(void);
28asmlinkage void page_fault(void);
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053029asmlinkage void spurious_interrupt_bug(void);
Alexander van Heukelume407d6202008-09-30 18:41:36 +020030asmlinkage void coprocessor_error(void);
31asmlinkage void alignment_check(void);
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053032#ifdef CONFIG_X86_MCE
33asmlinkage void machine_check(void);
34#endif /* CONFIG_X86_MCE */
Alexander van Heukelume407d6202008-09-30 18:41:36 +020035asmlinkage void simd_coprocessor_error(void);
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053036
Alexander van Heukelume407d6202008-09-30 18:41:36 +020037dotraplinkage void do_divide_error(struct pt_regs *, long);
38dotraplinkage void do_debug(struct pt_regs *, long);
39dotraplinkage void do_nmi(struct pt_regs *, long);
40dotraplinkage void do_int3(struct pt_regs *, long);
41dotraplinkage void do_overflow(struct pt_regs *, long);
42dotraplinkage void do_bounds(struct pt_regs *, long);
43dotraplinkage void do_invalid_op(struct pt_regs *, long);
44dotraplinkage void do_device_not_available(struct pt_regs *, long);
45dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long);
46dotraplinkage void do_invalid_TSS(struct pt_regs *, long);
47dotraplinkage void do_segment_not_present(struct pt_regs *, long);
48dotraplinkage void do_stack_segment(struct pt_regs *, long);
49dotraplinkage void do_general_protection(struct pt_regs *, long);
50dotraplinkage void do_page_fault(struct pt_regs *, unsigned long);
51dotraplinkage void do_spurious_interrupt_bug(struct pt_regs *, long);
52dotraplinkage void do_coprocessor_error(struct pt_regs *, long);
53dotraplinkage void do_alignment_check(struct pt_regs *, long);
54#ifdef CONFIG_X86_MCE
55dotraplinkage void do_machine_check(struct pt_regs *, long);
56#endif
57dotraplinkage void do_simd_coprocessor_error(struct pt_regs *, long);
58#ifdef CONFIG_X86_32
59dotraplinkage void do_iret_error(struct pt_regs *, long);
60#endif
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053061
Srinivasa Dsda654b72008-09-23 15:23:52 +053062static inline int get_si_code(unsigned long condition)
63{
64 if (condition & DR_STEP)
65 return TRAP_TRACE;
66 else if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))
67 return TRAP_HWBKPT;
68 else
69 return TRAP_BRKPT;
70}
71
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053072extern int panic_on_unrecovered_nmi;
73extern int kstack_depth_to_print;
74
75#ifdef CONFIG_X86_32
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053076void math_error(void __user *);
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053077unsigned long patch_espfix_desc(unsigned long, unsigned long);
78asmlinkage void math_emulate(long);
Alexander van Heukelume407d6202008-09-30 18:41:36 +020079#endif
Jaswinder Singh6ac8d512008-07-15 21:09:13 +053080
H. Peter Anvin1965aae2008-10-22 22:26:29 -070081#endif /* _ASM_X86_TRAPS_H */