Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys/uvm Sync with HEAD.
details: https://anonhg.NetBSD.org/src/rev/40face4afe43
branches: uebayasi-xip
changeset: 751895:40face4afe43
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Sun Nov 21 12:14:15 2010 +0000
description:
Sync with HEAD.
diffstat:
sys/uvm/uvm_pglist.c | 32 +++++++++++++++++++++++---------
1 files changed, 23 insertions(+), 9 deletions(-)
diffs (98 lines):
diff -r 35921b47f5b3 -r 40face4afe43 sys/uvm/uvm_pglist.c
--- a/sys/uvm/uvm_pglist.c Sun Nov 21 12:02:06 2010 +0000
+++ b/sys/uvm/uvm_pglist.c Sun Nov 21 12:14:15 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_pglist.c,v 1.45.2.4 2010/11/12 19:00:00 uebayasi Exp $ */
+/* $NetBSD: uvm_pglist.c,v 1.45.2.5 2010/11/21 12:14:15 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.4 2010/11/12 19:00:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.45.2.5 2010/11/21 12:14:15 uebayasi Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -59,6 +59,20 @@
#define STAT_DECR(v)
#endif
+#ifdef DEBUG
+static int
+vm_physmem_index(struct vm_physseg *ps)
+{
+ int i;
+
+ for (i = 0; i < vm_nphysmem; i++) {
+ if (VM_PHYSMEM_PTR(i) == ps)
+ return i;
+ }
+ return -1;
+}
+#endif
+
/*
* uvm_pglistalloc: allocate a list of pages
*
@@ -133,7 +147,7 @@
#endif
#ifdef PGALLOC_VERBOSE
printf("pgalloc: contig %d pgs from psi %ld\n", num,
- (long)(ps - vm_physmem_ptrs[0]));
+ (long)(ps - VM_PHYSMEM_PTR(0)));
#endif
KASSERT(mutex_owned(&uvm_fpageqlock));
@@ -164,11 +178,11 @@
* Make sure this is a managed physical page.
*/
- if (vm_physseg_find(try, &cidx) != ps - vm_physmem_ptrs[0])
+ if (vm_physseg_find(try, &cidx) != vm_physmem_index(ps))
panic("pgalloc contig: botch1");
if (cidx != try - ps->start)
panic("pgalloc contig: botch2");
- if (vm_physseg_find(try + num - 1, &cidx) != ps - vm_physmem_ptrs[0])
+ if (vm_physseg_find(try + num - 1, &cidx) != vm_physmem_index(ps))
panic("pgalloc contig: botch3");
if (cidx != try - ps->start + num - 1)
panic("pgalloc contig: botch4");
@@ -251,7 +265,7 @@
for (psi = 0 ; psi < vm_nphysmem ; psi++)
#endif
{
- ps = vm_physmem_ptrs[psi];
+ ps = VM_PHYSMEM_PTR(psi);
if (ps->free_list != fl)
continue;
@@ -292,7 +306,7 @@
#endif
#ifdef PGALLOC_VERBOSE
printf("pgalloc: simple %d pgs from psi %ld\n", num,
- (long)(ps - vm_physmem_ptrs[0]));
+ (long)(ps - VM_PHYSMEM_PTR(0)));
#endif
KASSERT(mutex_owned(&uvm_fpageqlock));
@@ -303,7 +317,7 @@
for (try = max(atop(low), ps->avail_start);
try < limit; try ++) {
#ifdef DEBUG
- if (vm_physseg_find(try, &cidx) != ps - vm_physmem_ptrs[0])
+ if (vm_physseg_find(try, &cidx) != vm_physmem_index(ps))
panic("pgalloc simple: botch1");
if (cidx != (try - ps->start))
panic("pgalloc simple: botch2");
@@ -350,7 +364,7 @@
for (psi = 0 ; psi < vm_nphysmem ; psi++)
#endif
{
- ps = vm_physmem_ptrs[psi];
+ ps = VM_PHYSMEM_PTR(psi);
if (ps->free_list != fl)
continue;
Home |
Main Index |
Thread Index |
Old Index