ptos: mm: Add page allocation helpers

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
2026-07-12 22:26:59 +00:00
parent f543f28bf0
commit 048c479cd7
2 changed files with 29 additions and 0 deletions
+17
View File
@@ -39,6 +39,23 @@ static USIZE PageSizeTable[] = {
static UPTR VallocBump = VALLOC_BASE;
static MM_VAD_TREE VadTree;
PT_STATUS
MmAllocatePages(USIZE Count, MM_RANGE *Result)
{
MM_VAD *Vad;
if (Count == 0 || Result == NULL) {
return STATUS_INVALID_PARAM;
}
Vad = MmVadTreeAllocate(&VadTree, Count);
if (Vad == NULL) {
return STATUS_NO_MEMORY;
}
*Result = Vad->Range;
return STATUS_SUCCESS;
}
PT_STATUS MmUnmapRange(MMU_VAS *Vas, const MM_RANGE *Range, MMU_PAGESIZE PageSize)
{