summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-10-09 17:02:16 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-10-09 17:02:16 +0000
commit21e5161103fbb47fa22eca675442a0198a331934 (patch)
tree00a384c8f59fc32242bf63cf1312b7486b5fcb18 /sys/arch
parent2957b789dda5fee3e9d1fb70d7c9e68a8a0f098b (diff)
Correctly handle invalidate of partial cache lines, for the Nth time.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/m88k/m88k/m8820x_machdep.c21
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110.c6
2 files changed, 24 insertions, 3 deletions
diff --git a/sys/arch/m88k/m88k/m8820x_machdep.c b/sys/arch/m88k/m88k/m8820x_machdep.c
index 757ee00e060..5faaa5f612f 100644
--- a/sys/arch/m88k/m88k/m8820x_machdep.c
+++ b/sys/arch/m88k/m88k/m8820x_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m8820x_machdep.c,v 1.48 2011/10/09 17:01:34 miod Exp $ */
+/* $OpenBSD: m8820x_machdep.c,v 1.49 2011/10/09 17:02:14 miod Exp $ */
/*
* Copyright (c) 2004, 2007, 2010, 2011, Miodrag Vallat.
*
@@ -839,12 +839,29 @@ m8820x_dma_cachectl(paddr_t _pa, psize_t _size, int op)
/*
* Restore data from incomplete cache lines having been invalidated,
- * if necessary.
+ * if necessary, write them back, and invalidate them again.
+ * (Note that these lines have been invalidated from all processors
+ * in the loop above, so there is no need to remote invalidate them
+ * again.)
*/
if (sz1 != 0)
bcopy(lines, (void *)pa1, sz1);
if (sz2 != 0)
bcopy(lines + MC88200_CACHE_LINE, (void *)pa2, sz2);
+ if (sz1 != 0) {
+#ifdef MULTIPROCESSOR
+ m8820x_cmmu_wbinv_locked(ci->ci_cpuid, pa1, MC88200_CACHE_LINE);
+#else
+ m8820x_cmmu_wbinv_locked(cpu, pa1, MC88200_CACHE_LINE);
+#endif
+ }
+ if (sz2 != 0) {
+#ifdef MULTIPROCESSOR
+ m8820x_cmmu_wbinv_locked(ci->ci_cpuid, pa2, MC88200_CACHE_LINE);
+#else
+ m8820x_cmmu_wbinv_locked(cpu, pa2, MC88200_CACHE_LINE);
+#endif
+ }
CMMU_UNLOCK;
set_psr(psr);
diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c
index 4f9ddb3f6b8..9c2e6dfc07f 100644
--- a/sys/arch/mvme88k/mvme88k/m88110.c
+++ b/sys/arch/mvme88k/mvme88k/m88110.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110.c,v 1.74 2011/04/19 21:25:28 miod Exp $ */
+/* $OpenBSD: m88110.c,v 1.75 2011/10/09 17:02:15 miod Exp $ */
/*
* Copyright (c) 2010, 2011, Miodrag Vallat.
@@ -876,6 +876,10 @@ m88110_dma_cachectl(paddr_t _pa, psize_t _size, int op)
bcopy(lines, (void *)pa1, sz1);
if (sz2 != 0)
bcopy(lines + MC88110_CACHE_LINE, (void *)pa2, sz2);
+ if (sz1 != 0)
+ m88110_cmmu_wbinv_locked(pa1, MC88110_CACHE_LINE);
+ if (sz2 != 0)
+ m88110_cmmu_wbinv_locked(pa2, MC88110_CACHE_LINE);
} else {
while (size != 0) {
count = (pa & PAGE_MASK) == 0 && size >= PAGE_SIZE ?