FreeBSD/sys/powerpc/aim/mmu_oea64.c
/*
 * Map a wired page into kernel virtual address space.
 */
Map a wired page into kernel virtual address space.
Map a wired page into kernel virtual address space .
void
moea64_kenter_attr(mmu_t mmu, vm_offset_t va, vm_paddr_t pa, vm_memattr_t ma)
{
	int		error;	
	struct pvo_entry *pvo, *oldpvo;
	pvo = alloc_pvo_entry(0);
	pvo->pvo_pte.prot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE;
	pvo->pvo_pte.pa = (pa & ~ADDR_POFF) | moea64_calc_wimg(pa, ma);
	pvo->pvo_vaddr |= PVO_WIRED;
	PMAP_LOCK(kernel_pmap);
	oldpvo = moea64_pvo_find_va(kernel_pmap, va);
	if (oldpvo != NULL)
		moea64_pvo_remove_from_pmap(mmu, oldpvo);
	init_pvo_entry(pvo, kernel_pmap, va);
	error = moea64_pvo_enter(mmu, pvo, NULL);
	PMAP_UNLOCK(kernel_pmap);
	if (oldpvo != NULL) {
		PV_LOCK(oldpvo->pvo_pte.pa & LPTE_RPGN);
		moea64_pvo_remove_from_page(mmu, oldpvo);
		PV_UNLOCK(oldpvo->pvo_pte.pa & LPTE_RPGN);
		free_pvo_entry(oldpvo);
	}
	if (error != 0 && error != ENOENT)
		panic("moea64_kenter: failed to enter va %#zx pa %#zx: %d", va,
		    pa, error);
}
void moea64_kenter_attr ( mmu_t mmu , vm_offset_t va , vm_paddr_t pa , vm_memattr_t ma ) { int error ; struct pvo_entry * pvo , * oldpvo ; pvo = alloc_pvo_entry ( 0 ) ; pvo -> pvo_pte . prot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE ; pvo -> pvo_pte . pa = ( pa & ~ ADDR_POFF ) | moea64_calc_wimg ( pa , ma ) ; pvo -> pvo_vaddr |= PVO_WIRED ; PMAP_LOCK ( kernel_pmap ) ; oldpvo = moea64_pvo_find_va ( kernel_pmap , va ) ; if ( oldpvo != NULL ) moea64_pvo_remove_from_pmap ( mmu , oldpvo ) ; init_pvo_entry ( pvo , kernel_pmap , va ) ; error = moea64_pvo_enter ( mmu , pvo , NULL ) ; PMAP_UNLOCK ( kernel_pmap ) ; if ( oldpvo != NULL ) { PV_LOCK ( oldpvo -> pvo_pte . pa & LPTE_RPGN ) ; moea64_pvo_remove_from_page ( mmu , oldpvo ) ; PV_UNLOCK ( oldpvo -> pvo_pte . pa & LPTE_RPGN ) ; free_pvo_entry ( oldpvo ) ; } if ( error != 0 && error != ENOENT ) panic ( " " , va , pa , error ) ; }
Map a wired page into kernel virtual address space.
Map a wired page into kernel virtual address space .
/* Free any dead pages */