diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2015-07-10 02:38:32 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-07-28 16:36:21 (GMT) |
commit | 013cf483c9d431e36d4ef2b854ee621cce51b8ce (patch) | |
tree | 513378f5f4dafc512599d43bc3e338a00dc52bd0 /arch/x86/include | |
parent | 66d10c18bf2c34698362b6fe1891bcc6e8755243 (diff) | |
download | u-boot-013cf483c9d431e36d4ef2b854ee621cce51b8ce.tar.xz |
x86: Display correct CS/EIP/EFLAGS when there is an error code
Some exceptions cause an error code to be saved on the current stack
after the EIP value. We should extract CS/EIP/EFLAGS from different
position on the stack based on the exception number.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/interrupt.h | 24 | ||||
-rw-r--r-- | arch/x86/include/asm/ptrace.h | 16 |
2 files changed, 37 insertions, 3 deletions
diff --git a/arch/x86/include/asm/interrupt.h b/arch/x86/include/asm/interrupt.h index 00cbe07..fcd766b 100644 --- a/arch/x86/include/asm/interrupt.h +++ b/arch/x86/include/asm/interrupt.h @@ -13,6 +13,30 @@ #include <asm/types.h> +/* Architecture defined exceptions */ +enum x86_exception { + EXC_DE = 0, + EXC_DB, + EXC_NMI, + EXC_BP, + EXC_OF, + EXC_BR, + EXC_UD, + EXC_NM, + EXC_DF, + EXC_CSO, + EXC_TS, + EXC_NP, + EXC_SS, + EXC_GP, + EXC_PF, + EXC_MF = 16, + EXC_AC, + EXC_MC, + EXC_XM, + EXC_VE +}; + /* arch/x86/cpu/interrupts.c */ void set_vector(u8 intnum, void *routine); diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index a727dbf..3849bc0 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h @@ -63,9 +63,19 @@ struct irq_regs { /* Pushed by vector handler (irq_<num>) */ long irq_id; /* Pushed by cpu in response to interrupt */ - long eip; - long xcs; - long eflags; + union { + struct { + long eip; + long xcs; + long eflags; + } ctx1; + struct { + long err; + long eip; + long xcs; + long eflags; + } ctx2; + } context; } __attribute__ ((packed)); /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |