stos/amd64: mmu: Implement page mapping

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-22 22:35:42 +00:00
parent 532e46c62f
commit 5b30974cb0
2 changed files with 226 additions and 0 deletions
+24
View File
@@ -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_ */