diff options
author | alc <alc@FreeBSD.org> | 2003-08-16 03:11:33 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-08-16 03:11:33 +0000 |
commit | 8f6b3a6b1b815311b090b321cafaa973b56b5356 (patch) | |
tree | 96ee164a969d2b2263dba7296c57e6113b7f7de7 /sys/amd64 | |
parent | 48df5c2fbb12117ed8d59780b2353916718cb1d2 (diff) | |
download | FreeBSD-src-8f6b3a6b1b815311b090b321cafaa973b56b5356.zip FreeBSD-src-8f6b3a6b1b815311b090b321cafaa973b56b5356.tar.gz |
Eliminate pmap_page_lookup() and its uses. Instead, use PHYS_TO_VM_PAGE()
to convert the pte's physical address into a vm page.
Reviewed by: peter
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index c34607d..1927f81 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -221,7 +221,6 @@ static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va); static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex); -static vm_page_t pmap_page_lookup(vm_object_t object, vm_pindex_t pindex); static int pmap_unuse_pt(pmap_t, vm_offset_t, vm_page_t); static vm_offset_t pmap_kmem_choose(vm_offset_t addr); static void *pmap_pv_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); @@ -860,22 +859,6 @@ pmap_qremove(vm_offset_t sva, int count) pmap_invalidate_range(kernel_pmap, sva, va); } -static vm_page_t -pmap_page_lookup(vm_object_t object, vm_pindex_t pindex) -{ - vm_page_t m; - -retry: - m = vm_page_lookup(object, pindex); - if (m != NULL) { - vm_page_lock_queues(); - if (vm_page_sleep_if_busy(m, FALSE, "pplookp")) - goto retry; - vm_page_unlock_queues(); - } - return m; -} - /*************************************************** * Page table page management routines..... ***************************************************/ @@ -1132,8 +1115,7 @@ _pmap_allocpte(pmap, ptepindex) _pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index); } else { /* Add reference to pdp page */ - pdppg = pmap_page_lookup(pmap->pm_pteobj, - NUPDE + NUPDPE + pml4index); + pdppg = PHYS_TO_VM_PAGE(*pml4); pdppg->hold_count++; } pdp = (pdp_entry_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME); @@ -1168,8 +1150,7 @@ _pmap_allocpte(pmap, ptepindex) _pmap_allocpte(pmap, NUPDE + pdpindex); } else { /* Add reference to the pd page */ - pdpg = pmap_page_lookup(pmap->pm_pteobj, - NUPDE + pdpindex); + pdpg = PHYS_TO_VM_PAGE(*pdp); pdpg->hold_count++; } } @@ -1227,16 +1208,7 @@ pmap_allocpte(pmap_t pmap, vm_offset_t va) * hold count, and activate it. */ if (pd != 0 && (*pd & PG_V) != 0) { - /* - * In order to get the page table page, try the - * hint first. - */ - if (pmap->pm_pteobj->root && - (pmap->pm_pteobj->root->pindex == ptepindex)) { - m = pmap->pm_pteobj->root; - } else { - m = pmap_page_lookup(pmap->pm_pteobj, ptepindex); - } + m = PHYS_TO_VM_PAGE(*pd); m->hold_count++; return m; } @@ -1982,7 +1954,6 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte) if (mpte && (mpte->pindex == ptepindex)) { mpte->hold_count++; } else { -retry: /* * Get the page directory entry */ @@ -1995,14 +1966,7 @@ retry: if (ptepa && (*ptepa & PG_V) != 0) { if (*ptepa & PG_PS) panic("pmap_enter_quick: unexpected mapping into 2MB page"); - if (pmap->pm_pteobj->root && - (pmap->pm_pteobj->root->pindex == ptepindex)) { - mpte = pmap->pm_pteobj->root; - } else { - mpte = pmap_page_lookup(pmap->pm_pteobj, ptepindex); - } - if (mpte == NULL) - goto retry; + mpte = PHYS_TO_VM_PAGE(*ptepa); mpte->hold_count++; } else { mpte = _pmap_allocpte(pmap, ptepindex); |