vm_offset_t pa;
paddr_t pa;
pmap_page_protect(pa, prot)	vm_offset_t pa;	vm_prot_t prot;{	register struct pv_entry *pv;	register pmap_t pmap;	register u_int tlbprot;	int s;#ifdef PMAPDEBUG	if (pmapdebug & PDB_FOLLOW)		printf("pmap_page_protect(%x, %x)\n", pa, prot);#endif	switch (prot) {	case VM_PROT_ALL:		return;	case VM_PROT_READ:	case VM_PROT_READ|VM_PROT_EXECUTE:		s = splimp();		for (pv = pmap_find_pv(pa); pv; pv = pv->pv_next) {			/*			 * Compare new protection with old to see if			 * anything needs to be changed.			 */			tlbprot = pmap_prot(pv->pv_pmap, prot);			if ((pv->pv_tlbprot & TLB_AR_MASK) != tlbprot) {				pv->pv_tlbprot &= ~TLB_AR_MASK;				pv->pv_tlbprot |= tlbprot;				pmap_clear_va(pv->pv_space, pv->pv_va);				/*				 * Purge the current TLB entry (if any)				 * to force a fault and reload with the				 * new protection.				 */				pdtlb(pv->pv_space, pv->pv_va);				pitlb(pv->pv_space, pv->pv_va);			}		}		splx(s);		break;	default:		s = splimp();		while ((pv = pmap_find_pv(pa)) && pv->pv_pmap) {			pmap = pv->pv_pmap;			simple_lock(&pmap->pmap_lock);			pmap_remove_pv(pmap, pv->pv_va, pv);			pmap->pmap_stats.resident_count--;			simple_unlock(&pmap->pmap_lock);		}		splx(s);		break;	}}