FreeBSD/sys/powerpc/aim/mmu_oea64.c
/*
 * Remove all pages mapped by the specified pmap
 */
Remove all pages mapped by the specified pmap
Remove all pages mapped by the specified pmap
void
moea64_remove_pages(mmu_t mmu, pmap_t pm)
{
	struct pvo_entry *pvo, *tpvo;
	struct pvo_tree tofree;
	RB_INIT(&tofree);
	PMAP_LOCK(pm);
	RB_FOREACH_SAFE(pvo, pvo_tree, &pm->pmap_pvo, tpvo) {
		if (pvo->pvo_vaddr & PVO_WIRED)
			continue;
		moea64_pvo_remove_from_pmap(mmu, pvo);
		RB_INSERT(pvo_tree, &tofree, pvo);
	}
	PMAP_UNLOCK(pm);
	RB_FOREACH_SAFE(pvo, pvo_tree, &tofree, tpvo) {
		PV_LOCK(pvo->pvo_pte.pa & LPTE_RPGN);
		moea64_pvo_remove_from_page(mmu, pvo);
		PV_UNLOCK(pvo->pvo_pte.pa & LPTE_RPGN);
		RB_REMOVE(pvo_tree, &tofree, pvo);
		free_pvo_entry(pvo);
	}
}
void moea64_remove_pages ( mmu_t mmu , pmap_t pm ) { struct pvo_entry * pvo , * tpvo ; struct pvo_tree tofree ; RB_INIT ( & tofree ) ; PMAP_LOCK ( pm ) ; RB_FOREACH_SAFE ( pvo , pvo_tree , & pm -> pmap_pvo , tpvo ) { if ( pvo -> pvo_vaddr & PVO_WIRED ) continue ; moea64_pvo_remove_from_pmap ( mmu , pvo ) ; RB_INSERT ( pvo_tree , & tofree , pvo ) ; } PMAP_UNLOCK ( pm ) ; RB_FOREACH_SAFE ( pvo , pvo_tree , & tofree , tpvo ) { PV_LOCK ( pvo -> pvo_pte . pa & LPTE_RPGN ) ; moea64_pvo_remove_from_page ( mmu , pvo ) ; PV_UNLOCK ( pvo -> pvo_pte . pa & LPTE_RPGN ) ; RB_REMOVE ( pvo_tree , & tofree , pvo ) ; free_pvo_entry ( pvo ) ; } }
Remove all pages mapped by the specified pmap
Remove all pages mapped by the specified pmap
/*
		 * For locking reasons, remove this from the page table and
		 * pmap, but save delinking from the vm_page for a second
		 * pass
		 */