diff options
author | Patrick Rudolph <siro@das-labor.org> | 2018-12-26 15:12:32 +0100 |
---|---|---|
committer | Patrick Rudolph <siro@das-labor.org> | 2020-08-14 17:55:26 +0000 |
commit | 8daa12f7e0ceca9ebf4c5e91a590a896e7f4413c (patch) | |
tree | 3b9f9920bf4d72659033fa631db8a0ee54547a76 /src/arch/x86/gdt_init.S | |
parent | 228d0e50789674be848f68f35f40570d8c3dd49c (diff) | |
download | coreboot-8daa12f7e0ceca9ebf4c5e91a590a896e7f4413c.tar.xz |
arch/x86/postcar: Add x86_64 support
* Add support for loading GDT on x86_64.
* Add x86_64 assembly code to do the same as the x86_32 code.
* Separate x86_32 and x86_64 code.
Tested on qemu x86_32 and x86_64 using additional MTRRs.
Tested on Lenovo T410 with additional x86_64 patches.
Change-Id: I1c190627f5f0ed6f82738cb99423892382899d7b
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/30500
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch/x86/gdt_init.S')
-rw-r--r-- | src/arch/x86/gdt_init.S | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/arch/x86/gdt_init.S b/src/arch/x86/gdt_init.S index d90aba64d3..7dd4b94933 100644 --- a/src/arch/x86/gdt_init.S +++ b/src/arch/x86/gdt_init.S @@ -15,6 +15,22 @@ gdtptr: .word gdt_end - gdt -1 /* compute the table limit */ .long gdt /* we know the offset */ +#ifdef __x86_64__ +.code64 +.section ".text._gdt64_", "ax", @progbits + .globl gdt_init64 +gdt_init64: + lgdt gdtptr64 + ret + +.previous + .align 4 +.globl gdtptr64 +gdtptr64: + .word gdt_end - gdt -1 /* compute the table limit */ + .quad gdt /* we know the offset */ +#endif + .align 4 gdt: /* selgdt 0, unused */ |