CVS commit: [uebayasi-xip] src/sys/arch/m68k/m68k

2010-11-15 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov 16 02:47:24 UTC 2010

Modified Files:
src/sys/arch/m68k/m68k [uebayasi-xip]: bus_dma.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.29.18.1 -r1.29.18.2 src/sys/arch/m68k/m68k/bus_dma.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/arch/m68k/m68k/bus_dma.c
diff -u src/sys/arch/m68k/m68k/bus_dma.c:1.29.18.1 src/sys/arch/m68k/m68k/bus_dma.c:1.29.18.2
--- src/sys/arch/m68k/m68k/bus_dma.c:1.29.18.1	Tue Aug 17 06:44:47 2010
+++ src/sys/arch/m68k/m68k/bus_dma.c	Tue Nov 16 02:47:24 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.29.18.1 2010/08/17 06:44:47 uebayasi Exp $ */
+/* $NetBSD: bus_dma.c,v 1.29.18.2 2010/11/16 02:47:24 uebayasi Exp $ */
 
 /*
  * This file was taken from from alpha/common/bus_dma.c
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.29.18.1 2010/08/17 06:44:47 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.29.18.2 2010/11/16 02:47:24 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -51,7 +51,7 @@
 #include sys/proc.h
 #include sys/mbuf.h
 
-#include uvm/uvm_extern.h
+#include uvm/uvm.h
 
 #include machine/cpu.h
 



CVS commit: [uebayasi-xip] src/sys/arch/mips/mips

2010-11-15 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov 16 02:47:40 UTC 2010

Modified Files:
src/sys/arch/mips/mips [uebayasi-xip]: bus_dma.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.2.1 src/sys/arch/mips/mips/bus_dma.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/arch/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.23 src/sys/arch/mips/mips/bus_dma.c:1.23.2.1
--- src/sys/arch/mips/mips/bus_dma.c:1.23	Mon Dec 14 00:46:05 2009
+++ src/sys/arch/mips/mips/bus_dma.c	Tue Nov 16 02:47:40 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.23 2009/12/14 00:46:05 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.23.2.1 2010/11/16 02:47:40 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.23 2009/12/14 00:46:05 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.23.2.1 2010/11/16 02:47:40 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -42,7 +42,7 @@
 #include sys/proc.h
 #include sys/mbuf.h
 
-#include uvm/uvm_extern.h
+#include uvm/uvm.h
 
 #include mips/cache.h
 #ifdef _LP64



CVS commit: [uebayasi-xip] src/sys/arch

2010-11-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Nov 10 08:05:00 UTC 2010

Modified Files:
src/sys/arch/alpha/alpha [uebayasi-xip]: pmap.c
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
opt_xip.h isn't needed any more here.


To generate a diff of this commit:
cvs rdiff -u -r1.252.2.7 -r1.252.2.8 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.211.2.20 -r1.211.2.21 src/sys/arch/arm/arm32/pmap.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/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.252.2.7 src/sys/arch/alpha/alpha/pmap.c:1.252.2.8
--- src/sys/arch/alpha/alpha/pmap.c:1.252.2.7	Wed Nov 10 03:36:25 2010
+++ src/sys/arch/alpha/alpha/pmap.c	Wed Nov 10 08:04:59 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.252.2.7 2010/11/10 03:36:25 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.252.2.8 2010/11/10 08:04:59 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -137,11 +137,10 @@
 #include opt_lockdebug.h
 #include opt_sysv.h
 #include opt_multiprocessor.h
-#include opt_xip.h
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.252.2.7 2010/11/10 03:36:25 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.252.2.8 2010/11/10 08:04:59 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.20 src/sys/arch/arm/arm32/pmap.c:1.211.2.21
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.20	Wed Nov 10 03:36:26 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Nov 10 08:04:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.20 2010/11/10 03:36:26 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.21 2010/11/10 08:04:59 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -191,7 +191,6 @@
 #include opt_ddb.h
 #include opt_lockdebug.h
 #include opt_multiprocessor.h
-#include opt_xip.h
 
 #include sys/param.h
 #include sys/types.h
@@ -212,7 +211,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.20 2010/11/10 03:36:26 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.21 2010/11/10 08:04:59 uebayasi Exp $);
 
 #define	VM_PAGE_TO_MD(pg)	((pg)-mdpage)
 



CVS commit: [uebayasi-xip] src/sys/arch/ia64/ia64

2010-11-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Nov 10 08:37:46 UTC 2010

Modified Files:
src/sys/arch/ia64/ia64 [uebayasi-xip]: pmap.c

Log Message:
opt_xip.h is no more here.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.6 -r1.24.2.7 src/sys/arch/ia64/ia64/pmap.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/arch/ia64/ia64/pmap.c
diff -u src/sys/arch/ia64/ia64/pmap.c:1.24.2.6 src/sys/arch/ia64/ia64/pmap.c:1.24.2.7
--- src/sys/arch/ia64/ia64/pmap.c:1.24.2.6	Wed Nov 10 03:36:27 2010
+++ src/sys/arch/ia64/ia64/pmap.c	Wed Nov 10 08:37:45 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.24.2.6 2010/11/10 03:36:27 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.24.2.7 2010/11/10 08:37:45 uebayasi Exp $ */
 
 
 /*-
@@ -85,9 +85,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.24.2.6 2010/11/10 03:36:27 uebayasi Exp $);
-
-#include opt_xip.h
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.24.2.7 2010/11/10 08:37:45 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h



CVS commit: [uebayasi-xip] src/sys/arch

2010-11-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Nov 10 03:36:29 UTC 2010

Modified Files:
src/sys/arch/alpha/alpha [uebayasi-xip]: pmap.c
src/sys/arch/amd64/amd64 [uebayasi-xip]: machdep.c
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c
src/sys/arch/i386/i386 [uebayasi-xip]: machdep.c
src/sys/arch/ia64/ia64 [uebayasi-xip]: pmap.c
src/sys/arch/mips/mips [uebayasi-xip]: pmap.c
src/sys/arch/sh3/sh3 [uebayasi-xip]: pmap.c

Log Message:
Always use VM_PHYSMEM_PTR().


To generate a diff of this commit:
cvs rdiff -u -r1.252.2.6 -r1.252.2.7 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.141.2.5 -r1.141.2.6 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.211.2.19 -r1.211.2.20 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.681.2.5 -r1.681.2.6 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.24.2.5 -r1.24.2.6 src/sys/arch/ia64/ia64/pmap.c
cvs rdiff -u -r1.188.2.9 -r1.188.2.10 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.74.2.6 -r1.74.2.7 src/sys/arch/sh3/sh3/pmap.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/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.252.2.6 src/sys/arch/alpha/alpha/pmap.c:1.252.2.7
--- src/sys/arch/alpha/alpha/pmap.c:1.252.2.6	Sat Nov  6 08:08:12 2010
+++ src/sys/arch/alpha/alpha/pmap.c	Wed Nov 10 03:36:25 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.252.2.6 2010/11/06 08:08:12 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.252.2.7 2010/11/10 03:36:25 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -141,7 +141,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.252.2.6 2010/11/06 08:08:12 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.252.2.7 2010/11/10 03:36:25 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1064,7 +1064,7 @@
 			vm_nphysseg--;
 			for (x = bank; x  vm_nphysseg; x++) {
 /* structure copy */
-vm_physmem_ptrs[x] = vm_physmem_ptrs[x + 1];
+*VM_PHYSMEM_PTR(x) = *VM_PHYSMEM_PTR(x + 1);
 			}
 		}
 

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.141.2.5 src/sys/arch/amd64/amd64/machdep.c:1.141.2.6
--- src/sys/arch/amd64/amd64/machdep.c:1.141.2.5	Sat Nov  6 08:08:12 2010
+++ src/sys/arch/amd64/amd64/machdep.c	Wed Nov 10 03:36:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.141.2.5 2010/11/06 08:08:12 uebayasi Exp $	*/
+/*	$NetBSD: machdep.c,v 1.141.2.6 2010/11/10 03:36:26 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.141.2.5 2010/11/06 08:08:12 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.141.2.6 2010/11/10 03:36:26 uebayasi Exp $);
 
 /* #define XENDEBUG_LOW  */
 
@@ -1182,7 +1182,7 @@
 	/* Remove the last segment if it now has no pages. */
 	if (vps-start == vps-end) {
 		for (vm_nphysseg--; x  vm_nphysseg; x++)
-			vm_physmem_ptrs[x] = vm_physmem_ptrs[x + 1];
+			*VM_PHYSMEM_PTR(x) = *VM_PHYSMEM_PTR(x + 1);
 	}
 
 	/* Now find where the new avail_end is. */

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.19 src/sys/arch/arm/arm32/pmap.c:1.211.2.20
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.19	Sat Nov  6 08:08:14 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Nov 10 03:36:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.19 2010/11/06 08:08:14 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.20 2010/11/10 03:36:26 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.19 2010/11/06 08:08:14 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.20 2010/11/10 03:36:26 uebayasi Exp $);
 
 #define	VM_PAGE_TO_MD(pg)	((pg)-mdpage)
 
@@ -6649,7 +6649,7 @@
 	}
 	KASSERT(mask == 0);
 	for (i = 0; i  vm_nphysseg; i++) {
-		ps = vm_physmem_ptrs[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;
@@ -6668,7 +6668,7 @@
 			 */
 			if (ps-avail_start == ps-avail_end) {
 for (--vm_nphysseg; i  vm_nphysseg; i++, ps++)
-	ps[0] = ps[1];
+	*(ps[0]) = *(ps[1]);
 			}
 			memset((void *)rpv-pv_va, 0, rpv-pv_size);
 			return;

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.681.2.5 src/sys/arch/i386/i386/machdep.c:1.681.2.6
--- src/sys/arch/i386/i386/machdep.c:1.681.2.5	Sat Nov  6 08:08:18 2010
+++ src/sys/arch/i386/i386/machdep.c	Wed Nov 10 03:36:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.681.2.5 2010/11/06 08:08:18 uebayasi Exp $	*/
+/*	$NetBSD: machdep.c,v 1.681.2.6 2010/11/10 03:36:27 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 

CVS commit: [uebayasi-xip] src/sys/arch

2010-11-08 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov  9 06:03:41 UTC 2010

Modified Files:
src/sys/arch/amd64/conf [uebayasi-xip]: XEN3_DOM0
src/sys/arch/hp700/dev [uebayasi-xip]: dino.c elroy.c
src/sys/arch/hp700/hp700 [uebayasi-xip]: machdep.c
src/sys/arch/i386/conf [uebayasi-xip]: ALL GENERIC XEN3_DOM0
src/sys/arch/i386/stand/boot [uebayasi-xip]: boot2.c
src/sys/arch/i386/stand/pxeboot [uebayasi-xip]: main.c
src/sys/arch/macppc/dev [uebayasi-xip]: pbms.c
src/sys/arch/mips/mips [uebayasi-xip]: locore_mips1.S
src/sys/arch/powerpc/conf [uebayasi-xip]: files.ibm4xx
src/sys/arch/powerpc/ibm4xx/dev [uebayasi-xip]: plb.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: bus_space.c
src/sys/arch/sparc/stand/ofwboot [uebayasi-xip]: boot.c
src/sys/arch/sparc64/sparc64 [uebayasi-xip]: vm_machdep.c
src/sys/arch/x86/include [uebayasi-xip]: pci_machdep_common.h
src/sys/arch/x86/pci [uebayasi-xip]: pciide_machdep.c
src/sys/arch/x86/x86 [uebayasi-xip]: bus_dma.c cpu.c
src/sys/arch/xen/x86 [uebayasi-xip]: cpu.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.48.2.2 -r1.48.2.3 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.22.2.1 -r1.22.2.2 src/sys/arch/hp700/dev/dino.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/sys/arch/hp700/dev/elroy.c
cvs rdiff -u -r1.77.2.2 -r1.77.2.3 src/sys/arch/hp700/hp700/machdep.c
cvs rdiff -u -r1.233.2.4 -r1.233.2.5 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.963.2.4 -r1.963.2.5 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.27.2.2 -r1.27.2.3 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.47.2.1 -r1.47.2.2 src/sys/arch/i386/stand/boot/boot2.c
cvs rdiff -u -r1.24.2.1 -r1.24.2.2 src/sys/arch/i386/stand/pxeboot/main.c
cvs rdiff -u -r1.9 -r1.9.2.1 src/sys/arch/macppc/dev/pbms.c
cvs rdiff -u -r1.67 -r1.67.2.1 src/sys/arch/mips/mips/locore_mips1.S
cvs rdiff -u -r1.10.88.4 -r1.10.88.5 src/sys/arch/powerpc/conf/files.ibm4xx
cvs rdiff -u -r1.14.98.2 -r1.14.98.3 src/sys/arch/powerpc/ibm4xx/dev/plb.c
cvs rdiff -u -r1.20.20.3 -r1.20.20.4 src/sys/arch/powerpc/powerpc/bus_space.c
cvs rdiff -u -r1.21.2.2 -r1.21.2.3 src/sys/arch/sparc/stand/ofwboot/boot.c
cvs rdiff -u -r1.91 -r1.91.2.1 src/sys/arch/sparc64/sparc64/vm_machdep.c
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 \
src/sys/arch/x86/include/pci_machdep_common.h
cvs rdiff -u -r1.9 -r1.9.2.1 src/sys/arch/x86/pci/pciide_machdep.c
cvs rdiff -u -r1.52.2.3 -r1.52.2.4 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.66.2.4 -r1.66.2.5 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.40.2.5 -r1.40.2.6 src/sys/arch/xen/x86/cpu.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/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.48.2.2 src/sys/arch/amd64/conf/XEN3_DOM0:1.48.2.3
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.48.2.2	Tue Aug 17 06:43:53 2010
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Tue Nov  9 06:03:37 2010
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.48.2.2 2010/08/17 06:43:53 uebayasi Exp $
+# $NetBSD: XEN3_DOM0,v 1.48.2.3 2010/11/09 06:03:37 uebayasi Exp $
 
 include 	arch/amd64/conf/std.xen
 
@@ -432,6 +432,7 @@
 pdcsata*	at pci? dev ? function ?	# Promise SATA150 controllers
 rccide* 	at pci? dev ? function ?	# ServerWorks IDE controllers
 satalink*	at pci? dev ? function ?	# SiI SATALink controllers
+siisata*	at pci? dev ? function ?	# SiI SteelVine controllers
 siside* 	at pci? dev ? function ?	# SiS IDE controllers
 slide*  	at pci? dev ? function ?	# Symphony Labs IDE controllers
 svwsata* 	at pci? dev ? function ?	# ServerWorks SATA controllers

Index: src/sys/arch/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.22.2.1 src/sys/arch/hp700/dev/dino.c:1.22.2.2
--- src/sys/arch/hp700/dev/dino.c:1.22.2.1	Fri Apr 30 14:39:23 2010
+++ src/sys/arch/hp700/dev/dino.c	Tue Nov  9 06:03:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.22.2.1 2010/04/30 14:39:23 uebayasi Exp $ */
+/*	$NetBSD: dino.c,v 1.22.2.2 2010/11/09 06:03:37 uebayasi Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dino.c,v 1.22.2.1 2010/04/30 14:39:23 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: dino.c,v 1.22.2.2 2010/11/09 06:03:37 uebayasi Exp $);
 
 /* #include cardbus.h */
 
@@ -955,7 +955,6 @@
 			p++;
 	}
 
-	c /= 2;
 	while (c--)
 		*a++ = *p;
 }
@@ -977,7 +976,6 @@
 		p = (volatile uint32_t *)r-pci_io_data;
 	}
 
-	c /= 4;
 	while (c--)
 		*a++ = *p;
 }
@@ -1008,7 +1006,6 @@
 			p++;
 	}
 
-	c /= 2;
 	while (c--)
 		*p = *a++;
 }
@@ -1030,7 +1027,6 @@
 		p = (volatile uint32_t *)r-pci_io_data;
 	}
 
-	c /= 4;
 	while (c--)
 		*p = *a++;
 }
@@ -1206,7 +1202,6 @@
 {
 	volatile uint16_t *p;
 
-	c /= 2;
 	h += o;
 	if (h  HPPA_IOSPACE) {
 		p = (volatile uint16_t *)h;
@@ -1232,7 +1227,6 @@
 {
 	

CVS commit: [uebayasi-xip] src/sys/arch

2010-11-08 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov  9 06:06:31 UTC 2010

Modified Files:
src/sys/arch/powerpc/conf [uebayasi-xip]: files.ibm4xx
src/sys/arch/powerpc/ibm4xx/dev [uebayasi-xip]: plb.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: bus_space.c
src/sys/arch/x86/x86 [uebayasi-xip]: bus_dma.c cpu.c
src/sys/arch/xen/x86 [uebayasi-xip]: cpu.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.10.88.5 -r1.10.88.6 src/sys/arch/powerpc/conf/files.ibm4xx
cvs rdiff -u -r1.14.98.3 -r1.14.98.4 src/sys/arch/powerpc/ibm4xx/dev/plb.c
cvs rdiff -u -r1.20.20.4 -r1.20.20.5 src/sys/arch/powerpc/powerpc/bus_space.c
cvs rdiff -u -r1.52.2.4 -r1.52.2.5 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.66.2.5 -r1.66.2.6 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.40.2.6 -r1.40.2.7 src/sys/arch/xen/x86/cpu.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/arch/powerpc/conf/files.ibm4xx
diff -u src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.5 src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.6
--- src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.5	Tue Nov  9 06:03:39 2010
+++ src/sys/arch/powerpc/conf/files.ibm4xx	Tue Nov  9 06:06:30 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ibm4xx,v 1.10.88.5 2010/11/09 06:03:39 uebayasi Exp $
+#	$NetBSD: files.ibm4xx,v 1.10.88.6 2010/11/09 06:06:30 uebayasi Exp $
 #
 # IBM 4xx specific configuration info
 
@@ -69,7 +69,6 @@
 device	gpiic: i2cbus, i2c_bitbang
 attach	gpiic at opb
 file	arch/powerpc/ibm4xx/dev/gpiic_opb.c	gpiic
- files.ibm4xx
 
 # External bus
 device	exb {[addr = -1]}
@@ -79,10 +78,3 @@
 # FlashROM on external bus
 attach	flash at exb with flash_exb
 file	arch/powerpc/ibm4xx/dev/flash_exb.c	flash_exb	needs-flag
-===
-
-# External bus
-#device exb {[addr = -1]}
-#attach exb at plb
-#file	arch/powerpc/ibm4xx/dev/exb.c		exb
- 1.12

Index: src/sys/arch/powerpc/ibm4xx/dev/plb.c
diff -u src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.14.98.3 src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.14.98.4
--- src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.14.98.3	Tue Nov  9 06:03:39 2010
+++ src/sys/arch/powerpc/ibm4xx/dev/plb.c	Tue Nov  9 06:06:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: plb.c,v 1.14.98.3 2010/11/09 06:03:39 uebayasi Exp $ */
+/* $NetBSD: plb.c,v 1.14.98.4 2010/11/09 06:06:30 uebayasi Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: plb.c,v 1.14.98.3 2010/11/09 06:03:39 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: plb.c,v 1.14.98.4 2010/11/09 06:06:30 uebayasi Exp $);
 
 #include locators.h
 #include emac.h
@@ -100,11 +100,7 @@
 	{ IBM405GPR,	ecc, },
 	{ IBM405GPR,	opb, },
 	{ IBM405GPR,	pchb, },
- plb.c
 	{ IBM405GPR,	exb, },
-===
-	{ IBM405GPR,exb, },
- 1.16
 
 	/* AMCC 405EX / EXR */
 	{ AMCC405EX,	cpu, },

Index: src/sys/arch/powerpc/powerpc/bus_space.c
diff -u src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.4 src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.5
--- src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.4	Tue Nov  9 06:03:39 2010
+++ src/sys/arch/powerpc/powerpc/bus_space.c	Tue Nov  9 06:06:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.20.20.4 2010/11/09 06:03:39 uebayasi Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.20.20.5 2010/11/09 06:06:31 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.20.20.4 2010/11/09 06:03:39 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.20.20.5 2010/11/09 06:06:31 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -41,12 +41,7 @@
 #include sys/extent.h
 #include sys/malloc.h
 
- bus_space.c
-#include uvm/uvm_extern.h
-#include uvm/uvm_prot.h
-===
 #include uvm/uvm.h
- 1.23
 
 #define _POWERPC_BUS_SPACE_PRIVATE
 #include machine/bus.h

Index: src/sys/arch/x86/x86/bus_dma.c
diff -u src/sys/arch/x86/x86/bus_dma.c:1.52.2.4 src/sys/arch/x86/x86/bus_dma.c:1.52.2.5
--- src/sys/arch/x86/x86/bus_dma.c:1.52.2.4	Tue Nov  9 06:03:40 2010
+++ src/sys/arch/x86/x86/bus_dma.c	Tue Nov  9 06:06:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.52.2.4 2010/11/09 06:03:40 uebayasi Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.52.2.5 2010/11/09 06:06:31 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.52.2.4 2010/11/09 06:03:40 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.52.2.5 2010/11/09 06:06:31 uebayasi Exp $);
 
 /*
  * The following is included because _bus_dma_uiomove is derived from
@@ -101,12 +101,7 @@
 #include dev/isa/isareg.h
 #include dev/isa/isavar.h
 
- bus_dma.c
-#include uvm/uvm_extern.h
-#include uvm/uvm_page.h
-===
 #include uvm/uvm.h
- 1.56
 
 extern	paddr_t avail_end;
 

Index: 

CVS commit: [uebayasi-xip] src/sys/arch

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 06:10:56 UTC 2010

Modified Files:
src/sys/arch/m68k/m68k [uebayasi-xip]: pmap_motorola.c
src/sys/arch/mips/mips [uebayasi-xip]: pmap.c

Log Message:
Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.55.2.6 -r1.55.2.7 src/sys/arch/m68k/m68k/pmap_motorola.c
cvs rdiff -u -r1.188.2.7 -r1.188.2.8 src/sys/arch/mips/mips/pmap.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/arch/m68k/m68k/pmap_motorola.c
diff -u src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.6 src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.7
--- src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.6	Thu Nov  4 08:47:36 2010
+++ src/sys/arch/m68k/m68k/pmap_motorola.c	Sat Nov  6 06:10:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.c,v 1.55.2.6 2010/11/04 08:47:36 uebayasi Exp $*/
+/*	$NetBSD: pmap_motorola.c,v 1.55.2.7 2010/11/06 06:10:55 uebayasi Exp $*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -119,7 +119,7 @@
 #include opt_m68k_arch.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_motorola.c,v 1.55.2.6 2010/11/04 08:47:36 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_motorola.c,v 1.55.2.7 2010/11/06 06:10:55 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -286,7 +286,7 @@
 void	pmap_free_pv(struct pv_entry *);
 
 #define	PAGE_IS_MANAGED(pa)	(pmap_initialized  \
-	(uvm_pageismanaged(pa) || uvm_pageismanaged_device(pa))
+	(uvm_pageismanaged(pa) || uvm_pageismanaged_device(pa)))
 
 static inline struct pv_header *
 pa_to_pvh(paddr_t pa)

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.188.2.7 src/sys/arch/mips/mips/pmap.c:1.188.2.8
--- src/sys/arch/mips/mips/pmap.c:1.188.2.7	Thu Nov  4 08:47:37 2010
+++ src/sys/arch/mips/mips/pmap.c	Sat Nov  6 06:10:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.188.2.7 2010/11/04 08:47:37 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.188.2.8 2010/11/06 06:10:55 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.188.2.7 2010/11/04 08:47:37 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.188.2.8 2010/11/06 06:10:55 uebayasi Exp $);
 
 /*
  *	Manages physical address maps.
@@ -226,7 +226,7 @@
 bool		pmap_initialized = false;
 
 #define PAGE_IS_MANAGED(pa)	(pmap_initialized  \
-	(uvm_pageismanaged(pa) || uvm_pageismanaged_device(pa))
+	(uvm_pageismanaged(pa) || uvm_pageismanaged_device(pa)))
 
 #define PMAP_IS_ACTIVE(pm)		\
 	((pm) == pmap_kernel() || 	\



CVS commit: [uebayasi-xip] src/sys/arch/evbppc/compile

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 16:21:16 UTC 2010

Modified Files:
src/sys/arch/evbppc/compile [uebayasi-xip]: walnut-mkimg.sh

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.3.98.1 -r1.3.98.2 \
src/sys/arch/evbppc/compile/walnut-mkimg.sh

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

Modified files:

Index: src/sys/arch/evbppc/compile/walnut-mkimg.sh
diff -u src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.3.98.1 src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.3.98.2
--- src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.3.98.1	Wed Aug 11 13:30:50 2010
+++ src/sys/arch/evbppc/compile/walnut-mkimg.sh	Sat Nov  6 16:21:15 2010
@@ -1,7 +1,7 @@
 #!/bin/sh
-# $NetBSD: walnut-mkimg.sh,v 1.3.98.1 2010/08/11 13:30:50 uebayasi Exp $
+# $NetBSD: walnut-mkimg.sh,v 1.3.98.2 2010/11/06 16:21:15 uebayasi Exp $
 
-# Convert a input to an tftp image loadable by the IBM PowerPC OpenBIOS.
+# Convert an input to a TFTP image loadable by the IBM PowerPC OpenBIOS.
 
 magic=5394511	# IBM OpenBIOS magic number 0x0052504f
 start=0



CVS commit: [uebayasi-xip] src/sys/arch/evbppc/conf

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 07:29:09 UTC 2010

Modified Files:
src/sys/arch/evbppc/conf [uebayasi-xip]: OPENBLOCKS266_XIP

Log Message:
Add xmd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP

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

Modified files:

Index: src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP
diff -u src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP:1.1.2.1 src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP:1.1.2.2
--- src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP:1.1.2.1	Wed Aug 11 14:03:10 2010
+++ src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP	Sat Oct 30 07:29:08 2010
@@ -1,8 +1,7 @@
-#	$NetBSD: OPENBLOCKS266_XIP,v 1.1.2.1 2010/08/11 14:03:10 uebayasi Exp $
+#	$NetBSD: OPENBLOCKS266_XIP,v 1.1.2.2 2010/10/30 07:29:08 uebayasi Exp $
 #
 
 include		arch/evbppc/conf/OPENBLOCKS266
-#	$NetBSD: OPENBLOCKS266_XIP,v 1.1.2.1 2010/08/11 14:03:10 uebayasi Exp $
 
 exb0	at plb?
 
@@ -11,3 +10,6 @@
 
 options 	__BUS_SPACE_HAS_PHYSLOAD_METHODS
 options 	XIP
+
+pseudo-device	xmd		1	# XIP memory disk device
+options 	XMD_ROOT_SIZE=10240	# 5MB



CVS commit: [uebayasi-xip] src/sys/arch

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 08:43:12 UTC 2010

Modified Files:
src/sys/arch/powerpc/conf [uebayasi-xip]: files.powerpc
src/sys/arch/x86/conf [uebayasi-xip]: files.x86

Log Message:
xmd_machdep.c is gone.


To generate a diff of this commit:
cvs rdiff -u -r1.71.4.4 -r1.71.4.5 src/sys/arch/powerpc/conf/files.powerpc
cvs rdiff -u -r1.54.2.2 -r1.54.2.3 src/sys/arch/x86/conf/files.x86

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

Modified files:

Index: src/sys/arch/powerpc/conf/files.powerpc
diff -u src/sys/arch/powerpc/conf/files.powerpc:1.71.4.4 src/sys/arch/powerpc/conf/files.powerpc:1.71.4.5
--- src/sys/arch/powerpc/conf/files.powerpc:1.71.4.4	Wed Aug 25 14:33:07 2010
+++ src/sys/arch/powerpc/conf/files.powerpc	Sat Oct 30 08:43:12 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.powerpc,v 1.71.4.4 2010/08/25 14:33:07 uebayasi Exp $
+#	$NetBSD: files.powerpc,v 1.71.4.5 2010/10/30 08:43:12 uebayasi Exp $
 
 defflag	opt_altivec.h	ALTIVEC K_ALTIVEC
 defflag	opt_openpic.h	OPENPIC OPENPIC_SERIAL_MODE
@@ -94,5 +94,3 @@
 file arch/powerpc/powerpc/linux_sigcode.S		compat_linux
 file arch/powerpc/powerpc/linux_trap.c			compat_linux
 file arch/powerpc/powerpc/linux_syscall.c		compat_linux
-
-file	arch/powerpc/powerpc/xmd_machdep.c		xmd

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.54.2.2 src/sys/arch/x86/conf/files.x86:1.54.2.3
--- src/sys/arch/x86/conf/files.x86:1.54.2.2	Fri Aug 20 07:04:37 2010
+++ src/sys/arch/x86/conf/files.x86	Sat Oct 30 08:43:12 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.54.2.2 2010/08/20 07:04:37 uebayasi Exp $
+#	$NetBSD: files.x86,v 1.54.2.3 2010/10/30 08:43:12 uebayasi Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -121,8 +121,6 @@
 
 file	arch/x86/x86/tprof_pmi.c	tprof	needs-flag
 
-file	arch/x86/x86/xmd_machdep.c	xmd
-
 file	arch/x86/pci/pci_machdep.c	pci
 file	arch/x86/pci/pci_intr_machdep.c	pci
 



CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 31 03:43:03 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
More struct vm_page * - struct vm_page_md * adjustments.


To generate a diff of this commit:
cvs rdiff -u -r1.211.2.16 -r1.211.2.17 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.16 src/sys/arch/arm/arm32/pmap.c:1.211.2.17
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.16	Sat Oct 30 08:41:06 2010
+++ src/sys/arch/arm/arm32/pmap.c	Sun Oct 31 03:43:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.16 2010/10/30 08:41:06 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.17 2010/10/31 03:43:02 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.16 2010/10/30 08:41:06 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.17 2010/10/31 03:43:02 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -663,7 +663,7 @@
 static void		pmap_vac_me_user(struct vm_page_md *, paddr_t, pmap_t, vaddr_t);
 #endif
 
-static void		pmap_clearbit(struct vm_page *, u_int);
+static void		pmap_clearbit(struct vm_page_md *, paddr_t, u_int);
 #ifdef PMAP_CACHE_VIVT
 static int		pmap_clean_page(struct pv_entry *, bool);
 #endif
@@ -676,7 +676,7 @@
 };
 static void		pmap_flush_page(struct vm_page_md *, paddr_t, enum pmap_flush_op);
 #endif
-static void		pmap_page_remove(struct vm_page *);
+static void		pmap_page_remove(struct vm_page_md *, paddr_t);
 
 static void		pmap_init_l1(struct l1_ttable *, pd_entry_t *);
 static vaddr_t		kernel_pt_lookup(paddr_t);
@@ -974,7 +974,7 @@
 	while (pv) {
 		if (pv-pv_pmap == pm  pv-pv_va == va) {	/* match? */
 			NPDEBUG(PDB_PVDUMP, printf(pmap_remove_pv: pm %p, md 
-			%p\n, pm, md));
+			%p, flags 0x%x\n, pm, md, pv-pv_flags));
 			if (pv-pv_flags  PVF_WIRED) {
 --pm-pm_stats.wired_count;
 			}
