mirror of https://github.com/RT-Thread/rt-thread
[libcpu][risc-v]:add comment for the round down of symb_pc
This commit is contained in:
parent
3922ec7e99
commit
e3d7bbb47c
|
@ -692,6 +692,9 @@ void rt_hw_mem_setup_early(void)
|
|||
* PC are still at lower region before relocating to high memory
|
||||
*/
|
||||
rt_ubase_t pg_idx ;
|
||||
/* Round down symb_pc to L1_PAGE_SIZE boundary to ensure proper page alignment.
|
||||
* This is necessary because MMU operations work with page-aligned addresses, and
|
||||
* make sure all the text region is mapped.*/
|
||||
ps = (rt_ubase_t)symb_pc & (~(L1_PAGE_SIZE - 1));
|
||||
pg_idx = GET_L1(ps);
|
||||
early_pgtbl[pg_idx] = COMBINEPTE(ps, MMU_MAP_EARLY);
|
||||
|
|
Loading…
Reference in New Issue