Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386 update resident_count and wired_count properly...
details: https://anonhg.NetBSD.org/src/rev/8d994b153542
branches: trunk
changeset: 472704:8d994b153542
user: chs <chs%NetBSD.org@localhost>
date: Wed May 05 05:21:13 1999 +0000
description:
update resident_count and wired_count properly in pmap_kenter_*()
and pmap_kremove().
diffstat:
sys/arch/i386/i386/pmap.new.c | 32 ++++++++++++++++++++++++++++++--
sys/arch/i386/include/pmap.new.h | 11 ++++++++++-
2 files changed, 40 insertions(+), 3 deletions(-)
diffs (101 lines):
diff -r fd24f0f47f1d -r 8d994b153542 sys/arch/i386/i386/pmap.new.c
--- a/sys/arch/i386/i386/pmap.new.c Wed May 05 04:40:00 1999 +0000
+++ b/sys/arch/i386/i386/pmap.new.c Wed May 05 05:21:13 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.new.c,v 1.24 1999/04/11 04:04:07 chs Exp $ */
+/* $NetBSD: pmap.new.c,v 1.25 1999/05/05 05:21:13 chs Exp $ */
/*
*
@@ -627,7 +627,10 @@
vsize_t len;
{
+ struct pmap *pm = pmap_kernel();
pt_entry_t *pte;
+ int s;
+
len = len / NBPG;
for ( /* null */ ; len ; len--, va += NBPG) {
@@ -646,6 +649,13 @@
return;
}
+ s = splimp();
+ simple_lock(&pm->pm_obj.vmobjlock);
+ pm->pm_stats.resident_count--;
+ pm->pm_stats.wired_count--;
+ simple_unlock(&pm->pm_obj.vmobjlock);
+ splx(s);
+
*pte = 0; /* zap! */
#if defined(I386_CPU)
if (cpu_class != CPUCLASS_386)
@@ -670,7 +680,17 @@
vaddr_t va;
{
+ struct pmap *pm = pmap_kernel();
pt_entry_t *pte;
+ int s;
+
+ s = splimp();
+ simple_lock(&pm->pm_obj.vmobjlock);
+ pm->pm_stats.resident_count--;
+ pm->pm_stats.wired_count--;
+ simple_unlock(&pm->pm_obj.vmobjlock);
+ splx(s);
+
pte = vtopte(va);
*pte = 0; /* zap! */
pmap_update_pg(va);
@@ -687,13 +707,21 @@
int npgs;
{
+ struct pmap *pm = pmap_kernel();
pt_entry_t *pte, opte;
- int lcv;
+ int s, lcv;
vaddr_t tva;
#if defined(I386_CPU)
boolean_t need_update = FALSE;
#endif
+ s = splimp();
+ simple_lock(&pm->pm_obj.vmobjlock);
+ pm->pm_stats.resident_count += npgs;
+ pm->pm_stats.wired_count += npgs;
+ simple_unlock(&pm->pm_obj.vmobjlock);
+ splx(s);
+
for (lcv = 0 ; lcv < npgs ; lcv++) {
tva = va + lcv * NBPG;
pte = vtopte(tva);
diff -r fd24f0f47f1d -r 8d994b153542 sys/arch/i386/include/pmap.new.h
--- a/sys/arch/i386/include/pmap.new.h Wed May 05 04:40:00 1999 +0000
+++ b/sys/arch/i386/include/pmap.new.h Wed May 05 05:21:13 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.new.h,v 1.7 1998/08/13 21:36:05 thorpej Exp $ */
+/* $NetBSD: pmap.new.h,v 1.8 1999/05/05 05:21:14 chs Exp $ */
/*
*
@@ -496,7 +496,16 @@
vm_prot_t prot;
{
+ struct pmap *pm = pmap_kernel();
pt_entry_t *pte, opte;
+ int s;
+
+ s = splimp();
+ simple_lock(&pm->pm_obj.vmobjlock);
+ pm->pm_stats.resident_count++;
+ pm->pm_stats.wired_count++;
+ simple_unlock(&pm->pm_obj.vmobjlock);
+ splx(s);
pte = vtopte(va);
opte = *pte;
Home |
Main Index |
Thread Index |
Old Index