Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Use more VM_PHYSMEM_*() accessors. No functional changes.
details: https://anonhg.NetBSD.org/src/rev/cd7a43618194
branches: trunk
changeset: 758596:cd7a43618194
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Wed Nov 10 09:27:21 2010 +0000
description:
Use more VM_PHYSMEM_*() accessors. No functional changes.
diffstat:
sys/arch/acorn26/acorn26/pmap.c | 10 ++++----
sys/arch/alpha/alpha/machdep.c | 6 ++--
sys/arch/alpha/alpha/pmap.c | 38 +++++++++++++++---------------
sys/arch/amd64/amd64/machdep.c | 12 +++++-----
sys/arch/arm/arm32/pmap.c | 15 ++++++-----
sys/arch/i386/i386/machdep.c | 12 +++++-----
sys/arch/ia64/ia64/machdep.c | 12 +++++-----
sys/arch/ia64/ia64/pmap.c | 42 +++++++++++++++++-----------------
sys/arch/m68k/m68k/pmap_motorola.c | 16 ++++++------
sys/arch/mips/mips/mips_machdep.c | 6 ++--
sys/arch/mips/mips/pmap.c | 28 +++++++++++-----------
sys/arch/powerpc/ibm4xx/pmap.c | 14 +++++-----
sys/arch/powerpc/isa/isadma_machdep.c | 12 +++++-----
sys/arch/powerpc/oea/pmap.c | 23 ++++++++++--------
sys/arch/powerpc/powerpc/bus_dma.c | 12 +++++-----
sys/arch/sh3/sh3/mem.c | 6 ++--
sys/arch/sh3/sh3/pmap.c | 16 ++++++++-----
sys/arch/vax/vax/pmap.c | 10 ++++----
sys/arch/x68k/x68k/machdep.c | 10 ++++----
sys/arch/x68k/x68k/mem.c | 8 +++---
sys/uvm/uvm_page.h | 5 ++-
21 files changed, 161 insertions(+), 152 deletions(-)
diffs (truncated from 990 to 300 lines):
diff -r 901d01dab2b8 -r cd7a43618194 sys/arch/acorn26/acorn26/pmap.c
--- a/sys/arch/acorn26/acorn26/pmap.c Wed Nov 10 05:22:55 2010 +0000
+++ b/sys/arch/acorn26/acorn26/pmap.c Wed Nov 10 09:27:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.30 2009/11/07 07:27:40 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.31 2010/11/10 09:27:21 uebayasi Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000 Ben Harris
* All rights reserved.
@@ -102,7 +102,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30 2009/11/07 07:27:40 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.31 2010/11/10 09:27:21 uebayasi Exp $");
#include <sys/kernel.h> /* for cold */
#include <sys/malloc.h>
@@ -299,11 +299,11 @@
addr = 0;
size = round_page(size);
for (i = 0; i < vm_nphysseg; i++) {
- if (vm_physmem[i].avail_start < vm_physmem[i].avail_end) {
+ if (VM_PHYSMEM_PTR(i)->avail_start < VM_PHYSMEM_PTR(i)->avail_end) {
addr = (vaddr_t)
((char*)MEMC_PHYS_BASE +
- ptoa(vm_physmem[i].avail_start));
- vm_physmem[i].avail_start++;
+ ptoa(VM_PHYSMEM_PTR(i)->avail_start));
+ VM_PHYSMEM_PTR(i)->avail_start++;
break;
}
}
diff -r 901d01dab2b8 -r cd7a43618194 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c Wed Nov 10 05:22:55 2010 +0000
+++ b/sys/arch/alpha/alpha/machdep.c Wed Nov 10 09:27:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.327 2010/11/06 11:46:00 uebayasi Exp $ */
+/* $NetBSD: machdep.c,v 1.328 2010/11/10 09:27:21 uebayasi Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.327 2010/11/06 11:46:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.328 2010/11/10 09:27:21 uebayasi Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -604,7 +604,7 @@
vsize_t sz = (vsize_t)round_page(MSGBUFSIZE);
vsize_t reqsz = sz;
- vps = &vm_physmem[vm_nphysseg - 1];
+ vps = VM_PHYSMEM_PTR(vm_nphysseg - 1);
/* shrink so that it'll fit in the last segment */
if ((vps->avail_end - vps->avail_start) < atop(sz))
diff -r 901d01dab2b8 -r cd7a43618194 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c Wed Nov 10 05:22:55 2010 +0000
+++ b/sys/arch/alpha/alpha/pmap.c Wed Nov 10 09:27:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.253 2010/10/30 17:00:54 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.254 2010/11/10 09:27:21 uebayasi Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.253 2010/10/30 17:00:54 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.254 2010/11/10 09:27:21 uebayasi Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -788,8 +788,8 @@
* the fact that BSEARCH sorts the vm_physmem[] array
* for us.
*/
- avail_start = ptoa(vm_physmem[0].start);
- avail_end = ptoa(vm_physmem[vm_nphysseg - 1].end);
+ avail_start = ptoa(VM_PHYSMEM_PTR(0)->start);
+ avail_end = ptoa(VM_PHYSMEM_PTR(vm_nphysseg - 1)->end);
virtual_end = VM_MIN_KERNEL_ADDRESS + lev3mapsize * PAGE_SIZE;
#if 0
@@ -1028,34 +1028,34 @@
#if 0
printf(" bank %d: avail_start 0x%lx, start 0x%lx, "
- "avail_end 0x%lx\n", bank, vm_physmem[bank].avail_start,
- vm_physmem[bank].start, vm_physmem[bank].avail_end);
+ "avail_end 0x%lx\n", bank, VM_PHYSMEM_PTR(bank)->avail_start,
+ VM_PHYSMEM_PTR(bank)->start, VM_PHYSMEM_PTR(bank)->avail_end);
#endif
- if (vm_physmem[bank].avail_start != vm_physmem[bank].start ||
- vm_physmem[bank].avail_start >= vm_physmem[bank].avail_end)
+ if (VM_PHYSMEM_PTR(bank)->avail_start != VM_PHYSMEM_PTR(bank)->start ||
+ VM_PHYSMEM_PTR(bank)->avail_start >= VM_PHYSMEM_PTR(bank)->avail_end)
continue;
#if 0
printf(" avail_end - avail_start = 0x%lx\n",
- vm_physmem[bank].avail_end - vm_physmem[bank].avail_start);
+ VM_PHYSMEM_PTR(bank)->avail_end - VM_PHYSMEM_PTR(bank)->avail_start);
#endif
- if ((vm_physmem[bank].avail_end - vm_physmem[bank].avail_start)
+ if ((VM_PHYSMEM_PTR(bank)->avail_end - VM_PHYSMEM_PTR(bank)->avail_start)
< npgs)
continue;
/*
* There are enough pages here; steal them!
*/
- pa = ptoa(vm_physmem[bank].avail_start);
- vm_physmem[bank].avail_start += npgs;
- vm_physmem[bank].start += npgs;
+ pa = ptoa(VM_PHYSMEM_PTR(bank)->avail_start);
+ VM_PHYSMEM_PTR(bank)->avail_start += npgs;
+ VM_PHYSMEM_PTR(bank)->start += npgs;
/*
* Have we used up this segment?
*/
- if (vm_physmem[bank].avail_start == vm_physmem[bank].end) {
+ if (VM_PHYSMEM_PTR(bank)->avail_start == VM_PHYSMEM_PTR(bank)->end) {
if (vm_nphysseg == 1)
panic("pmap_steal_memory: out of memory!");
@@ -1063,7 +1063,7 @@
vm_nphysseg--;
for (x = bank; x < vm_nphysseg; x++) {
/* structure copy */
- vm_physmem[x] = vm_physmem[x + 1];
+ VM_PHYSMEM_PTR_SWAP(x, x + 1);
}
}
@@ -1114,12 +1114,12 @@
#if 0
for (bank = 0; bank < vm_nphysseg; bank++) {
printf("bank %d\n", bank);
- printf("\tstart = 0x%x\n", ptoa(vm_physmem[bank].start));
- printf("\tend = 0x%x\n", ptoa(vm_physmem[bank].end));
+ printf("\tstart = 0x%x\n", ptoa(VM_PHYSMEM_PTR(bank)->start));
+ printf("\tend = 0x%x\n", ptoa(VM_PHYSMEM_PTR(bank)->end));
printf("\tavail_start = 0x%x\n",
- ptoa(vm_physmem[bank].avail_start));
+ ptoa(VM_PHYSMEM_PTR(bank)->avail_start));
printf("\tavail_end = 0x%x\n",
- ptoa(vm_physmem[bank].avail_end));
+ ptoa(VM_PHYSMEM_PTR(bank)->avail_end));
}
#endif
}
diff -r 901d01dab2b8 -r cd7a43618194 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c Wed Nov 10 05:22:55 2010 +0000
+++ b/sys/arch/amd64/amd64/machdep.c Wed Nov 10 09:27:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.154 2010/10/24 07:53:05 jruoho Exp $ */
+/* $NetBSD: machdep.c,v 1.155 2010/11/10 09:27:21 uebayasi Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -107,7 +107,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.154 2010/10/24 07:53:05 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.155 2010/11/10 09:27:21 uebayasi Exp $");
/* #define XENDEBUG_LOW */
@@ -1163,7 +1163,7 @@
vps = NULL;
for (x = 0; x < vm_nphysseg; x++) {
- vps = &vm_physmem[x];
+ vps = VM_PHYSMEM_PTR(x);
if (ctob(vps->avail_end) == avail_end)
break;
}
@@ -1182,13 +1182,13 @@
/* Remove the last segment if it now has no pages. */
if (vps->start == vps->end) {
for (vm_nphysseg--; x < vm_nphysseg; x++)
- vm_physmem[x] = vm_physmem[x + 1];
+ VM_PHYSMEM_PTR_SWAP(x, x + 1);
}
/* Now find where the new avail_end is. */
for (avail_end = 0, x = 0; x < vm_nphysseg; x++)
- if (vm_physmem[x].avail_end > avail_end)
- avail_end = vm_physmem[x].avail_end;
+ if (VM_PHYSMEM_PTR(x)->avail_end > avail_end)
+ avail_end = VM_PHYSMEM_PTR(x)->avail_end;
avail_end = ctob(avail_end);
if (sz == reqsz)
diff -r 901d01dab2b8 -r cd7a43618194 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Wed Nov 10 05:22:55 2010 +0000
+++ b/sys/arch/arm/arm32/pmap.c Wed Nov 10 09:27:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.217 2010/11/03 16:59:19 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.218 2010/11/10 09:27:22 uebayasi Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
#include <machine/param.h>
#include <arm/arm32/katelib.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.217 2010/11/03 16:59:19 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.218 2010/11/10 09:27:22 uebayasi Exp $");
#define VM_PAGE_TO_MD(pg) (&(pg)->mdpage)
@@ -5388,8 +5388,8 @@
* One could argue whether this should be the entire memory or just
* the memory that is useable in a user process.
*/
- avail_start = ptoa(vm_physmem[0].start);
- avail_end = ptoa(vm_physmem[vm_nphysseg - 1].end);
+ avail_start = ptoa(VM_PHYSMEM_PTR(0)->start);
+ avail_end = ptoa(VM_PHYSMEM_PTR(vm_nphysseg - 1)->end);
/*
* Now we need to free enough pv_entry structures to allow us to get
@@ -6639,7 +6639,8 @@
break;
}
KASSERT(mask == 0);
- for (ps = vm_physmem, i = 0; i < vm_nphysseg; ps++, i++) {
+ for (i = 0; i < vm_nphysseg; i++) {
+ ps = VM_PHYSMEM_PTR(i);
if (ps->avail_start == atop(pv->pv_pa + pv->pv_size)
&& pv->pv_va + pv->pv_size <= ptoa(ps->avail_end)) {
rpv->pv_va = pv->pv_va;
@@ -6657,8 +6658,8 @@
* If we consumed the entire physseg, remove it.
*/
if (ps->avail_start == ps->avail_end) {
- for (--vm_nphysseg; i < vm_nphysseg; i++, ps++)
- ps[0] = ps[1];
+ for (--vm_nphysseg; i < vm_nphysseg; i++)
+ VM_PHYSMEM_PTR_SWAP(i, i + 1);
}
memset((void *)rpv->pv_va, 0, rpv->pv_size);
return;
diff -r 901d01dab2b8 -r cd7a43618194 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Wed Nov 10 05:22:55 2010 +0000
+++ b/sys/arch/i386/i386/machdep.c Wed Nov 10 09:27:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.696 2010/10/24 07:53:04 jruoho Exp $ */
+/* $NetBSD: machdep.c,v 1.697 2010/11/10 09:27:22 uebayasi Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.696 2010/10/24 07:53:04 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.697 2010/11/10 09:27:22 uebayasi Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@@ -1189,7 +1189,7 @@
search_again:
vps = NULL;
for (x = 0; x < vm_nphysseg; ++x) {
- vps = &vm_physmem[x];
+ vps = VM_PHYSMEM_PTR(x);
if (ctob(vps->avail_end) == avail_end) {
break;
}
@@ -1209,13 +1209,13 @@
/* Remove the last segment if it now has no pages. */
if (vps->start == vps->end) {
for (--vm_nphysseg; x < vm_nphysseg; x++)
- vm_physmem[x] = vm_physmem[x + 1];
+ VM_PHYSMEM_PTR_SWAP(x, x + 1);
}
/* Now find where the new avail_end is. */
for (avail_end = 0, x = 0; x < vm_nphysseg; x++)
- if (vm_physmem[x].avail_end > avail_end)
- avail_end = vm_physmem[x].avail_end;
+ if (VM_PHYSMEM_PTR(x)->avail_end > avail_end)
+ avail_end = VM_PHYSMEM_PTR(x)->avail_end;
avail_end = ctob(avail_end);
if (sz == reqsz)
diff -r 901d01dab2b8 -r cd7a43618194 sys/arch/ia64/ia64/machdep.c
--- a/sys/arch/ia64/ia64/machdep.c Wed Nov 10 05:22:55 2010 +0000
Home |
Main Index |
Thread Index |
Old Index