@@ -2121,9 +2121,8 @@
  * constants and the latter would require an extra inversion at run-time.
  */
 static void
-pmap_clearbit(struct vm_page *pg, u_int maskbits)
+pmap_clearbit(struct vm_page_md *md, paddr_t pa, u_int maskbits)
 {
-	struct vm_page_md *md = VM_PAGE_TO_MD(pg);
 	struct l2_bucket *l2b;
 	struct pv_entry *pv;
 	pt_entry_t *ptep, npte, opte;
@@ -2138,8 +2137,8 @@
 #endif
 
 	NPDEBUG(PDB_BITS,
-	printf(pmap_clearbit: pg %p (0x%08lx) mask 0x%x\n,
-	pg, VM_PAGE_TO_PHYS(pg), maskbits));
+	printf(pmap_clearbit: md %p mask 0x%x\n,
+	md, maskbits));
 
 	PMAP_HEAD_TO_MAP_LOCK();
 	simple_lock(md-pvh_slock);
@@ -2317,7 +2316,7 @@
 	 * If we need to sync the I-cache and we haven't done it yet, do it.
 	 */
 	if (need_syncicache  !did_syncicache) {
-		pmap_syncicache_page(md, VM_PAGE_TO_PHYS(pg));
+		pmap_syncicache_page(md, pa);
 		PMAPCOUNT(exec_synced_clearbit);
 	}
 	/*
@@ -2327,7 +2326,7 @@
 	 */
 	if (need_vac_me_harder) {
 		if (md-pvh_attrs  PVF_NC)
-			pmap_vac_me_harder(md, VM_PAGE_TO_PHYS(pg), NULL, 0);
+			pmap_vac_me_harder(md, pa, NULL, 0);
 	}
 #endif
 
@@ -2567,10 +2566,8 @@
  *		Reflects back modify bits to the pager.
  */
 static void
-pmap_page_remove(struct vm_page *pg)
+pmap_page_remove(struct vm_page_md *md, paddr_t pa)
 {
-	struct vm_page_md *md = VM_PAGE_TO_MD(pg);
-	paddr_t pa = VM_PAGE_TO_PHYS(pg);
 	struct l2_bucket *l2b;
 	struct pv_entry *pv, *npv, **pvp;
 	pmap_t pm;
@@ -2579,7 +2576,7 @@
 	u_int flags;
 
 	NPDEBUG(PDB_FOLLOW,
-	printf(pmap_page_remove: pg %p (0x%08lx)\n, pg,
+	printf(pmap_page_remove: md %p (0x%08lx)\n, md,
 	pa));
 
 	PMAP_HEAD_TO_MAP_LOCK();
@@ -2896,9 +2893,7 @@
 			 */
 			if (opg) {
 struct vm_page_md *omd = VM_PAGE_TO_MD(opg);
-paddr_t opa;
-
-opa = VM_PAGE_TO_PHYS(opg);
+paddr_t opa = VM_PAGE_TO_PHYS(opg);
 
 /*
  * Replacing an existing mapping with a new one.
@@ -2945,7 +2940,7 @@
 return (ENOMEM);
 			}
 
-			pmap_enter_pv(md, VM_PAGE_TO_PHYS(pg), pv, pm, va, nflags);
+			pmap_enter_pv(md, pa, pv, pm, va, nflags);
 		}
 	} else {
 		/*
@@ -2969,9 +2964,11 @@
 			 * at this address.
 			 */
 			struct vm_page_md *omd = VM_PAGE_TO_MD(opg);
+			paddr_t opa = VM_PAGE_TO_PHYS(opg);
+
 			simple_lock(omd-pvh_slock);
-			pv = pmap_remove_pv(omd, VM_PAGE_TO_PHYS(opg), pm, va);
-			pmap_vac_me_harder(omd, VM_PAGE_TO_PHYS(opg), pm, 0);
+			pv = pmap_remove_pv(omd, opa, pm, va);
+			pmap_vac_me_harder(omd, opa, pm, 0);
 			simple_unlock(omd-pvh_slock);
 			oflags = pv-pv_flags;
 
@@ -3052,14 +3049,16 @@
 
 		if (pg != NULL) {
 			struct vm_page_md *md = VM_PAGE_TO_MD(pg);
+
 			simple_lock(md-pvh_slock);
-			pmap_vac_me_harder(md, VM_PAGE_TO_PHYS(pg), pm, va);
+			pmap_vac_me_harder(md, pa, pm, va);
 			simple_unlock(md-pvh_slock);
 		}
 	}
 #if defined(PMAP_CACHE_VIPT)  defined(DIAGNOSTIC)
 	if 

CVS commit: [uebayasi-xip] src/sys/arch

2010-10-29 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 05:02:28 UTC 2010

Modified Files:
src/sys/arch/amd64/conf [uebayasi-xip]: XIP
src/sys/arch/i386/conf [uebayasi-xip]: XIP

Log Message:
xmd(4) uses a conflicting symbol md_root_image with md(4).
Exclude md(4) where xmd(4) is used.

XXX In the long run mdsetimage(8) must die.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/amd64/conf/XIP
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/i386/conf/XIP

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

Modified files:

Index: src/sys/arch/amd64/conf/XIP
diff -u src/sys/arch/amd64/conf/XIP:1.1.2.1 src/sys/arch/amd64/conf/XIP:1.1.2.2
--- src/sys/arch/amd64/conf/XIP:1.1.2.1	Fri Aug 27 09:41:51 2010
+++ src/sys/arch/amd64/conf/XIP	Sat Oct 30 05:02:28 2010
@@ -1,8 +1,9 @@
-#	$NetBSD: XIP,v 1.1.2.1 2010/08/27 09:41:51 uebayasi Exp $
+#	$NetBSD: XIP,v 1.1.2.2 2010/10/30 05:02:28 uebayasi Exp $
 
 include arch/amd64/conf/GENERIC
 
 options 	XIP
 
+no pseudo-device md
 pseudo-device	xmd		1	# XIP memory disk device (ramdisk)
 options 	XMD_ROOT_SIZE=10240	# 5MB

Index: src/sys/arch/i386/conf/XIP
diff -u src/sys/arch/i386/conf/XIP:1.1.2.1 src/sys/arch/i386/conf/XIP:1.1.2.2
--- src/sys/arch/i386/conf/XIP:1.1.2.1	Fri Aug 20 07:04:38 2010
+++ src/sys/arch/i386/conf/XIP	Sat Oct 30 05:02:28 2010
@@ -1,9 +1,10 @@
-#	$NetBSD: XIP,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $
+#	$NetBSD: XIP,v 1.1.2.2 2010/10/30 05:02:28 uebayasi Exp $
 
 include arch/i386/conf/GENERIC
 
 file-system 	FFS		# UFS
 options 	XIP
 
+no pseudo-device md
 pseudo-device	xmd		1	# XIP memory disk device (ramdisk)
 options 	XMD_ROOT_SIZE=10240	# 5MB



CVS commit: [uebayasi-xip] src/sys/arch/powerpc/ibm4xx

2010-10-22 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Oct 22 07:37:49 UTC 2010

Removed Files:
src/sys/arch/powerpc/ibm4xx [uebayasi-xip]: pmap.c.work

Log Message:
Merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r0 src/sys/arch/powerpc/ibm4xx/pmap.c.work

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



CVS commit: [uebayasi-xip] src/sys/arch/arm

2010-08-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Aug 28 16:24:34 UTC 2010

Modified Files:
src/sys/arch/arm/conf [uebayasi-xip]: files.arm
Added Files:
src/sys/arch/arm/arm [uebayasi-xip]: xmd_machdep.c

Log Message:
xmd(4) glue for arm.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/arm/arm/xmd_machdep.c
cvs rdiff -u -r1.97.2.2 -r1.97.2.3 src/sys/arch/arm/conf/files.arm

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

Modified files:

Index: src/sys/arch/arm/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.97.2.2 src/sys/arch/arm/conf/files.arm:1.97.2.3
--- src/sys/arch/arm/conf/files.arm:1.97.2.2	Tue Aug 17 06:44:03 2010
+++ src/sys/arch/arm/conf/files.arm	Sat Aug 28 16:24:34 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.97.2.2 2010/08/17 06:44:03 uebayasi Exp $
+#	$NetBSD: files.arm,v 1.97.2.3 2010/08/28 16:24:34 uebayasi Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -183,3 +183,5 @@
 file	arch/arm/arm/linux_sigcode.S		compat_linux
 file	arch/arm/arm/linux_syscall.c		compat_linux
 file	arch/arm/arm/linux_trap.c		compat_linux
+
+file	arch/arm/arm/xmd_machdep.c		xmd

Added files:

Index: src/sys/arch/arm/arm/xmd_machdep.c
diff -u /dev/null src/sys/arch/arm/arm/xmd_machdep.c:1.1.2.1
--- /dev/null	Sat Aug 28 16:24:34 2010
+++ src/sys/arch/arm/arm/xmd_machdep.c	Sat Aug 28 16:24:33 2010
@@ -0,0 +1,68 @@
+/*	$NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/28 16:24:33 uebayasi Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/28 16:24:33 uebayasi Exp $);
+
+#include opt_xip.h
+
+#ifndef XIP
+#error xmd(4) needs options XIP
+#endif
+
+#include sys/param.h
+#include sys/mman.h
+
+#include uvm/uvm_page.h
+
+#include dev/xmdvar.h
+
+paddr_t
+xmd_machdep_mmap(vaddr_t addr, off_t off, int prot)
+{
+
+	return arm_btop(vtophys(addr + off));
+}
+
+void *
+xmd_machdep_physload(vaddr_t addr, size_t size)
+{
+	paddr_t start, end;
+
+	start = arm_btop(vtophys(addr));
+	end = arm_btop(vtophys(addr + size));
+
+	return uvm_page_physload_device(start, end, start, end, PROT_READ, 0);
+}
+
+void
+xmd_machdep_physunload(void *phys)
+{
+
+	uvm_page_physunload_device(phys);
+}



CVS commit: [uebayasi-xip] src/sys/arch/mips

2010-08-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Aug 28 18:24:07 UTC 2010

Modified Files:
src/sys/arch/mips/conf [uebayasi-xip]: files.mips
Added Files:
src/sys/arch/mips/mips [uebayasi-xip]: xmd_machdep.c

Log Message:
xmd(4) glue for mips.  Not tested.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.64.2.1 src/sys/arch/mips/conf/files.mips
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/mips/mips/xmd_machdep.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/arch/mips/conf/files.mips
diff -u src/sys/arch/mips/conf/files.mips:1.64 src/sys/arch/mips/conf/files.mips:1.64.2.1
--- src/sys/arch/mips/conf/files.mips:1.64	Mon Dec 14 00:46:04 2009
+++ src/sys/arch/mips/conf/files.mips	Sat Aug 28 18:24:07 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mips,v 1.64 2009/12/14 00:46:04 matt Exp $
+#	$NetBSD: files.mips,v 1.64.2.1 2010/08/28 18:24:07 uebayasi Exp $
 #
 
 defflag	opt_cputype.h		NOFPU
@@ -67,6 +67,8 @@
 
 file	arch/mips/mips/procfs_machdep.c		procfs
 
+file	arch/mips/mips/xmd_machdep.c		xmd
+
 # Binary compatibility with 32bit NetBSD (COMPAT_NETBSD32)
 file	arch/mips/mips/netbsd32_machdep.c	compat_netbsd32
 include compat/netbsd32/files.netbsd32

Added files:

Index: src/sys/arch/mips/mips/xmd_machdep.c
diff -u /dev/null src/sys/arch/mips/mips/xmd_machdep.c:1.1.2.1
--- /dev/null	Sat Aug 28 18:24:07 2010
+++ src/sys/arch/mips/mips/xmd_machdep.c	Sat Aug 28 18:24:07 2010
@@ -0,0 +1,68 @@
+/*	$NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/28 18:24:07 uebayasi Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/28 18:24:07 uebayasi Exp $);
+
+#include opt_xip.h
+
+#ifndef XIP
+#error xmd(4) needs options XIP
+#endif
+
+#include sys/param.h
+#include sys/mman.h
+
+#include uvm/uvm_page.h
+
+#include dev/xmdvar.h
+
+paddr_t
+xmd_machdep_mmap(vaddr_t addr, off_t off, int prot)
+{
+
+	return mips_btop(vtophys(addr + off));
+}
+
+void *
+xmd_machdep_physload(vaddr_t addr, size_t size)
+{
+	paddr_t start, end;
+
+	start = mips_btop(vtophys(addr));
+	end = mips_btop(vtophys(addr + size));
+
+	return uvm_page_physload_device(start, end, start, end, PROT_READ, 0);
+}
+
+void
+xmd_machdep_physunload(void *phys)
+{
+
+	uvm_page_physunload_device(phys);
+}



CVS commit: [uebayasi-xip] src/sys/arch/xen/conf

2010-08-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Aug 27 09:41:16 UTC 2010

Modified Files:
src/sys/arch/xen/conf [uebayasi-xip]: files.xen

Log Message:
Glue xmd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.106.2.1 -r1.106.2.2 src/sys/arch/xen/conf/files.xen

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

Modified files:

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.106.2.1 src/sys/arch/xen/conf/files.xen:1.106.2.2
--- src/sys/arch/xen/conf/files.xen:1.106.2.1	Tue Aug 17 06:45:35 2010
+++ src/sys/arch/xen/conf/files.xen	Fri Aug 27 09:41:16 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.106.2.1 2010/08/17 06:45:35 uebayasi Exp $
+#	$NetBSD: files.xen,v 1.106.2.2 2010/08/27 09:41:16 uebayasi Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -286,6 +286,8 @@
 attach ipmi at ipmibus
 file	arch/x86/x86/ipmi.c		ipmi needs-flag
 
+file	arch/x86/x86/xmd_machdep.c	xmd
+
 # CPUS
 
 device cpu



CVS commit: [uebayasi-xip] src/sys/arch/amd64/conf

2010-08-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Aug 27 09:41:52 UTC 2010

Modified Files:
src/sys/arch/amd64/conf [uebayasi-xip]: majors.amd64
Added Files:
src/sys/arch/amd64/conf [uebayasi-xip]: XIP

Log Message:
xmd(4) / XIP config for amd64.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/amd64/conf/XIP
cvs rdiff -u -r1.21 -r1.21.6.1 src/sys/arch/amd64/conf/majors.amd64

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

Modified files:

Index: src/sys/arch/amd64/conf/majors.amd64
diff -u src/sys/arch/amd64/conf/majors.amd64:1.21 src/sys/arch/amd64/conf/majors.amd64:1.21.6.1
--- src/sys/arch/amd64/conf/majors.amd64:1.21	Wed Nov 12 12:35:56 2008
+++ src/sys/arch/amd64/conf/majors.amd64	Fri Aug 27 09:41:52 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.amd64,v 1.21 2008/11/12 12:35:56 ad Exp $
+#	$NetBSD: majors.amd64,v 1.21.6.1 2010/08/27 09:41:52 uebayasi Exp $
 #
 # Device majors for amd64
 #
@@ -89,6 +89,7 @@
 device-major	dpt		char 96			dpt
 device-major	twe		char 97			twe
 device-major	nsmb		char 98			nsmb		
+device-major	xmd		char 99  block 21	xmd
 
 #
 # Device majors for Xen. These are assigned here so that:

Added files:

Index: src/sys/arch/amd64/conf/XIP
diff -u /dev/null src/sys/arch/amd64/conf/XIP:1.1.2.1
--- /dev/null	Fri Aug 27 09:41:52 2010
+++ src/sys/arch/amd64/conf/XIP	Fri Aug 27 09:41:51 2010
@@ -0,0 +1,8 @@
+#	$NetBSD: XIP,v 1.1.2.1 2010/08/27 09:41:51 uebayasi Exp $
+
+include arch/amd64/conf/GENERIC
+
+options 	XIP
+
+pseudo-device	xmd		1	# XIP memory disk device (ramdisk)
+options 	XMD_ROOT_SIZE=10240	# 5MB



CVS commit: [uebayasi-xip] src/sys/arch/xen/x86

2010-08-26 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Aug 26 09:43:45 UTC 2010

Modified Files:
src/sys/arch/xen/x86 [uebayasi-xip]: cpu.c

Log Message:
Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.40.2.2 -r1.40.2.3 src/sys/arch/xen/x86/cpu.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/arch/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.40.2.2 src/sys/arch/xen/x86/cpu.c:1.40.2.3
--- src/sys/arch/xen/x86/cpu.c:1.40.2.2	Tue Aug 17 06:45:35 2010
+++ src/sys/arch/xen/x86/cpu.c	Thu Aug 26 09:43:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.40.2.2 2010/08/17 06:45:35 uebayasi Exp $	*/
+/*	$NetBSD: cpu.c,v 1.40.2.3 2010/08/26 09:43:45 uebayasi Exp $	*/
 /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp  */
 
 /*-
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.40.2.2 2010/08/17 06:45:35 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.40.2.3 2010/08/26 09:43:45 uebayasi Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -87,6 +87,7 @@
 #include sys/reboot.h
 
 #include uvm/uvm_extern.h
+#include uvm/uvm_page.h
 
 #include machine/cpufunc.h
 #include machine/cpuvar.h



CVS commit: [uebayasi-xip] src/sys/arch/x86/x86

2010-08-25 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 25 13:36:09 UTC 2010

Modified Files:
src/sys/arch/x86/x86 [uebayasi-xip]: xmd_machdep.c

Log Message:
PA != VA here, use vtophys() to convert VA to PA.

(I hate x86.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/x86/x86/xmd_machdep.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/arch/x86/x86/xmd_machdep.c
diff -u src/sys/arch/x86/x86/xmd_machdep.c:1.1.2.1 src/sys/arch/x86/x86/xmd_machdep.c:1.1.2.2
--- src/sys/arch/x86/x86/xmd_machdep.c:1.1.2.1	Fri Aug 20 07:04:38 2010
+++ src/sys/arch/x86/x86/xmd_machdep.c	Wed Aug 25 13:36:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $	*/
+/*	$NetBSD: xmd_machdep.c,v 1.1.2.2 2010/08/25 13:36:09 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: xmd_machdep.c,v 1.1.2.2 2010/08/25 13:36:09 uebayasi Exp $);
 
 #include opt_xip.h
 
@@ -46,7 +46,7 @@
 xmd_machdep_mmap(vaddr_t addr, off_t off, int prot)
 {
 
-	return x86_btop(addr + off);
+	return x86_btop(vtophys(addr + off));
 }
 
 void *
@@ -54,8 +54,8 @@
 {
 	paddr_t start, end;
 
-	start = x86_btop(addr);
-	end = x86_btop(addr + size);
+	start = x86_btop(vtophys(addr));
+	end = x86_btop(vtophys(addr + size));
 
 	return uvm_page_physload_device(start, end, start, end, PROT_READ, 0);
 }



CVS commit: [uebayasi-xip] src/sys/arch/powerpc/powerpc

2010-08-25 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 25 14:32:54 UTC 2010

Modified Files:
src/sys/arch/powerpc/powerpc [uebayasi-xip]: xmd_machdep.c

Log Message:
RCS id.  Minor clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/powerpc/powerpc/xmd_machdep.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/arch/powerpc/powerpc/xmd_machdep.c
diff -u src/sys/arch/powerpc/powerpc/xmd_machdep.c:1.1.2.1 src/sys/arch/powerpc/powerpc/xmd_machdep.c:1.1.2.2
--- src/sys/arch/powerpc/powerpc/xmd_machdep.c:1.1.2.1	Thu Aug 19 12:36:58 2010
+++ src/sys/arch/powerpc/powerpc/xmd_machdep.c	Wed Aug 25 14:32:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/19 12:36:58 uebayasi Exp $	*/
+/*	$NetBSD: xmd_machdep.c,v 1.1.2.2 2010/08/25 14:32:54 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,8 +26,15 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: xmd_machdep.c,v 1.1.2.2 2010/08/25 14:32:54 uebayasi Exp $);
+
 #include opt_xip.h
 
+#ifndef XIP
+#error xmd(4) needs options XIP
+#endif
+
 #include sys/param.h
 #include sys/mman.h
 
@@ -49,16 +56,16 @@
 void *
 xmd_machdep_physload(vaddr_t addr, size_t size)
 {
-	paddr_t s, e, as, ae;
+	paddr_t start, end;
 
 	/* addr is in PA == VA RAM area. */
 	KASSERT(addr = 0x);
 	KASSERT(addr  0x8000);
 
-	s = as = (addr)  PAGE_SHIFT;
-	e = ae = (addr + size)  PAGE_SHIFT;
+	start = (addr)  PAGE_SHIFT;
+	end = (addr + size)  PAGE_SHIFT;
 
-	return uvm_page_physload_device(s, e, as, ae, PROT_READ, 0);
+	return uvm_page_physload_device(start, end, start, end, PROT_READ, 0);
 }
 
 void



CVS commit: [uebayasi-xip] src/sys/arch/powerpc/conf

2010-08-25 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 25 14:33:07 UTC 2010

Modified Files:
src/sys/arch/powerpc/conf [uebayasi-xip]: files.powerpc

Log Message:
Indent.


To generate a diff of this commit:
cvs rdiff -u -r1.71.4.3 -r1.71.4.4 src/sys/arch/powerpc/conf/files.powerpc

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

Modified files:

Index: src/sys/arch/powerpc/conf/files.powerpc
diff -u src/sys/arch/powerpc/conf/files.powerpc:1.71.4.3 src/sys/arch/powerpc/conf/files.powerpc:1.71.4.4
--- src/sys/arch/powerpc/conf/files.powerpc:1.71.4.3	Thu Aug 19 12:36:58 2010
+++ src/sys/arch/powerpc/conf/files.powerpc	Wed Aug 25 14:33:07 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.powerpc,v 1.71.4.3 2010/08/19 12:36:58 uebayasi Exp $
+#	$NetBSD: files.powerpc,v 1.71.4.4 2010/08/25 14:33:07 uebayasi Exp $
 
 defflag	opt_altivec.h	ALTIVEC K_ALTIVEC
 defflag	opt_openpic.h	OPENPIC OPENPIC_SERIAL_MODE
@@ -95,4 +95,4 @@
 file arch/powerpc/powerpc/linux_trap.c			compat_linux
 file arch/powerpc/powerpc/linux_syscall.c		compat_linux
 
-file arch/powerpc/powerpc/xmd_machdep.c			xmd
+file	arch/powerpc/powerpc/xmd_machdep.c		xmd



CVS commit: [uebayasi-xip] src/sys/arch

2010-08-20 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Aug 20 07:04:38 UTC 2010

Modified Files:
src/sys/arch/i386/conf [uebayasi-xip]: majors.i386
src/sys/arch/x86/conf [uebayasi-xip]: files.x86
Added Files:
src/sys/arch/i386/conf [uebayasi-xip]: XIP
src/sys/arch/x86/x86 [uebayasi-xip]: xmd_machdep.c

Log Message:
xmd(4) glue for i386.  XIP mount panics now.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/i386/conf/XIP
cvs rdiff -u -r1.37.6.1 -r1.37.6.2 src/sys/arch/i386/conf/majors.i386
cvs rdiff -u -r1.54.2.1 -r1.54.2.2 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/x86/x86/xmd_machdep.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/arch/i386/conf/majors.i386
diff -u src/sys/arch/i386/conf/majors.i386:1.37.6.1 src/sys/arch/i386/conf/majors.i386:1.37.6.2
--- src/sys/arch/i386/conf/majors.i386:1.37.6.1	Tue Aug 17 06:44:35 2010
+++ src/sys/arch/i386/conf/majors.i386	Fri Aug 20 07:04:38 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.i386,v 1.37.6.1 2010/08/17 06:44:35 uebayasi Exp $
+#	$NetBSD: majors.i386,v 1.37.6.2 2010/08/20 07:04:38 uebayasi Exp $
 #
 # Device majors for i386
 #
@@ -104,6 +104,7 @@
 device-major	rd		char 105 block 22	rd
 device-major	ct		char 106 block 23	ct
 device-major	mt		char 107 block 24	mt
+device-major	xmd		char 108 block 25	xmd
 
 #
 # Device majors for Xen. These are assigned here so that:

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.54.2.1 src/sys/arch/x86/conf/files.x86:1.54.2.2
--- src/sys/arch/x86/conf/files.x86:1.54.2.1	Tue Aug 17 06:45:30 2010
+++ src/sys/arch/x86/conf/files.x86	Fri Aug 20 07:04:37 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.54.2.1 2010/08/17 06:45:30 uebayasi Exp $
+#	$NetBSD: files.x86,v 1.54.2.2 2010/08/20 07:04:37 uebayasi Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -121,6 +121,8 @@
 
 file	arch/x86/x86/tprof_pmi.c	tprof	needs-flag
 
+file	arch/x86/x86/xmd_machdep.c	xmd
+
 file	arch/x86/pci/pci_machdep.c	pci
 file	arch/x86/pci/pci_intr_machdep.c	pci
 

Added files:

Index: src/sys/arch/i386/conf/XIP
diff -u /dev/null src/sys/arch/i386/conf/XIP:1.1.2.1
--- /dev/null	Fri Aug 20 07:04:38 2010
+++ src/sys/arch/i386/conf/XIP	Fri Aug 20 07:04:38 2010
@@ -0,0 +1,9 @@
+#	$NetBSD: XIP,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $
+
+include arch/i386/conf/GENERIC
+
+file-system 	FFS		# UFS
+options 	XIP
+
+pseudo-device	xmd		1	# XIP memory disk device (ramdisk)
+options 	XMD_ROOT_SIZE=10240	# 5MB

Index: src/sys/arch/x86/x86/xmd_machdep.c
diff -u /dev/null src/sys/arch/x86/x86/xmd_machdep.c:1.1.2.1
--- /dev/null	Fri Aug 20 07:04:38 2010
+++ src/sys/arch/x86/x86/xmd_machdep.c	Fri Aug 20 07:04:38 2010
@@ -0,0 +1,68 @@
+/*	$NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $);
+
+#include opt_xip.h
+
+#ifndef XIP
+#error xmd(4) needs options XIP
+#endif
+
+#include sys/param.h
+#include sys/mman.h
+
+#include uvm/uvm_page.h
+
+#include dev/xmdvar.h
+
+paddr_t
+xmd_machdep_mmap(vaddr_t addr, off_t off, int prot)
+{
+
+	return x86_btop(addr + off);
+}
+
+void *
+xmd_machdep_physload(vaddr_t addr, size_t size)
+{
+	paddr_t start, end;
+
+	start = x86_btop(addr);
+	end = x86_btop(addr + size);
+
+	return uvm_page_physload_device(start, end, start, 

CVS commit: [uebayasi-xip] src/sys/arch

2010-08-18 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Aug 19 01:02:22 UTC 2010

Modified Files:
src/sys/arch/evbppc/obs405 [uebayasi-xip]: obs266_autoconf.c
src/sys/arch/powerpc/conf [uebayasi-xip]: files.ibm4xx
src/sys/arch/powerpc/ibm4xx/dev [uebayasi-xip]: exb.c

Log Message:
Define FlashROM addresses in board specific code.


To generate a diff of this commit:
cvs rdiff -u -r1.4.76.1 -r1.4.76.2 \
src/sys/arch/evbppc/obs405/obs266_autoconf.c
cvs rdiff -u -r1.10.88.3 -r1.10.88.4 src/sys/arch/powerpc/conf/files.ibm4xx
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/powerpc/ibm4xx/dev/exb.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/arch/evbppc/obs405/obs266_autoconf.c
diff -u src/sys/arch/evbppc/obs405/obs266_autoconf.c:1.4.76.1 src/sys/arch/evbppc/obs405/obs266_autoconf.c:1.4.76.2
--- src/sys/arch/evbppc/obs405/obs266_autoconf.c:1.4.76.1	Fri Apr 30 14:39:18 2010
+++ src/sys/arch/evbppc/obs405/obs266_autoconf.c	Thu Aug 19 01:02:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: obs266_autoconf.c,v 1.4.76.1 2010/04/30 14:39:18 uebayasi Exp $	*/
+/*	$NetBSD: obs266_autoconf.c,v 1.4.76.2 2010/08/19 01:02:21 uebayasi Exp $	*/
 
 /*
  * Copyright 2004 Shigeyuki Fukushima.
@@ -33,15 +33,19 @@
  * DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: obs266_autoconf.c,v 1.4.76.1 2010/04/30 14:39:18 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: obs266_autoconf.c,v 1.4.76.2 2010/08/19 01:02:21 uebayasi Exp $);
+
+#include flash_exb.h
 
 #include sys/systm.h
 #include sys/device.h
+#include sys/bus.h
 
 #include machine/obs266.h
 
 #include powerpc/ibm4xx/cpu.h
 #include powerpc/ibm4xx/dcr4xx.h
+#include powerpc/ibm4xx/dev/exbvar.h
 
 #include dev/ic/comreg.h
 
@@ -78,3 +82,17 @@
 
 	obs405_device_register(dev, aux, OBS266_COM_FREQ);
 }
+
+#if NFLASH_EXB  0
+const struct exb_conf exb_confs[] = {
+	/* 0xff80-0xff81 */
+	{ flash, 0xff80 + 0x, 0x0001 },
+	/* 0xff81-0xfffc */
+	{ flash, 0xff80 + 0x0001, 0x007b },
+#if 0 /* XXX extent(9) */
+	/* 0xfffc-0x */
+	{ flash, 0xff80 + 0x007c, 0x0004 },
+#endif
+	{ NULL }
+};
+#endif

