FreeBSD/sys/powerpc/aim/mmu_oea.c
/*
 * Set the physical protection on the specified range of this map as requested.
 */
Set the physical protection on the specified range of this map as requested.
Set the physical protection on the specified range of this map as requested .
void
moea_protect(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva,
    vm_prot_t prot)
{
	struct	pvo_entry *pvo, *tpvo, key;
	struct	pte *pt;
	KASSERT(pm == &curproc->p_vmspace->vm_pmap || pm == kernel_pmap,
	    ("moea_protect: non current pmap"));
	if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
		moea_remove(mmu, pm, sva, eva);
		return;
	}
	rw_wlock(&pvh_global_lock);
	PMAP_LOCK(pm);
	key.pvo_vaddr = sva;
	for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key);
	    pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) {
		tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo);
		pt = moea_pvo_to_pte(pvo, -1);
		pvo->pvo_pte.pte.pte_lo &= ~PTE_PP;
		pvo->pvo_pte.pte.pte_lo |= PTE_BR;
		if (pt != NULL) {
			moea_pte_change(pt, &pvo->pvo_pte.pte, pvo->pvo_vaddr);
			mtx_unlock(&moea_table_mutex);
		}
	}
	rw_wunlock(&pvh_global_lock);
	PMAP_UNLOCK(pm);
}
void moea_protect ( mmu_t mmu , pmap_t pm , vm_offset_t sva , vm_offset_t eva , vm_prot_t prot ) { struct pvo_entry * pvo , * tpvo , key ; struct pte * pt ; KASSERT ( pm == & curproc -> p_vmspace -> vm_pmap || pm == kernel_pmap , ( " " ) ) ; if ( ( prot & VM_PROT_READ ) == VM_PROT_NONE ) { moea_remove ( mmu , pm , sva , eva ) ; return ; } rw_wlock ( & pvh_global_lock ) ; PMAP_LOCK ( pm ) ; key . pvo_vaddr = sva ; for ( pvo = RB_NFIND ( pvo_tree , & pm -> pmap_pvo , & key ) ; pvo != NULL && PVO_VADDR ( pvo ) < eva ; pvo = tpvo ) { tpvo = RB_NEXT ( pvo_tree , & pm -> pmap_pvo , pvo ) ; pt = moea_pvo_to_pte ( pvo , -1 ) ; pvo -> pvo_pte . pte . pte_lo &= ~ PTE_PP ; pvo -> pvo_pte . pte . pte_lo |= PTE_BR ; if ( pt != NULL ) { moea_pte_change ( pt , & pvo -> pvo_pte . pte , pvo -> pvo_vaddr ) ; mtx_unlock ( & moea_table_mutex ) ; } } rw_wunlock ( & pvh_global_lock ) ; PMAP_UNLOCK ( pm ) ; }
Set the physical protection on the specified range of this map as requested.
Set the physical protection on the specified range of this map as requested .
/*
		 * Grab the PTE pointer before we diddle with the cached PTE
		 * copy.
		 */ /*
		 * Change the protection of the page.
		 */ /*
		 * If the PVO is in the page table, update that pte as well.
		 */