Make PPE mapping architecture-specific
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 30s
Builds / ExectOS (amd64, release) (push) Successful in 28s
Builds / ExectOS (i686, release) (push) Successful in 26s
Builds / ExectOS (i686, debug) (push) Successful in 29s

This commit is contained in:
2025-12-19 20:25:43 +01:00
parent 7b93c39348
commit 24dccf4bed
3 changed files with 73 additions and 47 deletions

View File

@@ -139,6 +139,53 @@ MM::Pte::MapP5E(PVOID StartAddress,
}
}
/**
* Maps a range of virtual addresses at the PPE (Page Directory Pointer Entry) level.
*
* @param StartAddress
* The beginning of the virtual address range to map.
*
* @param EndAddress
* The end of the virtual address range to map.
*
* @param TemplatePpe
* A template PPE to use for creating new entries.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
MM::Pte::MapPPE(PVOID StartAddress,
PVOID EndAddress,
PMMPPE TemplatePpe)
{
PMMPPE EndSpace, PointerPpe;
/* Get PPE addresses */
PointerPpe = MM::Paging::GetPpeAddress(StartAddress);
EndSpace = MM::Paging::GetPpeAddress(EndAddress);
/* Iterate over all PPEs */
while(PointerPpe <= EndSpace)
{
/* Check if PPE is already mapped */
if(!MM::Paging::PteValid(PointerPpe))
{
/* Map PPE */
MM::Paging::SetPte(TemplatePpe, MM::Pfn::AllocateBootstrapPages(1), 0);
*PointerPpe = *TemplatePpe;
/* Clear the page table */
RtlZeroMemory(MM::Paging::GetPteVirtualAddress(PointerPpe), MM_PAGE_SIZE);
}
/* Get next table entry */
PointerPpe = MM::Paging::GetNextPte(PointerPpe);
}
}
/**
* Maps a range of virtual addresses at the PXE (PML4) level.
*

View File

@@ -73,3 +73,29 @@ MM::Pte::InitializePageTable(VOID)
{
UNIMPLEMENTED;
}
/*
* Maps a range of virtual addresses at the PPE (Page Directory Pointer Entry) level.
*
* @param StartAddress
* The beginning of the virtual address range to map.
*
* @param EndAddress
* The end of the virtual address range to map.
*
* @param TemplatePpe
* A template PPE to use for creating new entries.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
MM::Pte::MapPPE(PVOID StartAddress,
PVOID EndAddress,
PMMPPE TemplatePpe)
{
/* Just a stub on i686 platform */
return;
}

View File

@@ -71,53 +71,6 @@ MM::Pte::MapPDE(PVOID StartAddress,
}
}
/**
* Maps a range of virtual addresses at the PPE (Page Directory Pointer Entry) level.
*
* @param StartAddress
* The beginning of the virtual address range to map.
*
* @param EndAddress
* The end of the virtual address range to map.
*
* @param TemplatePpe
* A template PPE to use for creating new entries.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
MM::Pte::MapPPE(PVOID StartAddress,
PVOID EndAddress,
PMMPPE TemplatePpe)
{
PMMPPE EndSpace, PointerPpe;
/* Get PPE addresses */
PointerPpe = MM::Paging::GetPpeAddress(StartAddress);
EndSpace = MM::Paging::GetPpeAddress(EndAddress);
/* Iterate over all PPEs */
while(PointerPpe <= EndSpace)
{
/* Check if PPE is already mapped */
if(!MM::Paging::PteValid(PointerPpe))
{
/* Map PPE */
MM::Paging::SetPte(TemplatePpe, MM::Pfn::AllocateBootstrapPages(1), 0);
*PointerPpe = *TemplatePpe;
/* Clear the page table */
RtlZeroMemory(MM::Paging::GetPteVirtualAddress(PointerPpe), MM_PAGE_SIZE);
}
/* Get next table entry */
PointerPpe = MM::Paging::GetNextPte(PointerPpe);
}
}
/**
* Maps a range of virtual addresses at the PTE (Page Table Entry) level.
*