Index: src/sys/arch/powerpc/conf/files.ibm4xx
diff -u src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.3 src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.4
--- src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.3	Wed Aug 11 13:56:28 2010
+++ src/sys/arch/powerpc/conf/files.ibm4xx	Thu Aug 19 01:02:21 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ibm4xx,v 1.10.88.3 2010/08/11 13:56:28 uebayasi Exp $
+#	$NetBSD: files.ibm4xx,v 1.10.88.4 2010/08/19 01:02:21 uebayasi Exp $
 #
 # IBM 4xx specific configuration info
 
@@ -77,4 +77,4 @@
 
 # FlashROM on external bus
 attach	flash at exb with flash_exb
-file	arch/powerpc/ibm4xx/dev/flash_exb.c	flash_exb
+file	arch/powerpc/ibm4xx/dev/flash_exb.c	flash_exb	needs-flag

Index: src/sys/arch/powerpc/ibm4xx/dev/exb.c
diff -u src/sys/arch/powerpc/ibm4xx/dev/exb.c:1.1.2.1 src/sys/arch/powerpc/ibm4xx/dev/exb.c:1.1.2.2
--- src/sys/arch/powerpc/ibm4xx/dev/exb.c:1.1.2.1	Wed Aug 11 13:53:22 2010
+++ src/sys/arch/powerpc/ibm4xx/dev/exb.c	Thu Aug 19 01:02:21 2010
@@ -1,4 +1,4 @@
-/*	$Id: exb.c,v 1.1.2.1 2010/08/11 13:53:22 uebayasi Exp $	*/
+/*	$Id: exb.c,v 1.1.2.2 2010/08/19 01:02:21 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: exb.c,v 1.1.2.1 2010/08/11 13:53:22 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: exb.c,v 1.1.2.2 2010/08/19 01:02:21 uebayasi Exp $);
 
 #include locators.h
 
@@ -43,19 +43,11 @@
 #include powerpc/ibm4xx/dcr4xx.h
 #include powerpc/ibm4xx/dev/exbvar.h
 
-/* XXX board specific */
-static const struct exb_conf exb_confs[] = {
-	{ flash, 0xff80 + 0x, 0x0001 },	// 0xff80
-	{ flash, 0xff80 + 0x0001, 0x007b },	// 0xff81
-#if 0 /* XXX extent(9) */
-	{ flash, 0xff80 + 0x007c, 0x0004 },	// 0xfffc
-#endif
-	{ NULL }
-};
-
 struct exb_softc {
 };
 
+extern const struct exb_conf exb_confs[];
+
 static int exb_match(device_t, struct cfdata *, void *);
 static void exb_attach(device_t, struct device *, void *);
 static int exb_print(void *, const char *);



CVS commit: [uebayasi-xip] src/sys/arch

2010-08-13 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Aug 14 02:09:58 UTC 2010

Modified Files:
src/sys/arch/evbppc/obs405 [uebayasi-xip]: obs266_machdep.c
src/sys/arch/powerpc/ibm4xx [uebayasi-xip]: pmap.c
src/sys/arch/powerpc/include/ibm4xx [uebayasi-xip]: vmparam.h

Log Message:
Teach TLB miss handler (pmap_tlbmiss()) to map Expansion ROM area as
PA == VA.  Now we don't need to reserve a TLB entry for it.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.2 -r1.10.2.3 \
src/sys/arch/evbppc/obs405/obs266_machdep.c
cvs rdiff -u -r1.60.2.4 -r1.60.2.5 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 \
src/sys/arch/powerpc/include/ibm4xx/vmparam.h

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

Modified files:

Index: src/sys/arch/evbppc/obs405/obs266_machdep.c
diff -u src/sys/arch/evbppc/obs405/obs266_machdep.c:1.10.2.2 src/sys/arch/evbppc/obs405/obs266_machdep.c:1.10.2.3
--- src/sys/arch/evbppc/obs405/obs266_machdep.c:1.10.2.2	Wed Aug 11 14:02:45 2010
+++ src/sys/arch/evbppc/obs405/obs266_machdep.c	Sat Aug 14 02:09:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: obs266_machdep.c,v 1.10.2.2 2010/08/11 14:02:45 uebayasi Exp $	*/
+/*	$NetBSD: obs266_machdep.c,v 1.10.2.3 2010/08/14 02:09:57 uebayasi Exp $	*/
 /*	Original: md_machdep.c,v 1.3 2005/01/24 18:47:37 shige Exp $	*/
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: obs266_machdep.c,v 1.10.2.2 2010/08/11 14:02:45 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: obs266_machdep.c,v 1.10.2.3 2010/08/14 02:09:57 uebayasi Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_ddb.h
@@ -150,11 +150,6 @@
 	for (va = 0; va  endkernel; va += TLB_PG_SIZE)
 		ppc4xx_tlb_reserve(va, va, TLB_PG_SIZE, TLB_EX);
 
-#ifdef XIP
-	/* Map NOR FlashROM as managed. */
-	ppc4xx_tlb_reserve(0xff00, 0xff00, TLB_PG_SIZE, TLB_I);
-#endif
-
 	/* Map console after RAM (see pmap_tlbmiss()) */
 	ppc4xx_tlb_reserve(CONADDR, roundup(memsize, TLB_PG_SIZE), TLB_PG_SIZE,
 	TLB_I | TLB_G);

Index: src/sys/arch/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.4 src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.5
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.4	Wed Aug 11 13:46:28 2010
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Sat Aug 14 02:09:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.60.2.4 2010/08/11 13:46:28 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.60.2.5 2010/08/14 02:09:57 uebayasi Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.60.2.4 2010/08/11 13:46:28 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.60.2.5 2010/08/14 02:09:57 uebayasi Exp $);
 
 #include opt_xip.h
 
@@ -1517,7 +1517,8 @@
 	 * to not clobber 0 upto ${physmem} with device mappings in machdep
 	 * code.
 	 */
-	if (ctx != KERNEL_PID || va = VM_MIN_KERNEL_ADDRESS) {
+	if (ctx != KERNEL_PID ||
+	(va = VM_MIN_KERNEL_ADDRESS  va  VM_MAX_KERNEL_ADDRESS)) {
 		pte = pte_find((struct pmap *)__UNVOLATILE(ctxbusy[ctx]), va);
 		if (pte == NULL) {
 			/* Map unmanaged addresses directly for kernel access */

Index: src/sys/arch/powerpc/include/ibm4xx/vmparam.h
diff -u src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.6.2.2 src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.6.2.3
--- src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.6.2.2	Wed Aug 11 13:50:05 2010
+++ src/sys/arch/powerpc/include/ibm4xx/vmparam.h	Sat Aug 14 02:09:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.6.2.2 2010/08/11 13:50:05 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.6.2.3 2010/08/14 02:09:57 uebayasi Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -78,7 +78,7 @@
 #define	VM_MAXUSER_ADDRESS	((vaddr_t)0x-PAGE_SIZE)
 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t)0x8000)
-#define	VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xff00)
+#define	VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xef00)	/* before I/O periphs */
 #else
 /*
  * Would like to have MAX addresses = 0, but this doesn't (currently) work



CVS commit: [uebayasi-xip] src/sys/arch/powerpc

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 13:20:08 UTC 2010

Modified Files:
src/sys/arch/powerpc/conf [uebayasi-xip]: files.powerpc
src/sys/arch/powerpc/include [uebayasi-xip]: bus.h
src/sys/arch/powerpc/powerpc [uebayasi-xip]: bus_space.c

Log Message:
Support bus_space_physload(9) and friends.


To generate a diff of this commit:
cvs rdiff -u -r1.71.4.1 -r1.71.4.2 src/sys/arch/powerpc/conf/files.powerpc
cvs rdiff -u -r1.20 -r1.20.20.1 src/sys/arch/powerpc/include/bus.h
cvs rdiff -u -r1.20.20.1 -r1.20.20.2 src/sys/arch/powerpc/powerpc/bus_space.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/arch/powerpc/conf/files.powerpc
diff -u src/sys/arch/powerpc/conf/files.powerpc:1.71.4.1 src/sys/arch/powerpc/conf/files.powerpc:1.71.4.2
--- src/sys/arch/powerpc/conf/files.powerpc:1.71.4.1	Fri Apr 30 14:39:41 2010
+++ src/sys/arch/powerpc/conf/files.powerpc	Wed Aug 11 13:20:07 2010
@@ -1,9 +1,10 @@
-#	$NetBSD: files.powerpc,v 1.71.4.1 2010/04/30 14:39:41 uebayasi Exp $
+#	$NetBSD: files.powerpc,v 1.71.4.2 2010/08/11 13:20:07 uebayasi Exp $
 
 defflag	opt_altivec.h	ALTIVEC K_ALTIVEC
 defflag	opt_openpic.h	OPENPIC OPENPIC_SERIAL_MODE
 defparam opt_ppcparam.h	L2CR_CONFIG L3CR_CONFIG INTSTK CLOCKBASE
 defflag	opt_ppcarch.h	PPC_OEA PPC_OEA601 PPC_OEA64 PPC_OEA64_BRIDGE PPC_MPC8XX PPC_IBM4XX PPC_IBM403 PPC_BOOKE
+			__BUS_SPACE_HAS_PHYSLOAD_METHODS
 defflag opt_pmap.h	PMAPDEBUG PMAPCHECK PMAPCOUNTERS
 defparam opt_pmap.h	PTEGCOUNT PMAP_MEMLIMIT
 

Index: src/sys/arch/powerpc/include/bus.h
diff -u src/sys/arch/powerpc/include/bus.h:1.20 src/sys/arch/powerpc/include/bus.h:1.20.20.1
--- src/sys/arch/powerpc/include/bus.h:1.20	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/include/bus.h	Wed Aug 11 13:20:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.20 2008/04/28 20:23:32 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.20.20.1 2010/08/11 13:20:07 uebayasi Exp $	*/
 /*	$OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $	*/
 
 /*-
@@ -110,6 +110,8 @@
  */
 typedef uint32_t bus_addr_t;
 typedef uint32_t bus_size_t;
+#define	PRIxBUSADDR	PRIx32
+#define	PRIxBUSSIZE	PRIx32
 
 #ifndef __HAVE_LOCAL_BUS_SPACE
 typedef	uint32_t bus_space_handle_t;
@@ -211,6 +213,14 @@
 	const struct powerpc_bus_space_set *pbs_set;
 	const struct powerpc_bus_space_set *pbs_set_stream;
 	const struct powerpc_bus_space_copy *pbs_copy;
+
+#ifdef __BUS_SPACE_HAS_PHYSLOAD_METHODS
+	void *(*pbs_physload)(bus_space_tag_t, bus_addr_t, bus_size_t, int);
+	void (*pbs_physunload)(bus_space_tag_t, void *);
+	void *(*pbs_physload_device)(bus_space_tag_t, bus_addr_t, bus_size_t,
+	int, int);
+	void (*pbs_physunload_device)(bus_space_tag_t, void *);
+#endif
 };
 
 #define _BUS_SPACE_STRIDE(t, o) \
@@ -618,6 +628,46 @@
 
 #endif	/* !__HAVE_LOCAL_BUS_SPACE */
 
+#ifdef __BUS_SPACE_HAS_PHYSLOAD_METHODS
+/*
+ *	void *bus_space_physload (bus_space_tag_t t, bus_addr_t addr,
+ *	bus_size_t size, int freelist);
+ *
+ * Allocate general purpose managed memory segment for a given bus space.
+ */
+
+#define bus_space_physload(t, a, s, fl)	\
+((*(t)-pbs_physload)((t), (a), (s), (fl)))
+
+/*
+ *	void *bus_space_physunload (bus_space_tag_t t, void *phys);
+ *
+ * Free general purpose managed memory segment for a given bus space.
+ */
+
+#define bus_space_physunload(t, phys)	\
+((*(t)-pbs_physunload)((t), (phys)))
+
+/*
+ *	void *bus_space_physload_device (bus_space_tag_t t, bus_addr_t addr,
+ *	bus_size_t size, int freelist);
+ *
+ * Allocate managed device memory segment for a given bus space.
+ */
+
+#define bus_space_physload_device(t, a, s, prot, flags)			\
+((*(t)-pbs_physload_device)((t), (a), (s), (prot), (flags)))
+
+/*
+ *	void *bus_space_physunload_device (bus_space_tag_t t, void *phys);
+ *
+ * Allocate managed device memory segment for a given bus space.
+ */
+
+#define bus_space_physunload_device(t, phys)\
+((*(t)-pbs_physunload_device)((t), (phys)))
+#endif
+
 /*
  * Bus DMA methods.
  */

Index: src/sys/arch/powerpc/powerpc/bus_space.c
diff -u src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.1 src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.2
--- src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.1	Fri Apr 30 14:39:45 2010
+++ src/sys/arch/powerpc/powerpc/bus_space.c	Wed Aug 11 13:20:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.20.20.1 2010/04/30 14:39:45 uebayasi Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.20.20.2 2010/08/11 13:20:08 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.20.20.1 2010/04/30 14:39:45 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.20.20.2 2010/08/11 13:20:08 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -42,6 +42,7 @@
 #include sys/malloc.h
 
 #include uvm/uvm_extern.h
+#include uvm/uvm_prot.h

CVS commit: [uebayasi-xip] src/sys/arch/evbppc/compile

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 13:30:50 UTC 2010

Modified Files:
src/sys/arch/evbppc/compile [uebayasi-xip]: walnut-mkimg.sh

Log Message:
Support files other than kernel executables.

For filesystem images, embed (not prepend) OpenBIOS image headers to
the images, so that alignment is kept in the resulting files.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.98.1 src/sys/arch/evbppc/compile/walnut-mkimg.sh

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

Modified files:

Index: src/sys/arch/evbppc/compile/walnut-mkimg.sh
diff -u src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.3 src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.3.98.1
--- src/sys/arch/evbppc/compile/walnut-mkimg.sh:1.3	Sun Dec 11 12:17:11 2005
+++ src/sys/arch/evbppc/compile/walnut-mkimg.sh	Wed Aug 11 13:30:50 2010
@@ -1,36 +1,76 @@
 #!/bin/sh
-# $NetBSD: walnut-mkimg.sh,v 1.3 2005/12/11 12:17:11 christos Exp $
+# $NetBSD: walnut-mkimg.sh,v 1.3.98.1 2010/08/11 13:30:50 uebayasi Exp $
 
-# Convert a kernel to an tftp image loadable by the IBM PowerPC OpenBIOS.
+# Convert a input to an tftp image loadable by the IBM PowerPC OpenBIOS.
 
 magic=5394511	# IBM OpenBIOS magic number 0x0052504f
+start=0
+size=0
+overwrite=0
 
 if [ $# -ne 2 ] ; then
-	echo usage: $0 kernel image 12
+	echo usage: $0 input image 12
 	exit 1
 fi
 
-kernel=$1; shift
+input=$1; shift
 output=$1; shift
 
 : ${OBJDUMP=objdump}
 : ${OBJCOPY=objcopy}
 
-start=`${OBJDUMP} -f ${kernel} | awk '/start address/ { print $NF }'`
-start=`printf %d $start`
-${OBJCOPY} -O binary ${kernel} ${kernel}.bin.$$
-size=`/bin/ls -l ${kernel}.bin.$$ | awk '{ printf %d, ( $5 + 511 ) / 512 }'`
-
-printf %d\n%d\n%d\n0\n%d\n0\n0\n0\n $magic $start $size $start |
-awk '{
-		printf %c, int($0 / 256 / 256 / 256) % 256;
-		printf %c, int($0 / 256 / 256  ) % 256;
-		printf %c, int($0 / 256) % 256;
-		printf %c, int($0  ) % 256;
-	}
-'  ${output}
-
-cat ${kernel}.bin.$$  ${output}
+file=$( file $input )
+case $file in
+*:\ ELF\ *)
+	start=`${OBJDUMP} -f ${input} | awk '/start address/ { print $NF }'`
+	start=`printf %d $start`
+	${OBJCOPY} -O binary ${input} ${input}.bin.$$
+	;;
+*)
+	case $file in
+	*\ [Ff]ile\ [Ss]ystem*|*\ [Ff]ilesystem*)
+		overwrite=1
+		;;
+	esac
+	cp ${input} ${input}.bin.$$
+	;;
+esac
+
+size=`stat -f '%z' ${input}.bin.$$`
+size=$(( ( $size + 511 ) / 512 ))
+
+enc()
+{
+	local _x=$1; shift
+	printf $( printf '\\x%x' $_x )
+}
+
+be32enc()
+{
+	local _x=$1; shift
+	enc $(( ( $_x  24 )  0xff ))
+	enc $(( ( $_x  16 )  0xff ))
+	enc $(( ( $_x   8 )  0xff ))
+	enc $(( ( $_x   0 )  0xff ))
+}
+
+{
+	be32enc $magic
+	be32enc $start
+	be32enc $size
+	be32enc 0
+	be32enc $start
+	be32enc 0
+	be32enc 0
+	be32enc 0
+}  ${input}.hdr.$$
+
+if [ $overwrite = 0 ]; then
+	cat ${input}.hdr.$$ ${input}.bin.$$  ${output}
+else
+	cp ${input}.bin.$$ ${output}
+	dd if=${input}.hdr.$$ of=${output} conv=notrunc
+fi
 
-rm -f ${kernel}.bin.$$
+rm -f ${input}.hdr.$$ ${input}.bin.$$
 exit



CVS commit: [uebayasi-xip] src/sys/arch/powerpc/ibm4xx

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 13:46:28 UTC 2010

Modified Files:
src/sys/arch/powerpc/ibm4xx [uebayasi-xip]: pmap.c

Log Message:
Support XIP; look up device vm_physseg for managed pages.  Initialize
vm_physseg MD part.


