summaryrefslogtreecommitdiff
path: root/src/arch/x86/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/include')
-rw-r--r--src/arch/x86/include/arch/registers.h59
1 files changed, 49 insertions, 10 deletions
diff --git a/src/arch/x86/include/arch/registers.h b/src/arch/x86/include/arch/registers.h
index 256053c9b0..5f8f9becd3 100644
--- a/src/arch/x86/include/arch/registers.h
+++ b/src/arch/x86/include/arch/registers.h
@@ -6,7 +6,7 @@
#if !defined(__ASSEMBLER__)
#include <stdint.h>
-#define DOWNTO8(A) \
+#define LONG_DOWNTO8(A) \
union { \
struct { \
union { \
@@ -21,7 +21,7 @@
uint32_t e##A##x; \
} __packed;
-#define DOWNTO16(A) \
+#define LONG_DOWNTO16(A) \
union { \
struct { \
uint16_t A; \
@@ -30,21 +30,60 @@
uint32_t e##A; \
} __packed;
+#define QUAD_DOWNTO8(A) \
+ union { \
+ LONG_DOWNTO8(A) \
+ uint64_t r##A##x; \
+ } __packed
+
+#define QUAD_DOWNTO16(A) \
+ union {\
+ LONG_DOWNTO16(A) \
+ uint64_t r##A; \
+ } __packed
+
+#ifdef __ARCH_x86_64__
struct eregs {
- DOWNTO8(a);
- DOWNTO8(c);
- DOWNTO8(d);
- DOWNTO8(b);
- DOWNTO16(sp);
- DOWNTO16(bp);
- DOWNTO16(si);
- DOWNTO16(di);
+ QUAD_DOWNTO8(a);
+ QUAD_DOWNTO8(c);
+ QUAD_DOWNTO8(d);
+ QUAD_DOWNTO8(b);
+ QUAD_DOWNTO16(bp);
+ QUAD_DOWNTO16(si);
+ QUAD_DOWNTO16(di);
+ uint64_t r8;
+ uint64_t r9;
+ uint64_t r10;
+ uint64_t r11;
+ uint64_t r12;
+ uint64_t r13;
+ uint64_t r14;
+ uint64_t r15;
+ uint64_t vector;
+ uint64_t error_code;
+ uint64_t rip;
+ uint64_t cs;
+ uint64_t rflags;
+ QUAD_DOWNTO16(sp);
+ uint64_t ss;
+};
+#else
+struct eregs {
+ LONG_DOWNTO8(a);
+ LONG_DOWNTO8(c);
+ LONG_DOWNTO8(d);
+ LONG_DOWNTO8(b);
+ LONG_DOWNTO16(sp);
+ LONG_DOWNTO16(bp);
+ LONG_DOWNTO16(si);
+ LONG_DOWNTO16(di);
uint32_t vector;
uint32_t error_code;
uint32_t eip;
uint32_t cs;
uint32_t eflags;
};
+#endif
#endif // !ASSEMBLER
#if CONFIG(COMPILER_LLVM_CLANG)