ptos: pm: Add frame allocation and reclamation
Signed-off-by: Chloe M <chloe@yiffware.org>
This commit is contained in:
@@ -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_ */
|
||||
|
||||
Reference in New Issue
Block a user