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.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asm-x86/traps.h b/include/asm-x86/traps.h
index 2ccebc6fb0b0..7a692baa51ae 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 */
5asmlinkage void divide_error(void); 7asmlinkage void divide_error(void);
6asmlinkage void debug(void); 8asmlinkage void debug(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