summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/include/librm.h
diff options
context:
space:
mode:
authorMichael Brown2018-03-18 13:54:57 +0100
committerMichael Brown2018-03-18 13:59:34 +0100
commit89e31f8491895e6196d4ba56aee3809261aa6b89 (patch)
treef7104a5cdd168eedc241618211457f5104548e06 /src/arch/x86/include/librm.h
parent[intel] Add PCI_ROM entry for Intel i354 NIC (diff)
downloadipxe-89e31f8491895e6196d4ba56aee3809261aa6b89.tar.gz
ipxe-89e31f8491895e6196d4ba56aee3809261aa6b89.tar.xz
ipxe-89e31f8491895e6196d4ba56aee3809261aa6b89.zip
[librm] Add facility to provide register and stack dump for CPU exceptions
When DEBUG=librm_mgmt is enabled, intercept CPU exceptions and provide a register and stack dump, then drop to an emergency shell. Exiting from the shell will almost certainly not work, but this provides an opportunity to view the register and stack dump and carry out some basic debugging. Note that we can intercept only the first 8 CPU exceptions, since a PXE ROM is not permitted to rebase the PIC. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/include/librm.h')
-rw-r--r--src/arch/x86/include/librm.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/arch/x86/include/librm.h b/src/arch/x86/include/librm.h
index 311748be..597c65e6 100644
--- a/src/arch/x86/include/librm.h
+++ b/src/arch/x86/include/librm.h
@@ -376,6 +376,50 @@ struct interrupt_vector {
/** "jmp" instruction */
#define JMP_INSN 0xe9
+/** 32-bit interrupt wrapper stack frame */
+struct interrupt_frame32 {
+ uint32_t esp;
+ uint32_t ss;
+ uint32_t gs;
+ uint32_t fs;
+ uint32_t es;
+ uint32_t ds;
+ uint32_t ebp;
+ uint32_t edi;
+ uint32_t esi;
+ uint32_t edx;
+ uint32_t ecx;
+ uint32_t ebx;
+ uint32_t eax;
+ uint32_t eip;
+ uint32_t cs;
+ uint32_t eflags;
+} __attribute__ (( packed ));
+
+/** 64-bit interrupt wrapper stack frame */
+struct interrupt_frame64 {
+ uint64_t r15;
+ uint64_t r14;
+ uint64_t r13;
+ uint64_t r12;
+ uint64_t r11;
+ uint64_t r10;
+ uint64_t r9;
+ uint64_t r8;
+ uint64_t rbp;
+ uint64_t rdi;
+ uint64_t rsi;
+ uint64_t rdx;
+ uint64_t rcx;
+ uint64_t rbx;
+ uint64_t rax;
+ uint64_t rip;
+ uint64_t cs;
+ uint64_t rflags;
+ uint64_t rsp;
+ uint64_t ss;
+} __attribute__ (( packed ));
+
extern void set_interrupt_vector ( unsigned int intr, void *vector );
/** A page table */