Skip to content

Commit

Permalink
Merge pull request #195 from flaviojs/fix-ppc32-ptel-creation-ppc32_m…
Browse files Browse the repository at this point in the history
…ap_page

Fix ppc32 ptel creation in ppc32_map_page.
  • Loading branch information
grossmj authored Mar 27, 2024
2 parents e1dfdd0 + f50d133 commit dd901e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions stable/ppc32_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,9 @@ int ppc32_map_page(cpu_ppc_t *cpu,u_int vsid,m_uint32_t vaddr,m_uint64_t paddr,
tmp |= (vaddr >> 22) & 0x3F;
*(m_uint32_t *)pte_haddr = htovm32(tmp);

tmp = vaddr & PPC32_PTEL_RPN_MASK;
tmp |= (vaddr >> (32 - PPC32_PTEL_X_SHIFT)) & PPC32_PTEL_X_MASK;
tmp |= (vaddr >> (33 - PPC32_PTEL_XPN_SHIFT)) & PPC32_PTEL_XPN_MASK;
tmp = ((m_uint32_t)paddr) & PPC32_PTEL_RPN_MASK;
tmp |= ((m_uint32_t)(paddr >> (32 - PPC32_PTEL_X_SHIFT))) & PPC32_PTEL_X_MASK;
tmp |= ((m_uint32_t)(paddr >> (33 - PPC32_PTEL_XPN_SHIFT))) & PPC32_PTEL_XPN_MASK;

tmp |= (wimg << PPC32_PTEL_WIMG_SHIFT) + pp;
*(m_uint32_t *)(pte_haddr+sizeof(m_uint32_t)) = htovm32(tmp);
Expand Down
6 changes: 3 additions & 3 deletions unstable/ppc32_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,9 @@ int ppc32_map_page(cpu_ppc_t *cpu,u_int vsid,m_uint32_t vaddr,m_uint64_t paddr,
tmp |= (vaddr >> 22) & 0x3F;
*(m_uint32_t *)pte_haddr = htovm32(tmp);

tmp = vaddr & PPC32_PTEL_RPN_MASK;
tmp |= (vaddr >> (32 - PPC32_PTEL_X_SHIFT)) & PPC32_PTEL_X_MASK;
tmp |= (vaddr >> (33 - PPC32_PTEL_XPN_SHIFT)) & PPC32_PTEL_XPN_MASK;
tmp = ((m_uint32_t)vaddr) & PPC32_PTEL_RPN_MASK;
tmp |= ((m_uint32_t)(vaddr >> (32 - PPC32_PTEL_X_SHIFT))) & PPC32_PTEL_X_MASK;
tmp |= ((m_uint32_t)(vaddr >> (33 - PPC32_PTEL_XPN_SHIFT))) & PPC32_PTEL_XPN_MASK;

tmp |= (wimg << PPC32_PTEL_WIMG_SHIFT) + pp;
*(m_uint32_t *)(pte_haddr+sizeof(m_uint32_t)) = htovm32(tmp);
Expand Down

0 comments on commit dd901e1

Please sign in to comment.