From da2dab0c106ccdbdf442ffa11e579018a3cbf3f7 Mon Sep 17 00:00:00 2001 From: minoura Date: Thu, 16 Sep 1999 14:35:42 +0000 Subject: [PATCH] Finish PMAP_NEW. - Wrong argument to pmap_kremove (vm_machdep.c:pagemove()). - Uninitialized variable (pmap.c:pmap_kremove <- this should be fixed long ago...) --- sys/arch/x68k/x68k/pmap.c | 8 +++++--- sys/arch/x68k/x68k/vm_machdep.c | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/arch/x68k/x68k/pmap.c b/sys/arch/x68k/x68k/pmap.c index 6ad8ae6fbc29..ffff80eb92e9 100644 --- a/sys/arch/x68k/x68k/pmap.c +++ b/sys/arch/x68k/x68k/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.44 1999/09/12 01:17:30 chs Exp $ */ +/* $NetBSD: pmap.c,v 1.45 1999/09/16 14:35:42 minoura Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -261,7 +261,7 @@ struct pmap kernel_pmap_store; vm_map_t st_map, pt_map; struct vm_map st_map_store, pt_map_store; -paddr_t avail_start; /* PA of first available physical page */ +paddr_t avail_start; /* PA of first available physical page */ paddr_t avail_end; /* PA of last available physical page */ psize_t mem_size; /* memory size in bytes */ vaddr_t virtual_avail; /* VA of first avail page (after kernel bss)*/ @@ -1569,7 +1569,7 @@ pmap_kremove(sva, size) pmap_t pmap = pmap_kernel(); vaddr_t nssva; pt_entry_t *pte; - vaddr_t eva; + vaddr_t eva = sva + size; PMAP_DPRINTF(PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT, ("pmap_kremove(%lx, %lx)\n", sva, size)); @@ -1586,6 +1586,8 @@ pmap_kremove(sva, size) while (sva < nssva) { if (!pmap_pte_v(pte)) { printf ("pmap_kremove: attempt to remove invalid mapping.\n"); + pte++; + sva += NBPG; continue; } if (pmap_pte_w(pte)) { diff --git a/sys/arch/x68k/x68k/vm_machdep.c b/sys/arch/x68k/x68k/vm_machdep.c index deb90f4c8841..e8f013920409 100644 --- a/sys/arch/x68k/x68k/vm_machdep.c +++ b/sys/arch/x68k/x68k/vm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.25 1999/09/12 01:17:31 chs Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.26 1999/09/16 14:35:42 minoura Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -233,7 +233,7 @@ pagemove(from, to, size) if (pmap_extract(pmap_kernel(), (vaddr_t)to, NULL) == TRUE) panic("pagemove 3"); #endif - pmap_kremove((vaddr_t)from, (vaddr_t)from + PAGE_SIZE); + pmap_kremove((vaddr_t)from, (vsize_t)PAGE_SIZE); pmap_kenter_pa((vaddr_t)to, pa, VM_PROT_READ|VM_PROT_WRITE); from += PAGE_SIZE; to += PAGE_SIZE;