FreeBSD/sys/arm/arm/pmap-v6.c
/*
 *  Release any resources held by the given physical map.
 *  Called when a pmap initialized by pmap_pinit is being released.
 *  Should only be called if the map contains no valid mappings.
 */
Release any resources held by the given physical map.
Called when a pmap initialized by pmap_pinit is being released.
Should only be called if the map contains no valid mappings.
Release any resources held by the given physical map . Called when a pmap initialized by pmap_pinit is being released . Should only be called if the map contains no valid mappings .
void
pmap_release(pmap_t pmap)
{
#ifdef INVARIANTS
	vm_offset_t start, end;
#endif
	KASSERT(pmap->pm_stats.resident_count == 0,
	    ("%s: pmap resident count %ld != 0", __func__,
	    pmap->pm_stats.resident_count));
	KASSERT(pt2tab_user_is_empty(pmap->pm_pt2tab),
	    ("%s: has allocated user PT2(s)", __func__));
	KASSERT(CPU_EMPTY(&pmap->pm_active),
	    ("%s: pmap %p is active on some CPU(s)", __func__, pmap));
	mtx_lock_spin(&allpmaps_lock);
	LIST_REMOVE(pmap, pm_list);
	mtx_unlock_spin(&allpmaps_lock);
#ifdef INVARIANTS
	start = pte1_index(KERNBASE) * sizeof(pt1_entry_t);
	end = (pte1_index(0xFFFFFFFF) + 1) * sizeof(pt1_entry_t);
	bzero((char *)pmap->pm_pt1 + start, end - start);
	start = pt2tab_index(KERNBASE) * sizeof(pt2_entry_t);
	end = (pt2tab_index(0xFFFFFFFF) + 1) * sizeof(pt2_entry_t);
	bzero((char *)pmap->pm_pt2tab + start, end - start);
#endif
}
void pmap_release ( pmap_t pmap ) { #ifdef INVARIANTS vm_offset_t start , end ; #endif KASSERT ( pmap -> pm_stats . resident_count == 0 , ( " " , __func__ , pmap -> pm_stats . resident_count ) ) ; KASSERT ( pt2tab_user_is_empty ( pmap -> pm_pt2tab ) , ( " " , __func__ ) ) ; KASSERT ( CPU_EMPTY ( & pmap -> pm_active ) , ( " " , __func__ , pmap ) ) ; mtx_lock_spin ( & allpmaps_lock ) ; LIST_REMOVE ( pmap , pm_list ) ; mtx_unlock_spin ( & allpmaps_lock ) ; #ifdef INVARIANTS start = pte1_index ( KERNBASE ) * sizeof ( pt1_entry_t ) ; end = ( pte1_index ( 0xFFFFFFFF ) + 1 ) * sizeof ( pt1_entry_t ) ; bzero ( ( char * ) pmap -> pm_pt1 + start , end - start ) ; start = pt2tab_index ( KERNBASE ) * sizeof ( pt2_entry_t ) ; end = ( pt2tab_index ( 0xFFFFFFFF ) + 1 ) * sizeof ( pt2_entry_t ) ; bzero ( ( char * ) pmap -> pm_pt2tab + start , end - start ) ; #endif }
Release any resources held by the given physical map.
Release any resources held by the given physical map .
/*
	 * We are leaving PT1 and PT2TAB allocated on released pmap,
	 * so hopefully UMA vmspace_zone will always be inited with
	 * UMA_ZONE_NOFREE flag.
	 */