Subject: Flushing I/D caches from userspace

From: "J.D. Bakker" <[email-masked]>
Date: Thu, 8 Jun 2000 11:46:57 +0200

Hi all,

Is there any way to do cache flushes from userspace under ARMLinux ? I'm
developing a fixed point FFT library, and I want to do timings with both
hot and cold cache. The only way I can think of is to walk an array the
size of the D cache, and write a dummy function that fills the I cache, but
that seems a tad hackish.

Any thoughts ?

JDB.
[and yes, the library will be [L]GPL'd once it works properly]

--
LART. 250 MIPS under one Watt. Free hardware design files.
http://www.lart.tudelft.nl/

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]

---

From: Kira Brown <[email-masked]>
Date: Thu, 8 Jun 2000 11:34:35 +0100 (BST)

> Is there any way to do cache flushes from userspace under ARMLinux ? I'm

The way we used to do it under RISC OS was to write out enough data to
disparate pages that we could be sure that the cache had been flushed.

It's not a very smart way of doing things but hey...

kira.

---

From: "J.D. Bakker" <[email-masked]>
Date: Thu, 8 Jun 2000 12:47:42 +0200

>It's not a very smart way of doing things but hey...

On a processor with an SA-1 core this won't work as the caches are
allocate-on-read. I thought this was the norm for ARM ?

JDB.

--
"There is a style of design I call "wishful thinking engineering."  It starts
 with something like "pigs can fly if you feed them enough beans" and develops
 utopian plans such as like having everyone commute to work riding on personal
 pigs, and along the way ignores minor details such as the consequent rain of
 the non-gaseous byproducts."

 (Vernon Schryver in n.a.n-a.e)

---

From: Kira Brown <[email-masked]>
Date: Thu, 8 Jun 2000 11:49:30 +0100 (BST)

> allocate-on-read. I thought this was the norm for ARM ?

That was what we did to flush the write buffer-  if we didn't do that
regularly, we couldn't cache the video RAM without artifacts.

kira.

---

From: Nicolas Pitre <[email-masked]>
Date: Thu, 8 Jun 2000 20:42:09 -0400 (EDT)

On Thu, 8 Jun 2000, J.D. Bakker wrote:

> Hi all,
> 
> Is there any way to do cache flushes from userspace under ARMLinux ? 

Isn't a syscall for that?

Nicolas

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Sun, 11 Jun 2000 08:58:02 +0100 (BST)

> Isn't a syscall for that?

Yes there is.  Number 0x9f0002:

r0 = start
r1 = length
r2 = flags
	bit 0 - flush I cache as well.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |            http://www.arm.linux.org.uk/            /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |