MMU works

This commit is contained in:
Scott Shawcroft
2021-09-24 16:14:01 -07:00
parent 829f92d00f
commit 0a6ca65e3f
5 changed files with 177 additions and 7 deletions

View File

@@ -13,11 +13,11 @@
#define MT_DEVICE_nGnRnE 0x0
#define MT_NORMAL_NC 0x1
#define MT_DEVICE_nGnRnE_FLAGS 0x00
#define MT_NORMAL_NC_FLAGS 0x44
#define MT_NORMAL_NC_FLAGS 0xff
#define MAIR_VALUE (MT_DEVICE_nGnRnE_FLAGS << (8 * MT_DEVICE_nGnRnE)) | (MT_NORMAL_NC_FLAGS << (8 * MT_NORMAL_NC))
#define TCR_T0SZ (64 - 35)
#define TCR_T0SZ (64 - 36)
#define TCR_PS (0x01 << 16) // 36-bit physical address
#define TCR_TG0_4K (0 << 14)
#define TCR_SH0_OUTER_SHAREABLE (0x2 << 12)
@@ -36,6 +36,7 @@
// Block attributes
#define MM_DESCRIPTOR_EXECUTE_NEVER (0x1ull << 54)
#define MM_DESCRIPTOR_CONTIGUOUS (0x1ull << 52)
#define MM_DESCRIPTOR_ACCESS_FLAG (0x1ull << 10)
#define MM_DESCRIPTOR_MAIR_INDEX(index) (index << 2)