5b30974cb0
Signed-off-by: Chloe M. <chloe@mensia.org>
54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
/*
|
|
* Copyright (c) 2026, Chloe M.
|
|
* Provided under the BSD-3 clause.
|
|
*
|
|
* Description: MMU HAL layer
|
|
* Author: Chloe M.
|
|
*/
|
|
|
|
#ifndef _HAL_MMU_H_
|
|
#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
|
|
*
|
|
* @Result: Result is written here
|
|
*/
|
|
VOID HalMmuReadVas(MMU_VAS *Result);
|
|
|
|
/*
|
|
* Write a new virtual address space
|
|
*
|
|
* @Vas: Virtual address space to write
|
|
*/
|
|
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_ */
|