diff options
author | Paul Menzel <pmenzel@molgen.mpg.de> | 2019-06-24 18:44:33 +0200 |
---|---|---|
committer | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2020-07-05 19:56:09 +0000 |
commit | 6663ad99cf36f53f454defc8f7e87eb2e7495255 (patch) | |
tree | 818e3c711d8c316c96915dff63da535f139cff7d /src/arch/x86/include | |
parent | d9c6862809ca95712e18b967a1fefc24cb607a06 (diff) |
arch/x86: Support x86_64 exceptions
* Doesn't affect existing x86_32 code.
Tested on qemu using division by zero.
Tested on Lenovo T410 with additional x86_64 patches.
Change-Id: Idd12c90a95cc2989eb9b2a718740a84222193f48
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/30117
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/arch/x86/include')
-rw-r--r-- | src/arch/x86/include/arch/registers.h | 59 |
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) |