mmu: fix macro MMU_ENTRY_NUM and add new macro MMU_MAX_PADDR_PAGE_NUM

This commit is contained in:
Armando
2022-04-26 23:18:18 +08:00
parent 2764cd5682
commit e09787d851
13 changed files with 51 additions and 48 deletions

View File

@@ -86,16 +86,18 @@ extern "C" {
*/
#define INVALID_PHY_PAGE 0xffff
/**
* Max MMU entry num.
* `MMU_MAX_ENTRY_NUM * MMU_PAGE_SIZE` means the max paddr and vaddr region supported by the MMU. e.g.:
* 16384 * 64KB, means MMU can map 1GB at most
* Max MMU available paddr page num.
* `MMU_MAX_PADDR_PAGE_NUM * MMU_PAGE_SIZE` means the max paddr address supported by the MMU. e.g.:
* 16384 * 64KB, means MMU can support 1GB paddr at most
*/
#define MMU_MAX_ENTRY_NUM 16384
#define MMU_MAX_PADDR_PAGE_NUM 16384
/**
* This is the mask used for mapping. e.g.:
* 0x4200_0000 & MMU_VADDR_MASK
*/
#define MMU_VADDR_MASK 0x1FFFFFF
//MMU entry num
#define MMU_ENTRY_NUM 512
#define CACHE_ICACHE_LOW_SHIFT 0
#define CACHE_ICACHE_HIGH_SHIFT 2