Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys/uvm Fix debug code.



details:   https://anonhg.NetBSD.org/src/rev/17f3c92979c2
branches:  uebayasi-xip
changeset: 751852:17f3c92979c2
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Fri Nov 12 19:00:00 2010 +0000

description:
Fix debug code.

diffstat:

 sys/uvm/uvm_page.c   |   7 +++----
 sys/uvm/uvm_pglist.c |  28 +++++++---------------------
 2 files changed, 10 insertions(+), 25 deletions(-)

diffs (124 lines):

diff -r afefc03bda37 -r 17f3c92979c2 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Fri Nov 12 08:13:40 2010 +0000
+++ b/sys/uvm/uvm_page.c        Fri Nov 12 19:00:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.153.2.62 2010/11/11 16:22:25 uebayasi Exp $     */
+/*     $NetBSD: uvm_page.c,v 1.153.2.63 2010/11/12 19:00:00 uebayasi Exp $     */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.62 2010/11/11 16:22:25 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.63 2010/11/12 19:00:00 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -130,7 +130,7 @@
 
 struct vm_physseg *vm_physmem_ptrs[VM_PHYSSEG_MAX];
 int vm_nphysmem = 0;
-static struct vm_physseg vm_physmem_store[VM_PHYSSEG_MAX];
+struct vm_physseg vm_physmem_store[VM_PHYSSEG_MAX];
 static struct vm_physseg_freelist vm_physmem_freelist =
     SIMPLEQ_HEAD_INITIALIZER(vm_physmem_freelist);
 
@@ -1181,7 +1181,6 @@
  * PHYS_TO_VM_PAGE: find vm_page for a PA.   used by MI code to get vm_pages
  * back from an I/O mapping (ugh!).   used in some MD code as well.
  */
-
 struct vm_page *
 uvm_phys_to_vm_page(paddr_t pa)
 {
diff -r afefc03bda37 -r 17f3c92979c2 sys/uvm/uvm_pglist.c
--- a/sys/uvm/uvm_pglist.c      Fri Nov 12 08:13:40 2010 +0000
+++ b/sys/uvm/uvm_pglist.c      Fri Nov 12 19:00:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pglist.c,v 1.45.2.3 2010/08/17 06:48:16 uebayasi Exp $     */
+/*     $NetBSD: uvm_pglist.c,v 1.45.2.4 2010/11/12 19:00:00 uebayasi Exp $     */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.45.2.3 2010/08/17 06:48:16 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.45.2.4 2010/11/12 19:00:00 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -129,15 +129,11 @@
        int pagemask;
 #ifdef DEBUG
        paddr_t idxpa, lastidxpa;
-#if 0
        int cidx = 0;   /* XXX: GCC */
 #endif
-#endif
 #ifdef PGALLOC_VERBOSE
-#if 0
        printf("pgalloc: contig %d pgs from psi %ld\n", num,
-       (long)(ps - vm_physmem_store));
-#endif
+       (long)(ps - vm_physmem_ptrs[0]));
 #endif
 
        KASSERT(mutex_owned(&uvm_fpageqlock));
@@ -168,19 +164,15 @@
                 * Make sure this is a managed physical page.
                 */
 
-#if 0
-               if (vm_physseg_find(try, &cidx) != ps - vm_physmem_store)
+               if (vm_physseg_find(try, &cidx) != ps - vm_physmem_ptrs[0])
                        panic("pgalloc contig: botch1");
                if (cidx != try - ps->start)
                        panic("pgalloc contig: botch2");
-#endif
-#if 0
-               if (vm_physseg_find(try + num - 1, &cidx) != ps - vm_physmem_store)
+               if (vm_physseg_find(try + num - 1, &cidx) != ps - vm_physmem_ptrs[0])
                        panic("pgalloc contig: botch3");
                if (cidx != try - ps->start + num - 1)
                        panic("pgalloc contig: botch4");
 #endif
-#endif
                tryidx = try - ps->start;
                end = tryidx + num;
                pgs = ps->pgs;
@@ -296,15 +288,11 @@
        int todo, limit, try;
        struct vm_page *pg;
 #ifdef DEBUG
-#if 0
        int cidx = 0;   /* XXX: GCC */
 #endif
-#endif
 #ifdef PGALLOC_VERBOSE
-#if 0
        printf("pgalloc: simple %d pgs from psi %ld\n", num,
-           (long)(ps - vm_physmem_store));
-#endif
+           (long)(ps - vm_physmem_ptrs[0]));
 #endif
 
        KASSERT(mutex_owned(&uvm_fpageqlock));
@@ -315,13 +303,11 @@
        for (try = max(atop(low), ps->avail_start);
             try < limit; try ++) {
 #ifdef DEBUG
-#if 0
-               if (vm_physseg_find(try, &cidx) != ps - vm_physmem_store)
+               if (vm_physseg_find(try, &cidx) != ps - vm_physmem_ptrs[0])
                        panic("pgalloc simple: botch1");
                if (cidx != (try - ps->start))
                        panic("pgalloc simple: botch2");
 #endif
-#endif
                pg = &ps->pgs[try - ps->start];
                if (VM_PAGE_IS_FREE(pg) == 0)
                        continue;



Home | Main Index | Thread Index | Old Index