FreeBSD/sys/arm/arm/pmap-v4.c
/*
 * Change the PTEs for the specified kernel mappings such that they
 * will use the mini data cache instead of the main data cache.
 */
Change the PTEs for the specified kernel mappings such that they
will use the mini data cache instead of the main data cache.
Change the PTEs for the specified kernel mappings such that they will use the mini data cache instead of the main data cache .
void
pmap_use_minicache(vm_offset_t va, vm_size_t size)
{
	struct l2_bucket *l2b;
	pt_entry_t *ptep, *sptep, pte;
	vm_offset_t next_bucket, eva;
#if (ARM_NMMUS > 1) || defined(CPU_XSCALE_CORE3)
	if (xscale_use_minidata == 0)
		return;
#endif
	eva = va + size;
	while (va < eva) {
		next_bucket = L2_NEXT_BUCKET(va);
		if (next_bucket > eva)
			next_bucket = eva;
		l2b = pmap_get_l2_bucket(kernel_pmap, va);
		sptep = ptep = &l2b->l2b_kva[l2pte_index(va)];
		while (va < next_bucket) {
			pte = *ptep;
			if (!l2pte_minidata(pte)) {
				cpu_dcache_wbinv_range(va, PAGE_SIZE);
				cpu_tlb_flushD_SE(va);
				*ptep = pte & ~L2_B;
			}
			ptep++;
			va += PAGE_SIZE;
		}
		PTE_SYNC_RANGE(sptep, (u_int)(ptep - sptep));
	}
	cpu_cpwait();
}
void pmap_use_minicache ( vm_offset_t va , vm_size_t size ) { struct l2_bucket * l2b ; pt_entry_t * ptep , * sptep , pte ; vm_offset_t next_bucket , eva ; #if ( ARM_NMMUS > 1 ) || defined ( CPU_XSCALE_CORE3 ) if ( xscale_use_minidata == 0 ) return ; #endif eva = va + size ; while ( va < eva ) { next_bucket = L2_NEXT_BUCKET ( va ) ; if ( next_bucket > eva ) next_bucket = eva ; l2b = pmap_get_l2_bucket ( kernel_pmap , va ) ; sptep = ptep = & l2b -> l2b_kva [ l2pte_index ( va ) ] ; while ( va < next_bucket ) { pte = * ptep ; if ( ! l2pte_minidata ( pte ) ) { cpu_dcache_wbinv_range ( va , PAGE_SIZE ) ; cpu_tlb_flushD_SE ( va ) ; * ptep = pte & ~ L2_B ; } ptep ++ ; va += PAGE_SIZE ; } PTE_SYNC_RANGE ( sptep , ( u_int ) ( ptep - sptep ) ) ; } cpu_cpwait ( ) ; }
Change the PTEs for the specified kernel mappings such that they
 will use the mini data cache instead of the main data cache.
Change the PTEs for the specified kernel mappings such that they will use the mini data cache instead of the main data cache .