ptos/amd64+hal: Add page mapping interface
Signed-off-by: Chloe M <chloe@mensia.org>
This commit is contained in:
@@ -9,9 +9,19 @@
|
||||
#ifndef _HAL_MMU_H_
|
||||
#define _HAL_MMU_H_ 1
|
||||
|
||||
#include <ptapi/ptmm.h>
|
||||
#include <ptapi/status.h>
|
||||
#include <hal/vas.h>
|
||||
#include <ptdef.h>
|
||||
|
||||
/*
|
||||
* Represents valid page sizes that can be mapped
|
||||
* with.
|
||||
*/
|
||||
typedef enum {
|
||||
PAGESIZE_4K
|
||||
} MMU_PAGESIZE;
|
||||
|
||||
/*
|
||||
* Read the current virtual address space into an
|
||||
* MMU_VAS descriptor.
|
||||
@@ -28,4 +38,18 @@ VOID HalMmuReadVas(MMU_VAS *Result);
|
||||
*/
|
||||
VOID HalMmuWriteVas(const MMU_VAS *Vas);
|
||||
|
||||
/*
|
||||
* Map a single page of memory
|
||||
*
|
||||
* @Vas: Virtual address space to map within
|
||||
* @VirtualBase: Virtual address base to map
|
||||
* @Prot: Protection flags
|
||||
* @PageSize: Pagesize to map as
|
||||
*/
|
||||
PT_STATUS HalMmuMapPage(
|
||||
MMU_VAS *Vas, UPTR VirtualBase,
|
||||
UPTR PhysicalBase, MM_PROT Prot,
|
||||
MMU_PAGESIZE PageSize
|
||||
);
|
||||
|
||||
#endif /* !_HAL_MMU_H_ */
|
||||
|
||||
Reference in New Issue
Block a user