Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys pmap_change_wiring() -> pmap_unwire().
details: https://anonhg.NetBSD.org/src/rev/6dbcaf0794bc
branches: trunk
changeset: 473738:6dbcaf0794bc
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Jun 17 19:23:20 1999 +0000
description:
pmap_change_wiring() -> pmap_unwire().
diffstat:
sys/arch/alpha/alpha/pmap.c | 55 +++++++++++++++-------------------------
sys/arch/amiga/amiga/pmap.c | 32 ++++++++++++-----------
sys/arch/arm32/arm32/pmap.c | 11 +++----
sys/arch/atari/atari/pmap.c | 32 ++++++++++++-----------
sys/arch/bebox/include/pmap.h | 4 +-
sys/arch/hp300/hp300/pmap.c | 32 ++++++++++++-----------
sys/arch/i386/i386/pmap.c | 26 +++++++++++-------
sys/arch/mac68k/mac68k/pmap.c | 32 ++++++++++++-----------
sys/arch/mips/mips/pmap.c | 47 ++++++++++++++++++++--------------
sys/arch/mvme68k/mvme68k/pmap.c | 32 ++++++++++++-----------
sys/arch/next68k/next68k/pmap.c | 32 ++++++++++++-----------
sys/arch/pc532/pc532/pmap.c | 26 +++++++++++-------
sys/arch/pica/pica/pmap.c | 49 +++++++++++++++++++++--------------
sys/arch/powerpc/include/pmap.h | 4 +-
sys/arch/sparc/include/pmap.h | 4 +-
sys/arch/sparc/sparc/pmap.c | 7 ++--
sys/arch/sparc64/sparc64/pmap.c | 20 +++++--------
sys/arch/sun3/sun3/pmap.c | 22 ++++++---------
sys/arch/sun3/sun3x/pmap.c | 20 ++++----------
sys/arch/vax/include/pmap.h | 4 +-
sys/arch/x68k/x68k/pmap.c | 30 +++++++++++----------
sys/uvm/uvm_fault.c | 4 +-
sys/vm/pmap.h | 4 +-
23 files changed, 271 insertions(+), 258 deletions(-)
diffs (truncated from 1318 to 300 lines):
diff -r f7b8de08bb11 -r 6dbcaf0794bc sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c Thu Jun 17 18:21:21 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c Thu Jun 17 19:23:20 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.103 1999/06/17 18:21:24 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.104 1999/06/17 19:23:22 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.103 1999/06/17 18:21:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.104 1999/06/17 19:23:22 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2013,24 +2013,23 @@
#endif /* PMAP_NEW */
/*
- * pmap_change_wiring: [ INTERFACE ]
+ * pmap_unwire: [ INTERFACE ]
*
- * Change the wiring attribute for a map/virtual-address pair.
+ * Clear the wired attribute for a map/virtual-address pair.
*
* The mapping must already exist in the pmap.
*/
void
-pmap_change_wiring(pmap, va, wired)
+pmap_unwire(pmap, va)
pmap_t pmap;
vaddr_t va;
- boolean_t wired;
{
pt_entry_t *pte;
int ps;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired);
+ printf("pmap_unwire(%p, %lx)\n", pmap, va);
#endif
if (pmap == NULL)
return;
@@ -2038,38 +2037,26 @@
PMAP_LOCK(pmap, ps);
pte = pmap_l3pte(pmap, va, NULL);
-#ifdef DEBUG
+#ifdef DIAGNOSTIC
+ if (pte == NULL || pmap_pte_v(pte) == 0)
+ panic("pmap_unwire");
+#endif
+
/*
- * Page table page is not allocated.
- * Should this ever happen? Ignore it for now,
- * we don't want to force allocation of unnecessary PTE pages.
- */
- if (pmap_pte_v(pmap_l2pte(pmap, va, NULL)) == 0) {
- if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid STE for %lx\n", va);
- return;
- }
- /*
- * Page not valid. Should this ever happen?
- * Just continue and change wiring anyway.
- */
- if (!pmap_pte_v(pte)) {
- if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid PTE for %lx\n", va);
- }
-#endif
- /*
- * If wiring actually changed (always?) set the wire bit and
+ * If wiring actually changed (always?) clear the wire bit and
* update the wire count. Note that wiring is not a hardware
* characteristic so there is no need to invalidate the TLB.
*/
- if (pmap_pte_w_chg(pte, wired ? PG_WIRED : 0)) {
- pmap_pte_set_w(pte, wired);
- if (wired)
- pmap->pm_stats.wired_count++;
- else
- pmap->pm_stats.wired_count--;
+ if (pmap_pte_w_chg(pte, 0)) {
+ pmap_pte_set_w(pte, FALSE);
+ pmap->pm_stats.wired_count--;
}
+#ifdef DIAGNOSTIC
+ else {
+ printf("pmap_unwire: wiring for pmap %p va 0x%lx "
+ "didn't change!\n", pmap, va);
+ }
+#endif
PMAP_UNLOCK(pmap, ps);
}
diff -r f7b8de08bb11 -r 6dbcaf0794bc sys/arch/amiga/amiga/pmap.c
--- a/sys/arch/amiga/amiga/pmap.c Thu Jun 17 18:21:21 1999 +0000
+++ b/sys/arch/amiga/amiga/pmap.c Thu Jun 17 19:23:20 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.66 1999/06/17 18:21:27 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.67 1999/06/17 19:23:22 thorpej Exp $ */
/*
* Copyright (c) 1991 Regents of the University of California.
@@ -1593,23 +1593,22 @@
}
/*
- * Routine: pmap_change_wiring
- * Function: Change the wiring attribute for a map/virtual-address
+ * Routine: pmap_unwire
+ * Function: Clear the wired attribute for a map/virtual-address
* pair.
* In/out conditions:
* The mapping must already exist in the pmap.
*/
void
-pmap_change_wiring(pmap, va, wired)
+pmap_unwire(pmap, va)
register pmap_t pmap;
vm_offset_t va;
- boolean_t wired;
{
register u_int *pte;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired);
+ printf("pmap_unwire(%p, %lx)\n", pmap, va);
#endif
if (pmap == NULL)
return;
@@ -1623,7 +1622,7 @@
*/
if (!pmap_ste_v(pmap, va)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid STE for %lx\n", va);
+ printf("pmap_unwire: invalid STE for %lx\n", va);
return;
}
/*
@@ -1632,20 +1631,23 @@
*/
if (!pmap_pte_v(pte)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid PTE for %lx\n", va);
+ printf("pmap_unwire: invalid PTE for %lx\n", va);
}
#endif
- if ((wired && !pmap_pte_w(pte)) || (!wired && pmap_pte_w(pte))) {
- if (wired)
- pmap->pm_stats.wired_count++;
- else
- pmap->pm_stats.wired_count--;
- }
/*
* Wiring is not a hardware characteristic so there is no need
* to invalidate TLB.
*/
- pmap_pte_set_w(pte, wired);
+ if (pmap_pte_w(pte)) {
+ pmap->pm_stats.wired_count--;
+ pmap_pte_set_w(pte, FALSE);
+ }
+#ifdef DIAGNOSTIC
+ else {
+ printf("pmap_unwire: wiring for pmap %p va 0x%lx "
+ "didn't change!\n", pmap, va);
+ }
+#endif
}
/*
diff -r f7b8de08bb11 -r 6dbcaf0794bc sys/arch/arm32/arm32/pmap.c
--- a/sys/arch/arm32/arm32/pmap.c Thu Jun 17 18:21:21 1999 +0000
+++ b/sys/arch/arm32/arm32/pmap.c Thu Jun 17 19:23:20 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.61 1999/06/17 18:21:28 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.62 1999/06/17 19:23:22 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -2225,18 +2225,17 @@
/*
- * Routine: pmap_change_wiring
- * Function: Change the wiring attribute for a map/virtual-address
+ * Routine: pmap_unwire
+ * Function: Clear the wired attribute for a map/virtual-address
* pair.
* In/out conditions:
* The mapping must already exist in the pmap.
*/
void
-pmap_change_wiring(pmap, va, wired)
+pmap_unwire(pmap, va)
pmap_t pmap;
vm_offset_t va;
- boolean_t wired;
{
pt_entry_t *pte;
vm_offset_t pa;
@@ -2261,7 +2260,7 @@
return;
pv = &vm_physmem[bank].pmseg.pvent[off];
/* Update the wired bit in the pv entry for this page. */
- (void) pmap_modify_pv(pmap, va, pv, PT_W, wired ? PT_W : 0);
+ (void) pmap_modify_pv(pmap, va, pv, PT_W, 0);
}
/*
diff -r f7b8de08bb11 -r 6dbcaf0794bc sys/arch/atari/atari/pmap.c
--- a/sys/arch/atari/atari/pmap.c Thu Jun 17 18:21:21 1999 +0000
+++ b/sys/arch/atari/atari/pmap.c Thu Jun 17 19:23:20 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.47 1999/06/17 18:21:28 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.48 1999/06/17 19:23:23 thorpej Exp $ */
/*
* Copyright (c) 1991 Regents of the University of California.
@@ -1315,23 +1315,22 @@
}
/*
- * Routine: pmap_change_wiring
- * Function: Change the wiring attribute for a map/virtual-address
+ * Routine: pmap_unwire
+ * Function: Clear the wired attribute for a map/virtual-address
* pair.
* In/out conditions:
* The mapping must already exist in the pmap.
*/
void
-pmap_change_wiring(pmap, va, wired)
+pmap_unwire(pmap, va)
register pmap_t pmap;
vaddr_t va;
- boolean_t wired;
{
register u_int *pte;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired);
+ printf("pmap_unwire(%p, %lx)\n", pmap, va);
#endif
if (pmap == NULL)
return;
@@ -1345,7 +1344,7 @@
*/
if (!pmap_ste_v(pmap, va)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid STE for %lx\n", va);
+ printf("pmap_unwire: invalid STE for %lx\n", va);
return;
}
/*
@@ -1354,20 +1353,23 @@
*/
if (!pmap_pte_v(pte)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid PTE for %lx\n", va);
+ printf("pmap_unwire: invalid PTE for %lx\n", va);
}
#endif
- if ((wired && !pmap_pte_w(pte)) || (!wired && pmap_pte_w(pte))) {
- if (wired)
- pmap->pm_stats.wired_count++;
- else
- pmap->pm_stats.wired_count--;
- }
/*
* Wiring is not a hardware characteristic so there is no need
* to invalidate TLB.
*/
- pmap_pte_set_w(pte, wired);
+ if (pmap_ptw_w(pte)) {
+ pmap->pm_stats.wired_count--;
+ pmap_pte_set_w(pte, FALSE);
+ }
+#ifdef DIAGNOSTIC
+ else {
+ printf("pmap_unwire: wiring for pmap %p va 0x%lx "
+ "didn't change!\n", pmap, va);
+ }
+#endif
}
/*
diff -r f7b8de08bb11 -r 6dbcaf0794bc sys/arch/bebox/include/pmap.h
--- a/sys/arch/bebox/include/pmap.h Thu Jun 17 18:21:21 1999 +0000
+++ b/sys/arch/bebox/include/pmap.h Thu Jun 17 19:23:20 1999 +0000
Home |
Main Index |
Thread Index |
Old Index