[libcpu][risc-v]:add comment for the round down of symb_pc
Some checks failed
pkgs_test / change (push) Has been skipped
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled

This commit is contained in:
zhangjing
2025-05-28 09:38:54 +00:00
committed by Rbb666
parent 3922ec7e99
commit e3d7bbb47c

View File

@@ -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);