aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/traps.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/traps.h')
-rw-r--r--include/asm-x86/traps.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/include/asm-x86/traps.h b/include/asm-x86/traps.h
index a4b65a71bd66..7a692baa51ae 100644
--- a/include/asm-x86/traps.h
+++ b/include/asm-x86/traps.h
@@ -1,5 +1,7 @@
1#ifndef _ASM_X86_TRAPS_H 1#ifndef ASM_X86__TRAPS_H
2#define _ASM_X86_TRAPS_H 2#define ASM_X86__TRAPS_H
3
4#include <asm/debugreg.h>
3 5
4/* Common in X86_32 and X86_64 */ 6/* Common in X86_32 and X86_64 */
5asmlinkage void divide_error(void); 7asmlinkage void divide_error(void);
@@ -36,6 +38,16 @@ void do_invalid_op(struct pt_regs *, long);
36void do_general_protection(struct pt_regs *, long); 38void do_general_protection(struct pt_regs *, long);
37void do_nmi(struct pt_regs *, long); 39void do_nmi(struct pt_regs *, long);
38 40
41static inline int get_si_code(unsigned long condition)
42{
43 if (condition & DR_STEP)
44 return TRAP_TRACE;
45 else if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))
46 return TRAP_HWBKPT;
47 else
48 return TRAP_BRKPT;
49}
50
39extern int panic_on_unrecovered_nmi; 51extern int panic_on_unrecovered_nmi;
40extern int kstack_depth_to_print; 52extern int kstack_depth_to_print;
41 53
@@ -51,6 +63,8 @@ void do_spurious_interrupt_bug(struct pt_regs *, long);
51unsigned long patch_espfix_desc(unsigned long, unsigned long); 63unsigned long patch_espfix_desc(unsigned long, unsigned long);
52asmlinkage void math_emulate(long); 64asmlinkage void math_emulate(long);
53 65
66void do_page_fault(struct pt_regs *regs, unsigned long error_code);
67
54#else /* CONFIG_X86_32 */ 68#else /* CONFIG_X86_32 */
55 69
56asmlinkage void double_fault(void); 70asmlinkage void double_fault(void);
@@ -62,5 +76,7 @@ asmlinkage void do_coprocessor_error(struct pt_regs *);
62asmlinkage void do_simd_coprocessor_error(struct pt_regs *); 76asmlinkage void do_simd_coprocessor_error(struct pt_regs *);
63asmlinkage void do_spurious_interrupt_bug(struct pt_regs *); 77asmlinkage void do_spurious_interrupt_bug(struct pt_regs *);
64 78
79asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code);
80
65#endif /* CONFIG_X86_32 */ 81#endif /* CONFIG_X86_32 */
66#endif /* _ASM_X86_TRAPS_H */ 82#endif /* ASM_X86__TRAPS_H */