Module Name:    src
Committed By:   uebayasi
Date:           Wed Apr 28 05:12:30 UTC 2010

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

Log Message:
Use struct vm_physseg *vm_physmem_ptrs[] in lookup code paths
(vm_physseg_find()).


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.25 -r1.153.2.26 src/sys/uvm/uvm_page.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.25 src/sys/uvm/uvm_page.c:1.153.2.26
--- src/sys/uvm/uvm_page.c:1.153.2.25	Wed Apr 28 05:05:16 2010
+++ src/sys/uvm/uvm_page.c	Wed Apr 28 05:12:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.25 2010/04/28 05:05:16 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.26 2010/04/28 05:12:30 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.25 2010/04/28 05:05:16 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.26 2010/04/28 05:12:30 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -923,7 +923,7 @@
 #define	VM_PHYSSEG_FIND	vm_physseg_find_linear
 #endif
 
-static inline int VM_PHYSSEG_FIND(struct vm_physseg *, int, int,
+static inline int VM_PHYSSEG_FIND(struct vm_physseg **, int, int,
     paddr_t, const struct vm_page *, int *);
 static inline bool vm_physseg_within_p(struct vm_physseg *, int, paddr_t,
     const struct vm_page *, int *);
@@ -936,7 +936,7 @@
 vm_physseg_find(paddr_t pframe, int *offp)
 {
 
-	return VM_PHYSSEG_FIND(vm_physmem, vm_nphysmem, VM_PHYSSEG_OP_PF,
+	return VM_PHYSSEG_FIND(vm_physmem_ptrs, vm_nphysmem, VM_PHYSSEG_OP_PF,
 	    pframe, NULL, offp);
 }
 
@@ -945,19 +945,19 @@
 vm_physseg_find_device(paddr_t pframe, int *offp)
 {
 
-	return VM_PHYSSEG_FIND(vm_physdev, vm_nphysdev, VM_PHYSSEG_OP_PF,
+	return VM_PHYSSEG_FIND(vm_physdev_ptrs, vm_nphysdev, VM_PHYSSEG_OP_PF,
 	    pframe, NULL, offp);
 }
 #endif
 
 #if VM_PHYSSEG_MAX == 1
 static inline int
-vm_physseg_find_contig(struct vm_physseg *segs, int nsegs, int op,
+vm_physseg_find_contig(struct vm_physseg **segs, int nsegs, int op,
     paddr_t pframe, const struct vm_page *pg, int *offp)
 {
 
 	/* 'contig' case */
-	if (vm_physseg_within_p(&segs[0], op, pframe, pg, offp)) {
+	if (vm_physseg_within_p(segs[0], op, pframe, pg, offp)) {
 		return(0);
 	}
 	return(-1);
@@ -966,7 +966,7 @@
 #elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH)
 
 static inline int
-vm_physseg_find_bsearch(struct vm_physseg *segs, int nsegs, int op,
+vm_physseg_find_bsearch(struct vm_physseg **segs, int nsegs, int op,
     paddr_t pframe, const struct vm_page *pg, int *offp)
 {
 	/* binary search for it */
@@ -989,9 +989,9 @@
 		try = start + (len / 2);	/* try in the middle */
 
 		/* start past our try? */
-		if (vm_physseg_ge_p(&segs[try], op, pframe, pg, offp)) {
+		if (vm_physseg_ge_p(segs[try], op, pframe, pg, offp)) {
 			/* was try correct? */
-			if (vm_physseg_lt_p(&segs[try], op, pframe, pg, offp)) {
+			if (vm_physseg_lt_p(segs[try], op, pframe, pg, offp)) {
 				return(try);            /* got it */
 			}
 			start = try + 1;	/* next time, start here */
@@ -1009,14 +1009,14 @@
 #else
 
 static inline int
-vm_physseg_find_linear(struct vm_physseg *segs, int nsegs, int op,
+vm_physseg_find_linear(struct vm_physseg **segs, int nsegs, int op,
     paddr_t pframe, const struct vm_page *pg, int *offp)
 {
 	/* linear search for it */
 	int	lcv;
 
 	for (lcv = 0; lcv < nsegs; lcv++) {
-		if (vm_physseg_within_p(&segs[lcv], op, pframe, pg, offp)) {
+		if (vm_physseg_within_p(segs[lcv], op, pframe, pg, offp)) {
 			return(lcv);		   /* got it */
 		}
 	}
@@ -1153,7 +1153,7 @@
 	const struct vm_physseg *seg;
 	int psi;
 
-	psi = VM_PHYSSEG_FIND(vm_physmem, vm_nphysmem, VM_PHYSSEG_OP_PG, 0, pg, NULL);
+	psi = VM_PHYSSEG_FIND(vm_physmem_ptrs, vm_nphysmem, VM_PHYSSEG_OP_PG, 0, pg, NULL);
 	KASSERT(psi != -1);
 	seg = vm_physmem_ptrs[psi];
 	return (seg->start + pg - seg->pgs) * PAGE_SIZE;

Reply via email to