kernel/arm/pmap.c
/*
 * Get the physcial address of a page in the file cache
 */
Get the physcial address of a page in the file cache
Get the physcial address of a page in the file cache
int PmapCacheExtract(vm_addr va, vm_addr *pa) {
  uint32_t *pt, *phys_pt;
  int pde_idx, pte_idx;
  pde_idx = (va & L1_ADDR_BITS) >> L1_IDX_SHIFT;
  phys_pt = (uint32_t *)(root_pagedir[pde_idx] & L1_C_ADDR_MASK);
  pt = (uint32_t *)PmapPaToVa((vm_addr)phys_pt);
  pte_idx = (va & L2_ADDR_BITS) >> L2_IDX_SHIFT;
  *pa = pt[pte_idx] & L2_ADDR_MASK;
  return 0;
}
int PmapCacheExtract ( vm_addr va , vm_addr * pa ) { uint32_t * pt , * phys_pt ; int pde_idx , pte_idx ; pde_idx = ( va & L1_ADDR_BITS ) >> L1_IDX_SHIFT ; phys_pt = ( uint32_t * ) ( root_pagedir [ pde_idx ] & L1_C_ADDR_MASK ) ; pt = ( uint32_t * ) PmapPaToVa ( ( vm_addr ) phys_pt ) ; pte_idx = ( va & L2_ADDR_BITS ) >> L2_IDX_SHIFT ; * pa = pt [ pte_idx ] & L2_ADDR_MASK ; return 0 ; }
Get the physcial address of a page in the file cache
Get the physcial address of a page in the file cache