moved page alignment responsibility to caller
This commit is contained in:
@@ -448,7 +448,7 @@ bool access_exception(uint32_t pc, uint32_t format_status)
|
|||||||
}
|
}
|
||||||
else /* map this page */
|
else /* map this page */
|
||||||
{
|
{
|
||||||
mmu_map_page(fault_address, fault_address);
|
mmu_map_page(fault_address & 0xfff00000, fault_address & 0xfff00000);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -464,11 +464,11 @@ void mmu_map_page(uint32_t virt, uint32_t phys)
|
|||||||
/*
|
/*
|
||||||
* add page to TLB
|
* add page to TLB
|
||||||
*/
|
*/
|
||||||
MCF_MMU_MMUTR = (virt & 0xfff00000) | /* virtual aligned to 1M */
|
MCF_MMU_MMUTR = virt | /* virtual address */
|
||||||
MCF_MMU_MMUTR_SG | /* shared global */
|
MCF_MMU_MMUTR_SG | /* shared global */
|
||||||
MCF_MMU_MMUTR_V; /* valid */
|
MCF_MMU_MMUTR_V; /* valid */
|
||||||
|
|
||||||
MCF_MMU_MMUDR = (phys & 0xfff00000) | /* physical aligned to 1M */
|
MCF_MMU_MMUDR = phys | /* physical address */
|
||||||
MCF_MMU_MMUDR_SZ(0) | /* 1 MB page size */
|
MCF_MMU_MMUDR_SZ(0) | /* 1 MB page size */
|
||||||
MCF_MMU_MMUDR_CM(0x1) | /* cacheable copyback */
|
MCF_MMU_MMUDR_CM(0x1) | /* cacheable copyback */
|
||||||
MCF_MMU_MMUDR_R | /* read access enable */
|
MCF_MMU_MMUDR_R | /* read access enable */
|
||||||
|
|||||||
Reference in New Issue
Block a user