aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/traps.h
diff options
context:
space:
mode:
authorSrinivasa Ds <srinivasa@in.ibm.com>2008-09-23 05:53:52 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-23 07:26:52 -0400
commitda654b74bda14c45a7d98c731bf3c1a43b6b74e2 (patch)
treee3cc6f1a1f7300c07e59c9091cd2ede0c5da8d4d /include/asm-x86/traps.h
parent101d5b713700b902b1c200cdd1925c3cb7d34567 (diff)
signals: demultiplexing SIGTRAP signal
Currently a SIGTRAP can denote any one of below reasons. - Breakpoint hit - H/W debug register hit - Single step - Signal sent through kill() or rasie() Architectures like powerpc/parisc provides infrastructure to demultiplex SIGTRAP signal by passing down the information for receiving SIGTRAP through si_code of siginfot_t structure. Here is an attempt is generalise this infrastructure by extending it to x86 and x86_64 archs. Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com> Cc: Roland McGrath <roland@redhat.com> Cc: akpm@linux-foundation.org Cc: paulus@samba.org Cc: linuxppc-dev@ozlabs.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/traps.h')
-rw-r--r--include/asm-x86/traps.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-x86/traps.h b/include/asm-x86/traps.h
index 2ccebc6fb0b0..4b1e90409251 100644
--- a/include/asm-x86/traps.h
+++ b/include/asm-x86/traps.h
@@ -36,6 +36,16 @@ void do_invalid_op(struct pt_regs *, long);
36void do_general_protection(struct pt_regs *, long); 36void do_general_protection(struct pt_regs *, long);
37void do_nmi(struct pt_regs *, long); 37void do_nmi(struct pt_regs *, long);
38 38
39static inline int get_si_code(unsigned long condition)
40{
41 if (condition & DR_STEP)
42 return TRAP_TRACE;
43 else if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))
44 return TRAP_HWBKPT;
45 else
46 return TRAP_BRKPT;
47}
48
39extern int panic_on_unrecovered_nmi; 49extern int panic_on_unrecovered_nmi;
40extern int kstack_depth_to_print; 50extern int kstack_depth_to_print;
41 51