summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/alpha/alpha/pmap.c16
-rw-r--r--sys/arch/amiga/amiga/pmap.c50
-rw-r--r--sys/arch/hp300/hp300/pmap.c47
-rw-r--r--sys/arch/hppa/hppa/pmap.c23
-rw-r--r--sys/arch/hppa/include/pmap.h3
-rw-r--r--sys/arch/i386/i386/pmap.c5
-rw-r--r--sys/arch/mac68k/mac68k/pmap.c96
-rw-r--r--sys/arch/mvme68k/mvme68k/pmap.c102
-rw-r--r--sys/arch/mvme88k/mvme88k/pmap.c51
-rw-r--r--sys/arch/pmax/pmax/pmap.c52
-rw-r--r--sys/arch/powerpc/include/pmap.h4
-rw-r--r--sys/arch/powerpc/powerpc/pmap.c15
-rw-r--r--sys/arch/sparc/include/pmap.h5
-rw-r--r--sys/arch/sparc/sparc/pmap.c23
-rw-r--r--sys/arch/sun3/sun3/pmap.c42
-rw-r--r--sys/arch/vax/include/param.h3
-rw-r--r--sys/arch/vax/vax/pmap.c12
-rw-r--r--sys/uvm/uvm_fault.c26
-rw-r--r--sys/vm/pmap.h9
-rw-r--r--sys/vm/vm_fault.c21
20 files changed, 93 insertions, 512 deletions
diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c
index 258247c401d..772c2d8c9ac 100644
--- a/sys/arch/alpha/alpha/pmap.c
+++ b/sys/arch/alpha/alpha/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.12 2001/04/10 06:59:13 niklas Exp $ */
+/* $OpenBSD: pmap.c,v 1.13 2001/05/09 15:31:23 art Exp $ */
/* $NetBSD: pmap.c,v 1.148 2000/09/22 05:23:37 thorpej Exp $ */
/*-
@@ -2139,13 +2139,10 @@ pmap_kremove(vaddr_t va, vsize_t size)
* The mapping must already exist in the pmap.
*/
void
-pmap_change_wiring(pmap_t pmap, vaddr_t va, int wired)
+pmap_unwire(pmap_t pmap, vaddr_t va)
{
pt_entry_t *pte;
- if (wired)
- panic("pmap_change_wiring");
-
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
printf("pmap_unwire(%p, %lx)\n", pmap, va);
@@ -2451,15 +2448,6 @@ pmap_copy_page(paddr_t src, paddr_t dst)
memcpy(d, s, PAGE_SIZE);
}
-void
-pmap_pageable(pmap, start, end, pageable)
- pmap_t pmap;
- vaddr_t start;
- vaddr_t end;
- boolean_t pageable;
-{
-}
-
/*
* pmap_clear_modify: [ INTERFACE ]
*
diff --git a/sys/arch/amiga/amiga/pmap.c b/sys/arch/amiga/amiga/pmap.c
index afb0675235b..5bc3b48f405 100644
--- a/sys/arch/amiga/amiga/pmap.c
+++ b/sys/arch/amiga/amiga/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.28 2001/05/05 21:26:34 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.29 2001/05/09 15:31:24 art Exp $ */
/* $NetBSD: pmap.c,v 1.68 1999/06/19 19:44:09 is Exp $ */
/*-
@@ -1492,29 +1492,22 @@ validate:
}
/*
- * Routine: pmap_change_wiring
+ * Routine: pmap_unwire
* Function: Change the wiring 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;
vaddr_t va;
- boolean_t wired;
{
u_int *pte;
- /*
- * Never called this way.
- */
- if (wired)
- panic("pmap_change_wiring: wired");
-
#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;
@@ -1528,7 +1521,7 @@ pmap_change_wiring(pmap, va, wired)
*/
if (!pmap_ste_v(pmap, va)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid STE for %lx\n",
+ printf("pmap_unwire: invalid STE for %lx\n",
va);
return;
}
@@ -1538,21 +1531,18 @@ pmap_change_wiring(pmap, va, wired)
*/
if (!pmap_pte_v(pte)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid PTE for %lx\n",
+ 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
+ if (pmap_pte_w(pte)) {
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);
+ pmap_pte_set_w(pte, 0);
}
/*
@@ -1840,30 +1830,6 @@ pmap_copy_page(src, dst)
physcopyseg(src, dst);
}
-
-/*
- * Routine: pmap_pageable
- * Function:
- * Make the specified pages (by pmap, offset)
- * pageable (or not) as requested.
- *
- * A page which is not pageable may not take
- * a fault; therefore, its page table entry
- * must remain valid for the duration.
- *
- * This routine is merely advisory; pmap_enter
- * will specify that these pages are to be wired
- * down (or not) as appropriate.
- */
-void
-pmap_pageable(pmap, sva, eva, pageable)
- pmap_t pmap;
- vaddr_t sva, eva;
- boolean_t pageable;
-{
- /* nothing */
-}
-
/*
* Clear the modify bits on the specified physical page.
*/
diff --git a/sys/arch/hp300/hp300/pmap.c b/sys/arch/hp300/hp300/pmap.c
index e31fc729b6c..653666a56e7 100644
--- a/sys/arch/hp300/hp300/pmap.c
+++ b/sys/arch/hp300/hp300/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.19 2001/05/06 21:38:59 millert Exp $ */
+/* $OpenBSD: pmap.c,v 1.20 2001/05/09 15:31:24 art Exp $ */
/* $NetBSD: pmap.c,v 1.75 1999/06/15 22:18:07 thorpej Exp $ */
/*-
@@ -1540,22 +1540,20 @@ validate:
}
/*
- * pmap_change_wiring: [ INTERFACE]
+ * pmap_unwire: [ INTERFACE]
*
* Change the wiring 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;
- PMAP_DPRINTF(PDB_FOLLOW,
- ("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired));
+ PMAP_DPRINTF(PDB_FOLLOW, ("pmap_unwire(%p, %lx)\n", pmap, va));
if (pmap == NULL)
return;
@@ -1569,7 +1567,7 @@ pmap_change_wiring(pmap, va, wired)
*/
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;
}
/*
@@ -1578,7 +1576,7 @@ pmap_change_wiring(pmap, va, wired)
*/
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
/*
@@ -1586,12 +1584,9 @@ pmap_change_wiring(pmap, va, wired)
* 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_W : 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, 0);
+ pmap->pm_stats.wired_count--;
}
}
@@ -1937,30 +1932,6 @@ pmap_copy_page(src, dst)
}
/*
- * pmap_pageable: [ INTERFACE ]
- *
- * Make the specified pages (by pmap, offset) pageable (or not) as
- * requested.
- *
- * A page which is not pageable may not take a fault; therefore,
- * its page table entry must remain valid for the duration.
- *
- * This routine is merely advisory; pmap_enter() will specify that
- * these pages are to be wired down (or not) as appropriate.
- */
-void
-pmap_pageable(pmap, sva, eva, pageable)
- pmap_t pmap;
- vaddr_t sva, eva;
- boolean_t pageable;
-{
-
- PMAP_DPRINTF(PDB_FOLLOW,
- ("pmap_pageable(%p, %lx, %lx, %x)\n",
- pmap, sva, eva, pageable));
-}
-
-/*
* pmap_clear_modify: [ INTERFACE ]
*
* Clear the modify bits on the specified physical page.
diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c
index 110489e8fdb..39df5f46d6f 100644
--- a/sys/arch/hppa/hppa/pmap.c
+++ b/sys/arch/hppa/hppa/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.43 2001/05/05 21:26:36 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.44 2001/05/09 15:31:24 art Exp $ */
/*
* Copyright (c) 1998-2001 Michael Shalayeff
@@ -1261,7 +1261,7 @@ pmap_protect(pmap, sva, eva, prot)
}
/*
- * Routine: pmap_change_wiring
+ * Routine: pmap_unwire
* Function: Change the wiring attribute for a map/virtual-address
* pair.
* In/out conditions:
@@ -1271,19 +1271,16 @@ pmap_protect(pmap, sva, eva, prot)
* only used to unwire pages and hence the mapping entry will exist.
*/
void
-pmap_change_wiring(pmap, va, wired)
- register pmap_t pmap;
+pmap_unwire(pmap, va)
+ pmap_t pmap;
vaddr_t va;
- boolean_t wired;
{
- register struct pv_entry *pv;
- boolean_t waswired;
+ struct pv_entry *pv;
va = hppa_trunc_page(va);
#ifdef PMAPDEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_change_wiring(%p, %x, %swire)\n",
- pmap, va, wired? "": "un");
+ printf("pmap_unwire(%p, %x)\n", pmap, va);
#endif
if (!pmap)
@@ -1292,13 +1289,9 @@ pmap_change_wiring(pmap, va, wired)
simple_lock(&pmap->pmap_lock);
if ((pv = pmap_find_va(pmap_sid(pmap, va), va)) == NULL)
- panic("pmap_change_wiring: can't find mapping entry");
+ panic("pmap_unwire: can't find mapping entry");
- waswired = pv->pv_tlbprot & TLB_WIRED;
- if (wired && !waswired) {
- pv->pv_tlbprot |= TLB_WIRED;
- pmap->pmap_stats.wired_count++;
- } else if (!wired && waswired) {
+ if (pv->pv_tlbprot & TLB_WIRED) {
pv->pv_tlbprot &= ~TLB_WIRED;
pmap->pmap_stats.wired_count--;
}
diff --git a/sys/arch/hppa/include/pmap.h b/sys/arch/hppa/include/pmap.h
index f586f4785c9..d8a11ebbaed 100644
--- a/sys/arch/hppa/include/pmap.h
+++ b/sys/arch/hppa/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.13 2001/01/12 23:37:01 mickey Exp $ */
+/* $OpenBSD: pmap.h,v 1.14 2001/05/09 15:31:24 art Exp $ */
/*
* Copyright (c) 1998,1999 Michael Shalayeff
@@ -182,7 +182,6 @@ do { if (pmap) { \
} } while (0)
#define pmap_collect(pmap)
#define pmap_release(pmap)
-#define pmap_pageable(pmap, start, end, pageable)
#define pmap_copy(dpmap,spmap,da,len,sa)
#define pmap_update()
#define pmap_activate(p)
diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c
index 31f86a086c6..86a7055d625 100644
--- a/sys/arch/i386/i386/pmap.c
+++ b/sys/arch/i386/i386/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.39 2001/04/10 06:59:13 niklas Exp $ */
+/* $OpenBSD: pmap.c,v 1.40 2001/05/09 15:31:25 art Exp $ */
/* $NetBSD: pmap.c,v 1.84 2000/02/21 02:01:24 chs Exp $ */
/*
@@ -2915,10 +2915,9 @@ pmap_write_protect(pmap, sva, eva, prot)
*/
void
-pmap_change_wiring(pmap, va, wired)
+pmap_unwire(pmap, va)
struct pmap *pmap;
vaddr_t va;
- boolean_t wired;
{
pt_entry_t *ptes;
diff --git a/sys/arch/mac68k/mac68k/pmap.c b/sys/arch/mac68k/mac68k/pmap.c
index 73dec155d16..0c436639c99 100644
--- a/sys/arch/mac68k/mac68k/pmap.c
+++ b/sys/arch/mac68k/mac68k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.18 2001/05/08 17:30:41 aaron Exp $ */
+/* $OpenBSD: pmap.c,v 1.19 2001/05/09 15:31:25 art Exp $ */
/* $NetBSD: pmap.c,v 1.55 1999/04/22 04:24:53 chs Exp $ */
/*
@@ -1389,22 +1389,20 @@ validate:
}
/*
- * pmap_change_wiring: [ INTERFACE ]
+ * pmap_unwire: [ INTERFACE ]
*
* Change the wiring 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;
- PMAP_DPRINTF(PDB_FOLLOW,
- ("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired));
+ PMAP_DPRINTF(PDB_FOLLOW, ("pmap_unwire(%p, %lx)\n", pmap, va));
if (pmap == NULL)
return;
@@ -1418,7 +1416,7 @@ pmap_change_wiring(pmap, va, wired)
*/
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;
}
/*
@@ -1427,7 +1425,7 @@ pmap_change_wiring(pmap, va, wired)
*/
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
/*
@@ -1435,12 +1433,9 @@ pmap_change_wiring(pmap, va, wired)
* 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_W : 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, 0);
+ pmap->pm_stats.wired_count--;
}
}
@@ -1767,79 +1762,6 @@ pmap_copy_page(src, dst)
}
/*
- * pmap_pageable: [ INTERFACE ]
- *
- * Make the specified pages (by pmap, offset) pageable (or not) as
- * requested.
- *
- * A page which is not pageable may not take a fault; therefore,
- * its page table entry must remain valid for the duration.
- *
- * This routine is merely advisory; pmap_enter() will specify that
- * these pages are to be wired down (or not) as appropriate.
- */
-void
-pmap_pageable(pmap, sva, eva, pageable)
- pmap_t pmap;
- vaddr_t sva, eva;
- boolean_t pageable;
-{
-
- PMAP_DPRINTF(PDB_FOLLOW,
- ("pmap_pageable(%p, %lx, %lx, %x)\n",
- pmap, sva, eva, pageable));
-
- /*
- * If we are making a PT page pageable then all valid
- * mappings must be gone from that page. Hence it should
- * be all zeros and there is no need to clean it.
- * Assumptions:
- * - we are called with only one page at a time
- * - PT pages have only one pv_table entry
- */
- if (pmap == pmap_kernel() && pageable && sva + NBPG == eva) {
- struct pv_entry *pv;
- paddr_t pa;
-
-#ifdef DEBUG
- if ((pmapdebug & (PDB_FOLLOW|PDB_PTPAGE)) == PDB_PTPAGE)
- printf("pmap_pageable(%p, %lx, %lx, %x)\n",
- pmap, sva, eva, pageable);
-#endif
- if (!pmap_ste_v(pmap, sva))
- return;
- pa = pmap_pte_pa(pmap_pte(pmap, sva));
- if (PAGE_IS_MANAGED(pa) == 0)
- return;
- pv = pa_to_pvh(pa);
- if (pv->pv_ptste == NULL)
- return;
-#ifdef DEBUG
- if (pv->pv_va != sva || pv->pv_next) {
- printf("pmap_pageable: bad PT page va %lx next %p\n",
- pv->pv_va, pv->pv_next);
- return;
- }
-#endif
- /*
- * page is unused, free it now!
- */
- pmap_remove_mapping(pv->pv_pmap, pv->pv_va,
- NULL, PRM_TFLUSH|PRM_CFLUSH);
-#if defined(UVM)
- uvm_pagefree(PHYS_TO_VM_PAGE(pa));
-#else
- vm_page_free(PHYS_TO_VM_PAGE(pa));
-#endif
-#ifdef DEBUG
- if (pmapdebug & PDB_PTPAGE)
- printf("pmap_pageable: PT page %lx(%x) freed\n",
- sva, *pmap_pte(pmap, sva));
-#endif
- }
-}
-
-/*
* pmap_clear_modify: [ INTERFACE ]
*
* Clear the modify bits on the specified physical page.
diff --git a/sys/arch/mvme68k/mvme68k/pmap.c b/sys/arch/mvme68k/mvme68k/pmap.c
index 9160d60394c..886d019eb8c 100644
--- a/sys/arch/mvme68k/mvme68k/pmap.c
+++ b/sys/arch/mvme68k/mvme68k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.18 2001/05/05 21:26:38 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.19 2001/05/09 15:31:25 art Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -1413,23 +1413,22 @@ validate:
}
/*
- * Routine: pmap_change_wiring
+ * Routine: pmap_unwire
* Function: Change the wiring 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)
- register pmap_t pmap;
+pmap_unwire(pmap, va)
+ pmap_t pmap;
vm_offset_t va;
- boolean_t wired;
{
- register pt_entry_t *pte;
+ pt_entry_t *pte;
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_change_wiring(%x, %x, %x)\n", pmap, va, wired);
+ printf("pmap_unwire(%x, %x)\n", pmap, va);
#endif
if (pmap == NULL)
return;
@@ -1443,7 +1442,7 @@ pmap_change_wiring(pmap, va, wired)
*/
if (!pmap_ste_v(pmap, va)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid STE for %x\n", va);
+ printf("pmap_unwire: invalid STE for %x\n", va);
return;
}
/*
@@ -1452,7 +1451,7 @@ pmap_change_wiring(pmap, va, wired)
*/
if (!pmap_pte_v(pte)) {
if (pmapdebug & PDB_PARANOIA)
- printf("pmap_change_wiring: invalid PTE for %x\n", va);
+ printf("pmap_unwire: invalid PTE for %x\n", va);
}
#endif
/*
@@ -1460,12 +1459,9 @@ pmap_change_wiring(pmap, va, wired)
* 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_W : 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, 0);
+ pmap->pm_stats.wired_count--;
}
}
@@ -1762,82 +1758,6 @@ pmap_copy_page(src, dst)
}
/*
- * Routine: pmap_pageable
- * Function:
- * Make the specified pages (by pmap, offset)
- * pageable (or not) as requested.
- *
- * A page which is not pageable may not take
- * a fault; therefore, its page table entry
- * must remain valid for the duration.
- *
- * This routine is merely advisory; pmap_enter
- * will specify that these pages are to be wired
- * down (or not) as appropriate.
- */
-void
-pmap_pageable(pmap, sva, eva, pageable)
- pmap_t pmap;
- vm_offset_t sva, eva;
- boolean_t pageable;
-{
-#ifdef DEBUG
- if (pmapdebug & PDB_FOLLOW)
- printf("pmap_pageable(%x, %x, %x, %x)\n",
- pmap, sva, eva, pageable);
-#endif
- /*
- * If we are making a PT page pageable then all valid
- * mappings must be gone from that page. Hence it should
- * be all zeros and there is no need to clean it.
- * Assumptions:
- * - we are called with only one page at a time
- * - PT pages have only one pv_table entry
- */
- if (pmap == pmap_kernel() && pageable && sva + NBPG == eva) {
- register struct pv_entry *pv;
- register vm_offset_t pa;
-
-#ifdef DEBUG
- if ((pmapdebug & (PDB_FOLLOW|PDB_PTPAGE)) == PDB_PTPAGE)
- printf("pmap_pageable(%x, %x, %x, %x)\n",
- pmap, sva, eva, pageable);
-#endif
- if (!pmap_ste_v(pmap, sva))
- return;
- pa = pmap_pte_pa(pmap_pte(pmap, sva));
- if (PAGE_IS_MANAGED(pa) == 0)
- return;
- pv = pa_to_pvh(pa);
- if (pv->pv_ptste == NULL)
- return;
-#ifdef DEBUG
- if (pv->pv_va != sva || pv->pv_next) {
- printf("pmap_pageable: bad PT page va %x next %x\n",
- pv->pv_va, pv->pv_next);
- return;
- }
-#endif
- /*
- * Mark it unmodified to avoid pageout
- */
- pmap_changebit(pa, PG_M, FALSE);
-#ifdef DEBUG
- if ((PHYS_TO_VM_PAGE(pa)->flags & PG_CLEAN) == 0) {
- printf("pa %x: flags=%x: not clean\n",
- pa, PHYS_TO_VM_PAGE(pa)->flags);
- PHYS_TO_VM_PAGE(pa)->flags |= PG_CLEAN;
- }
- if (pmapdebug & PDB_PTPAGE)
- printf("pmap_pageable: PT page %x(%x) unmodified\n",
- sva, *pmap_pte(pmap, sva));
- if (pmapdebug & PDB_WIRING)
- pmap_check_wiring("pageable", sva);
-#endif
- }
-}
-
-/*
* Clear the modify bits on the specified physical page.
*/
diff --git a/sys/arch/mvme88k/mvme88k/pmap.c b/sys/arch/mvme88k/mvme88k/pmap.c
index 5e14c515e72..c7798c630b7 100644
--- a/sys/arch/mvme88k/mvme88k/pmap.c
+++ b/sys/arch/mvme88k/mvme88k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.25 2001/03/22 01:15:35 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.26 2001/05/09 15:31:25 art Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -3057,7 +3057,7 @@ Retry:
} /* pmap_enter */
/*
- * Routine: pmap_change_wiring
+ * Routine: pmap_unwire
*
* Author: Fuzzy
*
@@ -3066,7 +3066,6 @@ Retry:
* Prameterts:
* pmap pointer to pmap structure
* v virtual address of page to be wired/unwired
- * wired flag indicating new wired state
*
* Extern/Global:
* pte_per_vm_page
@@ -3080,7 +3079,7 @@ Retry:
* The mapping must already exist in the pmap.
*/
void
-pmap_change_wiring(pmap_t map, vm_offset_t v, boolean_t wired)
+pmap_unwire(pmap_t map, vm_offset_t v)
{
pt_entry_t *pte;
int i;
@@ -3089,22 +3088,18 @@ pmap_change_wiring(pmap_t map, vm_offset_t v, boolean_t wired)
PMAP_LOCK(map, spl);
if ((pte = pmap_pte(map, v)) == PT_ENTRY_NULL)
- panic ("pmap_change_wiring: pte missing");
+ panic ("pmap_unwire: pte missing");
- if (wired && !pte->wired)
- /* wiring mapping */
- map->stats.wired_count++;
-
- else if (!wired && pte->wired)
+ if (pte->wired)
/* unwired mapping */
map->stats.wired_count--;
for (i = ptes_per_vm_page; i>0; i--)
- (pte++)->wired = wired;
+ (pte++)->wired = 0;
PMAP_UNLOCK(map, spl);
-} /* pmap_change_wiring() */
+} /* pmap_unwire() */
/*
* Routine: PMAP_EXTRACT
@@ -3763,38 +3758,6 @@ copy_from_phys(vm_offset_t srcpa, vm_offset_t dstva, int bytecount)
}
/*
- * Routine: PMAP_PAGEABLE
- *
- * History:
- * '90.7.16 Fuzzy
- *
- * Function:
- * Make the specified pages (by pmap, offset) pageable (or not) as
- * requested. A page which is not pageable may not take a fault;
- * therefore, its page table entry must remain valid for the duration.
- * this routine is merely advisory; pmap_enter will specify that
- * these pages are to be wired down (or not) as appropriate.
- *
- * Parameters:
- * pmap pointer to pmap structure
- * start virtual address of start of range
- * end virtual address of end of range
- * pageable flag indicating whether range is to be pageable.
- *
- * This routine currently does nothing in the 88100 implemetation.
- */
-void
-pmap_pageable(pmap_t pmap, vm_offset_t start, vm_offset_t end,
- boolean_t pageable)
-{
-#ifdef lint
- pmap++; start++; end++; pageable++;
-#endif
-} /* pmap_pagealbe() */
-
-
-
-/*
* Routine: PMAP_REDZONE
*
* Function:
diff --git a/sys/arch/pmax/pmax/pmap.c b/sys/arch/pmax/pmax/pmap.c
index dd3a70d283c..24894aaa72f 100644
--- a/sys/arch/pmax/pmax/pmap.c
+++ b/sys/arch/pmax/pmax/pmap.c
@@ -1050,31 +1050,27 @@ pmap_enter(pmap, va, pa, prot, wired, access_type)
}
/*
- * Routine: pmap_change_wiring
+ * Routine: pmap_unwire
* Function: Change the wiring 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)
- register pmap_t pmap;
+pmap_unwire(pmap, va)
+ pmap_t pmap;
vm_offset_t va;
- boolean_t wired;
{
- register pt_entry_t *pte;
- u_int p;
- register int i;
+ pt_entry_t *pte;
+ int i;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_WIRING))
- printf("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired);
+ printf("pmap_unwire(%p, %lx)\n", pmap, va);
#endif
if (pmap == NULL)
return;
- p = wired ? PG_WIRED : 0;
-
/*
* Don't need to flush the TLB since PG_WIRED is only in software.
*/
@@ -1082,7 +1078,7 @@ pmap_change_wiring(pmap, va, wired)
/* change entries in kernel pmap */
#ifdef DIAGNOSTIC
if (va < VM_MIN_KERNEL_ADDRESS || va >= virtual_end)
- panic("pmap_change_wiring");
+ panic("pmap_unwire");
#endif
pte = kvtopte(va);
} else {
@@ -1092,13 +1088,11 @@ pmap_change_wiring(pmap, va, wired)
}
i = mipspagesperpage;
- if (!(pte->pt_entry & PG_WIRED) && p)
- pmap->pm_stats.wired_count += i;
- else if ((pte->pt_entry & PG_WIRED) && !p)
+ if ((pte->pt_entry & PG_WIRED))
pmap->pm_stats.wired_count -= i;
do {
if (pte->pt_entry & PG_V)
- pte->pt_entry = (pte->pt_entry & ~PG_WIRED) | p;
+ pte->pt_entry ~= PG_WIRED;
pte++;
} while (--i != 0);
}
@@ -1269,34 +1263,6 @@ pmap_copy_page(src, dst)
}
/*
- * Routine: pmap_pageable
- * Function:
- * Make the specified pages (by pmap, offset)
- * pageable (or not) as requested.
- *
- * A page which is not pageable may not take
- * a fault; therefore, its page table entry
- * must remain valid for the duration.
- *
- * This routine is merely advisory; pmap_enter
- * will specify that these pages are to be wired
- * down (or not) as appropriate.
- */
-void
-pmap_pageable(pmap, sva, eva, pageable)
- pmap_t pmap;
- vm_offset_t sva, eva;
- boolean_t pageable;
-{
-
-#ifdef DEBUG
- if (pmapdebug & PDB_FOLLOW)
- printf("pmap_pageable(%p, %lx, %lx, %x)\n",
- pmap, sva, eva, pageable);
-#endif
-}
-
-/*
* Clear the modify bits on the specified physical page.
*/
void
diff --git a/sys/arch/powerpc/include/pmap.h b/sys/arch/powerpc/include/pmap.h
index 3f54e7ad34e..d7e3815c3a9 100644
--- a/sys/arch/powerpc/include/pmap.h
+++ b/sys/arch/powerpc/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.4 2001/02/22 03:26:23 drahn Exp $ */
+/* $OpenBSD: pmap.h,v 1.5 2001/05/09 15:31:26 art Exp $ */
/* $NetBSD: pmap.h,v 1.1 1996/09/30 16:34:29 ws Exp $ */
/*-
@@ -81,7 +81,7 @@ extern struct pmap kernel_pmap_;
#define pmap_clear_reference(pa) (ptemodify((pa), PTE_REF, 0))
#define pmap_is_modified(pa) (ptebits((pa), PTE_CHG))
#define pmap_is_referenced(pa) (ptebits((pa), PTE_REF))
-#define pmap_change_wiring(pm, va, wired)
+#define pmap_unwire(pm, va)
#define pmap_phys_address(x) (x)
diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c
index b5cb6103a66..e476316b6fb 100644
--- a/sys/arch/powerpc/powerpc/pmap.c
+++ b/sys/arch/powerpc/powerpc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.28 2001/05/05 21:26:40 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.29 2001/05/09 15:31:26 art Exp $ */
/* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */
/*
@@ -988,19 +988,6 @@ pmap_collect(pm)
}
/*
- * Make the specified pages pageable or not as requested.
- *
- * This routine is merely advisory.
- */
-void
-pmap_pageable(pm, start, end, pageable)
- struct pmap *pm;
- vm_offset_t start, end;
- int pageable;
-{
-}
-
-/*
* Fill the given physical page with zeroes.
*/
void
diff --git a/sys/arch/sparc/include/pmap.h b/sys/arch/sparc/include/pmap.h
index ef9f26ee2cb..2cf54275ecd 100644
--- a/sys/arch/sparc/include/pmap.h
+++ b/sys/arch/sparc/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.16 2000/06/05 11:02:52 art Exp $ */
+/* $OpenBSD: pmap.h,v 1.17 2001/05/09 15:31:27 art Exp $ */
/* $NetBSD: pmap.h,v 1.30 1997/08/04 20:00:47 pk Exp $ */
/*
@@ -283,7 +283,7 @@ int pmap_count_ptes __P((struct pmap *));
void pmap_prefer __P((vaddr_t, vaddr_t *));
int pmap_pa_exists __P((paddr_t));
void *pmap_bootstrap_alloc __P((int));
-void pmap_change_wiring __P((pmap_t, vaddr_t, boolean_t));
+void pmap_unwire __P((pmap_t, vaddr_t));
void pmap_collect __P((pmap_t));
void pmap_copy __P((pmap_t, pmap_t, vaddr_t, vsize_t, vaddr_t));
#ifdef PMAP_NEW
@@ -294,7 +294,6 @@ pmap_t pmap_create __P((vsize_t));
void pmap_destroy __P((pmap_t));
void pmap_init __P((void));
vaddr_t pmap_map __P((vaddr_t, paddr_t, paddr_t, int));
-void pmap_pageable __P((pmap_t, paddr_t, paddr_t, boolean_t));
vaddr_t pmap_phys_address __P((int));
void pmap_pinit __P((pmap_t));
void pmap_reference __P((pmap_t));
diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c
index 54c782183fd..b736d752c68 100644
--- a/sys/arch/sparc/sparc/pmap.c
+++ b/sys/arch/sparc/sparc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.80 2000/11/22 11:57:04 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.81 2001/05/09 15:31:27 art Exp $ */
/* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */
/*
@@ -5783,7 +5783,7 @@ pmap_kremove4m(va, len)
*/
/* ARGSUSED */
void
-pmap_change_wiring(pm, va, wired)
+pmap_unwire(pm, va, wired)
struct pmap *pm;
vaddr_t va;
int wired;
@@ -6274,25 +6274,6 @@ pmap_is_referenced4m(pa)
#endif /* 4m */
/*
- * Make the specified pages (by pmap, offset) pageable (or not) as requested.
- *
- * A page which is not pageable may not take a fault; therefore, its page
- * table entry must remain valid for the duration (or at least, the trap
- * handler must not call vm_fault).
- *
- * This routine is merely advisory; pmap_enter will specify that these pages
- * are to be wired down (or not) as appropriate.
- */
-/* ARGSUSED */
-void
-pmap_pageable(pm, start, end, pageable)
- struct pmap *pm;
- vaddr_t start, end;
- int pageable;
-{
-}
-
-/*
* Fill the given MI physical page with zero bytes.
*
* We avoid stomping on the cache.
diff --git a/sys/arch/sun3/sun3/pmap.c b/sys/arch/sun3/sun3/pmap.c
index 53eff4b06eb..3f699654dc4 100644
--- a/sys/arch/sun3/sun3/pmap.c
+++ b/sys/arch/sun3/sun3/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.20 2000/06/19 01:33:02 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.21 2001/05/09 15:31:27 art Exp $ */
/* $NetBSD: pmap.c,v 1.64 1996/11/20 18:57:35 gwr Exp $ */
/*-
@@ -2272,7 +2272,7 @@ pmap_enter_user(pmap, va, pa, prot, wired, new_pte)
#ifdef PMAP_DEBUG
/*
* Some user pages are wired here, and a later
- * call to pmap_change_wiring() will unwire them.
+ * call to pmap_unwire() will unwire them.
* XXX - Need a separate list for wired user pmegs
* so they can not be stolen from the active list.
* XXX - Note: vm_fault.c assumes pmap_extract will
@@ -2707,17 +2707,16 @@ pmap_activate(pmap)
/*
- * Routine: pmap_change_wiring
+ * Routine: pmap_unwire
* Function: Change the wiring 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;
{
int s, sme;
int wiremask, ptenum;
@@ -2727,8 +2726,7 @@ pmap_change_wiring(pmap, va, wired)
return;
#ifdef PMAP_DEBUG
if (pmap_debug & PMD_WIRING)
- printf("pmap_change_wiring(pmap=%p, va=0x%x, wire=%d)\n",
- pmap, va, wired);
+ printf("pmap_unwire(pmap=%p, va=0x%x)\n", pmap, va);
#endif
/*
* We are asked to unwire pages that were wired when
@@ -2750,12 +2748,9 @@ pmap_change_wiring(pmap, va, wired)
sme = get_segmap(va);
if (sme == SEGINV)
- panic("pmap_change_wiring: invalid va=0x%x", va);
+ panic("pmap_unwire: invalid va=0x%x", va);
pmegp = pmeg_p(sme);
- if (wired)
- pmegp->pmeg_wired |= wiremask;
- else
- pmegp->pmeg_wired &= ~wiremask;
+ pmegp->pmeg_wired &= ~wiremask;
PMAP_UNLOCK();
}
@@ -2823,29 +2818,6 @@ pmap_extract(pmap, va)
}
/*
- * Routine: pmap_pageable
- * Function:
- * Make the specified pages (by pmap, offset)
- * pageable (or not) as requested.
- *
- * A page which is not pageable may not take
- * a fault; therefore, its page table entry
- * must remain valid for the duration.
- *
- * This routine is merely advisory; pmap_enter
- * will specify that these pages are to be wired
- * down (or not) as appropriate.
- */
-void
-pmap_pageable(pmap, sva, eva, pageable)
- pmap_t pmap;
- vm_offset_t sva, eva;
- boolean_t pageable;
-{
- /* not implemented, hopefully not needed */
-}
-
-/*
* Turn a cdevsw d_mmap value into a byte address for pmap_enter.
* XXX this should almost certainly be done differently, and
* elsewhere, or even not at all
diff --git a/sys/arch/vax/include/param.h b/sys/arch/vax/include/param.h
index 3762edc6f21..ea94b91ea62 100644
--- a/sys/arch/vax/include/param.h
+++ b/sys/arch/vax/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.14 2001/05/05 20:56:56 art Exp $ */
+/* $OpenBSD: param.h,v 1.15 2001/05/09 15:31:27 art Exp $ */
/* $NetBSD: param.h,v 1.39 1999/10/22 21:14:34 ragge Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -161,7 +161,6 @@
#define ovbcopy(x,y,z) bcopy(x, y, z)
#ifdef _KERNEL
-#define pmap_pageable(a,b,c,d) /* Dont do anything */
#ifndef lint
#define splx(reg) \
({ \
diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c
index 80eb65aa8af..a00a8ca75ef 100644
--- a/sys/arch/vax/vax/pmap.c
+++ b/sys/arch/vax/vax/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.14 2001/05/05 21:26:41 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.15 2001/05/09 15:31:28 art Exp $ */
/* $NetBSD: pmap.c,v 1.74 1999/11/13 21:32:25 matt Exp $ */
/*
* Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden.
@@ -461,10 +461,9 @@ if(startpmapdebug)printf("pmap_release: pmap %p\n",pmap);
}
void
-pmap_change_wiring(pmap, va, wired)
- register pmap_t pmap;
+pmap_unwire(pmap, va)
+ pmap_t pmap;
vaddr_t va;
- boolean_t wired;
{
int *p, *pte, i;
@@ -482,10 +481,7 @@ pmap_change_wiring(pmap, va, wired)
}
pte = &p[i];
- if(wired)
- *pte |= PG_W;
- else
- *pte &= ~PG_W;
+ *pte &= ~PG_W;
}
/*
diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c
index 50f29232244..12b31c1d4d2 100644
--- a/sys/uvm/uvm_fault.c
+++ b/sys/uvm/uvm_fault.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_fault.c,v 1.11 2001/05/07 16:08:40 art Exp $ */
-/* $NetBSD: uvm_fault.c,v 1.37 1999/06/16 23:02:40 thorpej Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.12 2001/05/09 15:31:23 art Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.39 1999/06/17 19:23:21 thorpej Exp $ */
/*
*
@@ -1725,17 +1725,8 @@ uvm_fault_wire(map, start, end, access_type)
pmap = vm_map_pmap(map);
-#ifndef PMAP_NEW
/*
- * call pmap pageable: this tells the pmap layer to lock down these
- * page tables.
- */
-
- pmap_pageable(pmap, start, end, FALSE);
-#endif
-
- /*
- * now fault it in page at a time. if the fault fails then we have
+ * fault it in page at a time. if the fault fails then we have
* to undo what we have done.
*/
@@ -1838,7 +1829,7 @@ uvm_fault_unwire_locked(map, start, end)
* if the entry is no longer wired, tell the pmap.
*/
if (VM_MAPENT_ISWIRED(entry) == 0)
- pmap_change_wiring(pmap, va, FALSE);
+ pmap_unwire(pmap, va);
pg = PHYS_TO_VM_PAGE(pa);
if (pg)
@@ -1846,13 +1837,4 @@ uvm_fault_unwire_locked(map, start, end)
}
uvm_unlock_pageq();
-
-#ifndef PMAP_NEW
- /*
- * now we call pmap_pageable to let the pmap know that the page tables
- * in this space no longer need to be wired.
- */
-
- pmap_pageable(pmap, start, end, TRUE);
-#endif
}
diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h
index 764572133fc..25b5cf2fe4b 100644
--- a/sys/vm/pmap.h
+++ b/sys/vm/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.15 2001/03/26 08:36:20 art Exp $ */
+/* $OpenBSD: pmap.h,v 1.16 2001/05/09 15:31:22 art Exp $ */
/* $NetBSD: pmap.h,v 1.16 1996/03/31 22:15:32 pk Exp $ */
/*
@@ -121,12 +121,9 @@ typedef struct pmap_statistics *pmap_statistics_t;
#ifdef _KERNEL
__BEGIN_DECLS
void *pmap_bootstrap_alloc __P((int));
-void pmap_change_wiring __P((pmap_t, vaddr_t, boolean_t));
+void pmap_unwire __P((pmap_t, vaddr_t));
#if defined(PMAP_NEW)
-#if 0
-void pmap_unwire __P((pmap_t, vaddr_t));
-#endif
#if !defined(pmap_clear_modify)
boolean_t pmap_clear_modify __P((struct vm_page *));
#endif
@@ -199,8 +196,6 @@ void pmap_page_protect __P((struct vm_page *, vm_prot_t));
void pmap_page_protect __P((paddr_t, vm_prot_t));
#endif
-void pmap_pageable __P((pmap_t,
- vaddr_t, vaddr_t, boolean_t));
#if !defined(pmap_phys_address)
paddr_t pmap_phys_address __P((int));
#endif
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index cf141035a1d..0f0bbc7fc48 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_fault.c,v 1.17 1999/09/03 18:02:27 art Exp $ */
+/* $OpenBSD: vm_fault.c,v 1.18 2001/05/09 15:31:23 art Exp $ */
/* $NetBSD: vm_fault.c,v 1.21 1998/01/31 04:02:39 ross Exp $ */
/*
@@ -861,14 +861,6 @@ vm_fault_wire(map, start, end)
pmap = vm_map_pmap(map);
/*
- * Inform the physical mapping system that the
- * range of addresses may not fault, so that
- * page tables and such can be locked down as well.
- */
-
- pmap_pageable(pmap, start, end, FALSE);
-
- /*
* We simulate a fault to get the page and enter it
* in the physical map.
*/
@@ -912,19 +904,10 @@ vm_fault_unwire(map, start, end)
if (pa == (vm_offset_t)0) {
panic("unwire: page not in pmap");
}
- pmap_change_wiring(pmap, va, FALSE);
+ pmap_unwire(pmap, va);
vm_page_unwire(PHYS_TO_VM_PAGE(pa));
}
vm_page_unlock_queues();
-
- /*
- * Inform the physical mapping system that the range
- * of addresses may fault, so that page tables and
- * such may be unwired themselves.
- */
-
- pmap_pageable(pmap, start, end, TRUE);
-
}
/*