Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!husc6!rice!sun-spots-request
From: legato!!mojo@uunet.uu.net (Joseph Moran)
Newsgroups: comp.sys.sun
Subject: Re: Help needed: clearing the 68020 cache.
Keywords: SunOS
Message-ID: <602@brazos.Rice.edu>
Date: 27 Jul 89 02:52:44 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 32
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 8, Issue 88, message 3 of 16

In article <83@brazos.Rice.edu> agesen@daimi.dk (Ole Agesen) writes:
>Can anyone tell me how to clear the cache?
>  Can I get supervisor privileges for a user process?

I hope not. :-)

>  Is there a kernel operation clearing the cache?

In SunOS, you can execute a "trap #2".  This undocumented interface was
used by the old pixrect code that used to build and execute subroutines on
the stack.

On an 020, doing a trap #2 will execute:

	movl #9,d0	# clear and renable instruction cache
	movc d0,cacr
	rte

On an 030, doing a trap #2 will execute:

	movl #3919,d0	# clear and renable instruction and data caches
	movc d0,cacr
	rte

This is exactly what you need.

Joseph Moran
Legato Systems, Inc.
260 Sheridan Avenue
Palo Alto, CA  94306
(415) 329-7886
mojo@Legato.COM or {sun,uunet}!legato!mojo