ficache(pmap->pm_space, sva, PAGE_SIZE);
if (pte & PTE_PROT(TLB_EXECUTE)) ficache(pmap->pm_space, sva, PAGE_SIZE);
pmap_write_protect(pmap, sva, eva, prot)	struct pmap *pmap;	vaddr_t sva;	vaddr_t eva;	vm_prot_t prot;{	pt_entry_t *pde, pte;	u_int tlbprot, pdemask;	struct pv_head *pvh;	int bank, off;	DPRINTF(PDB_FOLLOW|PDB_PMAP,	    ("pmap_write_protect(%p, %x, %x, %x)\n", pmap, sva, eva, prot));	sva = hppa_trunc_page(sva);	tlbprot = PTE_PROT(pmap_prot(pmap, prot));	simple_lock(&pmap->pm_obj.vmobjlock);	for(pdemask = sva + 1; sva < eva; sva += PAGE_SIZE) {		if (pdemask != (sva & PDE_MASK)) {			pdemask = sva & PDE_MASK;			if (!(pde = pmap_pde_get(pmap->pm_pdir, sva))) {				sva += ~PDE_MASK + 1 - PAGE_SIZE;				continue;			}		}		if ((pte = pmap_pte_get(pde, sva))) {			DPRINTF(PDB_PMAP,			    ("pmap_write_protect: va=0x%x pte=0x%x\n",			    sva,  pte));			/*			 * Determine if mapping is changing.			 * If not, nothing to do.			 */			if ((pte & PTE_PROT(TLB_AR_MASK)) == tlbprot)				continue;			bank = vm_physseg_find(atop(pte), &off);			if (bank == -1) {				printf("pmap_page_remove: unmanaged page?\n");				return;			}			pvh = &vm_physmem[bank].pmseg.pvhead[off];			simple_lock(&pvh->pvh_lock);			pvh->pvh_attrs |= pmap_pvh_attrs(pte);			simple_unlock(&pvh->pvh_lock);			ficache(pmap->pm_space, sva, PAGE_SIZE);			pitlb(pmap->pm_space, sva);			fdcache(pmap->pm_space, sva, PAGE_SIZE);			pdtlb(pmap->pm_space, sva);			if (!(tlbprot & TLB_WRITE))				pte &= ~PTE_PROT(TLB_DIRTY);			pte &= ~PTE_PROT(TLB_AR_MASK);			pte |= tlbprot;			pmap_pte_set(pde, sva, pte);		}	}	simple_unlock(&pmap->pm_obj.vmobjlock);}