Move PFN database size tracking to memory layout
Some checks failed
Builds / ExectOS (amd64, release) (push) Failing after 20s
Builds / ExectOS (i686, release) (push) Failing after 22s
Builds / ExectOS (i686, debug) (push) Failing after 29s
Builds / ExectOS (amd64, debug) (push) Failing after 30s

This commit is contained in:
2026-01-29 22:26:31 +01:00
parent 58669d3074
commit 5e3fb7a5a3
8 changed files with 26 additions and 41 deletions

View File

@@ -39,7 +39,7 @@ MM::Pfn::InitializePfnDatabase(VOID)
MemoryLayout = MM::Manager::GetMemoryLayout();
/* Get the PFN database size and calculate the end of the PFN database virtual address space */
PfnDatabaseEnd = (PUCHAR)MemoryLayout->PfnDatabase + (PfnDatabaseSize * MM_PAGE_SIZE) - 1;
PfnDatabaseEnd = (PUCHAR)MemoryLayout->PfnDatabase + (MemoryLayout->PfnDatabaseSize * MM_PAGE_SIZE) - 1;
/* Get a template PTE for mapping the PFN database pages */
ValidPte = MM::Pte::GetValidPte();
@@ -49,7 +49,7 @@ MM::Pfn::InitializePfnDatabase(VOID)
MM::Pte::MapPTE(MemoryLayout->PfnDatabase, PfnDatabaseEnd, ValidPte);
/* Zero PFN database virtual space */
RTL::Memory::ZeroMemory(MemoryLayout->PfnDatabase, PfnDatabaseSize * MM_PAGE_SIZE);
RTL::Memory::ZeroMemory(MemoryLayout->PfnDatabase, MemoryLayout->PfnDatabaseSize * MM_PAGE_SIZE);
/* Initialize the color tables */
MM::Colors::InitializeColorTables();
@@ -73,12 +73,12 @@ MM::Pfn::InitializePfnDatabase(VOID)
if(Descriptor == FreeDescriptor)
{
/* Initialize PFNs for the remaining free memory after the PFN database */
ProcessMemoryDescriptor(OriginalFreeDescriptor.BasePage + PfnDatabaseSize,
OriginalFreeDescriptor.PageCount - PfnDatabaseSize,
ProcessMemoryDescriptor(OriginalFreeDescriptor.BasePage + MemoryLayout->PfnDatabaseSize,
OriginalFreeDescriptor.PageCount - MemoryLayout->PfnDatabaseSize,
LoaderFree);
/* Initialize PFNs for the physical pages backing the PFN database itself */
ProcessMemoryDescriptor(OriginalFreeDescriptor.BasePage, PfnDatabaseSize, LoaderMemoryData);
ProcessMemoryDescriptor(OriginalFreeDescriptor.BasePage, MemoryLayout->PfnDatabaseSize, LoaderMemoryData);
}
else
{