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
This commit is contained in:
Alan Cox 2003-08-14 05:18:38 +00:00
parent eac100658a
commit d8df7ab7ea

View File

@ -253,7 +253,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, unsigned 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);
@ -962,22 +961,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.....
***************************************************/
@ -1262,16 +1245,7 @@ pmap_allocpte(pmap_t pmap, vm_offset_t va)
* hold count, and activate it.
*/
if (ptepa) {
/*
* 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(ptepa);
m->hold_count++;
return m;
}
@ -2108,7 +2082,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
*/
@ -2121,14 +2094,7 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte)
if (ptepa) {
if (ptepa & PG_PS)
panic("pmap_enter_quick: unexpected mapping into 4MB 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);