Help needed: clearing the 68020 cache.

Mark Lord bnr-fos!bnr-public!mlord at watmath.waterloo.edu
Sat Jul 22 02:23:18 AEST 1989


In article <83 at brazos.Rice.edu> agesen at daimi.dk (Ole Agesen) writes:
>X-Sun-Spots-Digest: Volume 8, Issue 68, message 8 of 22
>store the instruction stream prefetch accesses from the main memory.  I'm
>currently implementing a kind of incremental linking implying the need to
>write self-modifying code. Therefore, I have to clear the cache upon a
>modification of the code. According to the MC68020 User's Manual the cache
>...
>Can anyone tell me how to clear the cache?

Easy, if you don't care about real time.  Just execute 128 sequential NOP
instructions (no looping!).  This will cause the entire cache contents  to
be overwritten with the NOPs, effectively flushing the on-chip cache.
This is probably faster than doing the appropriate system/kernel call
(assuming there IS an appropriate system/kernel call).  

-Mark



More information about the Comp.sys.sun mailing list