FreeBSD/sys/sparc64/sparc64/spitfire.c
/*
 * Flush a physical page from the data cache.
 */
Flush a physical page from the data cache.
Flush a physical page from the data cache .
void
spitfire_dcache_page_inval(vm_paddr_t pa)
{
	u_long target;
	void *cookie;
	u_long addr;
	u_long tag;
	KASSERT((pa & PAGE_MASK) == 0, ("%s: pa not page aligned", __func__));
	PMAP_STATS_INC(spitfire_dcache_npage_inval);
	target = pa >> (PAGE_SHIFT - DC_TAG_SHIFT);
	cookie = ipi_dcache_page_inval(tl_ipi_spitfire_dcache_page_inval, pa);
	for (addr = 0; addr < PCPU_GET(cache.dc_size);
	    addr += PCPU_GET(cache.dc_linesize)) {
		tag = ldxa(addr, ASI_DCACHE_TAG);
		if (((tag >> DC_VALID_SHIFT) & DC_VALID_MASK) == 0)
			continue;
		tag &= DC_TAG_MASK << DC_TAG_SHIFT;
		if (tag == target) {
			PMAP_STATS_INC(spitfire_dcache_npage_inval_match);
			stxa_sync(addr, ASI_DCACHE_TAG, tag);
		}
	}
	ipi_wait(cookie);
}
void spitfire_dcache_page_inval ( vm_paddr_t pa ) { u_long target ; void * cookie ; u_long addr ; u_long tag ; KASSERT ( ( pa & PAGE_MASK ) == 0 , ( " " , __func__ ) ) ; PMAP_STATS_INC ( spitfire_dcache_npage_inval ) ; target = pa >> ( PAGE_SHIFT - DC_TAG_SHIFT ) ; cookie = ipi_dcache_page_inval ( tl_ipi_spitfire_dcache_page_inval , pa ) ; for ( addr = 0 ; addr < PCPU_GET ( cache . dc_size ) ; addr += PCPU_GET ( cache . dc_linesize ) ) { tag = ldxa ( addr , ASI_DCACHE_TAG ) ; if ( ( ( tag >> DC_VALID_SHIFT ) & DC_VALID_MASK ) == 0 ) continue ; tag &= DC_TAG_MASK << DC_TAG_SHIFT ; if ( tag == target ) { PMAP_STATS_INC ( spitfire_dcache_npage_inval_match ) ; stxa_sync ( addr , ASI_DCACHE_TAG , tag ) ; } } ipi_wait ( cookie ) ; }
Flush a physical page from the data cache.
Flush a physical page from the data cache .