summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-03-23 18:41:02 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-03-23 18:41:02 +0000
commit49b4dc6783233175909e6ba3129a7bb39dd490b7 (patch)
treeda0261329ff85f234b66596fc5450ecc0feef2bd /sys/arch
parentfcaed2e9fb183e63eb6d5cf9f0ff755900377603 (diff)
Fix pagemove to work with PMAP_NEW. Mostly from NetBSD.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/vm_machdep.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/vm_machdep.c b/sys/arch/i386/i386/vm_machdep.c
index 5b122ab36d6..ee5c433ad33 100644
--- a/sys/arch/i386/i386/vm_machdep.c
+++ b/sys/arch/i386/i386/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.22 2001/03/23 14:26:10 art Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.23 2001/03/23 18:41:01 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.61 1996/05/03 19:42:35 christos Exp $ */
/*-
@@ -334,6 +334,9 @@ pagemove(from, to, size)
size_t size;
{
pt_entry_t *fpte, *tpte;
+#ifdef PMAP_NEW
+ pt_entry_t ofpte, otpte;
+#endif
#ifdef DIAGNOSTIC
if ((size & PAGE_MASK) != 0)
@@ -342,13 +345,36 @@ pagemove(from, to, size)
fpte = kvtopte(from);
tpte = kvtopte(to);
while (size > 0) {
+#ifdef PMAP_NEW
+ ofpte = *fpte;
+ otpte = *tpte;
+#endif
*tpte++ = *fpte;
*fpte++ = 0;
+#ifdef PMAP_NEW
+#if defined(I386_CPU)
+ if (cpu_class != CPUCLASS_386)
+#endif
+ {
+ if (otpte & PG_V)
+ pmap_update_pg((vm_offset_t) to);
+ if (ofpte & PG_V)
+ pmap_update_pg((vm_offset_t) from);
+ }
+#endif
+
from += NBPG;
to += NBPG;
size -= NBPG;
}
+#ifdef PMAP_NEW
+#if defined(I386_CPU)
+ if (cpu_class != CPUCLASS_386)
+ tlbflush();
+#endif
+#else
pmap_update();
+#endif
}
/*