FreeBSD/sys/powerpc/aim/mmu_oea64.c
/*
 * Atomically extract and hold the physical page with the given
 * pmap and virtual address pair if that mapping permits the given
 * protection.
 */
Atomically extract and hold the physical page with the given
pmap and virtual address pair if that mapping permits the given
protection.
Atomically extract and hold the physical page with the given pmap and virtual address pair if that mapping permits the given protection .
vm_page_t
moea64_extract_and_hold(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_prot_t prot)
{
	struct	pvo_entry *pvo;
	vm_page_t m;
        vm_paddr_t pa;
	m = NULL;
	pa = 0;
	PMAP_LOCK(pmap);
retry:
	pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF);
	if (pvo != NULL && (pvo->pvo_pte.prot & prot) == prot) {
		if (vm_page_pa_tryrelock(pmap,
		    pvo->pvo_pte.pa & LPTE_RPGN, &pa))
			goto retry;
		m = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN);
		vm_page_hold(m);
	}
	PA_UNLOCK_COND(pa);
	PMAP_UNLOCK(pmap);
	return (m);
}
vm_page_t moea64_extract_and_hold ( mmu_t mmu , pmap_t pmap , vm_offset_t va , vm_prot_t prot ) { struct pvo_entry * pvo ; vm_page_t m ; vm_paddr_t pa ; m = NULL ; pa = 0 ; PMAP_LOCK ( pmap ) ; retry : pvo = moea64_pvo_find_va ( pmap , va & ~ ADDR_POFF ) ; if ( pvo != NULL && ( pvo -> pvo_pte . prot & prot ) == prot ) { if ( vm_page_pa_tryrelock ( pmap , pvo -> pvo_pte . pa & LPTE_RPGN , & pa ) ) goto retry ; m = PHYS_TO_VM_PAGE ( pvo -> pvo_pte . pa & LPTE_RPGN ) ; vm_page_hold ( m ) ; } PA_UNLOCK_COND ( pa ) ; PMAP_UNLOCK ( pmap ) ; return ( m ) ; }
Atomically extract and hold the physical page with the given
 pmap and virtual address pair if that mapping permits the given
 protection.
Atomically extract and hold the physical page with the given pmap and virtual address pair if that mapping permits the given protection .