27b9d726ff
Signed-off-by: Chloe M <chloe@mensia.org>
33 lines
607 B
C
33 lines
607 B
C
/*
|
|
* Copyright (c) 2026, Chloe M.
|
|
* Provided under the BSD-3 clause.
|
|
*
|
|
* Description: Physical memory management
|
|
* Author: Chloe M.
|
|
*/
|
|
|
|
#ifndef _MM_PM_H_
|
|
#define _MM_PM_H_ 1
|
|
|
|
#include <ptdef.h>
|
|
#include <hal/page.h>
|
|
|
|
/* Page frame number type */
|
|
typedef USIZE MM_PFN;
|
|
|
|
/*
|
|
* These macros allow the conversion of page frame numbers
|
|
* to physical addresses and vice versa.
|
|
*/
|
|
#define PFN_TO_ADDRESS(PFN) \
|
|
((PFN) << LOG2_PAGESIZE)
|
|
#define ADDRESS_TO_PFN(ADDR) \
|
|
((ADDR) >> LOG2_PAGESIZE)
|
|
|
|
/*
|
|
* Initialize the physical memory management
|
|
*/
|
|
VOID MmPmInit(VOID);
|
|
|
|
#endif /* !_MM_PM_H_ */
|