ptos: pm: Add frame allocation and reclamation

Signed-off-by: Chloe M <chloe@yiffware.org>
This commit is contained in:
2026-07-10 19:07:11 -04:00
parent 92f4720898
commit 79bbbc074b
2 changed files with 159 additions and 3 deletions
+17
View File
@@ -12,6 +12,9 @@
#include <ptdef.h>
#include <hal/page.h>
/* Used when out of memory */
#define PFN_ERROR 0
/* Page frame number type */
typedef USIZE MM_PFN;
@@ -29,4 +32,18 @@ typedef USIZE MM_PFN;
*/
VOID MmPmInit(VOID);
/*
* Request a single frame of memory
*
* Returns PFN_ERROR on failure
*/
MM_PFN MmRequestFrame(VOID);
/*
* Reclaim a single frame of memory
*
* @Pfn: Page frame number to reclaim
*/
VOID MmReclaimFrame(MM_PFN Pfn);
#endif /* !_MM_PM_H_ */