[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: caching mechanism



The flush functions have been added recently. If you download 2.4.19
you will find flush_etrax_cacherange and flush_etrax_cache. They look
like this:

tatic inline void
flush_etrax_cacherange(void *startadr, int length)
{
	/* CACHED_BOOTROM is mapped to the boot-rom area (cached) which
	 * we can use to get fast dummy-reads of cachelines
	 */

	volatile short *flushadr = (volatile short *)(((unsigned
long)startadr & ~PAGE_MASK) |
						      CACHED_BOOTROM);

	length = length > 8192 ? 8192 : length;  /* No need to flush more
than cache size */

	while(length > 0) {
		short tmp = *flushadr;           /* dummy read to flush */
		flushadr += (32/sizeof(short));  /* a cacheline is 32 bytes
*/
		length -= 32;
	}
}


void flush_etrax_cache(void)
{
	flush_etrax_cacherange(0, 8192);
}

/Mikael

-----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
Behalf Of Ronny L Nilsson
Sent: Wednesday, August 14, 2002 10:30 AM
To: Mikael Starvik; dev-etrax
Subject: Re: caching mechanism



> In arch/cris/mm/init there are various methods to flush the cache.
> If you run them too often it will degrade system performance
> drastically. 

there is? hmmmm.. Seems I can't find any obvious "flush()" routine in 
there, but perhaps I'm just unfamilar with the mm usage.

/Ronny