diff options
author | 2002-06-07 01:00:55 +0000 | |
---|---|---|
committer | 2002-06-07 01:00:55 +0000 | |
commit | 16740a12a584fee31a96888ef7249ff7b2bb7aaa (patch) | |
tree | ec4cf8e359d06e52bd0ebd8dc8c5549311996d05 | |
parent | avoid fd_set overrun. sync w/kame (diff) | |
download | wireguard-openbsd-16740a12a584fee31a96888ef7249ff7b2bb7aaa.tar.xz wireguard-openbsd-16740a12a584fee31a96888ef7249ff7b2bb7aaa.zip |
Fix the cache invalidation routines, per macppc cpu.h rev 1.3.
Initially from pefo@
-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; |