Skip to content

Commit

Permalink
[bugfix][risc-v]fix the PPN length error in GET_PPN(pte).
Browse files Browse the repository at this point in the history
  • Loading branch information
GorrayLi committed Feb 22, 2025
1 parent aa3328f commit 635e852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcpu/risc-v/common64/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct mem_desc
#define GET_L2(addr) __PARTBIT(addr, VPN1_SHIFT, VPN1_BIT)
#define GET_L3(addr) __PARTBIT(addr, VPN0_SHIFT, VPN0_BIT)
#define GET_PPN(pte) \
(__PARTBIT(pte, PTE_PPN_SHIFT, PHYSICAL_ADDRESS_WIDTH_BITS - PTE_PPN_SHIFT))
(__PARTBIT(pte, PTE_PPN_SHIFT, PHYSICAL_ADDRESS_WIDTH_BITS - PAGE_OFFSET_BIT))
#define GET_PADDR(pte) (GET_PPN(pte) << PAGE_OFFSET_BIT)
#define VPN_TO_PPN(vaddr, pv_off) (((rt_uintptr_t)(vaddr)) + (pv_off))
#define PPN_TO_VPN(paddr, pv_off) (((rt_uintptr_t)(paddr)) - (pv_off))
Expand Down

0 comments on commit 635e852

Please sign in to comment.