summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2002-06-07 01:00:56 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2002-06-07 01:00:56 +0000
commitf4158d55050e39c74ece7e7de6ad37dafd46a22e (patch)
treea4d924c4a2b6f6a9d5f7d577d02d5906fa07a8e6 /sys
parent7cbe16104287ae95cf153897e44e354c43b852d5 (diff)
Fix the cache invalidation routines, per macppc cpu.h rev 1.3.
Initially from pefo@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mvmeppc/include/cpu.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/mvmeppc/include/cpu.h b/sys/arch/mvmeppc/include/cpu.h
index 278051c2110..71d77072af9 100644
--- a/sys/arch/mvmeppc/include/cpu.h
+++ b/sys/arch/mvmeppc/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.3 2001/11/06 22:45:57 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.4 2002/06/07 01:00:55 miod Exp $ */
/* $NetBSD: cpu.h,v 1.1 1996/09/30 16:34:21 ws Exp $ */
/*
@@ -41,8 +41,11 @@
static __inline void
syncicache(void *from, int len)
{
- int l = len;
+ int l;
char *p = from;
+
+ len = len + (((u_int32_t) from) & (CACHELINESIZE - 1));
+ l = len;
do {
__asm__ __volatile__ ("dcbst 0,%0" :: "r"(p));
@@ -61,9 +64,12 @@ syncicache(void *from, int len)
static __inline void
invdcache(void *from, int len)
{
- int l = len;
+ int l;
char *p = from;
+ len = len + (((u_int32_t) from) & (CACHELINESIZE - 1));
+ l = len;
+
do {
__asm__ __volatile__ ("dcbi 0,%0" :: "r"(p));
p += CACHELINESIZE;