diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2002-06-07 01:00:56 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2002-06-07 01:00:56 +0000 |
commit | f4158d55050e39c74ece7e7de6ad37dafd46a22e (patch) | |
tree | a4d924c4a2b6f6a9d5f7d577d02d5906fa07a8e6 /sys/arch/mvmeppc | |
parent | 7cbe16104287ae95cf153897e44e354c43b852d5 (diff) |
Fix the cache invalidation routines, per macppc cpu.h rev 1.3.
Initially from pefo@
Diffstat (limited to 'sys/arch/mvmeppc')
-rw-r--r-- | sys/arch/mvmeppc/include/cpu.h | 12 |
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; |