From 720d525b952fe69984033c86135541ddafd5dfc7 Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Sun, 17 Aug 2025 00:29:28 +0200 Subject: [PATCH] Assign page map routines --- xtoskrnl/mm/amd64/init.c | 7 +++++++ xtoskrnl/mm/i686/init.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/xtoskrnl/mm/amd64/init.c b/xtoskrnl/mm/amd64/init.c index 8d2129c..0b12f80 100644 --- a/xtoskrnl/mm/amd64/init.c +++ b/xtoskrnl/mm/amd64/init.c @@ -4,6 +4,7 @@ * FILE: xtoskrnl/mm/amd64/init.c * DESCRIPTION: Architecture specific Memory Manager initialization routines * DEVELOPERS: Rafal Kupiec + * Aiken Harris */ #include @@ -23,6 +24,9 @@ MmInitializePageMapSupport(VOID) /* Check if XPA is enabled */ if(MmpGetExtendedPhysicalAddressingStatus()) { + /* XPA enabled, use LA57 paging (PML5) */ + MmpPageMapRoutines = &MmpPml5Routines; + /* Set PML5 page map information */ MmpPageMapInfo.Xpa = TRUE; @@ -35,6 +39,9 @@ MmInitializePageMapSupport(VOID) } else { + /* XPA disabled, use LA48 paging (PML4) */ + MmpPageMapRoutines = &MmpPml4Routines; + /* Set PML4 page map information */ MmpPageMapInfo.Xpa = FALSE; diff --git a/xtoskrnl/mm/i686/init.c b/xtoskrnl/mm/i686/init.c index 7b3e21d..a473449 100644 --- a/xtoskrnl/mm/i686/init.c +++ b/xtoskrnl/mm/i686/init.c @@ -4,6 +4,7 @@ * FILE: xtoskrnl/mm/i686/init.c * DESCRIPTION: Architecture specific Memory Manager initialization routines * DEVELOPERS: Rafal Kupiec + * Aiken Harris */ #include @@ -23,6 +24,9 @@ MmInitializePageMapSupport(VOID) /* Check if XPA is enabled */ if(MmpGetExtendedPhysicalAddressingStatus()) { + /* XPA enabled, use modern PAE paging (PML3) */ + MmpPageMapRoutines = &MmpPml3Routines; + /* Set PML3 page map information */ MmpPageMapInfo.Xpa = TRUE; @@ -36,6 +40,9 @@ MmInitializePageMapSupport(VOID) } else { + /* XPA disabled, use legacy i386 paging (PML2) */ + MmpPageMapRoutines = &MmpPml2Routines; + /* Set PML2 page map information */ MmpPageMapInfo.Xpa = FALSE;