diff options
author | 2001-03-23 18:41:01 +0000 | |
---|---|---|
committer | 2001-03-23 18:41:01 +0000 | |
commit | 3508fbedf58d533e7e3039870f6909aa10dda8bf (patch) | |
tree | b1a3e3e169df3d2f41e5d63275babb27aac64a75 /sys | |
parent | bsdi support, ok niklas@ (diff) | |
download | wireguard-openbsd-3508fbedf58d533e7e3039870f6909aa10dda8bf.tar.xz wireguard-openbsd-3508fbedf58d533e7e3039870f6909aa10dda8bf.zip |
Fix pagemove to work with PMAP_NEW. Mostly from NetBSD.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/vm_machdep.c | 28 |
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 } /* |