FreeBSD/sys/arm/arm/pmap-v6.c
/*
 *  Do the things to unmap a page in a process.
 */
Do the things to unmap a page in a process.
Do the things to unmap a page in a process .
static int
pmap_remove_pte2(pmap_t pmap, pt2_entry_t *pte2p, vm_offset_t va,
    struct spglist *free)
{
	pt2_entry_t opte2;
	vm_page_t m;
	rw_assert(&pvh_global_lock, RA_WLOCKED);
	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
	opte2 = pte2_load_clear(pte2p);
	pmap_tlb_flush(pmap, va);
	KASSERT(pte2_is_valid(opte2), ("%s: pmap %p va %#x not link pte2 %#x",
	    __func__, pmap, va, opte2));
	if (opte2 & PTE2_W)
		pmap->pm_stats.wired_count -= 1;
	pmap->pm_stats.resident_count -= 1;
	if (pte2_is_managed(opte2)) {
		m = PHYS_TO_VM_PAGE(pte2_pa(opte2));
		if (pte2_is_dirty(opte2))
			vm_page_dirty(m);
		if (opte2 & PTE2_A)
			vm_page_aflag_set(m, PGA_REFERENCED);
		pmap_remove_entry(pmap, m, va);
	}
	return (pmap_unuse_pt2(pmap, va, free));
}
static int pmap_remove_pte2 ( pmap_t pmap , pt2_entry_t * pte2p , vm_offset_t va , struct spglist * free ) { pt2_entry_t opte2 ; vm_page_t m ; rw_assert ( & pvh_global_lock , RA_WLOCKED ) ; PMAP_LOCK_ASSERT ( pmap , MA_OWNED ) ; opte2 = pte2_load_clear ( pte2p ) ; pmap_tlb_flush ( pmap , va ) ; KASSERT ( pte2_is_valid ( opte2 ) , ( " " , __func__ , pmap , va , opte2 ) ) ; if ( opte2 & PTE2_W ) pmap -> pm_stats . wired_count -= 1 ; pmap -> pm_stats . resident_count -= 1 ; if ( pte2_is_managed ( opte2 ) ) { m = PHYS_TO_VM_PAGE ( pte2_pa ( opte2 ) ) ; if ( pte2_is_dirty ( opte2 ) ) vm_page_dirty ( m ) ; if ( opte2 & PTE2_A ) vm_page_aflag_set ( m , PGA_REFERENCED ) ; pmap_remove_entry ( pmap , m , va ) ; } return ( pmap_unuse_pt2 ( pmap , va , free ) ) ; }
Do the things to unmap a page in a process.
Do the things to unmap a page in a process .
/* Clear and invalidate the mapping. */