FreeBSD/sys/arm/arm/pmap-v4.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)
{
	struct pcb *pcb;
	pmap_idcache_wbinv_all(pmap);
	cpu_l2cache_wbinv_all();
	pmap_tlb_flushID(pmap);
	cpu_cpwait();
	if (vector_page < KERNBASE) {
		struct pcb *curpcb = PCPU_GET(curpcb);
		pcb = thread0.td_pcb;
		if (pmap_is_current(pmap)) {
			critical_enter();
			*pcb->pcb_pl1vec = pcb->pcb_l1vec;
			cpu_domains(pcb->pcb_dacr);
			cpu_setttb(pcb->pcb_pagedir);
			critical_exit();
		}
		pmap_remove(pmap, vector_page, vector_page + PAGE_SIZE);
		curpcb->pcb_pl1vec = pcb->pcb_pl1vec;
		curpcb->pcb_l1vec = pcb->pcb_l1vec;
		curpcb->pcb_dacr = pcb->pcb_dacr;
		curpcb->pcb_pagedir = pcb->pcb_pagedir;
	}
	pmap_free_l1(pmap);
	dprintf("pmap_release()\n");
}
void pmap_release ( pmap_t pmap ) { struct pcb * pcb ; pmap_idcache_wbinv_all ( pmap ) ; cpu_l2cache_wbinv_all ( ) ; pmap_tlb_flushID ( pmap ) ; cpu_cpwait ( ) ; if ( vector_page < KERNBASE ) { struct pcb * curpcb = PCPU_GET ( curpcb ) ; pcb = thread0 . td_pcb ; if ( pmap_is_current ( pmap ) ) { critical_enter ( ) ; * pcb -> pcb_pl1vec = pcb -> pcb_l1vec ; cpu_domains ( pcb -> pcb_dacr ) ; cpu_setttb ( pcb -> pcb_pagedir ) ; critical_exit ( ) ; } pmap_remove ( pmap , vector_page , vector_page + PAGE_SIZE ) ; curpcb -> pcb_pl1vec = pcb -> pcb_pl1vec ; curpcb -> pcb_l1vec = pcb -> pcb_l1vec ; curpcb -> pcb_dacr = pcb -> pcb_dacr ; curpcb -> pcb_pagedir = pcb -> pcb_pagedir ; } pmap_free_l1 ( pmap ) ; dprintf ( " \n " ) ; }
Release any resources held by the given physical map.
Release any resources held by the given physical map .
/*
 			 * Frob the L1 entry corresponding to the vector
			 * page so that it contains the kernel pmap's domain
			 * number. This will ensure pmap_remove() does not
			 * pull the current vector page out from under us.
			 */ /*
		 * Make sure cpu_switch(), et al, DTRT. This is safe to do
		 * since this process has no remaining mappings of its own.
		 */