diff options
Diffstat (limited to 'include/asm-x86/traps.h')
-rw-r--r-- | include/asm-x86/traps.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asm-x86/traps.h b/include/asm-x86/traps.h index 2ccebc6fb0b..7a692baa51a 100644 --- a/include/asm-x86/traps.h +++ b/include/asm-x86/traps.h | |||
@@ -1,6 +1,8 @@ | |||
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 | 3 | ||
4 | #include <asm/debugreg.h> | ||
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); |
6 | asmlinkage void debug(void); | 8 | asmlinkage void debug(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 | ||