FreeBSD/sys/arm/arm/pmap-v6.c
/*
 *  Reusing of KVA used in pmap_zero_page function !!!
 */
Reusing of KVA used in pmap_zero_page function
Reusing of KVA used in pmap_zero_page function
static void
pmap_zero_page_check(vm_page_t m)
{
	uint32_t *p, *end;
	struct sysmaps *sysmaps;
	sched_pin();
	sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
	mtx_lock(&sysmaps->lock);
	if (pte2_load(sysmaps->CMAP2) != 0)
		panic("%s: CMAP2 busy", __func__);
	pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
	    vm_page_pte2_attr(m)));
	end = (uint32_t*)(sysmaps->CADDR2 + PAGE_SIZE);
	for (p = (uint32_t*)sysmaps->CADDR2; p < end; p++)
		if (*p != 0)
			panic("%s: page %p not zero, va: %p", __func__, m,
			    sysmaps->CADDR2);
	pte2_clear(sysmaps->CMAP2);
	tlb_flush((vm_offset_t)sysmaps->CADDR2);
	sched_unpin();
	mtx_unlock(&sysmaps->lock);
}
static void pmap_zero_page_check ( vm_page_t m ) { uint32_t * p , * end ; struct sysmaps * sysmaps ; sched_pin ( ) ; sysmaps = & sysmaps_pcpu [ PCPU_GET ( cpuid ) ] ; mtx_lock ( & sysmaps -> lock ) ; if ( pte2_load ( sysmaps -> CMAP2 ) != 0 ) panic ( " " , __func__ ) ; pte2_store ( sysmaps -> CMAP2 , PTE2_KERN_NG ( VM_PAGE_TO_PHYS ( m ) , PTE2_AP_KRW , vm_page_pte2_attr ( m ) ) ) ; end = ( uint32_t * ) ( sysmaps -> CADDR2 + PAGE_SIZE ) ; for ( p = ( uint32_t * ) sysmaps -> CADDR2 ; p < end ; p ++ ) if ( * p != 0 ) panic ( " " , __func__ , m , sysmaps -> CADDR2 ) ; pte2_clear ( sysmaps -> CMAP2 ) ; tlb_flush ( ( vm_offset_t ) sysmaps -> CADDR2 ) ; sched_unpin ( ) ; mtx_unlock ( & sysmaps -> lock ) ; }
Reusing of KVA used in pmap_zero_page function !
Reusing of KVA used in pmap_zero_page function !