diff options
author | Patrick Rudolph <siro@das-labor.org> | 2019-03-03 17:58:54 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-03-06 20:00:55 +0000 |
commit | 4e8dee51e3f0a69f3a4171723fddbda5ecebe403 (patch) | |
tree | 6a5b430812909589d3c41c2de7e8c5ba53ad8a2d /src/arch | |
parent | 0c590f064e040e0f75abdc9e816ef1d21bf8b437 (diff) |
arch/x86: Prepare GDT for x86_64
Make GDT a separate table and don't reuse GDT descriptor as unused
first field of GDT.
Required for separate x86_64 GDT descriptor, pointing to the same
GDT.
Tested on qemu.
Change-Id: I513329b67d49ade1055bc07cf7b93ff2e0131e0b
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31769
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/x86/gdt_init.S | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/arch/x86/gdt_init.S b/src/arch/x86/gdt_init.S index 6aa2a79b48..f66cd4366b 100644 --- a/src/arch/x86/gdt_init.S +++ b/src/arch/x86/gdt_init.S @@ -21,11 +21,15 @@ gdt_init: .previous .align 4 .globl gdtptr -gdt: gdtptr: .word gdt_end - gdt -1 /* compute the table limit */ .long gdt /* we know the offset */ - .word 0 + + .align 4 +gdt: + /* selgdt 0, unused */ + .word 0x0000, 0x0000 /* dummy */ + .byte 0x00, 0x00, 0x00, 0x00 /* selgdt 0x08, flat code segment */ .word 0xffff, 0x0000 |