kernel/vm.c
uint64
walkaddr(pagetable_t pagetable, uint64 va)
{
  pte_t *pte;
  uint64 pa;

  if(va >= MAXVA)
    return NULL;

  pte = walk(pagetable, va, 0);
  if(pte == 0)
    return NULL;
  if((*pte & PTE_V) == 0)
    return NULL;
  if((*pte & PTE_U) == 0)
    return NULL;
  pa = PTE2PA(*pte);
  return pa;
}
// Look up a virtual address, return the physical address,
// or 0 if not mapped.
// Can only be used to look up user pages.
Look up a virtual address, return the physical address,
or 0 if not mapped.
Can only be used to look up user pages.
Look up a virtual address return the physical address or 0 if not mapped . Can only be used to look up user pages .
uint64
walkaddr(pagetable_t pagetable, uint64 va)
{
  pte_t *pte;
  uint64 pa;
  if(va >= MAXVA)
    return NULL;
  pte = walk(pagetable, va, 0);
  if(pte == 0)
    return NULL;
  if((*pte & PTE_V) == 0)
    return NULL;
  if((*pte & PTE_U) == 0)
    return NULL;
  pa = PTE2PA(*pte);
  return pa;
}
uint64 walkaddr ( pagetable_t pagetable , uint64 va ) { pte_t * pte ; uint64 pa ; if ( va >= MAXVA ) return NULL ; pte = walk ( pagetable , va , 0 ) ; if ( pte == 0 ) return NULL ; if ( ( * pte & PTE_V ) == 0 ) return NULL ; if ( ( * pte & PTE_U ) == 0 ) return NULL ; pa = PTE2PA ( * pte ) ; return pa ; }
Look up a virtual address, return the physical address,
or 0 if not mapped.
Look up a virtual address return the physical address or 0 if not mapped .