sys/sparc/sparc/cache.c
/*
 * Enable the cache.
 * We need to clear out the valid bits first.
 */
Enable the cache.
We need to clear out the valid bits first.
Enable the cache . We need to clear out the valid bits first .
void
cache_enable()
{
	register u_int i, lim, ls, ts;
	ls = cacheinfo.c_linesize;
	ts = cacheinfo.c_totalsize;
	for (i = AC_CACHETAGS, lim = i + ts; i < lim; i += ls)
		sta(i, ASI_CONTROL, 0);
	stba(AC_SYSENABLE, ASI_CONTROL,
	    lduba(AC_SYSENABLE, ASI_CONTROL) | SYSEN_CACHE);
	cacheinfo.c_enabled = 1;
	printf("%d byte (%d/line) write-through %cw flush cache enabled\n",
	    ts, ls, cacheinfo.c_hwflush ? 'h' : 's');
}
void cache_enable ( ) { register u_int i , lim , ls , ts ; ls = cacheinfo . c_linesize ; ts = cacheinfo . c_totalsize ; for ( i = AC_CACHETAGS , lim = i + ts ; i < lim ; i += ls ) sta ( i , ASI_CONTROL , 0 ) ; stba ( AC_SYSENABLE , ASI_CONTROL , lduba ( AC_SYSENABLE , ASI_CONTROL ) | SYSEN_CACHE ) ; cacheinfo . c_enabled = 1 ; printf ( " \n " , ts , ls , cacheinfo . c_hwflush ? ' ' : ' ' ) ; }
Enable the cache.
Enable the cache .