ptos: mm: Add page allocation helpers
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -45,6 +45,10 @@ typedef struct {
|
||||
USIZE Length;
|
||||
} MM_RANGE;
|
||||
|
||||
/* Obtain a pointer from an &MM_RANGE pointer */
|
||||
#define RANGE_PTR(RANGE_P) \
|
||||
((VOID *)((RANGE_P)->VirtualBase))
|
||||
|
||||
/*
|
||||
* Unmap a virtual memory range
|
||||
*
|
||||
@@ -67,6 +71,14 @@ PT_STATUS MmMapRange(
|
||||
MM_PROT Prot, MMU_PAGESIZE PageSize
|
||||
);
|
||||
|
||||
/*
|
||||
* Allocate one or more pages
|
||||
*
|
||||
* @Count: Number of pages to allocate
|
||||
* @Result: Result is written back here
|
||||
*/
|
||||
PT_STATUS MmAllocatePages(USIZE Count, MM_RANGE *Result);
|
||||
|
||||
/*
|
||||
* Initialize virtual memory
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user