Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sun3/sun3 That last commit left pagemove() entering...



details:   https://anonhg.NetBSD.org/src/rev/c58af05d0fca
branches:  trunk
changeset: 471665:c58af05d0fca
user:      gwr <gwr%NetBSD.org@localhost>
date:      Wed Apr 07 06:07:59 1999 +0000

description:
That last commit left pagemove() entering random mappings...

diffstat:

 sys/arch/sun3/sun3/vm_machdep.c |  33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diffs (54 lines):

diff -r f94aff6bac73 -r c58af05d0fca sys/arch/sun3/sun3/vm_machdep.c
--- a/sys/arch/sun3/sun3/vm_machdep.c   Wed Apr 07 05:59:14 1999 +0000
+++ b/sys/arch/sun3/sun3/vm_machdep.c   Wed Apr 07 06:07:59 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.48 1999/03/26 23:41:37 mycroft Exp $  */
+/*     $NetBSD: vm_machdep.c,v 1.49 1999/04/07 06:07:59 gwr Exp $      */
 
 /*
  * Copyright (c) 1994, 1995 Gordon W. Ross
@@ -295,26 +295,31 @@
  * and size must be a multiple of CLSIZE.
  */
 void
-pagemove(fptr, tptr, len)
-       caddr_t fptr, tptr;
+pagemove(from, to, len)
+       caddr_t from, to;
        size_t len;
 {
-       struct pmap *kpmap;
-       vm_offset_t fva, tva, pa;
+       struct pmap *kpmap = vm_map_pmap(kernel_map);
+       vm_prot_t prot = VM_PROT_READ|VM_PROT_WRITE;
+       vaddr_t fva = (vaddr_t)from;
+       vaddr_t tva = (vaddr_t)to;
+       paddr_t pa;
 
-       fva = (vm_offset_t)fptr;
-       tva = (vm_offset_t)tptr;
-#ifdef DIAGNOSTIC
-       if (len & PGOFSET || fva & PGOFSET || tva & PGOFSET)
+#ifdef DEBUG
+       if (len & CLOFSET)
                panic("pagemove");
 #endif
-
-       kpmap = vm_map_pmap(kernel_map);
        while (len > 0) {
-               /* this does the cache flush work itself */
+               pa = pmap_extract(kpmap, fva);
+#ifdef DEBUG
+               if (pa == 0)
+                       panic("pagemove 2");
+               if (pmap_extract(kpmap, tva) != 0)
+                       panic("pagemove 3");
+#endif
+               /* pmap_remove does the necessary cache flush.*/
                pmap_remove(kpmap, fva, fva + NBPG);
-               pmap_enter(kpmap, tva, pa,
-                   VM_PROT_READ|VM_PROT_WRITE, 1, VM_PROT_READ|VM_PROT_WRITE);
+               pmap_enter(kpmap, tva, pa, prot, 1, prot);
                fva += NBPG;
                tva += NBPG;
                len -= NBPG;



Home | Main Index | Thread Index | Old Index