zircon/kernel/arch/x86/page_tables/page_tables.cc
// Convert a PTE to a physical address
Convert a PTE to a physical address
Convert a PTE to a physical address
paddr_t paddr_from_pte(PageTableLevel level, pt_entry_t pte) {
  DEBUG_ASSERT(IS_PAGE_PRESENT(pte));
  paddr_t pa;
  switch (level) {
    case PDP_L:
      pa = (pte & X86_HUGE_PAGE_FRAME);
      break;
    case PD_L:
      pa = (pte & X86_LARGE_PAGE_FRAME);
      break;
    case PT_L:
      pa = (pte & X86_PG_FRAME);
      break;
    default:
      panic("paddr_from_pte at unhandled level %d\n", level);
  }
  return pa;
}
paddr_t paddr_from_pte ( PageTableLevel level , pt_entry_t pte ) { DEBUG_ASSERT ( IS_PAGE_PRESENT ( pte ) ) ; paddr_t pa ; switch ( level ) { case PDP_L : pa = ( pte & X86_HUGE_PAGE_FRAME ) ; break ; case PD_L : pa = ( pte & X86_LARGE_PAGE_FRAME ) ; break ; case PT_L : pa = ( pte & X86_PG_FRAME ) ; break ; default : panic ( " \n " , level ) ; } return pa ; }
Convert a PTE to a physical address
Convert a PTE to a physical address