FreeBSD/sys/arm/arm/pmap-v4.c
/*
 * grow the number of kernel page table entries, if needed
 */
grow the number of kernel page table entries, if needed
grow the number of kernel page table entries if needed
void
pmap_growkernel(vm_offset_t addr)
{
	pmap_t kpm = kernel_pmap;
	if (addr <= pmap_curmaxkvaddr)
		return;		
	for (; pmap_curmaxkvaddr < addr; pmap_curmaxkvaddr += L1_S_SIZE)
		pmap_grow_l2_bucket(kpm, pmap_curmaxkvaddr);
	cpu_dcache_wbinv_all();
	cpu_l2cache_wbinv_all();
	cpu_tlb_flushD();
	cpu_cpwait();
	kernel_vm_end = pmap_curmaxkvaddr;
}
void pmap_growkernel ( vm_offset_t addr ) { pmap_t kpm = kernel_pmap ; if ( addr <= pmap_curmaxkvaddr ) return ; for ( ; pmap_curmaxkvaddr < addr ; pmap_curmaxkvaddr += L1_S_SIZE ) pmap_grow_l2_bucket ( kpm , pmap_curmaxkvaddr ) ; cpu_dcache_wbinv_all ( ) ; cpu_l2cache_wbinv_all ( ) ; cpu_tlb_flushD ( ) ; cpu_cpwait ( ) ; kernel_vm_end = pmap_curmaxkvaddr ; }
grow the number of kernel page table entries, if needed
grow the number of kernel page table entries if needed
/* we are OK */ /*
	 * whoops!   we need to add kernel PTPs
	 */ /* Map 1MB at a time */ /*
	 * flush out the cache, expensive but growkernel will happen so
	 * rarely
	 */