We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aaae1a8 commit 3c2897fCopy full SHA for 3c2897f
libcpu/risc-v/common64/mmu.c
@@ -691,11 +691,10 @@ void rt_hw_mem_setup_early(void)
691
* identical mapping,
692
* PC are still at lower region before relocating to high memory
693
*/
694
- for (size_t i = 0; i < __SIZE(PPN0_BIT); i++)
695
- {
696
- early_pgtbl[i] = COMBINEPTE(ps, MMU_MAP_EARLY);
697
- ps += L1_PAGE_SIZE;
698
- }
+ rt_ubase_t pg_idx ;
+ ps = (rt_ubase_t)symb_pc & (~(L1_PAGE_SIZE - 1));
+ pg_idx = GET_L1(ps);
+ early_pgtbl[pg_idx] = COMBINEPTE(ps, MMU_MAP_EARLY);
699
700
/* relocate text region */
701
__asm__ volatile("la %0, _start\n" : "=r"(ps));
0 commit comments