zircon/kernel/arch/x86/page_tables/page_tables.cc
// Extract the index needed for finding |vaddr| for the given level
Extract the index needed for finding |vaddr| for the given level
Extract the index needed for finding |vaddr| for the given level
uint vaddr_to_index(PageTableLevel level, vaddr_t vaddr) {
  switch (level) {
    case PML4_L:
      return VADDR_TO_PML4_INDEX(vaddr);
    case PDP_L:
      return VADDR_TO_PDP_INDEX(vaddr);
    case PD_L:
      return VADDR_TO_PD_INDEX(vaddr);
    case PT_L:
      return VADDR_TO_PT_INDEX(vaddr);
    default:
      panic("vaddr_to_index: invalid level\n");
  }
}
uint vaddr_to_index ( PageTableLevel level , vaddr_t vaddr ) { switch ( level ) { case PML4_L : return VADDR_TO_PML4_INDEX ( vaddr ) ; case PDP_L : return VADDR_TO_PDP_INDEX ( vaddr ) ; case PD_L : return VADDR_TO_PD_INDEX ( vaddr ) ; case PT_L : return VADDR_TO_PT_INDEX ( vaddr ) ; default : panic ( " \n " ) ; } }
Extract the index needed for finding |vaddr| for the given level
Extract the index needed for finding |vaddr| for the given level