Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 Use pmap_get_page return code inste...



details:   https://anonhg.NetBSD.org/src/rev/816e115034d7
branches:  trunk
changeset: 555880:816e115034d7
user:      petrov <petrov%NetBSD.org@localhost>
date:      Wed Dec 03 17:58:47 2003 +0000

description:
Use pmap_get_page return code instead, remove unused pmap_stats,
delete incorrect KASSERT in pmap_kenter_pa.

diffstat:

 sys/arch/sparc64/sparc64/pmap.c |  28 ++++++----------------------
 1 files changed, 6 insertions(+), 22 deletions(-)

diffs (78 lines):

diff -r 3abd4e8b6462 -r 816e115034d7 sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c   Wed Dec 03 13:20:34 2003 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c   Wed Dec 03 17:58:47 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.150 2003/11/25 05:14:58 cdi Exp $   */
+/*     $NetBSD: pmap.c,v 1.151 2003/12/03 17:58:47 petrov Exp $        */
 /*
  * 
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.150 2003/11/25 05:14:58 cdi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.151 2003/12/03 17:58:47 petrov Exp $");
 
 #undef NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define        HWREF
@@ -198,18 +198,6 @@
        }
 }
 
-struct pmap_stats {
-       int     ps_unlink_pvfirst;      /* # of pv_unlinks on head */
-       int     ps_unlink_pvsearch;     /* # of pv_unlink searches */
-       int     ps_changeprots;         /* # of calls to changeprot */
-       int     ps_useless_changeprots; /* # of changeprots for wiring */
-       int     ps_enter_firstpv;       /* pv heads entered */
-       int     ps_enter_secondpv;      /* pv nonheads entered */
-       int     ps_useless_changewire;  /* useless wiring changes */
-       int     ps_npg_prot_all;        /* # of active pages protected */
-       int     ps_npg_prot_actual;     /* # pages actually affected */
-} pmap_stats;
-
 struct prom_map *prom_map;
 int prom_map_size;
 
@@ -378,9 +366,7 @@
 
        newp = 0UL;
        while (pseg_set(pmap_kernel(), va, data, newp) & 1) {
-               newp = 0UL;
-               pmap_get_page(&newp);
-               if (!newp) {
+               if (!pmap_get_page(&newp)) {
                        prom_printf("pmap_enter_kpage: out of pages\n");
                        panic("pmap_enter_kpage");
                }
@@ -1278,7 +1264,8 @@
                while (vmmap < u0[1]) {
                        int64_t data;
 
-                       pmap_get_page(&pa);
+                       if (!pmap_get_page(&pa))
+                               panic("pmap_bootstrap: no pages");
                        prom_map_phys(pa, PAGE_SIZE, vmmap, -1);
                        data = TSB_DATA(0 /* global */,
                                PGSZ_8K,
@@ -1500,10 +1487,8 @@
        pm->pm_refs = 1;
        TAILQ_INIT(&pm->pm_obj.memq);
        if (pm != pmap_kernel()) {
-               pmap_get_page(&pm->pm_physaddr);
-               while (pm->pm_physaddr == 0UL) {
+               while (!pmap_get_page(&pm->pm_physaddr)) {
                        uvm_wait("pmap_create");
-                       pmap_get_page(&pm->pm_physaddr);
                }
                pm->pm_segs = (paddr_t *)(u_long)pm->pm_physaddr;
        }
@@ -1725,7 +1710,6 @@
 
  retry:
        i = pseg_set(pm, va, tte.data, ptp);
-       KASSERT((i & 6) == 0);
        if (i & 1) {
                KASSERT((i & 4) == 0);
                ptp = 0;



Home | Main Index | Thread Index | Old Index