FreeBSD/sys/arm/arm/pmap-v4.c
/*
 * Pool cache constructors for L2 descriptor tables, metadata and pmap
 * structures.
 */
Pool cache constructors for L2 descriptor tables, metadata and pmap
structures.
Pool cache constructors for L2 descriptor tables metadata and pmap structures .
static int
pmap_l2ptp_ctor(void *mem, int size, void *arg, int flags)
{
#ifndef PMAP_INCLUDE_PTE_SYNC
	struct l2_bucket *l2b;
	pt_entry_t *ptep, pte;
	vm_offset_t va = (vm_offset_t)mem & ~PAGE_MASK;
		l2b = pmap_get_l2_bucket(kernel_pmap, va);
		ptep = &l2b->l2b_kva[l2pte_index(va)];
		pte = *ptep;
		if ((pte & L2_S_CACHE_MASK) != pte_l2_s_cache_mode_pt) {
			*ptep = (pte & ~L2_S_CACHE_MASK) | pte_l2_s_cache_mode_pt;
			PTE_SYNC(ptep);
			cpu_tlb_flushD_SE(va);
			cpu_cpwait();
		}
#endif
	memset(mem, 0, L2_TABLE_SIZE_REAL);
	PTE_SYNC_RANGE(mem, L2_TABLE_SIZE_REAL / sizeof(pt_entry_t));
	return (0);
}
static int pmap_l2ptp_ctor ( void * mem , int size , void * arg , int flags ) { #ifndef PMAP_INCLUDE_PTE_SYNC struct l2_bucket * l2b ; pt_entry_t * ptep , pte ; vm_offset_t va = ( vm_offset_t ) mem & ~ PAGE_MASK ; l2b = pmap_get_l2_bucket ( kernel_pmap , va ) ; ptep = & l2b -> l2b_kva [ l2pte_index ( va ) ] ; pte = * ptep ; if ( ( pte & L2_S_CACHE_MASK ) != pte_l2_s_cache_mode_pt ) { * ptep = ( pte & ~ L2_S_CACHE_MASK ) | pte_l2_s_cache_mode_pt ; PTE_SYNC ( ptep ) ; cpu_tlb_flushD_SE ( va ) ; cpu_cpwait ( ) ; } #endif memset ( mem , 0 , L2_TABLE_SIZE_REAL ) ; PTE_SYNC_RANGE ( mem , L2_TABLE_SIZE_REAL / sizeof ( pt_entry_t ) ) ; return ( 0 ) ; }
Pool cache constructors for L2 descriptor tables, metadata and pmap
 structures.
Pool cache constructors for L2 descriptor tables metadata and pmap structures .
/*
	 * The mappings for these page tables were initially made using
	 * pmap_kenter() by the pool subsystem. Therefore, the cache-
	 * mode will not be right for page table mappings. To avoid
	 * polluting the pmap_kenter() code with a special case for
	 * page tables, we simply fix up the cache-mode here if it's not
	 * correct.
	 */ /*
			 * Page tables must have the cache-mode set to
			 * Write-Thru.
			 */