arch/x86: Use defines for GDT segments

Stop using magic values and use defines for Global Descriptor Table
(GDT) offsets. Use the existing defines from the corresponding headers.

Change-Id: I40c15f6341bdef9cd457619ec81e7ac624ec2d63
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87254
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Rudolph 2025-04-10 08:26:40 +02:00 committed by Matt DeVillier
commit 816d956dfd
3 changed files with 9 additions and 6 deletions

View file

@ -9,6 +9,7 @@
* found in smm.h.
*/
#include <arch/rom_segs.h>
#include <cpu/x86/cr.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/lapic_def.h>
@ -93,7 +94,7 @@ untampered_lapic:
movl %eax, %cr0
/* Enable protected mode */
ljmpl $0x8, $smm_trampoline32
ljmpl $ROM_CODE_SEG, $smm_trampoline32
.align 4
smm_relocate_gdt:
@ -124,7 +125,7 @@ smm_relocate_gdt_end:
.global smm_trampoline32
smm_trampoline32:
/* Use flat data segment */
movw $0x10, %ax
movw $ROM_DATA_SEG, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %ss