To generate a diff of this commit:
cvs rdiff -u -r1.60.2.3 -r1.60.2.4 src/sys/arch/powerpc/ibm4xx/pmap.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/arch/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.3 src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.4
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.3	Fri Apr 30 14:39:42 2010
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Wed Aug 11 13:46:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.60.2.3 2010/04/30 14:39:42 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.60.2.4 2010/08/11 13:46:28 uebayasi Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.60.2.3 2010/04/30 14:39:42 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.60.2.4 2010/08/11 13:46:28 uebayasi Exp $);
+
+#include opt_xip.h
 
 #include sys/param.h
 #include sys/malloc.h
@@ -192,10 +194,15 @@
 {
 	int bank, pg;
 
+#ifdef XIP
+	bank = vm_physseg_find_device(atop(pa), pg);
+	if (bank != -1)
+		return VM_PHYSDEV_PTR(bank)-pmseg.pvent[pg];
+#endif
 	bank = vm_physseg_find(atop(pa), pg);
-	if (bank == -1)
-		return NULL;
-	return VM_PHYSMEM_PTR(bank)-pmseg.pvent[pg];
+	if (bank != -1)
+		return VM_PHYSMEM_PTR(bank)-pmseg.pvent[pg];
+	return NULL;
 }
 
 static inline char *
@@ -203,10 +210,15 @@
 {
 	int bank, pg;
 
+#ifdef XIP
+	bank = vm_physseg_find_device(atop(pa), pg);
+	if (bank != -1)
+		return VM_PHYSDEV_PTR(bank)-pmseg.attrs[pg];
+#endif
 	bank = vm_physseg_find(atop(pa), pg);
-	if (bank == -1)
-		return NULL;
-	return VM_PHYSMEM_PTR(bank)-pmseg.attrs[pg];
+	if (bank != -1)
+		return VM_PHYSMEM_PTR(bank)-pmseg.attrs[pg];
+	return NULL;
 }
 
 /*
@@ -487,6 +499,36 @@
 	IPL_VM);
 }
 
+void
+pmap_physseg_init(struct vm_physseg *seg)
+{
+	size_t npages;
+	vsize_t sz;
+	struct pv_entry *pv;
+	char *attr;
+
+	npages = seg-end - seg-start + 1;
+	sz = (vsize_t)((sizeof(struct pv_entry) + 1) * npages);
+	sz = round_page(sz);
+	pv = (void *)uvm_km_alloc(kernel_map, sz, 0, UVM_KMF_WIRED | UVM_KMF_ZERO);
+	attr = (void *)(pv + npages);
+
+	seg-pmseg.pvent = pv;
+	seg-pmseg.attrs = attr;
+}
+
+void
+pmap_physseg_fini(struct vm_physseg *seg)
+{
+	size_t npages;
+	vsize_t sz;
+
+	npages = seg-end - seg-start + 1;
+	sz = (vsize_t)((sizeof(struct pv_entry) + 1) * npages);
+	sz = round_page(sz);
+	uvm_km_free(kernel_map, (vaddr_t)seg-pmseg.pvent, sz, UVM_KMF_WIRED);
+}
+
 /*
  * How much virtual space is available to the kernel?
  */



CVS commit: [uebayasi-xip] src/sys/arch/powerpc/include/ibm4xx

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 13:50:05 UTC 2010

Modified Files:
src/sys/arch/powerpc/include/ibm4xx [uebayasi-xip]: vmparam.h

Log Message:
Hook pmap_physseg_{init,fini} on powerpc/ibm4xx.


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.1 -r1.6.2.2 \
src/sys/arch/powerpc/include/ibm4xx/vmparam.h

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

Modified files:

Index: src/sys/arch/powerpc/include/ibm4xx/vmparam.h
diff -u src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.6.2.1 src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.6.2.2
--- src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.6.2.1	Mon Apr 26 06:19:05 2010
+++ src/sys/arch/powerpc/include/ibm4xx/vmparam.h	Wed Aug 11 13:50:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.6.2.1 2010/04/26 06:19:05 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.6.2.2 2010/08/11 13:50:05 uebayasi Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -103,6 +103,7 @@
 #define	VM_PHYS_SIZE		(USRIOSIZE * PAGE_SIZE)
 
 #define	__HAVE_PMAP_PHYSSEG
+#define	__HAVE_PMAP_PHYSSEG_INIT
 
 struct pmap_physseg {
 	struct pv_entry *pvent;



CVS commit: [uebayasi-xip] src/sys/arch/powerpc

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 13:53:23 UTC 2010

Modified Files:
src/sys/arch/powerpc/conf [uebayasi-xip]: files.ibm4xx
src/sys/arch/powerpc/ibm4xx/dev [uebayasi-xip]: plb.c
src/sys/arch/powerpc/include/ibm4xx [uebayasi-xip]: dcr4xx.h
Added Files:
src/sys/arch/powerpc/ibm4xx/dev [uebayasi-xip]: exb.c exbvar.h

Log Message:
Implement 405GPr's External Bus as exb(4).


To generate a diff of this commit:
cvs rdiff -u -r1.10.88.1 -r1.10.88.2 src/sys/arch/powerpc/conf/files.ibm4xx
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/powerpc/ibm4xx/dev/exb.c \
src/sys/arch/powerpc/ibm4xx/dev/exbvar.h
cvs rdiff -u -r1.14.98.1 -r1.14.98.2 src/sys/arch/powerpc/ibm4xx/dev/plb.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h

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

Modified files:

Index: src/sys/arch/powerpc/conf/files.ibm4xx
diff -u src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.1 src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.2
--- src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.1	Fri Apr 30 14:39:41 2010
+++ src/sys/arch/powerpc/conf/files.ibm4xx	Wed Aug 11 13:53:22 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ibm4xx,v 1.10.88.1 2010/04/30 14:39:41 uebayasi Exp $
+#	$NetBSD: files.ibm4xx,v 1.10.88.2 2010/08/11 13:53:22 uebayasi Exp $
 #
 # IBM 4xx specific configuration info
 
@@ -69,3 +69,8 @@
 device	gpiic: i2cbus, i2c_bitbang
 attach	gpiic at opb
 file	arch/powerpc/ibm4xx/dev/gpiic_opb.c	gpiic
+
+# External bus
+device	exb {[addr = -1]}
+attach	exb at plb
+file	arch/powerpc/ibm4xx/dev/exb.c		exb

Index: src/sys/arch/powerpc/ibm4xx/dev/plb.c
diff -u src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.14.98.1 src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.14.98.2
--- src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.14.98.1	Fri Apr 30 14:39:42 2010
+++ src/sys/arch/powerpc/ibm4xx/dev/plb.c	Wed Aug 11 13:53:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: plb.c,v 1.14.98.1 2010/04/30 14:39:42 uebayasi Exp $ */
+/* $NetBSD: plb.c,v 1.14.98.2 2010/08/11 13:53:22 uebayasi Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: plb.c,v 1.14.98.1 2010/04/30 14:39:42 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: plb.c,v 1.14.98.2 2010/08/11 13:53:22 uebayasi Exp $);
 
 #include locators.h
 #include emac.h
@@ -100,6 +100,7 @@
 	{ IBM405GPR,	ecc, },
 	{ IBM405GPR,	opb, },
 	{ IBM405GPR,	pchb, },
+	{ IBM405GPR,	exb, },
 
 	/* AMCC 405EX / EXR */
 	{ AMCC405EX,	cpu, },

Index: src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h
diff -u src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.1.2.2 src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.1.2.3
--- src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.1.2.2	Fri Apr 30 14:39:43 2010
+++ src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h	Wed Aug 11 13:53:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcr4xx.h,v 1.1.2.2 2010/04/30 14:39:43 uebayasi Exp $	*/
+/*	$NetBSD: dcr4xx.h,v 1.1.2.3 2010/08/11 13:53:23 uebayasi Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -272,4 +272,43 @@
 #define SDRAM0_ECCESR_BKEN(n)	  (0x8000  (n))
 #define SDRAM0_ECCESR_CBEN(n)	  (0x0080  (n))
 
+/* Indirectly accessed External Bus Controller (EBC) DCRs */
+
+#define DCR_EBC0_B0CR		0x00
+#define DCR_EBC0_B1CR		0x01
+#define DCR_EBC0_B2CR		0x02
+#define DCR_EBC0_B3CR		0x03
+#define DCR_EBC0_B4CR		0x04
+#define DCR_EBC0_B5CR		0x05
+#define DCR_EBC0_B6CR		0x06
+#define DCR_EBC0_B7CR		0x07
+#define DCR_EBC0_B0AP		0x10
+#define DCR_EBC0_B1AP		0x11
+#define DCR_EBC0_B2AP		0x12
+#define DCR_EBC0_B3AP		0x13
+#define DCR_EBC0_B4AP		0x14
+#define DCR_EBC0_B5AP		0x15
+#define DCR_EBC0_B6AP		0x16
+#define DCR_EBC0_B7AP		0x17
+#define DCR_EBC0_BEAR		0x20
+#define DCR_EBC0_BESR0		0x21
+#define DCR_EBC0_BESR1		0x22
+#define DCR_EBC0_CFG		0x23
+
+/* Indirectly accessed Decompression Controller DCRs */
+
+#define DCR_DCP0_ITOR0		0x00
+#define DCR_DCP0_ITOR1		0x01
+#define DCR_DCP0_ITOR2		0x02
+#define DCR_DCP0_ITOR3		0x03
+#define DCR_DCP0_ADDR0		0x04
+#define DCR_DCP0_ADDR1		0x05
+#define DCR_DCP0_CFG		0x40
+#define DCR_DCP0_ID		0x41
+#define DCR_DCP0_VER		0x42
+#define DCR_DCP0_PLBBEAR	0x50
+#define DCR_DCP0_MEMBEAR	0x51
+#define DCR_DCP0_ESR		0x52
+#define DCR_DCP0_RAM0		0x400
+
 #endif /* _DCR405GP_H_ */

Added files:

Index: src/sys/arch/powerpc/ibm4xx/dev/exb.c
diff -u /dev/null src/sys/arch/powerpc/ibm4xx/dev/exb.c:1.1.2.1
--- /dev/null	Wed Aug 11 13:53:23 2010
+++ src/sys/arch/powerpc/ibm4xx/dev/exb.c	Wed Aug 11 13:53:22 2010
@@ -0,0 +1,146 @@
+/*	$Id: exb.c,v 1.1.2.1 2010/08/11 13:53:22 uebayasi Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Masao Uebayashi.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions

CVS commit: [uebayasi-xip] src/sys/arch

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 13:56:28 UTC 2010

Modified Files:
src/sys/arch/evbppc/conf [uebayasi-xip]: majors.evbppc
src/sys/arch/powerpc/conf [uebayasi-xip]: files.ibm4xx
Added Files:
src/sys/arch/powerpc/ibm4xx/dev [uebayasi-xip]: flash_exb.c

Log Message:
Implement flash(4) glue at exb(4).


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.6.1 src/sys/arch/evbppc/conf/majors.evbppc
cvs rdiff -u -r1.10.88.2 -r1.10.88.3 src/sys/arch/powerpc/conf/files.ibm4xx
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/powerpc/ibm4xx/dev/flash_exb.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/arch/evbppc/conf/majors.evbppc
diff -u src/sys/arch/evbppc/conf/majors.evbppc:1.28 src/sys/arch/evbppc/conf/majors.evbppc:1.28.6.1
--- src/sys/arch/evbppc/conf/majors.evbppc:1.28	Wed Nov 12 12:36:00 2008
+++ src/sys/arch/evbppc/conf/majors.evbppc	Wed Aug 11 13:56:27 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.evbppc,v 1.28 2008/11/12 12:36:00 ad Exp $
+#	$NetBSD: majors.evbppc,v 1.28.6.1 2010/08/11 13:56:27 uebayasi Exp $
 #
 # Device majors for evbppc
 # (When possible, make entries the same as macppc)
@@ -80,6 +80,7 @@
 
 device-major	nsmb		char 98			nsmb
 device-major 	xlcom 		char 99 		xlcom
+device-major 	flash 		char 100  block 15 	flash
 
 # Majors up to 143 are reserved for machine-dependant drivers.
 # New machine-independent driver majors are assigned in 

Index: src/sys/arch/powerpc/conf/files.ibm4xx
diff -u src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.2 src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.3
--- src/sys/arch/powerpc/conf/files.ibm4xx:1.10.88.2	Wed Aug 11 13:53:22 2010
+++ src/sys/arch/powerpc/conf/files.ibm4xx	Wed Aug 11 13:56:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ibm4xx,v 1.10.88.2 2010/08/11 13:53:22 uebayasi Exp $
+#	$NetBSD: files.ibm4xx,v 1.10.88.3 2010/08/11 13:56:28 uebayasi Exp $
 #
 # IBM 4xx specific configuration info
 
@@ -74,3 +74,7 @@
 device	exb {[addr = -1]}
 attach	exb at plb
 file	arch/powerpc/ibm4xx/dev/exb.c		exb
+
+# FlashROM on external bus
+attach	flash at exb with flash_exb
+file	arch/powerpc/ibm4xx/dev/flash_exb.c	flash_exb

Added files:

Index: src/sys/arch/powerpc/ibm4xx/dev/flash_exb.c
diff -u /dev/null src/sys/arch/powerpc/ibm4xx/dev/flash_exb.c:1.1.2.1
--- /dev/null	Wed Aug 11 13:56:28 2010
+++ src/sys/arch/powerpc/ibm4xx/dev/flash_exb.c	Wed Aug 11 13:56:28 2010
@@ -0,0 +1,69 @@
+/*	$Id: flash_exb.c,v 1.1.2.1 2010/08/11 13:56:28 uebayasi Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software developed for The NetBSD Foundation
+ * by Masao Uebayashi.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/param.h
+#include sys/conf.h
+#include sys/device.h
+#include sys/bus.h
+
+#include dev/flashvar.h
+
+#include powerpc/ibm4xx/dev/exbvar.h
+
+static int flash_match(device_t, struct cfdata *, void *);
+static void flash_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(flash_exb, sizeof(struct flash_softc),
+flash_match, flash_attach, NULL, NULL);
+
+static int
+flash_match(device_t parent, struct cfdata *cf, void *aux)
+{
+	struct exb_conf *ec = aux;
+
+	if (strcmp(ec-ec_name, flash) == 0)
+		return 1;
+
+	return 0;
+}
+
+static void
+flash_attach(device_t parent, device_t self, void *aux)
+{
+	struct flash_softc *sc = device_private(self);
+	struct exb_conf *ec = aux;
+
+	sc-sc_addr = ec-ec_addr;
+	sc-sc_size = ec-ec_size;
+	sc-sc_iot = ec-ec_bust;
+
+	flash_init(sc);
+}



CVS commit: [uebayasi-xip] src/sys/arch/evbppc/obs405

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 14:02:45 UTC 2010

Modified Files:
src/sys/arch/evbppc/obs405 [uebayasi-xip]: obs266_machdep.c

Log Message:
Map the NOR FlashROM region into kernel using a reserved TLB.  This is
touched to synchronize I-cache an executable page by pmap_enter().


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 \
src/sys/arch/evbppc/obs405/obs266_machdep.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/arch/evbppc/obs405/obs266_machdep.c
diff -u src/sys/arch/evbppc/obs405/obs266_machdep.c:1.10.2.1 src/sys/arch/evbppc/obs405/obs266_machdep.c:1.10.2.2
--- src/sys/arch/evbppc/obs405/obs266_machdep.c:1.10.2.1	Fri Apr 30 14:39:18 2010
+++ src/sys/arch/evbppc/obs405/obs266_machdep.c	Wed Aug 11 14:02:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: obs266_machdep.c,v 1.10.2.1 2010/04/30 14:39:18 uebayasi Exp $	*/
+/*	$NetBSD: obs266_machdep.c,v 1.10.2.2 2010/08/11 14:02:45 uebayasi Exp $	*/
 /*	Original: md_machdep.c,v 1.3 2005/01/24 18:47:37 shige Exp $	*/
 
 /*
@@ -68,12 +68,13 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: obs266_machdep.c,v 1.10.2.1 2010/04/30 14:39:18 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: obs266_machdep.c,v 1.10.2.2 2010/08/11 14:02:45 uebayasi Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_ddb.h
 #include opt_ipkdb.h
 #include opt_modular.h
+#include opt_xip.h
 
 #include sys/param.h
 #include sys/kernel.h
@@ -149,6 +150,11 @@
 	for (va = 0; va  endkernel; va += TLB_PG_SIZE)
 		ppc4xx_tlb_reserve(va, va, TLB_PG_SIZE, TLB_EX);
 
+#ifdef XIP
+	/* Map NOR FlashROM as managed. */
+	ppc4xx_tlb_reserve(0xff00, 0xff00, TLB_PG_SIZE, TLB_I);
+#endif
+
 	/* Map console after RAM (see pmap_tlbmiss()) */
 	ppc4xx_tlb_reserve(CONADDR, roundup(memsize, TLB_PG_SIZE), TLB_PG_SIZE,
 	TLB_I | TLB_G);



CVS commit: [uebayasi-xip] src/sys/arch/evbppc/conf

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 14:03:10 UTC 2010

Added Files:
src/sys/arch/evbppc/conf [uebayasi-xip]: OPENBLOCKS266_XIP

Log Message:
XIP test kernel.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP

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

Added files:

Index: src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP
diff -u /dev/null src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP:1.1.2.1
--- /dev/null	Wed Aug 11 14:03:10 2010
+++ src/sys/arch/evbppc/conf/OPENBLOCKS266_XIP	Wed Aug 11 14:03:10 2010
@@ -0,0 +1,13 @@
+#	$NetBSD: OPENBLOCKS266_XIP,v 1.1.2.1 2010/08/11 14:03:10 uebayasi Exp $
+#
+
+include		arch/evbppc/conf/OPENBLOCKS266
+#	$NetBSD: OPENBLOCKS266_XIP,v 1.1.2.1 2010/08/11 14:03:10 uebayasi Exp $
+
+exb0	at plb?
+
+# FlashROM
+flash*	at exb?
+
+options 	__BUS_SPACE_HAS_PHYSLOAD_METHODS
+options 	XIP



CVS commit: [uebayasi-xip] src/sys/arch/evbppc/conf

2010-08-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 11 14:03:58 UTC 2010

Modified Files:
src/sys/arch/evbppc/conf [uebayasi-xip]: OPENBLOCKS266

Log Message:
Build net-bootable kernel (emac0) for test.


To generate a diff of this commit:
cvs rdiff -u -r1.46.2.1 -r1.46.2.2 src/sys/arch/evbppc/conf/OPENBLOCKS266

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

Modified files:

Index: src/sys/arch/evbppc/conf/OPENBLOCKS266
diff -u src/sys/arch/evbppc/conf/OPENBLOCKS266:1.46.2.1 src/sys/arch/evbppc/conf/OPENBLOCKS266:1.46.2.2
--- src/sys/arch/evbppc/conf/OPENBLOCKS266:1.46.2.1	Fri Apr 30 14:39:17 2010
+++ src/sys/arch/evbppc/conf/OPENBLOCKS266	Wed Aug 11 14:03:58 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: OPENBLOCKS266,v 1.46.2.1 2010/04/30 14:39:17 uebayasi Exp $
+#	$NetBSD: OPENBLOCKS266,v 1.46.2.2 2010/08/11 14:03:58 uebayasi Exp $
 #
 #	GENERIC -- everything that's currently supported
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		OPENBLOCKS266-$Revision: 1.46.2.1 $
+#ident 		OPENBLOCKS266-$Revision: 1.46.2.2 $
 
 maxusers	32
 
@@ -140,6 +140,7 @@
 #
 
 config		netbsd	root on ? type ?
+config		netbsd-emac0	root on emac0 type ?
 
 
 #



CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-07-08 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Jul  8 07:46:00 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: bus_dma.c

Log Message:
Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.18.1 src/sys/arch/arm/arm32/bus_dma.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/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.52 src/sys/arch/arm/arm32/bus_dma.c:1.52.18.1
--- src/sys/arch/arm/arm32/bus_dma.c:1.52	Wed Jun  4 12:41:40 2008
+++ src/sys/arch/arm/arm32/bus_dma.c	Thu Jul  8 07:45:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.52 2008/06/04 12:41:40 ad Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.52.18.1 2010/07/08 07:45:59 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.52 2008/06/04 12:41:40 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.52.18.1 2010/07/08 07:45:59 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -48,7 +48,7 @@
 #include sys/vnode.h
 #include sys/device.h
 
-#include uvm/uvm_extern.h
+#include uvm/uvm.h
 
 #include machine/bus.h
 #include machine/cpu.h



CVS commit: [uebayasi-xip] src/sys/arch/hppa/hppa

2010-05-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri May 28 08:32:20 UTC 2010

Modified Files:
src/sys/arch/hppa/hppa [uebayasi-xip]: pmap.c

Log Message:
Fix a typo; pointed out by Chuck Silvers.


To generate a diff of this commit:
cvs rdiff -u -r1.63.2.3 -r1.63.2.4 src/sys/arch/hppa/hppa/pmap.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/arch/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.63.2.3 src/sys/arch/hppa/hppa/pmap.c:1.63.2.4
--- src/sys/arch/hppa/hppa/pmap.c:1.63.2.3	Fri Apr 30 14:39:27 2010
+++ src/sys/arch/hppa/hppa/pmap.c	Fri May 28 08:32:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.63.2.3 2010/04/30 14:39:27 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.63.2.4 2010/05/28 08:32:20 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.63.2.3 2010/04/30 14:39:27 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.63.2.4 2010/05/28 08:32:20 uebayasi Exp $);
 
 #include opt_device_page.h
 #include opt_xip.h
@@ -1118,7 +1118,7 @@
 continue;
 
 			sheep = PHYS_TO_VM_PAGE(PTE_PAGE(*pde));
-			struct vm_page_md * const md = VM_PAGE_TO_MD(sheap);
+			struct vm_page_md * const md = VM_PAGE_TO_MD(sheep);
 			for (haggis = md-pvh_list; haggis != NULL; )
 if (haggis-pv_pmap == pmap) {
 



CVS commit: [uebayasi-xip] src/sys/arch/acorn26/acorn26

2010-05-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri May 28 15:40:05 UTC 2010

Modified Files:
src/sys/arch/acorn26/acorn26 [uebayasi-xip]: pmap.c

Log Message:
pmap_enter:
This pmap treats all pmap_enter()'ed entries as managed, and always
allocate PV entries.  Put back the original behavior.  There is no need
to check the new PMAP_UNMANAGED flag.


To generate a diff of this commit:
cvs rdiff -u -r1.30.2.2 -r1.30.2.3 src/sys/arch/acorn26/acorn26/pmap.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/arch/acorn26/acorn26/pmap.c
diff -u src/sys/arch/acorn26/acorn26/pmap.c:1.30.2.2 src/sys/arch/acorn26/acorn26/pmap.c:1.30.2.3
--- src/sys/arch/acorn26/acorn26/pmap.c:1.30.2.2	Wed Apr 28 08:31:05 2010
+++ src/sys/arch/acorn26/acorn26/pmap.c	Fri May 28 15:40:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.30.2.2 2010/04/28 08:31:05 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.30.2.3 2010/05/28 15:40:05 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.2.2 2010/04/28 08:31:05 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.30.2.3 2010/05/28 15:40:05 uebayasi Exp $);
 
 #include sys/kernel.h /* for cold */
 #include sys/malloc.h
@@ -634,8 +634,7 @@
 	UVMHIST_FUNC(pmap_enter);
 
 	UVMHIST_CALLED(pmaphist);
-	return pmap_enter1(pmap, va, pa, prot, flags,
-	(flags  PMAP_UNMANAGED) != 0);
+	return pmap_enter1(pmap, va, pa, prot, flags, 1);
 }
 
 static int



CVS commit: [uebayasi-xip] src/sys/arch

2010-05-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu May 27 14:47:31 UTC 2010

Modified Files:
src/sys/arch/alpha/alpha [uebayasi-xip]: machdep.c
src/sys/arch/atari/atari [uebayasi-xip]: bus.c
src/sys/arch/landisk/landisk [uebayasi-xip]: bus_dma.c
src/sys/arch/mips/mips [uebayasi-xip]: mips_machdep.c
src/sys/arch/powerpc/oea [uebayasi-xip]: cpu_subr.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: bus_dma.c pmap_subr.c
src/sys/arch/sh3/sh3 [uebayasi-xip]: mem.c sh3_machdep.c
src/sys/arch/sparc/sparc [uebayasi-xip]: db_interface.c
src/sys/arch/sparc64/dev [uebayasi-xip]: iommu.c
src/sys/arch/sparc64/sparc64 [uebayasi-xip]: cpu.c db_interface.c
src/sys/arch/vax/include [uebayasi-xip]: db_machdep.h pmap.h
src/sys/arch/vax/vax [uebayasi-xip]: pmap.c

