diff options
Diffstat (limited to 'include/asm-x86/traps.h')
-rw-r--r-- | include/asm-x86/traps.h | 22 |
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 */ |
5 | asmlinkage void divide_error(void); | 7 | asmlinkage void divide_error(void); |
@@ -36,6 +38,16 @@ void do_invalid_op(struct pt_regs *, long); | |||
36 | void do_general_protection(struct pt_regs *, long); | 38 | void do_general_protection(struct pt_regs *, long); |
37 | void do_nmi(struct pt_regs *, long); | 39 | void do_nmi(struct pt_regs *, long); |
38 | 40 | ||
41 | static 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 | |||
39 | extern int panic_on_unrecovered_nmi; | 51 | extern int panic_on_unrecovered_nmi; |
40 | extern int kstack_depth_to_print; | 52 | extern int kstack_depth_to_print; |
41 | 53 | ||
@@ -51,6 +63,8 @@ void do_spurious_interrupt_bug(struct pt_regs *, long); | |||
51 | unsigned long patch_espfix_desc(unsigned long, unsigned long); | 63 | unsigned long patch_espfix_desc(unsigned long, unsigned long); |
52 | asmlinkage void math_emulate(long); | 64 | asmlinkage void math_emulate(long); |
53 | 65 | ||
66 | void do_page_fault(struct pt_regs *regs, unsigned long error_code); | ||
67 | |||
54 | #else /* CONFIG_X86_32 */ | 68 | #else /* CONFIG_X86_32 */ |
55 | 69 | ||
56 | asmlinkage void double_fault(void); | 70 | asmlinkage void double_fault(void); |
@@ -62,5 +76,7 @@ asmlinkage void do_coprocessor_error(struct pt_regs *); | |||
62 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *); | 76 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *); |
63 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *); | 77 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *); |
64 | 78 | ||
79 | asmlinkage 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 */ |