Skip to content

Commit

Permalink
[libcpu][riscv]纠正pv_offset的对齐检查
Browse files Browse the repository at this point in the history
  • Loading branch information
heyuanjie87 authored and mysterywolf committed Nov 22, 2024
1 parent bb0a1ea commit 2a68412
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcpu/risc-v/common64/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ void rt_hw_mem_setup_early(void)

if (pv_off)
{
if (pv_off & (1ul << (ARCH_INDEX_WIDTH * 2 + ARCH_PAGE_SHIFT)))
if (pv_off & ((1ul << (ARCH_INDEX_WIDTH * 2 + ARCH_PAGE_SHIFT)) - 1))
{
LOG_E("%s: not aligned virtual address. pv_offset %p", __func__,
pv_off);
Expand Down

0 comments on commit 2a68412

Please sign in to comment.