stos/amd64: mmu: Implement page mapping
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -10,8 +10,18 @@
|
||||
#define _HAL_MMU_H_ 1
|
||||
|
||||
#include <stdef.h>
|
||||
#include <stapi/status.h>
|
||||
#include <machine/vas.h>
|
||||
|
||||
#define PAGE_READONLY 0x00 /* Readonly */
|
||||
#define PAGE_READONLY_X 0x02 /* Read/execute */
|
||||
#define PAGE_READWRITE 0x03 /* Read/write */
|
||||
#define PAGE_READWRITE_X 0x04 /* Read/write/execute */
|
||||
|
||||
typedef enum {
|
||||
PAGESIZE_4K
|
||||
} MMU_PAGESIZE;
|
||||
|
||||
/*
|
||||
* Read the current virtual address space
|
||||
*
|
||||
@@ -26,4 +36,18 @@ VOID HalMmuReadVas(MMU_VAS *Result);
|
||||
*/
|
||||
VOID HalMmuWriteVas(MMU_VAS *Vas);
|
||||
|
||||
/*
|
||||
* Map a single page of memory
|
||||
*
|
||||
* @Vas: Virtual address space to map within
|
||||
* @Vma: Virtual memory address to map
|
||||
* @Pma: Physical memory address to map
|
||||
* @Flags: Flags to map with
|
||||
* @PageSize: Pagesize to map
|
||||
*/
|
||||
ST_STATUS HalMmuMapSingle(
|
||||
MMU_VAS *Vas, UPTR Vma, UPTR Pma,
|
||||
USHORT Flags, MMU_PAGESIZE PageSize
|
||||
);
|
||||
|
||||
#endif /* !_HAL_MMU_H_ */
|
||||
|
||||
Reference in New Issue
Block a user