Log Message:
Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.325.2.2 -r1.325.2.3 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.51.2.1 -r1.51.2.2 src/sys/arch/atari/atari/bus.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/sys/arch/landisk/landisk/bus_dma.c
cvs rdiff -u -r1.225.2.2 -r1.225.2.3 src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.54.2.1 -r1.54.2.2 src/sys/arch/powerpc/oea/cpu_subr.c
cvs rdiff -u -r1.35.2.1 -r1.35.2.2 src/sys/arch/powerpc/powerpc/bus_dma.c
cvs rdiff -u -r1.22.2.1 -r1.22.2.2 src/sys/arch/powerpc/powerpc/pmap_subr.c
cvs rdiff -u -r1.26.64.1 -r1.26.64.2 src/sys/arch/sh3/sh3/mem.c
cvs rdiff -u -r1.85.2.1 -r1.85.2.2 src/sys/arch/sh3/sh3/sh3_machdep.c
cvs rdiff -u -r1.86 -r1.86.2.1 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r1.96.2.1 -r1.96.2.2 src/sys/arch/sparc64/dev/iommu.c
cvs rdiff -u -r1.88.2.1 -r1.88.2.2 src/sys/arch/sparc64/sparc64/cpu.c
cvs rdiff -u -r1.121.2.1 -r1.121.2.2 \
src/sys/arch/sparc64/sparc64/db_interface.c
cvs rdiff -u -r1.16 -r1.16.14.1 src/sys/arch/vax/include/db_machdep.h
cvs rdiff -u -r1.77 -r1.77.2.1 src/sys/arch/vax/include/pmap.h
cvs rdiff -u -r1.175.2.1 -r1.175.2.2 src/sys/arch/vax/vax/pmap.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/arch/alpha/alpha/machdep.c
diff -u src/sys/arch/alpha/alpha/machdep.c:1.325.2.2 src/sys/arch/alpha/alpha/machdep.c:1.325.2.3
--- src/sys/arch/alpha/alpha/machdep.c:1.325.2.2	Fri Apr 30 14:39:02 2010
+++ src/sys/arch/alpha/alpha/machdep.c	Thu May 27 14:47:28 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.325.2.2 2010/04/30 14:39:02 uebayasi Exp $ */
+/* $NetBSD: machdep.c,v 1.325.2.3 2010/05/27 14:47:28 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.325.2.2 2010/04/30 14:39:02 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.325.2.3 2010/05/27 14:47:28 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -105,7 +105,7 @@
 #include sys/mount.h
 #include sys/syscallargs.h
 
-#include uvm/uvm_extern.h
+#include uvm/uvm.h
 #include sys/sysctl.h
 
 #include dev/cons.h

Index: src/sys/arch/atari/atari/bus.c
diff -u src/sys/arch/atari/atari/bus.c:1.51.2.1 src/sys/arch/atari/atari/bus.c:1.51.2.2
--- src/sys/arch/atari/atari/bus.c:1.51.2.1	Fri Apr 30 14:39:09 2010
+++ src/sys/arch/atari/atari/bus.c	Thu May 27 14:47:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.51.2.1 2010/04/30 14:39:09 uebayasi Exp $	*/
+/*	$NetBSD: bus.c,v 1.51.2.2 2010/05/27 14:47:29 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.51.2.1 2010/04/30 14:39:09 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.51.2.2 2010/05/27 14:47:29 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -40,7 +40,7 @@
 #include sys/mbuf.h
 #include sys/proc.h
 
-#include uvm/uvm_extern.h
+#include uvm/uvm.h
 
 #include machine/cpu.h
 #include m68k/cacheops.h

Index: src/sys/arch/landisk/landisk/bus_dma.c
diff -u src/sys/arch/landisk/landisk/bus_dma.c:1.8.2.1 src/sys/arch/landisk/landisk/bus_dma.c:1.8.2.2
--- src/sys/arch/landisk/landisk/bus_dma.c:1.8.2.1	Fri Apr 30 14:39:32 2010
+++ src/sys/arch/landisk/landisk/bus_dma.c	Thu May 27 14:47:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.8.2.1 2010/04/30 14:39:32 uebayasi Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.8.2.2 2010/05/27 14:47:29 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2005 NONAKA Kimihiro
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.8.2.1 2010/04/30 14:39:32 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.8.2.2 2010/05/27 14:47:29 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -35,7 +35,7 @@
 #include sys/malloc.h
 #include sys/mbuf.h
 
-#include uvm/uvm_extern.h
+#include uvm/uvm.h
 
 #include sh3/cache.h
 

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u 

CVS commit: [uebayasi-xip] src/sys/arch/powerpc/include/booke

2010-05-26 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu May 27 04:44:09 UTC 2010

Modified Files:
src/sys/arch/powerpc/include/booke [uebayasi-xip]: vmparam.h

Log Message:
VM_PHYSSEG_NOADD is no more.


To generate a diff of this commit:
cvs rdiff -u -r1.1.6.2 -r1.1.6.3 src/sys/arch/powerpc/include/booke/vmparam.h

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

Modified files:

Index: src/sys/arch/powerpc/include/booke/vmparam.h
diff -u src/sys/arch/powerpc/include/booke/vmparam.h:1.1.6.2 src/sys/arch/powerpc/include/booke/vmparam.h:1.1.6.3
--- src/sys/arch/powerpc/include/booke/vmparam.h:1.1.6.2	Fri Apr 30 14:39:43 2010
+++ src/sys/arch/powerpc/include/booke/vmparam.h	Thu May 27 04:44:08 2010
@@ -109,7 +109,6 @@
 #define	VM_PHYSSEG_MAX		16
 #endif
 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_BIGFIRST
-#define	VM_PHYSSEG_NOADD
 
 #ifndef VM_PHYS_SIZE
 #define	VM_PHYS_SIZE		(USRIOSIZE * PAGE_SIZE)



CVS commit: [uebayasi-xip] src/sys/arch/arm/imx

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 03:16:18 UTC 2010

Modified Files:
src/sys/arch/arm/imx [uebayasi-xip]: imx31_space.c

Log Message:
Adapt to the new uvm_page_physload_device(9).


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 src/sys/arch/arm/imx/imx31_space.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/arch/arm/imx/imx31_space.c
diff -u src/sys/arch/arm/imx/imx31_space.c:1.3.2.1 src/sys/arch/arm/imx/imx31_space.c:1.3.2.2
--- src/sys/arch/arm/imx/imx31_space.c:1.3.2.1	Wed Apr 28 14:56:14 2010
+++ src/sys/arch/arm/imx/imx31_space.c	Thu Apr 29 03:16:18 2010
@@ -1,7 +1,7 @@
-/* $Id: imx31_space.c,v 1.3.2.1 2010/04/28 14:56:14 uebayasi Exp $ */
+/* $Id: imx31_space.c,v 1.3.2.2 2010/04/29 03:16:18 uebayasi Exp $ */
 
 /* derived from: */
-/*	$NetBSD: imx31_space.c,v 1.3.2.1 2010/04/28 14:56:14 uebayasi Exp $ */
+/*	$NetBSD: imx31_space.c,v 1.3.2.2 2010/04/29 03:16:18 uebayasi Exp $ */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -287,6 +287,7 @@
 void *
 imx31_bs_physload(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
 {
+	/* XXX */
 	const paddr_t start = imx31_bs_mmap(t, addr, 0, prot, flags);
 	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, prot, flags);
 
@@ -303,10 +304,11 @@
 void *
 imx31_bs_physload_device(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
 {
+	/* XXX */
 	const paddr_t start = imx31_bs_mmap(t, addr, 0, prot, flags);
 	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, prot, flags);
 
-	return uvm_page_physload_device(start, end, start, end, 0/* XXX freelist */);
+	return uvm_page_physload_device(start, end, start, end, prot, flags);
 }
 
 void



CVS commit: [uebayasi-xip] src/sys/arch

2010-04-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Apr 27 07:19:29 UTC 2010

Modified Files:
src/sys/arch/acorn26/acorn26 [uebayasi-xip]: pmap.c
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c
src/sys/arch/hppa/hppa [uebayasi-xip]: pmap.c
src/sys/arch/m68k/m68k [uebayasi-xip]: pmap_motorola.c
src/sys/arch/mips/mips [uebayasi-xip]: pmap.c
src/sys/arch/powerpc/ibm4xx [uebayasi-xip]: pmap.c
src/sys/arch/sh3/sh3 [uebayasi-xip]: pmap.c
src/sys/arch/sparc64/sparc64 [uebayasi-xip]: pmap.c
src/sys/arch/x86/x86 [uebayasi-xip]: pmap.c

Log Message:
Support PMAP_UNMANAGED in some pmaps.

(Others should be converted eventually, but no problem while managed
device page is enabled.)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.2.1 src/sys/arch/acorn26/acorn26/pmap.c
cvs rdiff -u -r1.211.2.9 -r1.211.2.10 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.63.2.1 -r1.63.2.2 src/sys/arch/hppa/hppa/pmap.c
cvs rdiff -u -r1.55 -r1.55.2.1 src/sys/arch/m68k/m68k/pmap_motorola.c
cvs rdiff -u -r1.188.2.1 -r1.188.2.2 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.60 -r1.60.2.1 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.74.2.1 -r1.74.2.2 src/sys/arch/sh3/sh3/pmap.c
cvs rdiff -u -r1.250.2.1 -r1.250.2.2 src/sys/arch/sparc64/sparc64/pmap.c
cvs rdiff -u -r1.100.2.1 -r1.100.2.2 src/sys/arch/x86/x86/pmap.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/arch/acorn26/acorn26/pmap.c
diff -u src/sys/arch/acorn26/acorn26/pmap.c:1.30 src/sys/arch/acorn26/acorn26/pmap.c:1.30.2.1
--- src/sys/arch/acorn26/acorn26/pmap.c:1.30	Sat Nov  7 07:27:40 2009
+++ src/sys/arch/acorn26/acorn26/pmap.c	Tue Apr 27 07:19:27 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.30 2009/11/07 07:27:40 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.30.2.1 2010/04/27 07:19:27 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.30.2.1 2010/04/27 07:19:27 uebayasi Exp $);
 
 #include sys/kernel.h /* for cold */
 #include sys/malloc.h
@@ -634,7 +634,8 @@
 	UVMHIST_FUNC(pmap_enter);
 
 	UVMHIST_CALLED(pmaphist);
-	return pmap_enter1(pmap, va, pa, prot, flags, 0);
+	return pmap_enter1(pmap, va, pa, prot, flags,
+	(flags  PMAP_UNMANAGED) != 0);
 }
 
 static int

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.9 src/sys/arch/arm/arm32/pmap.c:1.211.2.10
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.9	Thu Feb 25 03:30:22 2010
+++ src/sys/arch/arm/arm32/pmap.c	Tue Apr 27 07:19:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.9 2010/02/25 03:30:22 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.10 2010/04/27 07:19:28 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -213,7 +213,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.9 2010/02/25 03:30:22 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.10 2010/04/27 07:19:28 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -2781,7 +2781,8 @@
 	 * Get a pointer to the page.  Later on in this function, we
 	 * test for a managed page by checking pg != NULL.
 	 */
-	pg = pmap_initialized ? PHYS_TO_VM_PAGE(pa) : NULL;
+	pg = (pmap_initialized  ((flags  PMAP_UNMANAGED) == 0)) ?
+	PHYS_TO_VM_PAGE(pa) : NULL;
 
 	nflags = 0;
 	if (prot  VM_PROT_WRITE)

Index: src/sys/arch/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.63.2.1 src/sys/arch/hppa/hppa/pmap.c:1.63.2.2
--- src/sys/arch/hppa/hppa/pmap.c:1.63.2.1	Thu Feb 25 04:11:29 2010
+++ src/sys/arch/hppa/hppa/pmap.c	Tue Apr 27 07:19:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.63.2.1 2010/02/25 04:11:29 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.63.2.2 2010/04/27 07:19:28 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.63.2.1 2010/02/25 04:11:29 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.63.2.2 2010/04/27 07:19:28 uebayasi Exp $);
 
 #include opt_device_page.h
 #include opt_xip.h
@@ -1306,7 +1306,8 @@
 			ptp-wire_count++;
 	}
 
