File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -668,7 +668,7 @@ void rt_hw_mem_setup_early(void)
668668 rt_ubase_t ps = 0x0 ;
669669 rt_ubase_t vs = 0x0 ;
670670 rt_ubase_t * early_pgtbl = (rt_ubase_t * )(((size_t )& __bss_end + 4095 ) & ~0xfff );
671-
671+
672672 /* calculate pv_offset */
673673 void * symb_pc ;
674674 void * symb_linker ;
@@ -691,11 +691,10 @@ void rt_hw_mem_setup_early(void)
691691 * identical mapping,
692692 * PC are still at lower region before relocating to high memory
693693 */
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- }
694+ rt_ubase_t pg_idx ;
695+ ps = (rt_ubase_t )symb_pc & (~(L1_PAGE_SIZE - 1 ));
696+ pg_idx = GET_L1 (ps );
697+ early_pgtbl [pg_idx ] = COMBINEPTE (ps , MMU_MAP_EARLY );
699698
700699 /* relocate text region */
701700 __asm__ volatile ("la %0, _start\n" : "=r" (ps ));
You can’t perform that action at this time.
0 commit comments