mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
riscv/pgmap: Fix bug in kernel page directory init
The L2 table was not connected -> results in random crashes. Also add missing data sync barrier to the end.
This commit is contained in:
@@ -198,7 +198,7 @@ int up_addrenv_kmap_init(void)
|
|||||||
next = g_kernel_pgt_pbase;
|
next = g_kernel_pgt_pbase;
|
||||||
vaddr = CONFIG_ARCH_KMAP_VBASE;
|
vaddr = CONFIG_ARCH_KMAP_VBASE;
|
||||||
|
|
||||||
for (i = 0; i < (ARCH_SPGTS - 1); i++)
|
for (i = 0; i < ARCH_SPGTS; i++)
|
||||||
{
|
{
|
||||||
/* Connect the static page tables */
|
/* Connect the static page tables */
|
||||||
|
|
||||||
@@ -211,6 +211,10 @@ int up_addrenv_kmap_init(void)
|
|||||||
|
|
||||||
addrenv->satp = mmu_satp_reg(g_kernel_pgt_pbase, 0);
|
addrenv->satp = mmu_satp_reg(g_kernel_pgt_pbase, 0);
|
||||||
|
|
||||||
|
/* When all is set and done, flush the data caches */
|
||||||
|
|
||||||
|
__DMB();
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user