Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/pc532 Pull over some changes from the i386 port to ...



details:   https://anonhg.NetBSD.org/src/rev/a8e4f26ed8d1
branches:  trunk
changeset: 474033:a8e4f26ed8d1
user:      matthias <matthias%NetBSD.org@localhost>
date:      Sat Jun 26 09:09:51 1999 +0000

description:
Pull over some changes from the i386 port to fix the kernel RSS counters.

diffstat:

 sys/arch/pc532/include/pmap.h     |  10 ++++++++-
 sys/arch/pc532/pc532/pmap.c       |  43 ++++++++++++++++++++++++++++++++++----
 sys/arch/pc532/pc532/vm_machdep.c |   9 +++----
 3 files changed, 51 insertions(+), 11 deletions(-)

diffs (163 lines):

diff -r 12fbcd613e24 -r a8e4f26ed8d1 sys/arch/pc532/include/pmap.h
--- a/sys/arch/pc532/include/pmap.h     Sat Jun 26 08:30:17 1999 +0000
+++ b/sys/arch/pc532/include/pmap.h     Sat Jun 26 09:09:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.24 1999/06/17 00:22:41 thorpej Exp $        */
+/*     $NetBSD: pmap.h,v 1.25 1999/06/26 09:09:51 matthias Exp $       */
 
 /*
  *
@@ -481,7 +481,15 @@
 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++;
+  simple_unlock(&pm->pm_obj.vmobjlock);
+  splx(s);
 
   pte = vtopte(va);     
   opte = *pte;           
diff -r 12fbcd613e24 -r a8e4f26ed8d1 sys/arch/pc532/pc532/pmap.c
--- a/sys/arch/pc532/pc532/pmap.c       Sat Jun 26 08:30:17 1999 +0000
+++ b/sys/arch/pc532/pc532/pmap.c       Sat Jun 26 09:09:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.37 1999/06/17 19:23:26 thorpej Exp $        */
+/*     $NetBSD: pmap.c,v 1.38 1999/06/26 09:09:52 matthias Exp $       */
 
 /*
  *
@@ -609,9 +609,15 @@
 vsize_t len;
 
 {
+  struct pmap *pm = pmap_kernel();
   pt_entry_t *pte;
+  int s;
+
   len = len / NBPG;
 
+  s = splimp();
+  simple_lock(&pm->pm_obj.vmobjlock);
+
   for ( /* null */ ; len ; len--, va += NBPG) {
 
     pte = vtopte(va);    
@@ -621,11 +627,17 @@
       panic("pmap_kremove: PG_PVLIST mapping for 0x%lx\n", va);
 #endif
 
+    pm->pm_stats.resident_count--;
+    pm->pm_stats.wired_count--;
+
     *pte = 0;          /* zap! */
     pmap_update_pg(va);
     
   }
 
+  simple_unlock(&pm->pm_obj.vmobjlock);
+  splx(s);
+
 }
 
 /*
@@ -637,10 +649,22 @@
 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--;
+
   pte = vtopte(va);
   *pte = 0;            /* zap! */
   pmap_update_pg(va);
+
+  simple_unlock(&pm->pm_obj.vmobjlock);
+  splx(s);
 }
 
 /*
@@ -654,10 +678,18 @@
 int npgs;
 
 {
+  struct pmap *pm = pmap_kernel();
   pt_entry_t *pte, opte;
-  int lcv;
+  int s, lcv;
   vaddr_t tva;
 
+  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);
@@ -1712,13 +1744,14 @@
 struct pmap *pmap;
 
 {
+       int refs;
   /*
    * drop reference count
    */
   simple_lock(&pmap->pm_obj.vmobjlock);
-  pmap->pm_obj.uo_refs--;
-  if (pmap->pm_obj.uo_refs > 0) {
-    simple_unlock(&pmap->pm_obj.vmobjlock);
+  refs = --pmap->pm_obj.uo_refs;
+  simple_unlock(&pmap->pm_obj.vmobjlock);
+  if (refs > 0) {
     return;
   }
 
diff -r 12fbcd613e24 -r a8e4f26ed8d1 sys/arch/pc532/pc532/vm_machdep.c
--- a/sys/arch/pc532/pc532/vm_machdep.c Sat Jun 26 08:30:17 1999 +0000
+++ b/sys/arch/pc532/pc532/vm_machdep.c Sat Jun 26 09:09:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.35 1999/06/17 00:22:43 thorpej Exp $  */
+/*     $NetBSD: vm_machdep.c,v 1.36 1999/06/26 09:09:52 matthias Exp $ */
 
 /*-
  * Copyright (c) 1996 Matthias Pfaller.
@@ -350,7 +350,6 @@
 {
        vaddr_t faddr, taddr, off;
        paddr_t fpa;
-       pt_entry_t *tpte;
 
        if ((bp->b_flags & B_PHYS) == 0)
                panic("vmapbuf");
@@ -371,13 +370,13 @@
         * where we we just allocated (TLB will be flushed when our
         * mapping is removed).
         */
-       tpte = PTE_BASE + ns532_btop(taddr);
        while (len) {
                fpa = pmap_extract(vm_map_pmap(&bp->b_proc->p_vmspace->vm_map),
                                   faddr);
-               *tpte = fpa | PG_RW | PG_V;
-               tpte++;
+               pmap_enter(vm_map_pmap(phys_map), taddr, fpa,
+                          VM_PROT_READ|VM_PROT_WRITE, TRUE, 0);
                faddr += PAGE_SIZE;
+               taddr += PAGE_SIZE;
                len -= PAGE_SIZE;
        }
 }



Home | Main Index | Thread Index | Old Index