summaryrefslogtreecommitdiff
path: root/sys/arch/mvmeppc/stand/libsa/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/mvmeppc/stand/libsa/cache.c')
-rw-r--r--sys/arch/mvmeppc/stand/libsa/cache.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/arch/mvmeppc/stand/libsa/cache.c b/sys/arch/mvmeppc/stand/libsa/cache.c
new file mode 100644
index 00000000000..7c6f8b4de97
--- /dev/null
+++ b/sys/arch/mvmeppc/stand/libsa/cache.c
@@ -0,0 +1,23 @@
+/* $OpenBSD: cache.c,v 1.1 2001/06/26 21:58:07 smurph Exp $ */
+#define CACHELINESIZE 32 /* For now XXX */
+
+void
+syncicache(from, len)
+ void *from;
+ int len;
+{
+ int l = len;
+ void *p = from;
+
+ do {
+ asm volatile ("dcbf %1,%0" :: "r"(p), "r"(0));
+ p += CACHELINESIZE;
+ } while ((l -= CACHELINESIZE) > 0);
+ asm volatile ("sync");
+ do {
+ asm volatile ("icbi %1,%0" :: "r"(from), "r"(0));
+ from += CACHELINESIZE;
+ } while ((len -= CACHELINESIZE) > 0);
+ asm volatile ("isync");
+}
+