sys/sparc/sparc/cache.c
/*
 * Flush the current context from the cache.
 *
 * This is done by writing to each cache line in the `flush context'
 * address space (or, for hardware flush, once to each page in the
 * hardware flush space, for all cache pages).
 */
Flush the current context from the cache.
This is done by writing to each cache line in the `flush context'
address space (or, for hardware flush, once to each page in the
hardware flush space, for all cache pages).
Flush the current context from the cache . This is done by writing to each cache line in the ` flush context ' address space ( or for hardware flush once to each page in the hardware flush space for all cache pages ) .
void
cache_flush_context()
{
	register char *p;
	register int i, ls;
	cachestats.cs_ncxflush++;
	p = (char *)0;	
	if (cacheinfo.c_hwflush) {
		ls = NBPG;
		i = cacheinfo.c_totalsize >> PGSHIFT;
		for (; --i >= 0; p += ls)
			sta(p, ASI_HWFLUSHCTX, 0);
	} else {
		ls = cacheinfo.c_linesize;
		i = cacheinfo.c_totalsize >> cacheinfo.c_l2linesize;
		for (; --i >= 0; p += ls)
			sta(p, ASI_FLUSHCTX, 0);
	}
}
void cache_flush_context ( ) { register char * p ; register int i , ls ; cachestats . cs_ncxflush ++ ; p = ( char * ) 0 ; if ( cacheinfo . c_hwflush ) { ls = NBPG ; i = cacheinfo . c_totalsize >> PGSHIFT ; for ( ; -- i >= 0 ; p += ls ) sta ( p , ASI_HWFLUSHCTX , 0 ) ; } else { ls = cacheinfo . c_linesize ; i = cacheinfo . c_totalsize >> cacheinfo . c_l2linesize ; for ( ; -- i >= 0 ; p += ls ) sta ( p , ASI_FLUSHCTX , 0 ) ; } }
Flush the current context from the cache.
Flush the current context from the cache .
/* addresses 0..cacheinfo.c_totalsize will do fine */