-	if (pmap_initialized  (pg = PHYS_TO_VM_PAGE(pa))) {
+	if (pmap_initialized  ((flags  PMAP_UNMANAGED) == 0) 
+	(pg = PHYS_TO_VM_PAGE(pa))) {
 		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 		mutex_enter(md-pvh_lock);
 

Index: src/sys/arch/m68k/m68k/pmap_motorola.c
diff -u src/sys/arch/m68k/m68k/pmap_motorola.c:1.55 src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.1
--- src/sys/arch/m68k/m68k/pmap_motorola.c:1.55	Fri Dec 11 18:28:35 2009
+++ src/sys/arch/m68k/m68k/pmap_motorola.c	Tue Apr 27 07:19:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.c,v 1.55 2009/12/11 18:28:35 tsutsui Exp $*/
+/*	

CVS commit: [uebayasi-xip] src/sys/arch/x86/x86

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 02:57:18 UTC 2010

Modified Files:
src/sys/arch/x86/x86 [uebayasi-xip]: pmap.c

Log Message:
pg-mdpage - VM_PAGE_TO_MD(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.100.2.1 src/sys/arch/x86/x86/pmap.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/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.100 src/sys/arch/x86/x86/pmap.c:1.100.2.1
--- src/sys/arch/x86/x86/pmap.c:1.100	Sun Jan 31 00:43:37 2010
+++ src/sys/arch/x86/x86/pmap.c	Thu Feb 25 02:57:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.100 2010/01/31 00:43:37 hubertf Exp $	*/
+/*	$NetBSD: pmap.c,v 1.100.2.1 2010/02/25 02:57:17 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -149,7 +149,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.100 2010/01/31 00:43:37 hubertf Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.100.2.1 2010/02/25 02:57:17 uebayasi Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -415,7 +415,7 @@
 paddr_t pmap_pa_end;   /* PA of last physical page for this domain */
 #endif /* XEN */
 
-#define	VM_PAGE_TO_PP(pg)	((pg)-mdpage.mp_pp)
+#define	VM_PAGE_TO_PP(pg)	(VM_PAGE_TO_MD(pg)-mp_pp)
 
 #define	pp_lock(pp)	mutex_spin_enter((pp)-pp_lock)
 #define	pp_unlock(pp)	mutex_spin_exit((pp)-pp_lock)



CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 03:19:51 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: mem.c

Log Message:
pg-mdpage - VM_PAGE_TO_MD(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.26.6.1 -r1.26.6.2 src/sys/arch/arm/arm32/mem.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/arch/arm/arm32/mem.c
diff -u src/sys/arch/arm/arm32/mem.c:1.26.6.1 src/sys/arch/arm/arm32/mem.c:1.26.6.2
--- src/sys/arch/arm/arm32/mem.c:1.26.6.1	Wed Feb 10 14:20:23 2010
+++ src/sys/arch/arm/arm32/mem.c	Thu Feb 25 03:19:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.26.6.1 2010/02/10 14:20:23 uebayasi Exp $	*/
+/*	$NetBSD: mem.c,v 1.26.6.2 2010/02/25 03:19:51 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -74,9 +74,11 @@
 
 #include opt_arm32_pmap.h
 #include opt_compat_netbsd.h
+#include opt_device_page.h
+#include opt_xip.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.26.6.1 2010/02/10 14:20:23 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.26.6.2 2010/02/25 03:19:51 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -144,7 +146,7 @@
 			{
 struct vm_page *pg;
 pg = PHYS_TO_VM_PAGE(trunc_page(v));
-if (pg != NULL  pmap_is_page_colored_p(pg-mdpage))
+if (pg != NULL  pmap_is_page_colored_p(VM_PAGE_TO_MD(pg)))
 	o = pg-mdpage.pvh_attrs;
 else
 	o = v;



CVS commit: [uebayasi-xip] src/sys/arch/arm

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 03:30:22 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: mem.c pmap.c
src/sys/arch/arm/include/arm32 [uebayasi-xip]: pmap.h

Log Message:
A few more VM_PAGE_TO_MD().


To generate a diff of this commit:
cvs rdiff -u -r1.26.6.2 -r1.26.6.3 src/sys/arch/arm/arm32/mem.c
cvs rdiff -u -r1.211.2.8 -r1.211.2.9 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.94.2.1 -r1.94.2.2 src/sys/arch/arm/include/arm32/pmap.h

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

Modified files:

Index: src/sys/arch/arm/arm32/mem.c
diff -u src/sys/arch/arm/arm32/mem.c:1.26.6.2 src/sys/arch/arm/arm32/mem.c:1.26.6.3
--- src/sys/arch/arm/arm32/mem.c:1.26.6.2	Thu Feb 25 03:19:51 2010
+++ src/sys/arch/arm/arm32/mem.c	Thu Feb 25 03:30:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.26.6.2 2010/02/25 03:19:51 uebayasi Exp $	*/
+/*	$NetBSD: mem.c,v 1.26.6.3 2010/02/25 03:30:22 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -78,7 +78,7 @@
 #include opt_xip.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.26.6.2 2010/02/25 03:19:51 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.26.6.3 2010/02/25 03:30:22 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -147,7 +147,7 @@
 struct vm_page *pg;
 pg = PHYS_TO_VM_PAGE(trunc_page(v));
 if (pg != NULL  pmap_is_page_colored_p(VM_PAGE_TO_MD(pg)))
-	o = pg-mdpage.pvh_attrs;
+	o = VM_PAGE_TO_MD(pg)-pvh_attrs;
 else
 	o = v;
 m += o  arm_cache_prefer_mask;

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.8 src/sys/arch/arm/arm32/pmap.c:1.211.2.9
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.8	Sat Feb 20 16:48:57 2010
+++ src/sys/arch/arm/arm32/pmap.c	Thu Feb 25 03:30:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.8 2010/02/20 16:48:57 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.9 2010/02/25 03:30:22 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -191,6 +191,8 @@
 #include opt_ddb.h
 #include opt_lockdebug.h
 #include opt_multiprocessor.h
+#include opt_device_page.h
+#include opt_xip.h
 
 #include sys/param.h
 #include sys/types.h
@@ -211,7 +213,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.8 2010/02/20 16:48:57 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.9 2010/02/25 03:30:22 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -3343,8 +3345,8 @@
 	struct vm_page_md *md = VM_PAGE_TO_MD(pg);
 
 	NPDEBUG(PDB_KENTER,
-	printf(pmap_kenter_pa: va 0x%08lx, pa 0x%08lx, prot 0x%x\n,
-	va, pa, prot));
+	printf(pmap_kenter_pa: va 0x%08lx, pa 0x%08lx, prot 0x%x pg %p md %p\n,
+	va, pa, prot, pg, md));
 
 	l2b = pmap_get_l2_bucket(pmap_kernel(), va);
 	KDASSERT(l2b != NULL);

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.94.2.1 src/sys/arch/arm/include/arm32/pmap.h:1.94.2.2
--- src/sys/arch/arm/include/arm32/pmap.h:1.94.2.1	Wed Feb 10 14:20:23 2010
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu Feb 25 03:30:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.94.2.1 2010/02/10 14:20:23 uebayasi Exp $	*/
+/*	$NetBSD: pmap.h,v 1.94.2.2 2010/02/25 03:30:22 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -269,9 +269,10 @@
 #define	pmap_wired_count(pmap)		((pmap)-pm_stats.wired_count)
 
 #define	pmap_is_modified(pg)	\
-	(((pg)-mdpage.pvh_attrs  PVF_MOD) != 0)
+	((VM_PAGE_TO_MD(pg)-pvh_attrs  PVF_MOD) != 0)
 #define	pmap_is_referenced(pg)	\
-	(((pg)-mdpage.pvh_attrs  PVF_REF) != 0)
+	((VM_PAGE_TO_MD(pg)-pvh_attrs  PVF_REF) != 0)
+
 #define	pmap_is_page_colored_p(md)	\
 	(((md)-pvh_attrs  PVF_COLORED) != 0)
 



CVS commit: [uebayasi-xip] src/sys/arch/alpha

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 03:44:17 UTC 2010

Modified Files:
src/sys/arch/alpha/alpha [uebayasi-xip]: pmap.c
src/sys/arch/alpha/include [uebayasi-xip]: pmap.h

Log Message:
Use VM_PAGE_TO_MD().  Only compile tested.


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.252.2.1 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.75 -r1.75.2.1 src/sys/arch/alpha/include/pmap.h

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

Modified files:

Index: src/sys/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.252 src/sys/arch/alpha/alpha/pmap.c:1.252.2.1
--- src/sys/arch/alpha/alpha/pmap.c:1.252	Thu Nov 26 00:19:11 2009
+++ src/sys/arch/alpha/alpha/pmap.c	Thu Feb 25 03:44:16 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.252 2009/11/26 00:19:11 matt Exp $ */
+/* $NetBSD: pmap.c,v 1.252.2.1 2010/02/25 03:44:16 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -137,10 +137,12 @@
 #include opt_lockdebug.h
 #include opt_sysv.h
 #include opt_multiprocessor.h
+#include opt_device_page.h
+#include opt_xip.h
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.252 2009/11/26 00:19:11 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.252.2.1 2010/02/25 03:44:16 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1401,6 +1403,7 @@
 void
 pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pmap_t pmap;
 	pv_entry_t pv, nextpv;
 	bool needkisync = false;
@@ -1427,7 +1430,7 @@
 		PMAP_HEAD_TO_MAP_LOCK();
 		lock = pmap_pvh_lock(pg);
 		mutex_enter(lock);
-		for (pv = pg-mdpage.pvh_list; pv != NULL; pv = pv-pv_next) {
+		for (pv = md-pvh_list; pv != NULL; pv = pv-pv_next) {
 			PMAP_LOCK(pv-pv_pmap);
 			if (*pv-pv_pte  (PG_KWE | PG_UWE)) {
 *pv-pv_pte = ~(PG_KWE | PG_UWE);
@@ -1452,7 +1455,7 @@
 	PMAP_HEAD_TO_MAP_LOCK();
 	lock = pmap_pvh_lock(pg);
 	mutex_enter(lock);
-	for (pv = pg-mdpage.pvh_list; pv != NULL; pv = nextpv) {
+	for (pv = md-pvh_list; pv != NULL; pv = nextpv) {
 		nextpv = pv-pv_next;
 		pmap = pv-pv_pmap;
 
@@ -1793,6 +1796,7 @@
 	 */
 	npte = ((pa  PGSHIFT)  PG_SHIFT) | pte_prot(pmap, prot) | PG_V;
 	if (pg != NULL) {
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 		int attrs;
 
 #ifdef DIAGNOSTIC
@@ -1802,10 +1806,10 @@
 		lock = pmap_pvh_lock(pg);
 		mutex_enter(lock);
 		if (flags  VM_PROT_WRITE)
-			pg-mdpage.pvh_attrs |= (PGA_REFERENCED|PGA_MODIFIED);
+			md-pvh_attrs |= (PGA_REFERENCED|PGA_MODIFIED);
 		else if (flags  VM_PROT_ALL)
-			pg-mdpage.pvh_attrs |= PGA_REFERENCED;
-		attrs = pg-mdpage.pvh_attrs;
+			md-pvh_attrs |= PGA_REFERENCED;
+		attrs = md-pvh_attrs;
 		mutex_exit(lock);
 
 		/*
@@ -2282,6 +2286,7 @@
 bool
 pmap_clear_modify(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	bool rv = false;
 	long cpu_id = cpu_number();
 	kmutex_t *lock;
@@ -2295,10 +2300,10 @@
 	lock = pmap_pvh_lock(pg);
 	mutex_enter(lock);
 
-	if (pg-mdpage.pvh_attrs  PGA_MODIFIED) {
+	if (md-pvh_attrs  PGA_MODIFIED) {
 		rv = true;
 		pmap_changebit(pg, PG_FOW, ~0, cpu_id);
-		pg-mdpage.pvh_attrs = ~PGA_MODIFIED;
+		md-pvh_attrs = ~PGA_MODIFIED;
 	}
 
 	mutex_exit(lock);
@@ -2315,6 +2320,7 @@
 bool
 pmap_clear_reference(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	bool rv = false;
 	long cpu_id = cpu_number();
 	kmutex_t *lock;
@@ -2328,10 +2334,10 @@
 	lock = pmap_pvh_lock(pg);
 	mutex_enter(lock);
 
-	if (pg-mdpage.pvh_attrs  PGA_REFERENCED) {
+	if (md-pvh_attrs  PGA_REFERENCED) {
 		rv = true;
 		pmap_changebit(pg, PG_FOR | PG_FOW | PG_FOE, ~0, cpu_id);
-		pg-mdpage.pvh_attrs = ~PGA_REFERENCED;
+		md-pvh_attrs = ~PGA_REFERENCED;
 	}
 
 	mutex_exit(lock);
@@ -2539,6 +2545,7 @@
 static void
 pmap_changebit(struct vm_page *pg, u_long set, u_long mask, long cpu_id)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv;
 	pt_entry_t *pte, npte;
 	vaddr_t va;
@@ -2554,7 +2561,7 @@
 	/*
 	 * Loop over all current mappings setting/clearing as apropos.
 	 */
-	for (pv = pg-mdpage.pvh_list; pv != NULL; pv = pv-pv_next) {
+	for (pv = md-pvh_list; pv != NULL; pv = pv-pv_next) {
 		va = pv-pv_va;
 
 		PMAP_LOCK(pv-pv_pmap);
@@ -2681,16 +2688,17 @@
 	 *	(2) if it was a write fault, mark page as modified.
 	 */
 	pg = PHYS_TO_VM_PAGE(pa);
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 
 	PMAP_HEAD_TO_MAP_LOCK();
 	lock = pmap_pvh_lock(pg);
 	mutex_enter(lock);
 
 	if (type == ALPHA_MMCSR_FOW) {
-		pg-mdpage.pvh_attrs |= (PGA_REFERENCED|PGA_MODIFIED);
+		md-pvh_attrs |= (PGA_REFERENCED|PGA_MODIFIED);
 		faultoff = PG_FOR | PG_FOW;
 	} else {
-		pg-mdpage.pvh_attrs |= PGA_REFERENCED;
+		md-pvh_attrs |= PGA_REFERENCED;
 		faultoff = PG_FOR;
 		if (exec) {
 			faultoff |= PG_FOE;
@@ -2713,16 +2721,18 @@
 

CVS commit: [uebayasi-xip] src/sys/arch/hppa

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 04:11:29 UTC 2010

Modified Files:
src/sys/arch/hppa/hppa [uebayasi-xip]: pmap.c
src/sys/arch/hppa/include [uebayasi-xip]: pmap.h

Log Message:
Use VM_PAGE_TO_MD().  Only compile tested.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.63.2.1 src/sys/arch/hppa/hppa/pmap.c
cvs rdiff -u -r1.23 -r1.23.2.1 src/sys/arch/hppa/include/pmap.h

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

Modified files:

Index: src/sys/arch/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.63 src/sys/arch/hppa/hppa/pmap.c:1.63.2.1
--- src/sys/arch/hppa/hppa/pmap.c:1.63	Fri Dec 18 19:20:35 2009
+++ src/sys/arch/hppa/hppa/pmap.c	Thu Feb 25 04:11:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.63 2009/12/18 19:20:35 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.63.2.1 2010/02/25 04:11:29 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,10 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.63 2009/12/18 19:20:35 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.63.2.1 2010/02/25 04:11:29 uebayasi Exp $);
+
+#include opt_device_page.h
+#include opt_xip.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -486,16 +489,18 @@
 pmap_dump_pv(paddr_t pa)
 {
 	struct vm_page *pg;
+	struct vm_page_md *md;
 	struct pv_entry *pve;
 
 	pg = PHYS_TO_VM_PAGE(pa);
-	mutex_enter(pg-mdpage.pvh_lock);
-	printf(pg %p attr 0x%08x aliases %d\n, pg, pg-mdpage.pvh_attrs,
-	pg-mdpage.pvh_aliases);
-	for (pve = pg-mdpage.pvh_list; pve; pve = pve-pv_next)
+	md = VM_PAGE_TO_MD(pg);
+	mutex_enter(md-pvh_lock);
+	printf(pg %p attr 0x%08x aliases %d\n, pg, md-pvh_attrs,
+	md-pvh_aliases);
+	for (pve = md-pvh_list; pve; pve = pve-pv_next)
 		printf(%x:%lx\n, pve-pv_pmap-pm_space,
 		pve-pv_va  PV_VAMASK);
-	mutex_exit(pg-mdpage.pvh_lock);
+	mutex_exit(md-pvh_lock);
 }
 #endif
 
@@ -507,12 +512,13 @@
  *
  * - Shouldn't be called for pages that have been marked uncacheable by
  *   pmap_kenter_pa.
- * - Must be called with pg-mdpage.pvh_lock held.
+ * - Must be called with md-pvh_lock held.
  */
 void
 pmap_check_alias(struct vm_page *pg, struct pv_entry *pve, vaddr_t va,
 pt_entry_t *ptep)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	bool nonequiv = false;
 	struct pv_entry *tpve;
 	u_int attrs;
@@ -521,8 +527,8 @@
 	(%s(%p, %p, 0x%lx, %p)\n, __func__, pg, pve, va, ptep));
 
 	/* we should only be looking if we're not PVF_NC */
-	KASSERT((pg-mdpage.pvh_attrs  PVF_NC) == 0);
-	KASSERT(mutex_owned(pg-mdpage.pvh_lock));
+	KASSERT((md-pvh_attrs  PVF_NC) == 0);
+	KASSERT(mutex_owned(md-pvh_lock));
 
 	if (ptep) {
 		attrs = pmap_pvh_attrs(*ptep);
@@ -578,7 +584,7 @@
 			 * mark all mappings as uncacheable (if they're not
 			 * already marked as such).
 			 */
-			pg-mdpage.pvh_aliases++;
+			md-pvh_aliases++;
 
 			if ((attrs  PVF_UNCACHEABLE) == 0)
 __changebit(pg, PVF_UNCACHEABLE, 0);
@@ -595,8 +601,8 @@
 			 * it cacheable if all non-equiv aliases are gone.
 			 */
 
-			pg-mdpage.pvh_aliases--;
-			if (pg-mdpage.pvh_aliases == 0) {
+			md-pvh_aliases--;
+			if (md-pvh_aliases == 0) {
 __changebit(pg, 0, PVF_UNCACHEABLE);
 
 DPRINTF(PDB_FOLLOW|PDB_ALIAS,
@@ -639,26 +645,29 @@
 pmap_pv_enter(struct vm_page *pg, struct pv_entry *pve, pmap_t pm,
 vaddr_t va, struct vm_page *pdep, u_int flags)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
 	DPRINTF(PDB_FOLLOW|PDB_PV, (%s(%p, %p, %p, 0x%lx, %p, 0x%x)\n,
 	__func__, pg, pve, pm, va, pdep, flags));
 
-	KASSERT(mutex_owned(pg-mdpage.pvh_lock));
+	KASSERT(mutex_owned(md-pvh_lock));
 
 	pve-pv_pmap = pm;
 	pve-pv_va = va | flags;
 	pve-pv_ptp = pdep;
-	pve-pv_next = pg-mdpage.pvh_list;
-	pg-mdpage.pvh_list = pve;
+	pve-pv_next = md-pvh_list;
+	md-pvh_list = pve;
 }
 
 static inline struct pv_entry *
 pmap_pv_remove(struct vm_page *pg, pmap_t pmap, vaddr_t va)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	struct pv_entry **pve, *pv;
 
-	KASSERT(mutex_owned(pg-mdpage.pvh_lock));
+	KASSERT(mutex_owned(md-pvh_lock));
 
-	for (pv = *(pve = pg-mdpage.pvh_list);
+	for (pv = *(pve = md-pvh_list);
 	pv; pv = *(pve = (*pve)-pv_next))
 		if (pv-pv_pmap == pmap  (pv-pv_va  PV_VAMASK) == va) {
 			*pve = pv-pv_next;
@@ -1182,7 +1191,8 @@
 continue;
 
 			sheep = PHYS_TO_VM_PAGE(PTE_PAGE(*pde));
-			for (haggis = sheep-mdpage.pvh_list; haggis != NULL; )
+			struct vm_page_md * const md = VM_PAGE_TO_MD(sheap);
+			for (haggis = md-pvh_list; haggis != NULL; )
 if (haggis-pv_pmap == pmap) {
 
 	DPRINTF(PDB_FOLLOW, ( 0x%lx,
@@ -1196,7 +1206,7 @@
 	 * exploit the sacred knowledge of
 	 * lambeous ozzmosis
 	 */
-	haggis = sheep-mdpage.pvh_list;
+	haggis = md-pvh_list;
 } else
 	haggis = haggis-pv_next;
 		}
@@ -1279,10 +1289,11 @@
 		}
 
 		pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte));
-		

CVS commit: [uebayasi-xip] src/sys/arch/ia64/include

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 04:33:06 UTC 2010

Modified Files:
src/sys/arch/ia64/include [uebayasi-xip]: proc.h

Log Message:
Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/arch/ia64/include/proc.h

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

Modified files:

Index: src/sys/arch/ia64/include/proc.h
diff -u src/sys/arch/ia64/include/proc.h:1.4 src/sys/arch/ia64/include/proc.h:1.4.2.1
--- src/sys/arch/ia64/include/proc.h:1.4	Sat Nov 21 15:36:34 2009
+++ src/sys/arch/ia64/include/proc.h	Thu Feb 25 04:33:06 2010
@@ -21,7 +21,7 @@
 
 struct mdproc {
   /* XXX: Todo */
-	void	(*md_syscall)(struct trapframe *);
+	void	(*md_syscall)(struct lwp *, u_int64_t, struct trapframe *);
 	/* Syscall handling function */
 };
 



CVS commit: [uebayasi-xip] src/sys/arch/ia64

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 04:33:44 UTC 2010

Modified Files:
src/sys/arch/ia64/ia64 [uebayasi-xip]: pmap.c
src/sys/arch/ia64/include [uebayasi-xip]: pmap.h

Log Message:
Use VM_PAGE_TO_MD().  Only compile tested.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 src/sys/arch/ia64/ia64/pmap.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/ia64/include/pmap.h

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

Modified files:

Index: src/sys/arch/ia64/ia64/pmap.c
diff -u src/sys/arch/ia64/ia64/pmap.c:1.24 src/sys/arch/ia64/ia64/pmap.c:1.24.2.1
--- src/sys/arch/ia64/ia64/pmap.c:1.24	Sat Nov  7 07:27:44 2009
+++ src/sys/arch/ia64/ia64/pmap.c	Thu Feb 25 04:33:44 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.24 2009/11/07 07:27:44 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.24.2.1 2010/02/25 04:33:44 uebayasi Exp $ */
 
 
 /*-
@@ -85,7 +85,10 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.24 2009/11/07 07:27:44 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.24.2.1 2010/02/25 04:33:44 uebayasi Exp $);
+
+#include opt_device_page.h
+#include opt_xip.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -1233,6 +1236,7 @@
 bool
 pmap_clear_modify(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	bool rv = false;
 	struct ia64_lpte *pte;
 	pmap_t oldpmap;
@@ -1241,7 +1245,7 @@
 	if (pg-flags  PG_FAKE)
 		return rv;
 
-	TAILQ_FOREACH(pv, pg-mdpage.pv_list, pv_list) {
+	TAILQ_FOREACH(pv, md-pv_list, pv_list) {
 		PMAP_LOCK(pv-pv_pmap);
 		oldpmap = pmap_install(pv-pv_pmap);
 		pte = pmap_find_vhpt(pv-pv_va);
@@ -1266,6 +1270,7 @@
 void
 pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 struct ia64_lpte *pte;
 pmap_t oldpmap, pmap;
 pv_entry_t pv;
@@ -1275,7 +1280,7 @@
 if (prot  (VM_PROT_READ | VM_PROT_EXECUTE)) {
 if (pg-flags  PG_RDONLY)
 return;
-TAILQ_FOREACH(pv, pg-mdpage.pv_list, pv_list) {
+TAILQ_FOREACH(pv, md-pv_list, pv_list) {
 pmap = pv-pv_pmap;
 PMAP_LOCK(pmap);
 oldpmap = pmap_install(pmap);
@@ -1489,8 +1494,9 @@
  */
 
 void
-pmap_page_purge(struct vm_page * pg)
+pmap_page_purge(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pmap_t oldpmap;
 	pv_entry_t pv;
 
@@ -1505,7 +1511,7 @@
 #endif
 	//UVM_LOCK_ASSERT_PAGEQ();
 
-	while ((pv = TAILQ_FIRST(pg-mdpage.pv_list)) != NULL) {
+	while ((pv = TAILQ_FIRST(md-pv_list)) != NULL) {
 		struct ia64_lpte *pte;
 		pmap_t pmap = pv-pv_pmap;
 		vaddr_t va = pv-pv_va;
@@ -1972,11 +1978,13 @@
  * Remove an entry from the list of managed mappings.
  */
 static int
-pmap_remove_entry(pmap_t pmap, struct vm_page * pg, vaddr_t va, pv_entry_t pv)
+pmap_remove_entry(pmap_t pmap, struct vm_page *pg, vaddr_t va, pv_entry_t pv)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
 	if (!pv) {
-		if (pg-mdpage.pv_list_count  pmap-pm_stats.resident_count) {
-			TAILQ_FOREACH(pv, pg-mdpage.pv_list, pv_list) {
+		if (md-pv_list_count  pmap-pm_stats.resident_count) {
+			TAILQ_FOREACH(pv, md-pv_list, pv_list) {
 if (pmap == pv-pv_pmap  va == pv-pv_va) 
 	break;
 			}
@@ -1989,9 +1997,9 @@
 	}
 
 	if (pv) {
-		TAILQ_REMOVE(pg-mdpage.pv_list, pv, pv_list);
-		pg-mdpage.pv_list_count--;
-		if (TAILQ_FIRST(pg-mdpage.pv_list) == NULL) {
+		TAILQ_REMOVE(md-pv_list, pv, pv_list);
+		md-pv_list_count--;
+		if (TAILQ_FIRST(md-pv_list) == NULL) {
 			//UVM_LOCK_ASSERT_PAGEQ(); 
 			pg-flags |= PG_RDONLY;
 		}
@@ -2012,6 +2020,7 @@
 static void
 pmap_insert_entry(pmap_t pmap, vaddr_t va, struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv;
 
 	pv = get_pv_entry(pmap);
@@ -2021,8 +2030,8 @@
 	//LOCK_ASSERT(simple_lock_held(pmap-slock));
 	//UVM_LOCK_ASSERT_PAGEQ(); 
 	TAILQ_INSERT_TAIL(pmap-pm_pvlist, pv, pv_plist);
-	TAILQ_INSERT_TAIL(pg-mdpage.pv_list, pv, pv_list);
-	pg-mdpage.pv_list_count++;
+	TAILQ_INSERT_TAIL(md-pv_list, pv, pv_list);
+	md-pv_list_count++;
 }
 
 
@@ -2092,13 +2101,14 @@
 		pa = VM_PAGE_TO_PHYS(pg);
 
 #ifdef DEBUG
-		mutex_enter(pg-mdpage.pv_mutex);
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+		mutex_enter(md-pv_mutex);
 		if (pg-wire_count != 0) {
 			printf(pmap_physpage_alloc: page 0x%lx has 
 			%d references\n, pa, pg-wire_count);
 			panic(pmap_physpage_alloc);
 		}
-		mutex_exit(pg-mdpage.pv_mutex);
+		mutex_exit(md-pv_mutex);
 #endif
 		*pap = pa;
 		return true;
@@ -2120,10 +2130,11 @@
 		panic(pmap_physpage_free: bogus physical page address);
 
 #ifdef DEBUG
-	mutex_enter(pg-mdpage.pv_mutex);
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+	mutex_enter(md-pv_mutex);
 	if (pg-wire_count != 0)
 		panic(pmap_physpage_free: page still has references);
-	

CVS commit: [uebayasi-xip] src/sys/arch/mips/mips

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 04:46:28 UTC 2010

Modified Files:
src/sys/arch/mips/mips [uebayasi-xip]: pmap.c

Log Message:
Use VM_PAGE_TO_MD().  Only compile tested.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.188.2.1 src/sys/arch/mips/mips/pmap.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/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.188 src/sys/arch/mips/mips/pmap.c:1.188.2.1
--- src/sys/arch/mips/mips/pmap.c:1.188	Mon Dec 14 00:46:07 2009
+++ src/sys/arch/mips/mips/pmap.c	Thu Feb 25 04:46:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.188 2009/12/14 00:46:07 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.188.2.1 2010/02/25 04:46:28 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.188 2009/12/14 00:46:07 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.188.2.1 2010/02/25 04:46:28 uebayasi Exp $);
 
 /*
  *	Manages physical address maps.
@@ -265,6 +265,7 @@
 mips_flushcache_allpvh(paddr_t pa)
 {
 	struct vm_page *pg;
+	struct vm_page_md *md;
 	struct pv_entry *pv;
 
 	pg = PHYS_TO_VM_PAGE(pa);
@@ -277,7 +278,8 @@
 		return;
 	}
 
-	pv = pg-mdpage.pvh_list;
+	md = VM_PAGE_TO_MD(pg);
+	pv = md-pvh_list;
 
 #if defined(MIPS3_NO_PV_UNCACHED)
 	/* No current mapping.  Cache was flushed by pmap_remove_pv() */
@@ -522,7 +524,7 @@
 	for (bank = 0; bank  vm_nphysseg; bank++) {
 		s = vm_physmem[bank].end - vm_physmem[bank].start;
 		for (i = 0; i  s; i++)
-			vm_physmem[bank].pgs[i].mdpage.pvh_list = pv++;
+			VM_PAGE_TO_MD(vm_physmem[bank].pgs[i])-pvh_list = pv++;
 	}
 
 	/*
@@ -861,6 +863,7 @@
 void
 pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv;
 	vaddr_t va;
 
@@ -878,7 +881,7 @@
 	/* copy_on_write */
 	case VM_PROT_READ:
 	case VM_PROT_READ|VM_PROT_EXECUTE:
-		pv = pg-mdpage.pvh_list;
+		pv = md-pvh_list;
 		/*
 		 * Loop over all current mappings setting/clearing as appropos.
 		 */
@@ -894,7 +897,7 @@
 
 	/* remove_all */
 	default:
-		pv = pg-mdpage.pvh_list;
+		pv = md-pvh_list;
 		while (pv-pv_pmap != NULL) {
 			pmap_remove(pv-pv_pmap, pv-pv_va,
 			pv-pv_va + PAGE_SIZE);
@@ -1079,6 +1082,7 @@
 static void
 pmap_page_cache(struct vm_page *pg, int mode)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv;
 	pt_entry_t *pte;
 	unsigned entry;
@@ -1090,7 +1094,7 @@
 		printf(pmap_page_uncache(%#PRIxPADDR)\n, VM_PAGE_TO_PHYS(pg));
 #endif
 	newmode = mode  PV_UNCACHED ? MIPS3_PG_UNCACHED : MIPS3_PG_CACHED;
-	pv = pg-mdpage.pvh_list;
+	pv = md-pvh_list;
 	asid = pv-pv_pmap-pm_asid;
 	needupdate = (pv-pv_pmap-pm_asidgen == pmap_asid_generation);
 
@@ -1189,7 +1193,8 @@
 	pg = PHYS_TO_VM_PAGE(pa);
 
 	if (pg) {
-		int *attrs = pg-mdpage.pvh_attrs;
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+		int *attrs = md-pvh_attrs;
 
 		/* Set page referenced/modified status based on flags */
 		if (flags  VM_PROT_WRITE)
@@ -1643,7 +1648,8 @@
 #if defined(MIPS3_PLUS)	/* XXX mmu XXX */
 	pg = PHYS_TO_VM_PAGE(phys);
 	if (mips_cache_virtual_alias) {
-		pv = pg-mdpage.pvh_list;
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+		pv = md-pvh_list;
 		if ((pv-pv_flags  PV_UNCACHED) == 0 
 		mips_cache_indexof(pv-pv_va) != mips_cache_indexof(va))
 			mips_dcache_wbinv_range_index(pv-pv_va, PAGE_SIZE);
@@ -1745,6 +1751,7 @@
 bool
 pmap_clear_reference(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	int *attrp;
 	bool rv;
 
@@ -1753,7 +1760,7 @@
 		printf(pmap_clear_reference(%#PRIxPADDR)\n,
 		VM_PAGE_TO_PHYS(pg));
 #endif
-	attrp = pg-mdpage.pvh_attrs;
+	attrp = md-pvh_attrs;
 	rv = *attrp  PGA_REFERENCED;
 	*attrp = ~PGA_REFERENCED;
 	return rv;
@@ -1768,8 +1775,9 @@
 bool
 pmap_is_referenced(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 
-	return pg-mdpage.pvh_attrs  PGA_REFERENCED;
+	return md-pvh_attrs  PGA_REFERENCED;
 }
 
 /*
@@ -1778,6 +1786,7 @@
 bool
 pmap_clear_modify(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	struct pmap *pmap;
 	struct pv_entry *pv;
 	pt_entry_t *pte;
@@ -1790,13 +1799,13 @@
 	if (pmapdebug  PDB_FOLLOW)
 		printf(pmap_clear_modify(%#PRIxPADDR)\n, VM_PAGE_TO_PHYS(pg));
 #endif
-	attrp = pg-mdpage.pvh_attrs;
+	attrp = md-pvh_attrs;
 	rv = *attrp  PGA_MODIFIED;
 	*attrp = ~PGA_MODIFIED;
 	if (!rv) {
 		return rv;
 	}
-	pv = pg-mdpage.pvh_list;
+	pv = md-pvh_list;
 	if (pv-pv_pmap == NULL) {
 		return true;
 	}
@@ -1846,8 +1855,9 @@
 bool
 pmap_is_modified(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 
-	return pg-mdpage.pvh_attrs  PGA_MODIFIED;
+	return md-pvh_attrs  PGA_MODIFIED;
 }
 
 /*
@@ -1859,9 +1869,11 @@
 pmap_set_modified(paddr_t pa)
 {
 	struct vm_page *pg;

CVS commit: [uebayasi-xip] src/sys/arch/sh3/sh3

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 05:05:23 UTC 2010

Modified Files:
src/sys/arch/sh3/sh3 [uebayasi-xip]: pmap.c

Log Message:
Use VM_PAGE_TO_MD().  Only compile tested.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.74.2.1 src/sys/arch/sh3/sh3/pmap.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/arch/sh3/sh3/pmap.c
diff -u src/sys/arch/sh3/sh3/pmap.c:1.74 src/sys/arch/sh3/sh3/pmap.c:1.74.2.1
--- src/sys/arch/sh3/sh3/pmap.c:1.74	Sat Nov  7 07:27:46 2009
+++ src/sys/arch/sh3/sh3/pmap.c	Thu Feb 25 05:05:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.74 2009/11/07 07:27:46 cegger Exp $	*/
+/*	$NetBSD: pmap.c,v 1.74.2.1 2010/02/25 05:05:23 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.74 2009/11/07 07:27:46 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.74.2.1 2010/02/25 05:05:23 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -339,7 +339,7 @@
 		entry |= _PG_WIRED;
 
 	if (pg != NULL) {	/* memory-space */
-		pvh = pg-mdpage;
+		pvh = VM_PAGE_TO_MD(pg);
 		entry |= PG_C;	/* always cached */
 
 		/* Seed modified/reference tracking */
@@ -483,7 +483,7 @@
 		 * XXX mapping them uncached (like arm and mips do).
 		 */
  again:
-		pvh = pg-mdpage;
+		pvh = VM_PAGE_TO_MD(pg);
 		SLIST_FOREACH(pv, pvh-pvh_head, pv_link) {
 			if (sh_cache_indexof(va) !=
 			sh_cache_indexof(pv-pv_va)) {
@@ -495,7 +495,7 @@
 	}
 
 	/* Register pv map */
-	pvh = pg-mdpage;
+	pvh = VM_PAGE_TO_MD(pg);
 	pv = __pmap_pv_alloc();
 	pv-pv_pmap = pmap;
 	pv-pv_va = va;
@@ -547,12 +547,12 @@
 	int s;
 
 	s = splvm();
-	pvh = pg-mdpage;
+	pvh = VM_PAGE_TO_MD(pg);
 	SLIST_FOREACH(pv, pvh-pvh_head, pv_link) {
 		if (pv-pv_pmap == pmap  pv-pv_va == vaddr) {
 			if (SH_HAS_VIRTUAL_ALIAS ||
 			(SH_HAS_WRITEBACK_CACHE 
-(pg-mdpage.pvh_flags  PVH_MODIFIED))) {
+(pvh-pvh_flags  PVH_MODIFIED))) {
 /*
  * Always use index ops. since I don't want to
  * worry about address space.
@@ -699,7 +699,7 @@
 void
 pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
 {
-	struct vm_page_md *pvh = pg-mdpage;
+	struct vm_page_md *pvh = VM_PAGE_TO_MD(pg);
 	struct pv_entry *pv;
 	struct pmap *pmap;
 	vaddr_t va;
@@ -789,24 +789,25 @@
 bool
 pmap_is_referenced(struct vm_page *pg)
 {
+	struct vm_page_md *pvh = VM_PAGE_TO_MD(pg);
 
-	return ((pg-mdpage.pvh_flags  PVH_REFERENCED) ? true : false);
+	return ((pvh-pvh_flags  PVH_REFERENCED) ? true : false);
 }
 
 bool
 pmap_clear_reference(struct vm_page *pg)
 {
-	struct vm_page_md *pvh = pg-mdpage;
+	struct vm_page_md *pvh = VM_PAGE_TO_MD(pg);
 	struct pv_entry *pv;
 	pt_entry_t *pte;
 	pmap_t pmap;
 	vaddr_t va;
 	int s;
 
-	if ((pg-mdpage.pvh_flags  PVH_REFERENCED) == 0)
+	if ((pvh-pvh_flags  PVH_REFERENCED) == 0)
 		return (false);
 
-	pg-mdpage.pvh_flags = ~PVH_REFERENCED;
+	pvh-pvh_flags = ~PVH_REFERENCED;
 
 	s = splvm();
 	/* Restart reference bit emulation */
@@ -831,14 +832,15 @@
 bool
 pmap_is_modified(struct vm_page *pg)
 {
+	struct vm_page_md *pvh = VM_PAGE_TO_MD(pg);
 
-	return ((pg-mdpage.pvh_flags  PVH_MODIFIED) ? true : false);
+	return ((pvh-pvh_flags  PVH_MODIFIED) ? true : false);
 }
 
 bool
 pmap_clear_modify(struct vm_page *pg)
 {
-	struct vm_page_md *pvh = pg-mdpage;
+	struct vm_page_md *pvh = VM_PAGE_TO_MD(pg);
 	struct pv_entry *pv;
 	struct pmap *pmap;
 	pt_entry_t *pte, entry;
@@ -1023,12 +1025,14 @@
 
 	/* Emulate reference/modified tracking for managed page. */
 	if (flags != 0  (pg = PHYS_TO_VM_PAGE(entry  PG_PPN)) != NULL) {
+		struct vm_page_md *pvh = VM_PAGE_TO_MD(pg);
+
 		if (flags  PVH_REFERENCED) {
-			pg-mdpage.pvh_flags |= PVH_REFERENCED;
+			pvh-pvh_flags |= PVH_REFERENCED;
 			entry |= PG_V;
 		}
 		if (flags  PVH_MODIFIED) {
-			pg-mdpage.pvh_flags |= PVH_MODIFIED;
+			pvh-pvh_flags |= PVH_MODIFIED;
 			entry |= PG_D;
 		}
 		*pte = entry;



CVS commit: [uebayasi-xip] src/sys/arch/sh3/include

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 05:13:01 UTC 2010

Modified Files:
src/sys/arch/sh3/include [uebayasi-xip]: vmparam.h

Log Message:
Make this reall build.


To generate a diff of this commit:
cvs rdiff -u -r1.19.2.1 -r1.19.2.2 src/sys/arch/sh3/include/vmparam.h

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

Modified files:

Index: src/sys/arch/sh3/include/vmparam.h
diff -u src/sys/arch/sh3/include/vmparam.h:1.19.2.1 src/sys/arch/sh3/include/vmparam.h:1.19.2.2
--- src/sys/arch/sh3/include/vmparam.h:1.19.2.1	Tue Feb 23 15:27:56 2010
+++ src/sys/arch/sh3/include/vmparam.h	Thu Feb 25 05:13:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.19.2.1 2010/02/23 15:27:56 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.19.2.2 2010/02/25 05:13:01 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -99,8 +99,8 @@
 
 #define	VM_MDPAGE_INIT(pvh, pa)		\
 do {	\
-	SLIST_INIT(pvh-pvh_head);	\
-	pvh-pvh_flags = 0;		\
+	SLIST_INIT((pvh)-pvh_head);	\
+	(pvh)-pvh_flags = 0;		\
 } while (/*CONSTCOND*/0)
 #endif /* _LOCORE */
 #endif /* !_SH3_VMPARAM_H_ */



CVS commit: [uebayasi-xip] src/sys/arch

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 05:54:03 UTC 2010

Modified Files:
src/sys/arch/sparc/include [uebayasi-xip]: vmparam.h
src/sys/arch/sparc64/sparc64 [uebayasi-xip]: pmap.c

Log Message:
Use VM_PAGE_TO_MD().  Only compile tested.


To generate a diff of this commit:
cvs rdiff -u -r1.40.2.1 -r1.40.2.2 src/sys/arch/sparc/include/vmparam.h
cvs rdiff -u -r1.250 -r1.250.2.1 src/sys/arch/sparc64/sparc64/pmap.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/arch/sparc/include/vmparam.h
diff -u src/sys/arch/sparc/include/vmparam.h:1.40.2.1 src/sys/arch/sparc/include/vmparam.h:1.40.2.2
--- src/sys/arch/sparc/include/vmparam.h:1.40.2.1	Tue Feb 23 15:27:56 2010
+++ src/sys/arch/sparc/include/vmparam.h	Thu Feb 25 05:54:03 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.40.2.1 2010/02/23 15:27:56 uebayasi Exp $ */
+/*	$NetBSD: vmparam.h,v 1.40.2.2 2010/02/25 05:54:03 uebayasi Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -136,7 +136,7 @@
 		int	pv_flags;		/* flags (below) */
 	} pvlisthead;
 };
-#define VM_MDPAGE_PVHEAD(pg)	((pg)-mdpage.pvlisthead)
+#define VM_MDPAGE_PVHEAD(pg)	(VM_PAGE_TO_MD(pg)-pvlisthead)
 
 #define VM_MDPAGE_INIT(md, pa) do {			\
 	(md)-pvlisthead.pv_next = NULL;		\

Index: src/sys/arch/sparc64/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.250 src/sys/arch/sparc64/sparc64/pmap.c:1.250.2.1
--- src/sys/arch/sparc64/sparc64/pmap.c:1.250	Fri Feb  5 12:04:10 2010
+++ src/sys/arch/sparc64/sparc64/pmap.c	Thu Feb 25 05:54:03 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.250 2010/02/05 12:04:10 martin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.250.2.1 2010/02/25 05:54:03 uebayasi Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.250 2010/02/05 12:04:10 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.250.2.1 2010/02/25 05:54:03 uebayasi Exp $);
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -1398,9 +1398,13 @@
 
 	/* we could be a little smarter and leave pages zeroed */
 	for (pg = TAILQ_FIRST(pm-pm_obj.memq); pg != NULL; pg = nextpg) {
+#ifdef DIAGNOSTIC
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+#endif
+
 		nextpg = TAILQ_NEXT(pg, listq.queue);
 		TAILQ_REMOVE(pm-pm_obj.memq, pg, listq.queue);
-		KASSERT(pg-mdpage.mdpg_pvh.pv_pmap == NULL);
+		KASSERT(md-mdpg_pvh.pv_pmap == NULL);
 		uvm_pagefree(pg);
 	}
 	pmap_free_page((paddr_t)(u_long)pm-pm_segs);
@@ -1667,7 +1671,9 @@
 	 */
 	pg = PHYS_TO_VM_PAGE(pa);
 	if (pg) {
-		pvh = pg-mdpage.mdpg_pvh;
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+		pvh = md-mdpg_pvh;
 		uncached = (pvh-pv_va  (PV_ALIAS|PV_NVC));
 #ifdef DIAGNOSTIC
 		if ((flags  VM_PROT_ALL)  ~prot)
@@ -2064,8 +2070,10 @@
 
 		pg = PHYS_TO_VM_PAGE(pa);
 		if (pg) {
+			struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
 			/* Save REF/MOD info */
-			pv = pg-mdpage.mdpg_pvh;
+			pv = md-mdpg_pvh;
 			if (data  TLB_ACCESS)
 pv-pv_va |= PV_REF;
 			if (data  TLB_MODIFY)
@@ -2410,6 +2418,7 @@
 bool
 pmap_clear_modify(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv;
 	int rv;
 	int changed = 0;
@@ -2424,7 +2433,7 @@
 #endif
 	mutex_enter(pmap_lock);
 	/* Clear all mappings */
-	pv = pg-mdpage.mdpg_pvh;
+	pv = md-mdpg_pvh;
 #ifdef DEBUG
 	if (pv-pv_va  PV_MOD)
 		pv-pv_va |= PV_WE;	/* Remember this was modified */
@@ -2493,6 +2502,7 @@
 bool
 pmap_clear_reference(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv;
 	int rv;
 	int changed = 0;
@@ -2506,7 +2516,7 @@
 	referenced = pmap_is_referenced_locked(pg);
 #endif
 	/* Clear all references */
-	pv = pg-mdpage.mdpg_pvh;
+	pv = md-mdpg_pvh;
 	if (pv-pv_va  PV_REF) {
 		changed |= 1;
 		pv-pv_va = ~PV_REF;
@@ -2559,7 +2569,7 @@
 	pv_check();
 #ifdef DEBUG
 	if (pmap_is_referenced_locked(pg)) {
-		pv = pg-mdpage.mdpg_pvh;
+		pv = md-mdpg_pvh;
 		printf(pmap_clear_reference(): %p still referenced 
 			(pmap = %p, ctx = %d)\n, pg, pv-pv_pmap,
 			pv-pv_pmap ? pmap_ctx(pv-pv_pmap) : 0);
@@ -2584,13 +2594,14 @@
 bool
 pmap_is_modified(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv, npv;
 	bool res = false;
 
 	KASSERT(!mutex_owned(pmap_lock));
 
 	/* Check if any mapping has been modified */
-	pv = pg-mdpage.mdpg_pvh;
+	pv = md-mdpg_pvh;
 	if (pv-pv_va  PV_MOD)
 		res = true;
 #ifdef HWREF
@@ -2640,13 +2651,14 @@
 static bool
 pmap_is_referenced_locked(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv, npv;
 	bool res = false;
 
 	KASSERT(mutex_owned(pmap_lock));
 
 	/* Check if any mapping has been referenced */
-	pv = pg-mdpage.mdpg_pvh;
+	pv = md-mdpg_pvh;
 	if (pv-pv_va  PV_REF)
 		return true;
 
@@ -2688,13 +2700,14 @@
 bool
 pmap_is_referenced(struct vm_page *pg)
 

CVS commit: [uebayasi-xip] src/sys/arch

2010-02-23 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Feb 23 15:27:57 UTC 2010

Modified Files:
src/sys/arch/alpha/include [uebayasi-xip]: vmparam.h
src/sys/arch/amd64/include [uebayasi-xip]: vmparam.h
src/sys/arch/hppa/include [uebayasi-xip]: vmparam.h
src/sys/arch/i386/include [uebayasi-xip]: vmparam.h
src/sys/arch/ia64/include [uebayasi-xip]: vmparam.h
src/sys/arch/mips/include [uebayasi-xip]: vmparam.h
src/sys/arch/powerpc/include/oea [uebayasi-xip]: vmparam.h
src/sys/arch/sh3/include [uebayasi-xip]: vmparam.h
src/sys/arch/sparc/include [uebayasi-xip]: vmparam.h
src/sys/arch/sparc64/include [uebayasi-xip]: vmparam.h
src/sys/arch/vax/include [uebayasi-xip]: vmparam.h

Log Message:
Convert all VM_MDPAGE_INIT()'s to take struct vm_page_md * and paddr_t.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.2.1 src/sys/arch/alpha/include/vmparam.h
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/arch/amd64/include/vmparam.h
cvs rdiff -u -r1.14 -r1.14.2.1 src/sys/arch/hppa/include/vmparam.h
cvs rdiff -u -r1.70 -r1.70.2.1 src/sys/arch/i386/include/vmparam.h
cvs rdiff -u -r1.5 -r1.5.2.1 src/sys/arch/ia64/include/vmparam.h
cvs rdiff -u -r1.44 -r1.44.2.1 src/sys/arch/mips/include/vmparam.h
cvs rdiff -u -r1.14 -r1.14.2.1 src/sys/arch/powerpc/include/oea/vmparam.h
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/arch/sh3/include/vmparam.h
cvs rdiff -u -r1.40 -r1.40.2.1 src/sys/arch/sparc/include/vmparam.h
cvs rdiff -u -r1.30 -r1.30.2.1 src/sys/arch/sparc64/include/vmparam.h
cvs rdiff -u -r1.45 -r1.45.2.1 src/sys/arch/vax/include/vmparam.h

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

Modified files:

Index: src/sys/arch/alpha/include/vmparam.h
diff -u src/sys/arch/alpha/include/vmparam.h:1.33 src/sys/arch/alpha/include/vmparam.h:1.33.2.1
--- src/sys/arch/alpha/include/vmparam.h:1.33	Fri Mar  6 20:31:46 2009
+++ src/sys/arch/alpha/include/vmparam.h	Tue Feb 23 15:27:55 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.33 2009/03/06 20:31:46 joerg Exp $ */
+/* $NetBSD: vmparam.h,v 1.33.2.1 2010/02/23 15:27:55 uebayasi Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -162,10 +162,10 @@
 	unsigned pvh_refcnt;
 };
 
-#define	VM_MDPAGE_INIT(pg)		\
+#define	VM_MDPAGE_INIT(md, pa)		\
 do {	\
-	(pg)-mdpage.pvh_list = NULL;	\
-	(pg)-mdpage.pvh_refcnt = 0;	\
+	(md)-pvh_list = NULL;		\
+	(md)-pvh_refcnt = 0;		\
 } while (/*CONSTCOND*/0)
 
 #endif	/* ! _ALPHA_VMPARAM_H_ */

Index: src/sys/arch/amd64/include/vmparam.h
diff -u src/sys/arch/amd64/include/vmparam.h:1.22 src/sys/arch/amd64/include/vmparam.h:1.22.2.1
--- src/sys/arch/amd64/include/vmparam.h:1.22	Sun Nov 22 21:41:03 2009
+++ src/sys/arch/amd64/include/vmparam.h	Tue Feb 23 15:27:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.22 2009/11/22 21:41:03 bouyer Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.22.2.1 2010/02/23 15:27:55 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -160,9 +160,9 @@
 #include x86/pmap_pv.h
 
 #define	__HAVE_VM_PAGE_MD
-#define	VM_MDPAGE_INIT(pg) \
-	memset((pg)-mdpage, 0, sizeof((pg)-mdpage)); \
-	PMAP_PAGE_INIT((pg)-mdpage.mp_pp)
+#define	VM_MDPAGE_INIT(md, pa) \
+	memset((md), 0, sizeof(*(md))); \
+	PMAP_PAGE_INIT((md)-mp_pp)
 
 struct vm_page_md {
 	struct pmap_page mp_pp;

Index: src/sys/arch/hppa/include/vmparam.h
diff -u src/sys/arch/hppa/include/vmparam.h:1.14 src/sys/arch/hppa/include/vmparam.h:1.14.2.1
--- src/sys/arch/hppa/include/vmparam.h:1.14	Thu Apr 30 07:01:27 2009
+++ src/sys/arch/hppa/include/vmparam.h	Tue Feb 23 15:27:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.14 2009/04/30 07:01:27 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.14.2.1 2010/02/23 15:27:55 uebayasi Exp $	*/
 
 /*	$OpenBSD: vmparam.h,v 1.33 2006/06/04 17:21:24 miod Exp $	*/
 
@@ -112,12 +112,12 @@
 	int		pvh_aliases;	/* alias counting */
 };
 
-#define	VM_MDPAGE_INIT(pg) \
+#define	VM_MDPAGE_INIT(md, pa) \
 do {	\
-	mutex_init((pg)-mdpage.pvh_lock, MUTEX_NODEBUG, IPL_VM);	\
-	(pg)-mdpage.pvh_list = NULL;	\
-	(pg)-mdpage.pvh_attrs = 0;	\
-	(pg)-mdpage.pvh_aliases = 0;	\
+	mutex_init((md)-pvh_lock, MUTEX_NODEBUG, IPL_VM);		\
+	(md)-pvh_list = NULL;		\
+	(md)-pvh_attrs = 0;		\
+	(md)-pvh_aliases = 0;		\
 } while (0)
 #endif
 

Index: src/sys/arch/i386/include/vmparam.h
diff -u src/sys/arch/i386/include/vmparam.h:1.70 src/sys/arch/i386/include/vmparam.h:1.70.2.1
--- src/sys/arch/i386/include/vmparam.h:1.70	Fri Mar  6 20:31:49 2009
+++ src/sys/arch/i386/include/vmparam.h	Tue Feb 23 15:27:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.70 2009/03/06 20:31:49 joerg Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.70.2.1 2010/02/23 15:27:55 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -137,9 +137,9 @@
 #include x86/pmap_pv.h
 
 #define	__HAVE_VM_PAGE_MD
-#define	

CVS commit: [uebayasi-xip] src/sys/arch/arm/include/arm32

2010-02-22 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Feb 23 07:03:13 UTC 2010

Modified Files:
src/sys/arch/arm/include/arm32 [uebayasi-xip]: vmparam.h

Log Message:
Pass struct vm_page_md * to VM_MDPAGE_INIT(), not struct vm_page *.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.1 -r1.24.2.2 src/sys/arch/arm/include/arm32/vmparam.h

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

Modified files:

Index: src/sys/arch/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.24.2.1 src/sys/arch/arm/include/arm32/vmparam.h:1.24.2.2
--- src/sys/arch/arm/include/arm32/vmparam.h:1.24.2.1	Tue Feb  9 07:42:26 2010
+++ src/sys/arch/arm/include/arm32/vmparam.h	Tue Feb 23 07:03:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.24.2.1 2010/02/09 07:42:26 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.24.2.2 2010/02/23 07:03:12 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -120,22 +120,22 @@
  * Set the default color of each page.
  */
 #if ARM_MMU_V6  0
-#define	VM_MDPAGE_PVH_ATTRS_INIT(pg) \
-	(pg)-mdpage.pvh_attrs = VM_PAGE_TO_PHYS(pg)  arm_cache_prefer_mask
+#define	VM_MDPAGE_PVH_ATTRS_INIT(md, pa) \
+	(md)-pvh_attrs = (pa)  arm_cache_prefer_mask
 #else
-#define	VM_MDPAGE_PVH_ATTRS_INIT(pg) \
-	(pg)-mdpage.pvh_attrs = 0
+#define	VM_MDPAGE_PVH_ATTRS_INIT(md, pa) \
+	(md)-pvh_attrs = 0
 #endif
  
 
-#define	VM_MDPAGE_INIT(pg)		\
+#define	VM_MDPAGE_INIT(md, pa)		\
 do {	\
-	SLIST_INIT((pg)-mdpage.pvh_list);\
-	simple_lock_init((pg)-mdpage.pvh_slock);			\
-	VM_MDPAGE_PVH_ATTRS_INIT(pg);	\
-	(pg)-mdpage.uro_mappings = 0;	\
-	(pg)-mdpage.urw_mappings = 0;	\
-	(pg)-mdpage.k_mappings = 0;	\
+	SLIST_INIT((md)-pvh_list);	\
+	simple_lock_init((md)-pvh_slock);\
+	VM_MDPAGE_PVH_ATTRS_INIT((md), (pa));\
+	(md)-uro_mappings = 0;		\
+	(md)-urw_mappings = 0;		\
+	(md)-k_mappings = 0;		\
 } while (/*CONSTCOND*/0)
 #endif /* __ASSEMBLER__ */
 



CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-02-20 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Feb 20 16:48:57 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
Fix \!DIAGNOSTIC build.


To generate a diff of this commit:
cvs rdiff -u -r1.211.2.7 -r1.211.2.8 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.7 src/sys/arch/arm/arm32/pmap.c:1.211.2.8
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.7	Wed Feb 10 15:48:28 2010
+++ src/sys/arch/arm/arm32/pmap.c	Sat Feb 20 16:48:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.7 2010/02/10 15:48:28 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.8 2010/02/20 16:48:57 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.211.2.7 2010/02/10 15:48:28 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.8 2010/02/20 16:48:57 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -4794,7 +4794,9 @@
 			return (1);
 		pa = VM_PAGE_TO_PHYS(pg);
 #ifdef PMAP_CACHE_VIPT
+#ifdef DIAGNOSTIC
 		struct vm_page_md *md = VM_PAGE_TO_MD(pg);
+#endif
 		/*
 		 * This new page must not have any mappings.  Enter it via
 		 * pmap_kenter_pa and let that routine do the hard work.



CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-02-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Feb 10 12:53:26 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
Start changing this to be ready for device page (XIP).  The basic rule is
device pages don't have struct vm_page * objects.  Instead per-page data
(mainly PV mappings) is rooted from the global struct vm_page_md array.

Convert 2 functions to take struct vm_page_md * instead of struct vm_page *.


To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.211.2.1 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211 src/sys/arch/arm/arm32/pmap.c:1.211.2.1
--- src/sys/arch/arm/arm32/pmap.c:1.211	Sat Jan  2 07:53:29 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Feb 10 12:53:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211 2010/01/02 07:53:29 he Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.1 2010/02/10 12:53:26 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.211 2010/01/02 07:53:29 he Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.1 2010/02/10 12:53:26 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -638,7 +638,7 @@
 static bool		pmap_is_cached(pmap_t);
 static void		pmap_enter_pv(struct vm_page *, struct pv_entry *,
 			pmap_t, vaddr_t, u_int);
-static struct pv_entry *pmap_find_pv(struct vm_page *, pmap_t, vaddr_t);
+static struct pv_entry *pmap_find_pv(struct vm_page_md *, pmap_t, vaddr_t);
 static struct pv_entry *pmap_remove_pv(struct vm_page *, pmap_t, vaddr_t);
 static u_int		pmap_modify_pv(struct vm_page *, pmap_t, vaddr_t,
 			u_int, u_int);
@@ -667,7 +667,7 @@
 static int		pmap_clean_page(struct pv_entry *, bool);
 #endif
 #ifdef PMAP_CACHE_VIPT
-static void		pmap_syncicache_page(struct vm_page *);
+static void		pmap_syncicache_page(struct vm_page_md *, paddr_t);
 enum pmap_flush_op {
 	PMAP_FLUSH_PRIMARY,
 	PMAP_FLUSH_SECONDARY,
@@ -916,7 +916,7 @@
 	 */
 	if (PV_IS_EXEC_P(flags)) {
 		if (!PV_IS_EXEC_P(pg-mdpage.pvh_attrs)) {
-			pmap_syncicache_page(pg);
+			pmap_syncicache_page(pg-mdpage, VM_PAGE_TO_PHYS(pg));
 			PMAPCOUNT(exec_synced_map);
 		}
 		PMAPCOUNT(exec_mappings);
@@ -937,11 +937,11 @@
  * = caller should hold lock on vm_page
  */
 static inline struct pv_entry *
-pmap_find_pv(struct vm_page *pg, pmap_t pm, vaddr_t va)
+pmap_find_pv(struct vm_page_md *md, pmap_t pm, vaddr_t va)
 {
 	struct pv_entry *pv;
 
-	SLIST_FOREACH(pv, pg-mdpage.pvh_list, pv_link) {
+	SLIST_FOREACH(pv, md-pvh_list, pv_link) {
 		if (pm == pv-pv_pmap  va == pv-pv_va)
 			break;
 	}
@@ -1005,7 +1005,7 @@
 	pg-mdpage.pvh_attrs = ~PVF_EXEC;
 	PMAPCOUNT(exec_discarded_unmap);
 } else {
-	pmap_syncicache_page(pg);
+	pmap_syncicache_page(pg-mdpage, VM_PAGE_TO_PHYS(pg));
 	PMAPCOUNT(exec_synced_unmap);
 }
 			}
@@ -1060,7 +1060,7 @@
 	KASSERT((clr_mask  PVF_KENTRY) == 0);
 	KASSERT((set_mask  PVF_KENTRY) == 0);
 
-	if ((npv = pmap_find_pv(pg, pm, va)) == NULL)
+	if ((npv = pmap_find_pv(pg-mdpage, pm, va)) == NULL)
 		return (0);
 
 	NPDEBUG(PDB_PVDUMP,
@@ -1120,7 +1120,7 @@
 	if ((PV_IS_EXEC_P(flags)  !PV_IS_EXEC_P(pg-mdpage.pvh_attrs))
 	|| (PV_IS_EXEC_P(pg-mdpage.pvh_attrs)
 		|| (!(flags  PVF_WRITE)  (oflags  PVF_WRITE {
-		pmap_syncicache_page(pg);
+		pmap_syncicache_page(pg-mdpage, VM_PAGE_TO_PHYS(pg));
 		PMAPCOUNT(exec_synced_remap);
 	}
 	KASSERT((pg-mdpage.pvh_attrs  PVF_DMOD) == 0 || (pg-mdpage.pvh_attrs  (PVF_DIRTY|PVF_NC)));
@@ -2315,7 +2315,7 @@
 	 * If we need to sync the I-cache and we haven't done it yet, do it.
 	 */
 	if (need_syncicache  !did_syncicache) {
-		pmap_syncicache_page(pg);
+		pmap_syncicache_page(pg-mdpage, VM_PAGE_TO_PHYS(pg));
 		PMAPCOUNT(exec_synced_clearbit);
 	}
 	/*
@@ -2427,26 +2427,26 @@
  * right cache alias to make sure we flush the right stuff.
  */
 void
-pmap_syncicache_page(struct vm_page *pg)
+pmap_syncicache_page(struct vm_page_md *md, paddr_t pa)
 {
-	const vsize_t va_offset = pg-mdpage.pvh_attrs  arm_cache_prefer_mask;
+	const vsize_t va_offset = md-pvh_attrs  arm_cache_prefer_mask;
 	pt_entry_t * const ptep = cdst_pte[va_offset  PGSHIFT];
 
-	NPDEBUG(PDB_EXEC, printf(pmap_syncicache_page: pg=%p (attrs=%#x)\n,
-	pg, pg-mdpage.pvh_attrs));
+	NPDEBUG(PDB_EXEC, printf(pmap_syncicache_page: md=%p (attrs=%#x)\n,
+	md, md-pvh_attrs));
 	/*
 	 * No need to clean the page if it's non-cached.
 	 */
-	if (pg-mdpage.pvh_attrs  PVF_NC)
+	if (md-pvh_attrs  PVF_NC)
 		return;
-	KASSERT(arm_cache_prefer_mask == 0 || pg-mdpage.pvh_attrs  PVF_COLORED);
+	KASSERT(arm_cache_prefer_mask == 0 || md-pvh_attrs  PVF_COLORED);
 
 	pmap_tlb_flushID_SE(pmap_kernel(), cdstp + va_offset);
 	/*
 	 * Set up a PTE with the right coloring to flush existing cache lines.
 

CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-02-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Feb 10 13:23:57 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
Convert pmap_remove_pv() / pmap_modify_pv() to take struct vm_page_md *.


To generate a diff of this commit:
cvs rdiff -u -r1.211.2.1 -r1.211.2.2 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.1 src/sys/arch/arm/arm32/pmap.c:1.211.2.2
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.1	Wed Feb 10 12:53:26 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Feb 10 13:23:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.1 2010/02/10 12:53:26 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.2 2010/02/10 13:23:57 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.211.2.1 2010/02/10 12:53:26 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.2 2010/02/10 13:23:57 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -639,8 +639,8 @@
 static void		pmap_enter_pv(struct vm_page *, struct pv_entry *,
 			pmap_t, vaddr_t, u_int);
 static struct pv_entry *pmap_find_pv(struct vm_page_md *, pmap_t, vaddr_t);
-static struct pv_entry *pmap_remove_pv(struct vm_page *, pmap_t, vaddr_t);
-static u_int		pmap_modify_pv(struct vm_page *, pmap_t, vaddr_t,
+static struct pv_entry *pmap_remove_pv(struct vm_page_md *, paddr_t, pmap_t, vaddr_t);
+static u_int		pmap_modify_pv(struct vm_page_md *, paddr_t, pmap_t, vaddr_t,
 			u_int, u_int);
 
 static void		pmap_pinit(pmap_t);
@@ -960,20 +960,20 @@
  * = we return the removed pv
  */
 static struct pv_entry *
-pmap_remove_pv(struct vm_page *pg, pmap_t pm, vaddr_t va)
+pmap_remove_pv(struct vm_page_md *md, paddr_t pa, pmap_t pm, vaddr_t va)
 {
 	struct pv_entry *pv, **prevptr;
 
 	NPDEBUG(PDB_PVDUMP,
-	printf(pmap_remove_pv: pm %p, pg %p, va 0x%08lx\n, pm, pg, va));
+	printf(pmap_remove_pv: pm %p, md %p, va 0x%08lx\n, pm, md, va));
 
-	prevptr = SLIST_FIRST(pg-mdpage.pvh_list); /* prev pv_entry ptr */
+	prevptr = SLIST_FIRST(md-pvh_list); /* prev pv_entry ptr */
 	pv = *prevptr;
 
 	while (pv) {
 		if (pv-pv_pmap == pm  pv-pv_va == va) {	/* match? */
-			NPDEBUG(PDB_PVDUMP, printf(pmap_remove_pv: pm %p, pg 
-			%p, flags 0x%x\n, pm, pg, pv-pv_flags));
+			NPDEBUG(PDB_PVDUMP, printf(pmap_remove_pv: pm %p, md 
+			%p\n, pm, md));
 			if (pv-pv_flags  PVF_WIRED) {
 --pm-pm_stats.wired_count;
 			}
@@ -981,14 +981,14 @@
 			if (pm == pmap_kernel()) {
 PMAPCOUNT(kernel_unmappings);
 if (pv-pv_flags  PVF_WRITE)
-	pg-mdpage.krw_mappings--;
+	md-krw_mappings--;
 else
-	pg-mdpage.kro_mappings--;
+	md-kro_mappings--;
 			} else {
 if (pv-pv_flags  PVF_WRITE)
-	pg-mdpage.urw_mappings--;
+	md-urw_mappings--;
 else
-	pg-mdpage.uro_mappings--;
+	md-uro_mappings--;
 			}
 
 			PMAPCOUNT(unmappings);
@@ -1000,12 +1000,12 @@
 			 * this was the last mapping, discard the contents,
 			 * otherwise sync the i-cache for this page.
 			 */
-			if (PV_IS_EXEC_P(pg-mdpage.pvh_attrs)) {
-if (SLIST_EMPTY(pg-mdpage.pvh_list)) {
-	pg-mdpage.pvh_attrs = ~PVF_EXEC;
+			if (PV_IS_EXEC_P(md-pvh_attrs)) {
+if (SLIST_EMPTY(md-pvh_list)) {
+	md-pvh_attrs = ~PVF_EXEC;
 	PMAPCOUNT(exec_discarded_unmap);
 } else {
-	pmap_syncicache_page(pg-mdpage, VM_PAGE_TO_PHYS(pg));
+	pmap_syncicache_page(md, pa);
 	PMAPCOUNT(exec_synced_unmap);
 }
 			}
@@ -1021,18 +1021,18 @@
 	 * If we no longer have a WRITEABLE KENTRY at the head of list,
 	 * clear the KMOD attribute from the page.
 	 */
-	if (SLIST_FIRST(pg-mdpage.pvh_list) == NULL
-	|| (SLIST_FIRST(pg-mdpage.pvh_list)-pv_flags  PVF_KWRITE) != PVF_KWRITE)
-		pg-mdpage.pvh_attrs = ~PVF_KMOD;
+	if (SLIST_FIRST(md-pvh_list) == NULL
+	|| (SLIST_FIRST(md-pvh_list)-pv_flags  PVF_KWRITE) != PVF_KWRITE)
+		md-pvh_attrs = ~PVF_KMOD;
 
 	/*
 	 * If this was a writeable page and there are no more writeable
 	 * mappings (ignoring KMPAGE), clear the WRITE flag and writeback
 	 * the contents to memory.
 	 */
-	if (pg-mdpage.krw_mappings + pg-mdpage.urw_mappings == 0)
-		pg-mdpage.pvh_attrs = ~PVF_WRITE;
-	KASSERT((pg-mdpage.pvh_attrs  PVF_DMOD) == 0 || (pg-mdpage.pvh_attrs  (PVF_DIRTY|PVF_NC)));
+	if (md-krw_mappings + md-urw_mappings == 0)
+		md-pvh_attrs = ~PVF_WRITE;
+	KASSERT((md-pvh_attrs  PVF_DMOD) == 0 || (md-pvh_attrs  (PVF_DIRTY|PVF_NC)));
 #endif /* PMAP_CACHE_VIPT */
 
 	return(pv);/* return removed pv */
@@ -1051,7 +1051,7 @@
  * Modify a physical-virtual mapping in the pv table
  */
 static u_int
-pmap_modify_pv(struct vm_page *pg, pmap_t pm, vaddr_t va,
+pmap_modify_pv(struct vm_page_md *md, paddr_t pa, pmap_t pm, vaddr_t va,
 u_int clr_mask, u_int set_mask)
 {
 	

CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-02-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Feb 10 13:26:22 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
Convert pmap_enter_pv().


To generate a diff of this commit:
cvs rdiff -u -r1.211.2.2 -r1.211.2.3 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.2 src/sys/arch/arm/arm32/pmap.c:1.211.2.3
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.2	Wed Feb 10 13:23:57 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Feb 10 13:26:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.2 2010/02/10 13:23:57 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.3 2010/02/10 13:26: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.211.2.2 2010/02/10 13:23:57 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.3 2010/02/10 13:26:22 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -636,7 +636,7 @@
 			pt_entry_t **);
 static bool		pmap_is_current(pmap_t);
 static bool		pmap_is_cached(pmap_t);
-static void		pmap_enter_pv(struct vm_page *, struct pv_entry *,
+static void		pmap_enter_pv(struct vm_page_md *, paddr_t, struct pv_entry *,
 			pmap_t, vaddr_t, u_int);
 static struct pv_entry *pmap_find_pv(struct vm_page_md *, pmap_t, vaddr_t);
 static struct pv_entry *pmap_remove_pv(struct vm_page_md *, paddr_t, pmap_t, vaddr_t);
@@ -859,20 +859,20 @@
  * = caller should not adjust pmap's wire_count
  */
 static void
-pmap_enter_pv(struct vm_page *pg, struct pv_entry *pv, pmap_t pm,
+pmap_enter_pv(struct vm_page_md *md, paddr_t pa, struct pv_entry *pv, pmap_t pm,
 vaddr_t va, u_int flags)
 {
 	struct pv_entry **pvp;
 
 	NPDEBUG(PDB_PVDUMP,
-	printf(pmap_enter_pv: pm %p, pg %p, flags 0x%x\n, pm, pg, flags));
+	printf(pmap_enter_pv: pm %p, md %p, flags 0x%x\n, pm, md, flags));
 
 	pv-pv_pmap = pm;
 	pv-pv_va = va;
 	pv-pv_flags = flags;
 
-	simple_lock(pg-mdpage.pvh_slock);	/* lock vm_page */
-	pvp = SLIST_FIRST(pg-mdpage.pvh_list);
+	simple_lock(md-pvh_slock);	/* lock vm_page */
+	pvp = SLIST_FIRST(md-pvh_list);
 #ifdef PMAP_CACHE_VIPT
 	/*
 	 * Insert unmanaged entries, writeable first, at the head of
@@ -888,25 +888,25 @@
 #endif
 	SLIST_NEXT(pv, pv_link) = *pvp;		/* add to ... */
 	*pvp = pv;/* ... locked list */
-	pg-mdpage.pvh_attrs |= flags  (PVF_REF | PVF_MOD);
+	md-pvh_attrs |= flags  (PVF_REF | PVF_MOD);
 #ifdef PMAP_CACHE_VIPT
 	if ((pv-pv_flags  PVF_KWRITE) == PVF_KWRITE)
-		pg-mdpage.pvh_attrs |= PVF_KMOD;
-	if ((pg-mdpage.pvh_attrs  (PVF_DMOD|PVF_NC)) != PVF_NC)
-		pg-mdpage.pvh_attrs |= PVF_DIRTY;
-	KASSERT((pg-mdpage.pvh_attrs  PVF_DMOD) == 0 || (pg-mdpage.pvh_attrs  (PVF_DIRTY|PVF_NC)));
+		md-pvh_attrs |= PVF_KMOD;
+	if ((md-pvh_attrs  (PVF_DMOD|PVF_NC)) != PVF_NC)
+		md-pvh_attrs |= PVF_DIRTY;
+	KASSERT((md-pvh_attrs  PVF_DMOD) == 0 || (md-pvh_attrs  (PVF_DIRTY|PVF_NC)));
 #endif
 	if (pm == pmap_kernel()) {
 		PMAPCOUNT(kernel_mappings);
 		if (flags  PVF_WRITE)
-			pg-mdpage.krw_mappings++;
+			md-krw_mappings++;
 		else
-			pg-mdpage.kro_mappings++;
+			md-kro_mappings++;
 	} else {
 		if (flags  PVF_WRITE)
-			pg-mdpage.urw_mappings++;
+			md-urw_mappings++;
 		else
-			pg-mdpage.uro_mappings++;
+			md-uro_mappings++;
 	}
 
 #ifdef PMAP_CACHE_VIPT
@@ -915,8 +915,8 @@
 	 * for this page, make sure to sync the I-cache.
 	 */
 	if (PV_IS_EXEC_P(flags)) {
-		if (!PV_IS_EXEC_P(pg-mdpage.pvh_attrs)) {
-			pmap_syncicache_page(pg-mdpage, VM_PAGE_TO_PHYS(pg));
+		if (!PV_IS_EXEC_P(md-pvh_attrs)) {
+			pmap_syncicache_page(md, pa);
 			PMAPCOUNT(exec_synced_map);
 		}
 		PMAPCOUNT(exec_mappings);
@@ -924,7 +924,7 @@
 #endif
 
 	PMAPCOUNT(mappings);
-	simple_unlock(pg-mdpage.pvh_slock);	/* unlock, done! */
+	simple_unlock(md-pvh_slock);	/* unlock, done! */
 
 	if (pv-pv_flags  PVF_WIRED)
 		++pm-pm_stats.wired_count;
@@ -2933,7 +2933,7 @@
 return (ENOMEM);
 			}
 
-			pmap_enter_pv(pg, pv, pm, va, nflags);
+			pmap_enter_pv(pg-mdpage, VM_PAGE_TO_PHYS(pg), pv, pm, va, nflags);
 		}
 	} else {
 		/*
@@ -3405,7 +3405,7 @@
 pv = pool_get(pmap_pv_pool, PR_NOWAIT);
 KASSERT(pv != NULL);
 			}
-			pmap_enter_pv(pg, pv, pmap_kernel(), va,
+			pmap_enter_pv(pg-mdpage, VM_PAGE_TO_PHYS(pg), pv, pmap_kernel(), va,
 			PVF_WIRED | PVF_KENTRY
 			| (prot  VM_PROT_WRITE ? PVF_WRITE : 0));
 			if ((prot  VM_PROT_WRITE)



CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-02-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Feb 10 13:58:08 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
Convert pmap_enter() and pmap_vac_me_harder().


To generate a diff of this commit:
cvs rdiff -u -r1.211.2.3 -r1.211.2.4 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.3 src/sys/arch/arm/arm32/pmap.c:1.211.2.4
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.3	Wed Feb 10 13:26:22 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Feb 10 13:58:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.3 2010/02/10 13:26:22 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.4 2010/02/10 13:58:08 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.211.2.3 2010/02/10 13:26:22 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.4 2010/02/10 13:58:08 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -656,10 +656,10 @@
 static int		pmap_l2ptp_ctor(void *, void *, int);
 static int		pmap_l2dtable_ctor(void *, void *, int);
 
-static void		pmap_vac_me_harder(struct vm_page *, pmap_t, vaddr_t);
+static void		pmap_vac_me_harder(struct vm_page_md *, paddr_t, pmap_t, vaddr_t);
 #ifdef PMAP_CACHE_VIVT
-static void		pmap_vac_me_kpmap(struct vm_page *, pmap_t, vaddr_t);
-static void		pmap_vac_me_user(struct vm_page *, pmap_t, vaddr_t);
+static void		pmap_vac_me_kpmap(struct vm_page_md *, paddr_t, pmap_t, vaddr_t);
+static void		pmap_vac_me_user(struct vm_page_md *, paddr_t, pmap_t, vaddr_t);
 #endif
 
 static void		pmap_clearbit(struct vm_page *, u_int);
@@ -673,7 +673,7 @@
 	PMAP_FLUSH_SECONDARY,
 	PMAP_CLEAN_PRIMARY
 };
-static void		pmap_flush_page(struct vm_page *, enum pmap_flush_op);
+static void		pmap_flush_page(struct vm_page_md *, paddr_t, enum pmap_flush_op);
 #endif
 static void		pmap_page_remove(struct vm_page *);
 
@@ -1573,50 +1573,50 @@
 };
 
 static inline int
-pmap_get_vac_flags(const struct vm_page *pg)
+pmap_get_vac_flags(const struct vm_page_md *md)
 {
 	int kidx, uidx;
 
 	kidx = 0;
-	if (pg-mdpage.kro_mappings || pg-mdpage.krw_mappings  1)
+	if (md-kro_mappings || md-krw_mappings  1)
 		kidx |= 1;
-	if (pg-mdpage.krw_mappings)
+	if (md-krw_mappings)
 		kidx |= 2;
 
 	uidx = 0;
-	if (pg-mdpage.uro_mappings || pg-mdpage.urw_mappings  1)
+	if (md-uro_mappings || md-urw_mappings  1)
 		uidx |= 1;
-	if (pg-mdpage.urw_mappings)
+	if (md-urw_mappings)
 		uidx |= 2;
 
 	return (pmap_vac_flags[uidx][kidx]);
 }
 
 static inline void
-pmap_vac_me_harder(struct vm_page *pg, pmap_t pm, vaddr_t va)
+pmap_vac_me_harder(struct vm_page_md *md, paddr_t pa, pmap_t pm, vaddr_t va)
 {
 	int nattr;
 
-	nattr = pmap_get_vac_flags(pg);
+	nattr = pmap_get_vac_flags(md);
 
 	if (nattr  0) {
-		pg-mdpage.pvh_attrs = ~PVF_NC;
+		md-pvh_attrs = ~PVF_NC;
 		return;
 	}
 
-	if (nattr == 0  (pg-mdpage.pvh_attrs  PVF_NC) == 0)
+	if (nattr == 0  (md-pvh_attrs  PVF_NC) == 0)
 		return;
 
 	if (pm == pmap_kernel())
-		pmap_vac_me_kpmap(pg, pm, va);
+		pmap_vac_me_kpmap(md, pa, pm, va);
 	else
-		pmap_vac_me_user(pg, pm, va);
+		pmap_vac_me_user(md, pa, pm, va);
 
-	pg-mdpage.pvh_attrs = (pg-mdpage.pvh_attrs  ~PVF_NC) | nattr;
+	md-pvh_attrs = (md-pvh_attrs  ~PVF_NC) | nattr;
 }
 
 static void
-pmap_vac_me_kpmap(struct vm_page *pg, pmap_t pm, vaddr_t va)
+pmap_vac_me_kpmap(struct vm_page_md *md, paddr_t pa, pmap_t pm, vaddr_t va)
 {
 	u_int u_cacheable, u_entries;
 	struct pv_entry *pv;
@@ -1628,19 +1628,19 @@
 	 * kernel-writable pages.
 	 */
 	u_cacheable = 0;
-	SLIST_FOREACH(pv, pg-mdpage.pvh_list, pv_link) {
+	SLIST_FOREACH(pv, md-pvh_list, pv_link) {
 		if (pv-pv_pmap != pm  (pv-pv_flags  PVF_NC) == 0)
 			u_cacheable++;
 	}
 
-	u_entries = pg-mdpage.urw_mappings + pg-mdpage.uro_mappings;
+	u_entries = md-urw_mappings + md-uro_mappings;
 
 	/* 
 	 * We know we have just been updating a kernel entry, so if
 	 * all user pages are already cacheable, then there is nothing
 	 * further to do.
 	 */
-	if (pg-mdpage.k_mappings == 0  u_cacheable == u_entries)
+	if (md-k_mappings == 0  u_cacheable == u_entries)
 		return;
 
 	if (u_entries) {
@@ -1649,7 +1649,7 @@
 		 * might not be set correctly, call pmap_vac_me_user
 		 * to recalculate the settings.
 		 */
-		SLIST_FOREACH(pv, pg-mdpage.pvh_list, pv_link) {
+		SLIST_FOREACH(pv, md-pvh_list, pv_link) {
 			/* 
 			 * We know kernel mappings will get set
 			 * correctly in other calls.  We also know
@@ -1664,7 +1664,7 @@
 			 * is writable but non-cacheable, then we can
 			 * skip this entry also.  
 			 */
-			if (pg-mdpage.k_mappings 
+			if (md-k_mappings 
 			(pv-pv_flags  (PVF_NC | PVF_WRITE)) ==
 			(PVF_NC | PVF_WRITE))
 continue;
@@ -1674,7 +1674,7 @@
 			 * entries and the page is already 
 			

CVS commit: [uebayasi-xip] src/sys/arch/arm

2010-02-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Feb 10 14:20:23 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: mem.c
src/sys/arch/arm/include/arm32 [uebayasi-xip]: pmap.h

Log Message:
Missing bits of pmap_is_page_colored_p() conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.6.1 src/sys/arch/arm/arm32/mem.c
cvs rdiff -u -r1.94 -r1.94.2.1 src/sys/arch/arm/include/arm32/pmap.h

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

Modified files:

Index: src/sys/arch/arm/arm32/mem.c
diff -u src/sys/arch/arm/arm32/mem.c:1.26 src/sys/arch/arm/arm32/mem.c:1.26.6.1
--- src/sys/arch/arm/arm32/mem.c:1.26	Wed Nov 19 06:24:04 2008
+++ src/sys/arch/arm/arm32/mem.c	Wed Feb 10 14:20:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.26 2008/11/19 06:24:04 matt Exp $	*/
+/*	$NetBSD: mem.c,v 1.26.6.1 2010/02/10 14:20:23 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -76,7 +76,7 @@
 #include opt_compat_netbsd.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.26 2008/11/19 06:24:04 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mem.c,v 1.26.6.1 2010/02/10 14:20:23 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -144,7 +144,7 @@
 			{
 struct vm_page *pg;
 pg = PHYS_TO_VM_PAGE(trunc_page(v));
-if (pg != NULL  pmap_is_page_colored_p(pg))
+if (pg != NULL  pmap_is_page_colored_p(pg-mdpage))
 	o = pg-mdpage.pvh_attrs;
 else
 	o = v;

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.94 src/sys/arch/arm/include/arm32/pmap.h:1.94.2.1
--- src/sys/arch/arm/include/arm32/pmap.h:1.94	Sun Dec 27 05:14:56 2009
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Feb 10 14:20:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.94 2009/12/27 05:14:56 uebayasi Exp $	*/
+/*	$NetBSD: pmap.h,v 1.94.2.1 2010/02/10 14:20:23 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -272,8 +272,8 @@
 	(((pg)-mdpage.pvh_attrs  PVF_MOD) != 0)
 #define	pmap_is_referenced(pg)	\
 	(((pg)-mdpage.pvh_attrs  PVF_REF) != 0)
-#define	pmap_is_page_colored_p(pg)	\
-	(((pg)-mdpage.pvh_attrs  PVF_COLORED) != 0)
+#define	pmap_is_page_colored_p(md)	\
+	(((md)-pvh_attrs  PVF_COLORED) != 0)
 
 #define	pmap_copy(dp, sp, da, l, sa)	/* nothing */
 



CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-02-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Feb 10 15:37:48 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
Replace all remaining pg-mdpage references with VM_PAGE_TO_MD().  Now struct
vm_page * is fully opaque.


To generate a diff of this commit:
cvs rdiff -u -r1.211.2.5 -r1.211.2.6 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.5 src/sys/arch/arm/arm32/pmap.c:1.211.2.6
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.5	Wed Feb 10 14:18:30 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Feb 10 15:37:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.5 2010/02/10 14:18:30 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.6 2010/02/10 15:37:48 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.211.2.5 2010/02/10 14:18:30 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.6 2010/02/10 15:37:48 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -2122,6 +2122,7 @@
 static void
 pmap_clearbit(struct vm_page *pg, u_int maskbits)
 {
+	struct vm_page_md *md = VM_PAGE_TO_MD(pg);
 	struct l2_bucket *l2b;
 	struct pv_entry *pv;
 	pt_entry_t *ptep, npte, opte;
@@ -2129,7 +2130,7 @@
 	vaddr_t va;
 	u_int oflags;
 #ifdef PMAP_CACHE_VIPT
-	const bool want_syncicache = PV_IS_EXEC_P(pg-mdpage.pvh_attrs);
+	const bool want_syncicache = PV_IS_EXEC_P(md-pvh_attrs);
 	bool need_syncicache = false;
 	bool did_syncicache = false;
 	bool need_vac_me_harder = false;
@@ -2140,7 +2141,7 @@
 	pg, VM_PAGE_TO_PHYS(pg), maskbits));
 
 	PMAP_HEAD_TO_MAP_LOCK();
-	simple_lock(pg-mdpage.pvh_slock);
+	simple_lock(md-pvh_slock);
 
 #ifdef PMAP_CACHE_VIPT
 	/*
@@ -2148,25 +2149,25 @@
 	 * then we know we definitely need to sync or discard it.
 	 */
 	if (want_syncicache)
-		need_syncicache = pg-mdpage.pvh_attrs  PVF_MOD;
+		need_syncicache = md-pvh_attrs  PVF_MOD;
 #endif
 	/*
 	 * Clear saved attributes (modify, reference)
 	 */
-	pg-mdpage.pvh_attrs = ~(maskbits  (PVF_MOD | PVF_REF));
+	md-pvh_attrs = ~(maskbits  (PVF_MOD | PVF_REF));
 
-	if (SLIST_EMPTY(pg-mdpage.pvh_list)) {
+	if (SLIST_EMPTY(md-pvh_list)) {
 #ifdef PMAP_CACHE_VIPT
 		if (need_syncicache) {
 			/*
 			 * No one has it mapped, so just discard it.  The next
 			 * exec remapping will cause it to be synced.
 			 */
-			pg-mdpage.pvh_attrs = ~PVF_EXEC;
+			md-pvh_attrs = ~PVF_EXEC;
 			PMAPCOUNT(exec_discarded_clearbit);
 		}
 #endif
-		simple_unlock(pg-mdpage.pvh_slock);
+		simple_unlock(md-pvh_slock);
 		PMAP_HEAD_TO_MAP_UNLOCK();
 		return;
 	}
@@ -2174,7 +2175,7 @@
 	/*
 	 * Loop over all current mappings setting/clearing as appropos
 	 */
-	SLIST_FOREACH(pv, pg-mdpage.pvh_list, pv_link) {
+	SLIST_FOREACH(pv, md-pvh_list, pv_link) {
 		va = pv-pv_va;
 		pm = pv-pv_pmap;
 		oflags = pv-pv_flags;
@@ -2244,15 +2245,15 @@
  * Keep alias accounting up to date
  */
 if (pv-pv_pmap == pmap_kernel()) {
-	pg-mdpage.krw_mappings--;
-	pg-mdpage.kro_mappings++;
+	md-krw_mappings--;
+	md-kro_mappings++;
 } else {
-	pg-mdpage.urw_mappings--;
-	pg-mdpage.uro_mappings++;
+	md-urw_mappings--;
+	md-uro_mappings++;
 }
 #ifdef PMAP_CACHE_VIPT
-if (pg-mdpage.urw_mappings + pg-mdpage.krw_mappings == 0)
-	pg-mdpage.pvh_attrs = ~PVF_WRITE;
+if (md-urw_mappings + md-krw_mappings == 0)
+	md-pvh_attrs = ~PVF_WRITE;
 if (want_syncicache)
 	need_syncicache = true;
 need_vac_me_harder = true;
@@ -2315,7 +2316,7 @@
 	 * If we need to sync the I-cache and we haven't done it yet, do it.
 	 */
 	if (need_syncicache  !did_syncicache) {
-		pmap_syncicache_page(pg-mdpage, VM_PAGE_TO_PHYS(pg));
+		pmap_syncicache_page(md, VM_PAGE_TO_PHYS(pg));
 		PMAPCOUNT(exec_synced_clearbit);
 	}
 	/*
@@ -2324,12 +2325,12 @@
 	 * this as a page deletion.
 	 */
 	if (need_vac_me_harder) {
-		if (pg-mdpage.pvh_attrs  PVF_NC)
-			pmap_vac_me_harder(pg-mdpage, VM_PAGE_TO_PHYS(pg), NULL, 0);
+		if (md-pvh_attrs  PVF_NC)
+			pmap_vac_me_harder(md, VM_PAGE_TO_PHYS(pg), NULL, 0);
 	}
 #endif
 
-	simple_unlock(pg-mdpage.pvh_slock);
+	simple_unlock(md-pvh_slock);
 	PMAP_HEAD_TO_MAP_UNLOCK();
 }
 
@@ -2567,6 +2568,7 @@
 static void
 pmap_page_remove(struct vm_page *pg)
 {
+	struct vm_page_md *md = VM_PAGE_TO_MD(pg);
 	struct l2_bucket *l2b;
 	struct pv_entry *pv, *npv, **pvp;
 	pmap_t pm;
@@ -2579,35 +2581,35 @@
 	VM_PAGE_TO_PHYS(pg)));
 
 	PMAP_HEAD_TO_MAP_LOCK();
-	simple_lock(pg-mdpage.pvh_slock);
+	simple_lock(md-pvh_slock);
 
-	pv = SLIST_FIRST(pg-mdpage.pvh_list);
+	pv = SLIST_FIRST(md-pvh_list);
 	if (pv == NULL) {
 #ifdef PMAP_CACHE_VIPT
 		/*
 		 * We *know* the page contents are about to be replaced.
 		 * Discard the exec contents
 		 */
-		if 

CVS commit: [uebayasi-xip] src/sys/arch/arm/arm32

2010-02-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Feb 10 15:48:28 UTC 2010

Modified Files:
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c

Log Message:
Adjust previous.


To generate a diff of this commit:
cvs rdiff -u -r1.211.2.6 -r1.211.2.7 src/sys/arch/arm/arm32/pmap.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/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.6 src/sys/arch/arm/arm32/pmap.c:1.211.2.7
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.6	Wed Feb 10 15:37:48 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Feb 10 15:48:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.6 2010/02/10 15:37:48 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.7 2010/02/10 15:48:28 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.211.2.6 2010/02/10 15:37:48 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.211.2.7 2010/02/10 15:48:28 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -2569,6 +2569,7 @@
 pmap_page_remove(struct vm_page *pg)
 {
 	struct vm_page_md *md = VM_PAGE_TO_MD(pg);
+	paddr_t pa = VM_PAGE_TO_PHYS(pg);
 	struct l2_bucket *l2b;
 	struct pv_entry *pv, *npv, **pvp;
 	pmap_t pm;
@@ -2578,7 +2579,7 @@
 
 	NPDEBUG(PDB_FOLLOW,
 	printf(pmap_page_remove: pg %p (0x%08lx)\n, pg,
-	VM_PAGE_TO_PHYS(pg)));
+	pa));
 
 	PMAP_HEAD_TO_MAP_LOCK();
 	simple_lock(md-pvh_slock);
@@ -2681,7 +2682,7 @@
 		if (pv == NULL) {
 			*pvp = NULL;
 			if (!SLIST_EMPTY(md-pvh_list))
-pmap_vac_me_harder(md, VM_PAGE_TO_PHYS(pg), pm, 0);
+pmap_vac_me_harder(md, pa, pm, 0);
 		}
 		pmap_release_pmap_lock(pm);
 	}
@@ -3471,8 +3472,8 @@
 		while (va  next_bucket) {
 			opte = *ptep;
 			opg = PHYS_TO_VM_PAGE(l2pte_pa(opte));
-			struct vm_page_md *omd = VM_PAGE_TO_MD(opg);
 			if (opg) {
+struct vm_page_md *omd = VM_PAGE_TO_MD(opg);
 if (omd-pvh_attrs  PVF_KMPAGE) {
 	simple_lock(omd-pvh_slock);
 	KASSERT(omd-urw_mappings == 0);
@@ -3640,8 +3641,8 @@
 *ptep = pte;
 PTE_SYNC(ptep);
 
-struct vm_page_md *md = VM_PAGE_TO_MD(pg);
 if (pg != NULL) {
+	struct vm_page_md *md = VM_PAGE_TO_MD(pg);
 	simple_lock(md-pvh_slock);
 	f = pmap_modify_pv(md, VM_PAGE_TO_PHYS(pg), pm, sva,
 	clr_mask, 0);