mmu: simplify mmu_hal_init

This commit is contained in:
Armando
2022-04-21 21:55:44 +08:00
parent 63ac5e4a99
commit 2764cd5682
8 changed files with 92 additions and 19 deletions

View File

@@ -129,6 +129,19 @@ static inline void mmu_ll_set_entry_invalid(uint32_t mmu_id, uint32_t entry_id)
*(uint32_t *)(DR_REG_MMU_TABLE + entry_id * 4) = MMU_INVALID;
}
/**
* Unmap all the items in the MMU table
*
* @param mmu_id MMU ID
*/
__attribute__((always_inline))
static inline void mmu_ll_unmap_all(uint32_t mmu_id)
{
for (int i = 0; i < MMU_MAX_ENTRY_NUM; i++) {
mmu_ll_set_entry_invalid(mmu_id, i);
}
}
#ifdef __cplusplus
}
#endif