Unify GDT selector naming convention
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 30s
Builds / ExectOS (i686, debug) (push) Successful in 29s
Builds / ExectOS (amd64, release) (push) Successful in 38s
Builds / ExectOS (i686, release) (push) Successful in 37s

This commit is contained in:
2026-04-01 11:02:05 +02:00
parent 38d49eece4
commit 154b2062ba
2 changed files with 6 additions and 6 deletions

View File

@@ -46,7 +46,7 @@ ArEnableExtendedPhysicalAddressing:
leaq XpaEnterLongMode(%rip), %rbx
/* Push the 32-bit code segment selector and the target address for a far jump */
pushq $GDT_R0_CMCODE
pushq $KGDT_R0_CMCODE
pushq %rax
/* Perform a far return to switch to 32-bit compatibility mode */
@@ -60,7 +60,7 @@ XpaEnterCompatMode:
pushl %ecx
/* Set the stack segment to the 32-bit data segment selector */
movl $GDT_R0_DATA, %eax
movl $KGDT_R0_DATA, %eax
movl %eax, %ss
/* Disable PGE and PCIDE to ensure all TLB entries will be flushed */
@@ -100,7 +100,7 @@ XpaEnterCompatMode:
XpaFlushInstructions:
/* Push the 64-bit code segment selector and the target address for a far jump */
pushl $GDT_R0_CODE
pushl $KGDT_R0_CODE
pushl %ebx
/* Perform a far return to switch to 64-bit long mode */

View File

@@ -17,9 +17,9 @@
#define CR4_PCIDE 0x00020000
/* GDT selectors */
#define GDT_R0_CMCODE 0x08
#define GDT_R0_CODE 0x10
#define GDT_R0_DATA 0x18
#define KGDT_R0_CMCODE 0x08
#define KGDT_R0_CODE 0x10
#define KGDT_R0_DATA 0x18
/* MSR registers */
#define X86_MSR_EFER 0xC0000080