summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorchs <chs@NetBSD.org>2001-12-13 04:39:50 +0000
committerchs <chs@NetBSD.org>2001-12-13 04:39:50 +0000
commit2dfd15933eb4b5896709d82dc0d557f88e1231c8 (patch)
tree91496cefa0a34f18a2b00044b9afcb2221d6bca7 /sys
parent94ff9810676a694793e25fbd8c4b11e38310f516 (diff)
change the reference-counting of PT pages to start from zero instead of
one, so that we don't mess up the global count of wired pages by having the page's wire_count be non-zero when we free the page. pointed out by Michael Hitch.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amiga/amiga/pmap.c15
-rw-r--r--sys/arch/atari/atari/pmap.c13
-rw-r--r--sys/arch/cesfic/cesfic/pmap.c15
-rw-r--r--sys/arch/hp300/hp300/pmap.c11
-rw-r--r--sys/arch/luna68k/luna68k/pmap.c15
-rw-r--r--sys/arch/mac68k/mac68k/pmap.c15
-rw-r--r--sys/arch/mvme68k/mvme68k/pmap.c12
-rw-r--r--sys/arch/news68k/news68k/pmap.c15
-rw-r--r--sys/arch/next68k/next68k/pmap.c15
-rw-r--r--sys/arch/x68k/x68k/pmap.c15
10 files changed, 66 insertions, 75 deletions
diff --git a/sys/arch/amiga/amiga/pmap.c b/sys/arch/amiga/amiga/pmap.c
index 1551261506d..8324839a45d 100644
--- a/sys/arch/amiga/amiga/pmap.c
+++ b/sys/arch/amiga/amiga/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.94 2001/11/24 06:53:16 isaki Exp $ */
+/* $NetBSD: pmap.c,v 1.95 2001/12/13 04:39:50 chs Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -2086,7 +2086,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2614,7 +2614,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2734,8 +2733,8 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
- printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count);
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
+ panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2743,9 +2742,9 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
- printf("*%s*: 0x%lx: w%d/a%d\n",
- str, va, (pg->wire_count-1), count);
+ if (pg->wire_count != count)
+ panic("*%s*: 0x%lx: w%d/a%d",
+ str, va, pg->wire_count, count);
}
#endif
diff --git a/sys/arch/atari/atari/pmap.c b/sys/arch/atari/atari/pmap.c
index 78605c69e2d..19ff3452899 100644
--- a/sys/arch/atari/atari/pmap.c
+++ b/sys/arch/atari/atari/pmap.c
@@ -2039,7 +2039,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2562,7 +2562,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2716,8 +2715,8 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
- printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count);
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
+ panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2725,8 +2724,8 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
- printf("*%s*: 0x%lx: w%d/a%d\n",
- str, va, (pg->wire_count - 1), count);
+ if (pg->wire_count != count)
+ panic("*%s*: 0x%lx: w%d/a%d",
+ str, va, pg->wire_count, count);
}
#endif
diff --git a/sys/arch/cesfic/cesfic/pmap.c b/sys/arch/cesfic/cesfic/pmap.c
index 76f6e72b151..7151903d922 100644
--- a/sys/arch/cesfic/cesfic/pmap.c
+++ b/sys/arch/cesfic/cesfic/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.8 2001/11/24 06:53:17 isaki Exp $ */
+/* $NetBSD: pmap.c,v 1.9 2001/12/13 04:39:51 chs Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -2119,7 +2119,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2576,7 +2576,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2746,8 +2745,8 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
- printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count);
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
+ panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2755,8 +2754,8 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
- printf("*%s*: 0x%lx: w%d/a%d\n",
- str, va, (pg->wire_count - 1), count);
+ if (pg->wire_count != count)
+ panic("*%s*: 0x%lx: w%d/a%d",
+ str, va, pg->wire_count, count);
}
#endif /* DEBUG */
diff --git a/sys/arch/hp300/hp300/pmap.c b/sys/arch/hp300/hp300/pmap.c
index a90e03a96d3..b52086affc5 100644
--- a/sys/arch/hp300/hp300/pmap.c
+++ b/sys/arch/hp300/hp300/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.100 2001/12/08 03:55:23 gmcgarry Exp $ */
+/* $NetBSD: pmap.c,v 1.101 2001/12/13 04:39:51 chs Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -2243,7 +2243,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2714,7 +2714,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2890,7 +2889,7 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2899,8 +2898,8 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
+ if (pg->wire_count != count)
panic("*%s*: 0x%lx: w%d/a%d",
- str, va, (pg->wire_count - 1), count);
+ str, va, pg->wire_count, count);
}
#endif /* DEBUG */
diff --git a/sys/arch/luna68k/luna68k/pmap.c b/sys/arch/luna68k/luna68k/pmap.c
index e77b0bfc32f..740f82a2eaf 100644
--- a/sys/arch/luna68k/luna68k/pmap.c
+++ b/sys/arch/luna68k/luna68k/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.19 2001/11/24 06:53:18 isaki Exp $ */
+/* $NetBSD: pmap.c,v 1.20 2001/12/13 04:39:51 chs Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -1942,7 +1942,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2367,7 +2367,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2553,8 +2552,8 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
- printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count);
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
+ panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2562,8 +2561,8 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
- printf("*%s*: 0x%lx: w%d/a%d\n",
- str, va, (pg->wire_count - 1), count);
+ if (pg->wire_count != count)
+ panic("*%s*: 0x%lx: w%d/a%d",
+ str, va, pg->wire_count, count);
}
#endif /* DEBUG */
diff --git a/sys/arch/mac68k/mac68k/pmap.c b/sys/arch/mac68k/mac68k/pmap.c
index 47c9a30326b..dca2f44b847 100644
--- a/sys/arch/mac68k/mac68k/pmap.c
+++ b/sys/arch/mac68k/mac68k/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.82 2001/11/24 06:53:18 isaki Exp $ */
+/* $NetBSD: pmap.c,v 1.83 2001/12/13 04:39:52 chs Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -1970,7 +1970,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2391,7 +2391,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2561,8 +2560,8 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
- printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count);
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
+ panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2570,8 +2569,8 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
- printf("*%s*: 0x%lx: w%d/a%d\n",
- str, va, (pg->wire_count - 1), count);
+ if (pg->wire_count != count)
+ panic("*%s*: 0x%lx: w%d/a%d",
+ str, va, pg->wire_count, count);
}
#endif /* DEBUG */
diff --git a/sys/arch/mvme68k/mvme68k/pmap.c b/sys/arch/mvme68k/mvme68k/pmap.c
index 5f95a30c7cd..544d5586909 100644
--- a/sys/arch/mvme68k/mvme68k/pmap.c
+++ b/sys/arch/mvme68k/mvme68k/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.73 2001/11/24 06:53:18 isaki Exp $ */
+/* $NetBSD: pmap.c,v 1.74 2001/12/13 04:39:52 chs Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -2080,7 +2080,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2532,7 +2532,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2796,7 +2795,7 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2805,8 +2804,9 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
+ if (pg->wire_count != count)
panic("*%s*: 0x%lx: w%d/a%d",
- str, va, (pg->wire_count - 1), count);
+ str, va, pg->wire_count, count);
}
#endif /* DEBUG */
+
diff --git a/sys/arch/news68k/news68k/pmap.c b/sys/arch/news68k/news68k/pmap.c
index 0c73a15218b..2b7f3e68d4d 100644
--- a/sys/arch/news68k/news68k/pmap.c
+++ b/sys/arch/news68k/news68k/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.24 2001/11/24 06:53:18 isaki Exp $ */
+/* $NetBSD: pmap.c,v 1.25 2001/12/13 04:39:52 chs Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -2246,7 +2246,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2706,7 +2706,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2876,8 +2875,8 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (m->wire_count < 1) {
- printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count);
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
+ panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2885,8 +2884,8 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
- printf("*%s*: 0x%lx: w%d/a%d\n",
- str, va, (pg->wire_count - 1), count);
+ if (pg->wire_count != count)
+ panic("*%s*: 0x%lx: w%d/a%d",
+ str, va, pg->wire_count, count);
}
#endif /* DEBUG */
diff --git a/sys/arch/next68k/next68k/pmap.c b/sys/arch/next68k/next68k/pmap.c
index 788ac73af87..0db58a6f138 100644
--- a/sys/arch/next68k/next68k/pmap.c
+++ b/sys/arch/next68k/next68k/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.39 2001/11/24 06:53:19 isaki Exp $ */
+/* $NetBSD: pmap.c,v 1.40 2001/12/13 04:39:52 chs Exp $ */
/*
* This file was taken from mvme68k/mvme68k/pmap.c
@@ -2263,7 +2263,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2772,7 +2772,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2940,8 +2939,8 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
- printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count);
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
+ panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2949,8 +2948,8 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
- printf("*%s*: 0x%lx: w%d/a%d\n",
- str, va, (pg->wire_count - 1), count);
+ if (pg->wire_count != count)
+ panic("*%s*: 0x%lx: w%d/a%d",
+ str, va, pg->wire_count, count);
}
#endif /* DEBUG */
diff --git a/sys/arch/x68k/x68k/pmap.c b/sys/arch/x68k/x68k/pmap.c
index 86d6612f130..4f8889f69c6 100644
--- a/sys/arch/x68k/x68k/pmap.c
+++ b/sys/arch/x68k/x68k/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.72 2001/12/06 04:13:39 minoura Exp $ */
+/* $NetBSD: pmap.c,v 1.73 2001/12/13 04:39:53 chs Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -2110,7 +2110,7 @@ pmap_remove_mapping(pmap, va, pte, flags)
* If reference count drops to 1, and we're not instructed
* to keep it around, free the PT page.
*/
- if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) {
+ if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) {
#ifdef DIAGNOSTIC
struct pv_entry *pv;
#endif
@@ -2567,7 +2567,6 @@ pmap_enter_ptpage(pmap, va)
UVM_PGA_ZERO)) == NULL) {
uvm_wait("ptpage");
}
- pg->wire_count = 1;
pg->flags &= ~(PG_BUSY|PG_FAKE);
UVM_PAGE_OWN(pg, NULL);
ptpa = VM_PAGE_TO_PHYS(pg);
@@ -2747,8 +2746,8 @@ pmap_check_wiring(str, va)
pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va));
pg = PHYS_TO_VM_PAGE(pa);
- if (pg->wire_count < 1) {
- printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count);
+ if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) {
+ panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count);
return;
}
@@ -2756,8 +2755,8 @@ pmap_check_wiring(str, va)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
if (*pte)
count++;
- if ((pg->wire_count - 1) != count)
- printf("*%s*: 0x%lx: w%d/a%d\n",
- str, va, (pg->wire_count - 1), count);
+ if (pg->wire_count != count)
+ panic("*%s*: 0x%lx: w%d/a%d",
+ str, va, pg->wire_count, count);
}
#endif /* DEBUG */