Module Name:    src
Committed By:   uebayasi
Date:           Fri Nov 12 19:00:01 UTC 2010

Modified Files:
        src/sys/uvm [uebayasi-xip]: uvm_page.c uvm_pglist.c

Log Message:
Fix debug code.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.62 -r1.153.2.63 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.45.2.3 -r1.45.2.4 src/sys/uvm/uvm_pglist.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.62 src/sys/uvm/uvm_page.c:1.153.2.63
--- src/sys/uvm/uvm_page.c:1.153.2.62	Thu Nov 11 16:22:25 2010
+++ src/sys/uvm/uvm_page.c	Fri Nov 12 19:00:00 2010
@@ -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)
 {

Index: src/sys/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.45.2.3 src/sys/uvm/uvm_pglist.c:1.45.2.4
--- src/sys/uvm/uvm_pglist.c:1.45.2.3	Tue Aug 17 06:48:16 2010
+++ src/sys/uvm/uvm_pglist.c	Fri Nov 12 19:00:00 2010
@@ -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;

Reply via email to