CVS commit: src/sys/uvm

2010-11-12 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov 12 12:02:35 UTC 2010

Modified Files:
src/sys/uvm: uvm_extern.h

Log Message:
Put back uvm_page.h for now.  Sorry for mess.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/uvm/uvm_extern.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.164 src/sys/uvm/uvm_extern.h:1.165
--- src/sys/uvm/uvm_extern.h:1.164	Fri Nov 12 02:36:02 2010
+++ src/sys/uvm/uvm_extern.h	Fri Nov 12 12:02:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.164 2010/11/12 02:36:02 uebayasi Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.165 2010/11/12 12:02:35 uebayasi Exp $	*/
 
 /*
  *
@@ -477,6 +477,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 



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

2010-11-12 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov 12 08:13:40 UTC 2010

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

Log Message:
Move MD member in struct vm_physseg to the tail, in case this struct
can be shared among architectures with only difference of the MD
part.


To generate a diff of this commit:
cvs rdiff -u -r1.59.2.34 -r1.59.2.35 src/sys/uvm/uvm_page.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/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.59.2.34 src/sys/uvm/uvm_page.h:1.59.2.35
--- src/sys/uvm/uvm_page.h:1.59.2.34	Wed Nov 10 08:59:12 2010
+++ src/sys/uvm/uvm_page.h	Fri Nov 12 08:13:40 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.59.2.34 2010/11/10 08:59:12 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.59.2.35 2010/11/12 08:13:40 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -241,15 +241,15 @@
 	int	free_list;		/* which free list they belong on */
 	struct	vm_page *pgs;		/* vm_page structures (from start) */
 	struct	vm_page *endpg;		/* vm_page structure for end */
-
-#ifdef __HAVE_PMAP_PHYSSEG
-	struct	pmap_physseg pmseg;	/* pmap specific (MD) data */
-#endif
 	SIMPLEQ_ENTRY(vm_physseg) list;
 
 	/* device properties */
 	int	prot;			/* protection of device region */
 	int	flags;			/* XXXUEBS BUS_SPACE_MAP_* */
+
+#ifdef __HAVE_PMAP_PHYSSEG
+	struct	pmap_physseg pmseg;	/* pmap specific (MD) data */
+#endif
 };
 
 #ifdef _KERNEL



CVS commit: src/sys

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov 12 07:59:28 UTC 2010

Modified Files:
src/sys/arch/alpha/alpha: pmap.c
src/sys/arch/arm/arm32: mem.c pmap.c
src/sys/arch/hppa/hppa: pmap.c
src/sys/arch/ia64/ia64: pmap.c
src/sys/arch/mips/mips: pmap.c
src/sys/arch/powerpc/oea: pmap.c
src/sys/arch/powerpc/powerpc: pmap_subr.c
src/sys/arch/sh3/sh3: pmap.c
src/sys/arch/sparc64/sparc64: pmap.c
src/sys/uvm: uvm_page.h

Log Message:
Put VM_PAGE_TO_MD() definition in one place.  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/arm32/mem.c
cvs rdiff -u -r1.218 -r1.219 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/hppa/hppa/pmap.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/ia64/ia64/pmap.c
cvs rdiff -u -r1.191 -r1.192 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/powerpc/pmap_subr.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/sh3/sh3/pmap.c
cvs rdiff -u -r1.268 -r1.269 src/sys/arch/sparc64/sparc64/pmap.c
cvs rdiff -u -r1.65 -r1.66 src/sys/uvm/uvm_page.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.254 src/sys/arch/alpha/alpha/pmap.c:1.255
--- src/sys/arch/alpha/alpha/pmap.c:1.254	Wed Nov 10 09:27:21 2010
+++ src/sys/arch/alpha/alpha/pmap.c	Fri Nov 12 07:59:25 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.254 2010/11/10 09:27:21 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.255 2010/11/12 07:59:25 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.254 2010/11/10 09:27:21 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.255 2010/11/12 07:59:25 uebayasi Exp $");
 
 #include 
 #include 
@@ -159,8 +159,6 @@
 #include 
 #endif
 
-#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
-
 #ifdef DEBUG
 #define	PDB_FOLLOW	0x0001
 #define	PDB_INIT	0x0002

Index: src/sys/arch/arm/arm32/mem.c
diff -u src/sys/arch/arm/arm32/mem.c:1.29 src/sys/arch/arm/arm32/mem.c:1.30
--- src/sys/arch/arm/arm32/mem.c:1.29	Sat Nov  6 11:46:00 2010
+++ src/sys/arch/arm/arm32/mem.c	Fri Nov 12 07:59:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.29 2010/11/06 11:46:00 uebayasi Exp $	*/
+/*	$NetBSD: mem.c,v 1.30 2010/11/12 07:59:25 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -76,7 +76,7 @@
 #include "opt_compat_netbsd.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.29 2010/11/06 11:46:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.30 2010/11/12 07:59:25 uebayasi Exp $");
 
 #include 
 #include 
@@ -92,8 +92,6 @@
 
 #include 
 
-#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
-
 extern vaddr_t memhook;			/* in pmap.c (poor name!) */
 extern kmutex_t memlock;		/* in pmap.c */
 extern void *zeropage;			/* in pmap.c */

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.218 src/sys/arch/arm/arm32/pmap.c:1.219
--- src/sys/arch/arm/arm32/pmap.c:1.218	Wed Nov 10 09:27:22 2010
+++ src/sys/arch/arm/arm32/pmap.c	Fri Nov 12 07:59:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.218 2010/11/10 09:27:22 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.219 2010/11/12 07:59:25 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,9 +211,7 @@
 #include 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.218 2010/11/10 09:27:22 uebayasi Exp $");
-
-#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.219 2010/11/12 07:59:25 uebayasi Exp $");
 
 #ifdef PMAP_DEBUG
 

Index: src/sys/arch/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.77 src/sys/arch/hppa/hppa/pmap.c:1.78
--- src/sys/arch/hppa/hppa/pmap.c:1.77	Sat Oct 30 17:20:43 2010
+++ src/sys/arch/hppa/hppa/pmap.c	Fri Nov 12 07:59:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.77 2010/10/30 17:20:43 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.78 2010/11/12 07:59:26 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2010/10/30 17:20:43 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.78 2010/11/12 07:59:26 uebayasi Exp $");
 
 #include "opt_cputype.h"
 
@@ -91,8 +91,6 @@
 #include 
 #endif
 
-#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
-
 #ifdef PMAPDEBUG
 
 #define	static	/**/

Index: src/sys/arch/ia64/ia64/pmap.c
diff -u src/sys/arch/ia64/ia64/pmap.c:1.26 src/sys/arch/ia64/ia64/pmap.c:1.27
--- src/sys/arch/ia64/ia64/pmap.c:1.26	Wed Nov 10 09:27:22 2010
+++ src/sys/arch/ia64/ia64/pmap.c	Fri Nov 12 07:59:26 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.26 

CVS commit: src/sys

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov 12 05:23:41 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: vm.c
src/sys/uvm: uvm_page.c uvm_page.h

Log Message:
Abstraction fix; move physical address -> per-page metadata (struct
vm_page *) "reverse" lookup code from uvm_page.h to uvm_page.c, to
help migration to not do that.

Likewise move per-page metadata (struct vm_page *) -> physical
address "forward" conversion code into *.c too.  This is called
only low-layer VM and MD code.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/rump/librump/rumpkern/vm.c
cvs rdiff -u -r1.162 -r1.163 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.64 -r1.65 src/sys/uvm/uvm_page.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/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.98 src/sys/rump/librump/rumpkern/vm.c:1.99
--- src/sys/rump/librump/rumpkern/vm.c:1.98	Wed Oct 27 20:44:49 2010
+++ src/sys/rump/librump/rumpkern/vm.c	Fri Nov 12 05:23:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.98 2010/10/27 20:44:49 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.99 2010/11/12 05:23:41 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.98 2010/10/27 20:44:49 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.99 2010/11/12 05:23:41 uebayasi Exp $");
 
 #include 
 #include 
@@ -799,6 +799,24 @@
 }
 
 /*
+ * Physical address accessors.
+ */
+
+struct vm_page *
+uvm_phys_to_vm_page(paddr_t pa)
+{
+
+	return NULL;
+}
+
+paddr_t
+uvm_vm_page_to_phys(const struct vm_page *pg)
+{
+
+	return 0;
+}
+
+/*
  * Routines related to the Page Baroness.
  */
 

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.162 src/sys/uvm/uvm_page.c:1.163
--- src/sys/uvm/uvm_page.c:1.162	Fri Nov 12 03:21:04 2010
+++ src/sys/uvm/uvm_page.c	Fri Nov 12 05:23:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.162 2010/11/12 03:21:04 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.163 2010/11/12 05:23:41 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.162 2010/11/12 03:21:04 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.163 2010/11/12 05:23:41 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -978,6 +978,30 @@
 #endif
 
 /*
+ * PHYS_TO_VM_PAGE: find vm_page for a PA.   used by MI code to get vm_pages
+ * back from an I/O mapping (ugh!).   used in some MD code as well.
+ */
+struct vm_page *
+uvm_phys_to_vm_page(paddr_t pa)
+{
+	paddr_t pf = atop(pa);
+	int	off;
+	int	psi;
+
+	psi = vm_physseg_find(pf, &off);
+	if (psi != -1)
+		return(&VM_PHYSMEM_PTR(psi)->pgs[off]);
+	return(NULL);
+}
+
+paddr_t
+uvm_vm_page_to_phys(const struct vm_page *pg)
+{
+
+	return pg->phys_addr;
+}
+
+/*
  * uvm_page_recolor: Recolor the pages if the new bucket count is
  * larger than the old one.
  */

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.64 src/sys/uvm/uvm_page.h:1.65
--- src/sys/uvm/uvm_page.h:1.64	Fri Nov 12 03:21:04 2010
+++ src/sys/uvm/uvm_page.h	Fri Nov 12 05:23:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.64 2010/11/12 03:21:04 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.65 2010/11/12 05:23:41 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -294,8 +294,9 @@
 
 int uvm_page_lookup_freelist(struct vm_page *);
 
-static struct vm_page *PHYS_TO_VM_PAGE(paddr_t);
 int vm_physseg_find(paddr_t, int *);
+struct vm_page *uvm_phys_to_vm_page(paddr_t);
+paddr_t uvm_vm_page_to_phys(const struct vm_page *);
 
 /*
  * macros
@@ -303,7 +304,7 @@
 
 #define UVM_PAGE_TREE_PENALTY	4	/* XXX: a guess */
 
-#define VM_PAGE_TO_PHYS(entry)	((entry)->phys_addr)
+#define VM_PAGE_TO_PHYS(entry)	uvm_vm_page_to_phys(entry)
 
 /*
  * Compute the page color bucket for a given page.
@@ -311,23 +312,7 @@
 #define	VM_PGCOLOR_BUCKET(pg) \
 	(atop(VM_PAGE_TO_PHYS((pg))) & uvmexp.colormask)
 
-
-/*
- * PHYS_TO_VM_PAGE: find vm_page for a PA.   used by MI code to get vm_pages
- * back from an I/O mapping (ugh!).   used in some MD code as well.
- */
-static inline struct vm_page *
-PHYS_TO_VM_PAGE(paddr_t pa)
-{
-	paddr_t pf = atop(pa);
-	int	off;
-	int	psi;
-
-	psi = vm_physseg_find(pf, &off);
-	if (psi != -1)
-		return(&vm_physmem[psi].pgs[off]);
-	return(NULL);
-}
+#define	PHYS_TO_VM_PAGE(pa)	uvm_phys_to_vm_page(pa)
 
 #define VM_PAGE_IS_FREE(entry)  ((entry)->pqflags & PQ_FREE)
 #define	VM_FREE_PAGE_TO_CPU(pg)	((struct uvm_cpu *)((uintptr_t)pg->offset))



CVS commit: src/lib/libkvm

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov 12 04:52:09 UTC 2010

Modified Files:
src/lib/libkvm: kvm_proc.c

Log Message:
Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/lib/libkvm/kvm_proc.c

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

Modified files:

Index: src/lib/libkvm/kvm_proc.c
diff -u src/lib/libkvm/kvm_proc.c:1.87 src/lib/libkvm/kvm_proc.c:1.88
--- src/lib/libkvm/kvm_proc.c:1.87	Sun Sep 26 22:28:05 2010
+++ src/lib/libkvm/kvm_proc.c	Fri Nov 12 04:52:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kvm_proc.c,v 1.87 2010/09/26 22:28:05 jym Exp $	*/
+/*	$NetBSD: kvm_proc.c,v 1.88 2010/11/12 04:52:08 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_proc.c	8.3 (Berkeley) 9/23/93";
 #else
-__RCSID("$NetBSD: kvm_proc.c,v 1.87 2010/09/26 22:28:05 jym Exp $");
+__RCSID("$NetBSD: kvm_proc.c,v 1.88 2010/11/12 04:52:08 uebayasi Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -102,6 +102,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



CVS commit: src/sys/uvm

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov 12 03:21:04 UTC 2010

Modified Files:
src/sys/uvm: uvm_page.c uvm_page.h

Log Message:
Abstraction fix; move physical address -> physical segment "reverse"
lookup code from uvm_page.h to uvm_page.c.

This code is used by some pmaps to lookup per-page state (PV) from
per-segment metadata (struct vm_physseg).  This is not needed if
UVM looks up physical segment once in fault handler, then directly
passes it to pmap.  This change helps transition to that model.

The only users of vm_physseg_find() are pmap_motorola.c and
powerpc/ibm4xx/pmap.c.

Tested By:  Compiling and running powerpc/ibm4xx/pmap.c
(evbppc/conf/OPENBLOCKS266)


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.63 -r1.64 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.161 src/sys/uvm/uvm_page.c:1.162
--- src/sys/uvm/uvm_page.c:1.161	Thu Nov 11 15:59:27 2010
+++ src/sys/uvm/uvm_page.c	Fri Nov 12 03:21:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.161 2010/11/11 15:59:27 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.162 2010/11/12 03:21:04 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.161 2010/11/11 15:59:27 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.162 2010/11/12 03:21:04 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -872,6 +872,112 @@
 }
 
 /*
+ * when VM_PHYSSEG_MAX is 1, we can simplify these functions
+ */
+
+#if VM_PHYSSEG_MAX == 1
+static inline int vm_physseg_find_contig(struct vm_physseg *, int, paddr_t, int *);
+#elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH)
+static inline int vm_physseg_find_bsearch(struct vm_physseg *, int, paddr_t, int *);
+#else
+static inline int vm_physseg_find_linear(struct vm_physseg *, int, paddr_t, int *);
+#endif
+
+/*
+ * vm_physseg_find: find vm_physseg structure that belongs to a PA
+ */
+int
+vm_physseg_find(paddr_t pframe, int *offp)
+{
+
+#if VM_PHYSSEG_MAX == 1
+	return vm_physseg_find_contig(vm_physmem, vm_nphysseg, pframe, offp);
+#elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH)
+	return vm_physseg_find_bsearch(vm_physmem, vm_nphysseg, pframe, offp);
+#else
+	return vm_physseg_find_linear(vm_physmem, vm_nphysseg, pframe, offp);
+#endif
+}
+
+#if VM_PHYSSEG_MAX == 1
+static inline int
+vm_physseg_find_contig(struct vm_physseg *segs, int nsegs, paddr_t pframe, int *offp)
+{
+
+	/* 'contig' case */
+	if (pframe >= segs[0].start && pframe < segs[0].end) {
+		if (offp)
+			*offp = pframe - segs[0].start;
+		return(0);
+	}
+	return(-1);
+}
+
+#elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH)
+
+static inline int
+vm_physseg_find_bsearch(struct vm_physseg *segs, int nsegs, paddr_t pframe, int *offp)
+{
+	/* binary search for it */
+	u_int	start, len, try;
+
+	/*
+	 * if try is too large (thus target is less than try) we reduce
+	 * the length to trunc(len/2) [i.e. everything smaller than "try"]
+	 *
+	 * if the try is too small (thus target is greater than try) then
+	 * we set the new start to be (try + 1).   this means we need to
+	 * reduce the length to (round(len/2) - 1).
+	 *
+	 * note "adjust" below which takes advantage of the fact that
+	 *  (round(len/2) - 1) == trunc((len - 1) / 2)
+	 * for any value of len we may have
+	 */
+
+	for (start = 0, len = nsegs ; len != 0 ; len = len / 2) {
+		try = start + (len / 2);	/* try in the middle */
+
+		/* start past our try? */
+		if (pframe >= segs[try].start) {
+			/* was try correct? */
+			if (pframe < segs[try].end) {
+if (offp)
+	*offp = pframe - segs[try].start;
+return(try);/* got it */
+			}
+			start = try + 1;	/* next time, start here */
+			len--;			/* "adjust" */
+		} else {
+			/*
+			 * pframe before try, just reduce length of
+			 * region, done in "for" loop
+			 */
+		}
+	}
+	return(-1);
+}
+
+#else
+
+static inline int
+vm_physseg_find_linear(struct vm_physseg *segs, int nsegs, paddr_t pframe, int *offp)
+{
+	/* linear search for it */
+	int	lcv;
+
+	for (lcv = 0; lcv < nsegs; lcv++) {
+		if (pframe >= segs[lcv].start &&
+		pframe < segs[lcv].end) {
+			if (offp)
+*offp = pframe - segs[lcv].start;
+			return(lcv);		   /* got it */
+		}
+	}
+	return(-1);
+}
+#endif
+
+/*
  * uvm_page_recolor: Recolor the pages if the new bucket count is
  * larger than the old one.
  */

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.63 src/sys/uvm/uvm_page.h:1.64
--- src/sys/uvm/uvm_page.h:1.63	Wed Nov 10 09:27:21 2010
+++ src/sys/uvm/uvm_page.h	Fri Nov 12 03:21:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.63 2010/11/10 09:27:21 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.64 2010/11/12 03:21:04 uebayasi Exp $	*/
 
 /*
  * Copyright (c)

CVS commit: src/sys/uvm

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov 12 02:36:02 UTC 2010

Modified Files:
src/sys/uvm: uvm_extern.h

Log Message:
Abstraction fix; don't pull in physical segment/page definitions
in UVM external API, uvm_extern.h.  Because most users care only
virtual memory.

Device drivers use bus_dma(9) to manage physical memory.  Device
drivers pull in bus_dma(9) API, bus_dma.h.  bus_dma(9) implementations
pull in UVM internal API, uvm.h.

Tested By:  Compiling i386 ALL kernel


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/uvm/uvm_extern.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.163 src/sys/uvm/uvm_extern.h:1.164
--- src/sys/uvm/uvm_extern.h:1.163	Fri Apr 16 03:21:49 2010
+++ src/sys/uvm/uvm_extern.h	Fri Nov 12 02:36:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.163 2010/04/16 03:21:49 rmind Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.164 2010/11/12 02:36:02 uebayasi Exp $	*/
 
 /*
  *
@@ -476,7 +476,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



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

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov 11 16:22:25 UTC 2010

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

Log Message:
s/managed device page/device page/


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

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.61 src/sys/uvm/uvm_page.c:1.153.2.62
--- src/sys/uvm/uvm_page.c:1.153.2.61	Thu Nov 11 16:20:28 2010
+++ src/sys/uvm/uvm_page.c	Thu Nov 11 16:22:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.61 2010/11/11 16:20:28 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.62 2010/11/11 16:22:25 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.61 2010/11/11 16:20:28 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.62 2010/11/11 16:22:25 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -843,7 +843,7 @@
 	seg->flags = flags;
 
 	/*
-	 * Managed device page metadata initialization
+	 * Device page metadata initialization
 	 * - Pages are not used for general purpose memory.
 	 *   - Pages are not put in free lists.
 	 * - Pages are not paged out ("fixed").



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

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov 11 16:20:28 UTC 2010

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

Log Message:
Use vm_physseg accessors.  Remove confusing comments.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.60 -r1.153.2.61 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.60 src/sys/uvm/uvm_page.c:1.153.2.61
--- src/sys/uvm/uvm_page.c:1.153.2.60	Thu Nov  4 11:57:49 2010
+++ src/sys/uvm/uvm_page.c	Thu Nov 11 16:20:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.60 2010/11/04 11:57:49 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.61 2010/11/11 16:20:28 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.60 2010/11/04 11:57:49 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.61 2010/11/11 16:20:28 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -433,7 +433,7 @@
 
 	freepages = 0;
 	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) {
-		seg = vm_physmem_ptrs[lcv];
+		seg = VM_PHYSMEM_PTR(lcv);
 		freepages += (seg->end - seg->start);
 	}
 
@@ -480,7 +480,7 @@
 	 */
 
 	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) {
-		seg = vm_physmem_ptrs[lcv];
+		seg = VM_PHYSMEM_PTR(lcv);
 		n = seg->end - seg->start;
 
 		/* set up page array pointers */
@@ -490,7 +490,7 @@
 		seg->endpg = seg->pgs + n;
 
 		/* init and free vm_pages (we've already zeroed them) */
-		paddr = ctob(vm_physmem_ptrs[lcv]->start);
+		paddr = ctob(seg->start);
 		for (i = 0 ; i < n ; i++, paddr += PAGE_SIZE) {
 			seg->pgs[i].phys_addr = paddr;
 #ifdef __HAVE_VM_PAGE_MD
@@ -684,7 +684,7 @@
 	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++)
 #endif
 	{
-		seg = vm_physmem_ptrs[lcv];
+		seg = VM_PHYSMEM_PTR(lcv);
 
 		if (uvm.page_init_done == true)
 			panic("uvm_page_physget: called _after_ bootstrap");
@@ -704,7 +704,7 @@
 panic("uvm_page_physget: out of memory!");
 vm_nphysmem--;
 for (x = lcv ; x < vm_nphysmem ; x++)
-	vm_physmem_ptrs[x] = vm_physmem_ptrs[x+1];
+	VM_PHYSMEM_PTR_SWAP(x, x + 1);
 			}
 			return (true);
 		}
@@ -721,7 +721,7 @@
 panic("uvm_page_physget: out of memory!");
 vm_nphysmem--;
 for (x = lcv ; x < vm_nphysmem ; x++)
-	vm_physmem_ptrs[x] = vm_physmem_ptrs[x+1];
+	VM_PHYSMEM_PTR_SWAP(x, x + 1);
 			}
 			return (true);
 		}
@@ -734,7 +734,7 @@
 	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++)
 #endif
 	{
-		seg = vm_physmem_ptrs[lcv];
+		seg = VM_PHYSMEM_PTR(lcv);
 
 		/* any room in this bank? */
 		if (seg->avail_start >= seg->avail_end)
@@ -751,7 +751,7 @@
 panic("uvm_page_physget: out of memory!");
 			vm_nphysmem--;
 			for (x = lcv ; x < vm_nphysmem ; x++)
-vm_physmem_ptrs[x] = vm_physmem_ptrs[x+1];
+VM_PHYSMEM_PTR_SWAP(x, x + 1);
 		}
 		return (true);
 	}
@@ -801,14 +801,15 @@
 	 * check to see if this is a "preload" (i.e. uvm_page_init hasn't been
 	 * called yet, so malloc is not available).
 	 */
-	for (lcv = 0; lcv < vm_nphysmem; lcv++) {
-		if (vm_physmem_ptrs[lcv]->pgs)
+
+	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) {
+		if (VM_PHYSMEM_PTR(lcv)->pgs)
 			break;
 	}
 	if (lcv == vm_nphysmem) {
 		seg->pgs = NULL;
 		seg->endpg = NULL;
-		seg->free_list = free_list;	/* XXX */
+		seg->free_list = free_list;
 	} else {
 		panic("uvm_page_physload: "
 		"tried to add RAM after uvm_page_init");
@@ -824,8 +825,6 @@
 
 	panic("memory unload is not supported yet");
 
-	/* XXX */
-
 	uvm_physseg_free(&vm_physmem_freelist, vm_physmem_ptrs, seg);
 	vm_nphysmem--;
 }
@@ -841,7 +840,7 @@
 	KASSERT(seg != NULL);
 
 	seg->prot = prot;
-	seg->flags = flags;	/* XXXUEBS BUS_SPACE_MAP_* */
+	seg->flags = flags;
 
 	/*
 	 * Managed device page metadata initialization
@@ -921,7 +920,6 @@
 		"\tincrease VM_PHYSSEG_MAX\n",
 		VM_PHYSSEG_MAX, (long long)start, (long long)end);
 
-	/* XXXUEBS too early to use RUN_ONCE(9)? */
 	if (uvm_physseg_inited == 0) {
 		uvm_physseg_inited = 1;
 		uvm_physseg_init();
@@ -1193,10 +1191,10 @@
 
 	psi = vm_physseg_find_device(pf, &off);
 	if (psi != -1)
-		return(&vm_physdev_ptrs[psi]->pgs[off]);
+		return(&VM_PHYSDEV_PTR(psi)->pgs[off]);
 	psi = vm_physseg_find(pf, &off);
 	if (psi != -1)
-		return(&vm_physmem_ptrs[psi]->pgs[off]);
+		return(&VM_PHYSMEM_PTR(psi)->pgs[off]);
 	return(NULL);
 }
 
@@ -2234,7 +2232,7 @@
 
 	lcv = vm_physseg_find(atop(VM_PAGE_TO_PHYS(pg)), NULL);
 	KASSERT(lcv != -1);
-	return (vm_physmem_ptrs[lcv]->free_list);
+	return (VM_PHYSMEM_PTR(lcv)->free_list);
 }
 
 #if defined(DDB) || defined(DEBUGPRINT)
@@ -2341,7 +2339,7 @@
 #endif
 	"\n", "PAGE", "FLAG", "PQ", "UOBJECT", "UANON");
 	for (i = 0; i < vm_nphysmem; i++) {
-		for (pg = vm_physmem_ptrs[i]->pgs; pg < vm_physmem_ptrs[i]->endpg; pg++) {
+		for (pg = VM_PHY

CVS commit: src/sys/uvm

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov 11 15:59:27 UTC 2010

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
C style; make a sentinel pointer have an exclusive value; no
functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.160 src/sys/uvm/uvm_page.c:1.161
--- src/sys/uvm/uvm_page.c:1.160	Thu Nov 11 15:51:05 2010
+++ src/sys/uvm/uvm_page.c	Thu Nov 11 15:59:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.160 2010/11/11 15:51:05 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.161 2010/11/11 15:59:27 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.160 2010/11/11 15:51:05 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.161 2010/11/11 15:59:27 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -467,7 +467,7 @@
 		seg->pgs = pagearray;
 		pagearray += n;
 		pagecount -= n;
-		seg->lastpg = seg->pgs + (n - 1);
+		seg->lastpg = seg->pgs + n;
 
 		/* init and free vm_pages (we've already zeroed them) */
 		paddr = ctob(seg->start);
@@ -861,7 +861,7 @@
 		ps->pgs = NULL;
 	} else {
 		ps->pgs = pgs;
-		ps->lastpg = pgs + npages - 1;
+		ps->lastpg = pgs + npages;
 	}
 	ps->free_list = free_list;
 	vm_nphysmem++;
@@ -1987,7 +1987,7 @@
 #endif
 	"\n", "PAGE", "FLAG", "PQ", "UOBJECT", "UANON");
 	for (i = 0; i < vm_nphysmem; i++) {
-		for (pg = VM_PHYSMEM_PTR(i)->pgs; pg <= VM_PHYSMEM_PTR(i)->lastpg; pg++) {
+		for (pg = VM_PHYSMEM_PTR(i)->pgs; pg < VM_PHYSMEM_PTR(i)->lastpg; pg++) {
 			(*pr)("%18p %04x %04x %18p %18p",
 			pg, pg->flags, pg->pqflags, pg->uobject,
 			pg->uanon);



CVS commit: src/sys/uvm

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov 11 15:51:05 UTC 2010

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
Typo in a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.159 src/sys/uvm/uvm_page.c:1.160
--- src/sys/uvm/uvm_page.c:1.159	Thu Nov 11 15:47:43 2010
+++ src/sys/uvm/uvm_page.c	Thu Nov 11 15:51:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.159 2010/11/11 15:47:43 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.160 2010/11/11 15:51:05 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.159 2010/11/11 15:47:43 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.160 2010/11/11 15:51:05 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -794,7 +794,7 @@
 	}
 
 	/*
-	 * check to see if this is a "preload" (i.e. uvm_mem_init hasn't been
+	 * check to see if this is a "preload" (i.e. uvm_page_init hasn't been
 	 * called yet, so malloc is not available).
 	 */
 



CVS commit: src/sys/uvm

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov 11 15:47:43 UTC 2010

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
Minor clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.158 src/sys/uvm/uvm_page.c:1.159
--- src/sys/uvm/uvm_page.c:1.158	Thu Nov 11 14:50:54 2010
+++ src/sys/uvm/uvm_page.c	Thu Nov 11 15:47:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.158 2010/11/11 14:50:54 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.159 2010/11/11 15:47:43 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.158 2010/11/11 14:50:54 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.159 2010/11/11 15:47:43 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -367,8 +367,8 @@
 	static struct uvm_cpu boot_cpu;
 	psize_t freepages, pagecount, bucketcount, n;
 	struct pgflbucket *bucketarray, *cpuarray;
-	struct vm_page *pagearray;
 	struct vm_physseg *seg;
+	struct vm_page *pagearray;
 	int lcv;
 	u_int i;
 	paddr_t paddr;
@@ -654,6 +654,7 @@
 static bool
 uvm_page_physget_freelist(paddr_t *paddrp, int freelist)
 {
+	struct vm_physseg *seg;
 	int lcv, x;
 
 	/* pass 1: try allocating from a matching end */
@@ -663,22 +664,22 @@
 	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++)
 #endif
 	{
+		seg = VM_PHYSMEM_PTR(lcv);
 
 		if (uvm.page_init_done == true)
 			panic("uvm_page_physget: called _after_ bootstrap");
 
-		if (vm_physmem[lcv].free_list != freelist)
+		if (seg->free_list != freelist)
 			continue;
 
 		/* try from front */
-		if (vm_physmem[lcv].avail_start == vm_physmem[lcv].start &&
-		vm_physmem[lcv].avail_start < vm_physmem[lcv].avail_end) {
-			*paddrp = ctob(vm_physmem[lcv].avail_start);
-			vm_physmem[lcv].avail_start++;
-			vm_physmem[lcv].start++;
+		if (seg->avail_start == seg->start &&
+		seg->avail_start < seg->avail_end) {
+			*paddrp = ctob(seg->avail_start);
+			seg->avail_start++;
+			seg->start++;
 			/* nothing left?   nuke it */
-			if (vm_physmem[lcv].avail_start ==
-			vm_physmem[lcv].end) {
+			if (seg->avail_start == seg->end) {
 if (vm_nphysmem == 1)
 panic("uvm_page_physget: out of memory!");
 vm_nphysmem--;
@@ -690,14 +691,13 @@
 		}
 
 		/* try from rear */
-		if (vm_physmem[lcv].avail_end == vm_physmem[lcv].end &&
-		vm_physmem[lcv].avail_start < vm_physmem[lcv].avail_end) {
-			*paddrp = ctob(vm_physmem[lcv].avail_end - 1);
-			vm_physmem[lcv].avail_end--;
-			vm_physmem[lcv].end--;
+		if (seg->avail_end == seg->end &&
+		seg->avail_start < seg->avail_end) {
+			*paddrp = ctob(seg->avail_end - 1);
+			seg->avail_end--;
+			seg->end--;
 			/* nothing left?   nuke it */
-			if (vm_physmem[lcv].avail_end ==
-			vm_physmem[lcv].start) {
+			if (seg->avail_end == seg->start) {
 if (vm_nphysmem == 1)
 panic("uvm_page_physget: out of memory!");
 vm_nphysmem--;
@@ -716,18 +716,19 @@
 	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++)
 #endif
 	{
+		seg = VM_PHYSMEM_PTR(lcv);
 
 		/* any room in this bank? */
-		if (vm_physmem[lcv].avail_start >= vm_physmem[lcv].avail_end)
+		if (seg->avail_start >= seg->avail_end)
 			continue;  /* nope */
 
-		*paddrp = ctob(vm_physmem[lcv].avail_start);
-		vm_physmem[lcv].avail_start++;
+		*paddrp = ctob(seg->avail_start);
+		seg->avail_start++;
 		/* truncate! */
-		vm_physmem[lcv].start = vm_physmem[lcv].avail_start;
+		seg->start = seg->avail_start;
 
 		/* nothing left?   nuke it */
-		if (vm_physmem[lcv].avail_start == vm_physmem[lcv].end) {
+		if (seg->avail_start == seg->end) {
 			if (vm_nphysmem == 1)
 panic("uvm_page_physget: out of memory!");
 			vm_nphysmem--;
@@ -798,7 +799,7 @@
 	 */
 
 	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) {
-		if (vm_physmem[lcv].pgs)
+		if (VM_PHYSMEM_PTR(lcv)->pgs)
 			break;
 	}
 	preload = (lcv == vm_nphysmem);
@@ -820,15 +821,15 @@
 
 #if (VM_PHYSSEG_STRAT == VM_PSTRAT_RANDOM)
 	/* random: put it at the end (easy!) */
-	ps = &vm_physmem[vm_nphysmem];
+	ps = VM_PHYSMEM_PTR(vm_nphysmem);
 #elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH)
 	{
 		int x;
 		/* sort by address for binary search */
 		for (lcv = 0 ; lcv < vm_nphysmem ; lcv++)
-			if (start < vm_physmem[lcv].start)
+			if (start < VM_PHYSMEM_PTR(lcv)->start)
 break;
-		ps = &vm_physmem[lcv];
+		ps = VM_PHYSMEM_PTR(lcv);
 		/* move back other entries, if necessary ... */
 		for (x = vm_nphysmem ; x > lcv ; x--)
 			/* structure copy */
@@ -840,9 +841,9 @@
 		/* sort by largest segment first */
 		for (lcv = 0 ; lcv < vm_nphysmem ; lcv++)
 			if ((end - start) >
-			(vm_physmem[lcv].end - vm_physmem[lcv].start))
+			(VM_PHYSMEM_PTR(lcv)->end - VM_PHYSMEM_PTR(lcv)->start))
 break;
-		ps = &vm_phys

CVS commit: src/sys/uvm

2010-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov 11 14:50:54 UTC 2010

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
Minor clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.157 src/sys/uvm/uvm_page.c:1.158
--- src/sys/uvm/uvm_page.c:1.157	Sat Nov  6 15:42:43 2010
+++ src/sys/uvm/uvm_page.c	Thu Nov 11 14:50:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.157 2010/11/06 15:42:43 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.158 2010/11/11 14:50:54 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.157 2010/11/06 15:42:43 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.158 2010/11/11 14:50:54 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -127,6 +127,7 @@
 
 struct vm_physseg vm_physmem[VM_PHYSSEG_MAX];	/* XXXCDC: uvm.physmem */
 int vm_nphysseg = 0;/* XXXCDC: uvm.nphysseg */
+#define	vm_nphysmem	vm_nphysseg
 
 /*
  * Some supported CPUs in a given architecture don't support all
@@ -367,6 +368,7 @@
 	psize_t freepages, pagecount, bucketcount, n;
 	struct pgflbucket *bucketarray, *cpuarray;
 	struct vm_page *pagearray;
+	struct vm_physseg *seg;
 	int lcv;
 	u_int i;
 	paddr_t paddr;
@@ -398,7 +400,7 @@
 	 * now is to allocate vm_page structures for this memory.
 	 */
 
-	if (vm_nphysseg == 0)
+	if (vm_nphysmem == 0)
 		panic("uvm_page_bootstrap: no memory pre-allocated");
 
 	/*
@@ -410,8 +412,10 @@
 	 */
 
 	freepages = 0;
-	for (lcv = 0 ; lcv < vm_nphysseg ; lcv++)
-		freepages += (vm_physmem[lcv].end - vm_physmem[lcv].start);
+	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) {
+		seg = VM_PHYSMEM_PTR(lcv);
+		freepages += (seg->end - seg->start);
+	}
 
 	/*
 	 * Let MD code initialize the number of colors, or default
@@ -455,27 +459,28 @@
 	 * init the vm_page structures and put them in the correct place.
 	 */
 
-	for (lcv = 0 ; lcv < vm_nphysseg ; lcv++) {
-		n = vm_physmem[lcv].end - vm_physmem[lcv].start;
+	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) {
+		seg = VM_PHYSMEM_PTR(lcv);
+		n = seg->end - seg->start;
 
 		/* set up page array pointers */
-		vm_physmem[lcv].pgs = pagearray;
+		seg->pgs = pagearray;
 		pagearray += n;
 		pagecount -= n;
-		vm_physmem[lcv].lastpg = vm_physmem[lcv].pgs + (n - 1);
+		seg->lastpg = seg->pgs + (n - 1);
 
 		/* init and free vm_pages (we've already zeroed them) */
-		paddr = ctob(vm_physmem[lcv].start);
+		paddr = ctob(seg->start);
 		for (i = 0 ; i < n ; i++, paddr += PAGE_SIZE) {
-			vm_physmem[lcv].pgs[i].phys_addr = paddr;
+			seg->pgs[i].phys_addr = paddr;
 #ifdef __HAVE_VM_PAGE_MD
-			VM_MDPAGE_INIT(&vm_physmem[lcv].pgs[i]);
+			VM_MDPAGE_INIT(&seg->pgs[i]);
 #endif
-			if (atop(paddr) >= vm_physmem[lcv].avail_start &&
-			atop(paddr) <= vm_physmem[lcv].avail_end) {
+			if (atop(paddr) >= seg->avail_start &&
+			atop(paddr) <= seg->avail_end) {
 uvmexp.npages++;
 /* add page to free pool */
-uvm_pagefree(&vm_physmem[lcv].pgs[i]);
+uvm_pagefree(&seg->pgs[i]);
 			}
 		}
 	}
@@ -653,9 +658,9 @@
 
 	/* pass 1: try allocating from a matching end */
 #if (VM_PHYSSEG_STRAT == VM_PSTRAT_BIGFIRST)
-	for (lcv = vm_nphysseg - 1 ; lcv >= 0 ; lcv--)
+	for (lcv = vm_nphysmem - 1 ; lcv >= 0 ; lcv--)
 #else
-	for (lcv = 0 ; lcv < vm_nphysseg ; lcv++)
+	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++)
 #endif
 	{
 
@@ -674,12 +679,12 @@
 			/* nothing left?   nuke it */
 			if (vm_physmem[lcv].avail_start ==
 			vm_physmem[lcv].end) {
-if (vm_nphysseg == 1)
+if (vm_nphysmem == 1)
 panic("uvm_page_physget: out of memory!");
-vm_nphysseg--;
-for (x = lcv ; x < vm_nphysseg ; x++)
+vm_nphysmem--;
+for (x = lcv ; x < vm_nphysmem ; x++)
 	/* structure copy */
-	vm_physmem[x] = vm_physmem[x+1];
+	VM_PHYSMEM_PTR_SWAP(x, x + 1);
 			}
 			return (true);
 		}
@@ -693,12 +698,12 @@
 			/* nothing left?   nuke it */
 			if (vm_physmem[lcv].avail_end ==
 			vm_physmem[lcv].start) {
-if (vm_nphysseg == 1)
+if (vm_nphysmem == 1)
 panic("uvm_page_physget: out of memory!");
-vm_nphysseg--;
-for (x = lcv ; x < vm_nphysseg ; x++)
+vm_nphysmem--;
+for (x = lcv ; x < vm_nphysmem ; x++)
 	/* structure copy */
-	vm_physmem[x] = vm_physmem[x+1];
+	VM_PHYSMEM_PTR_SWAP(x, x + 1);
 			}
 			return (true);
 		}
@@ -706,9 +711,9 @@
 
 	/* pass2: forget about matching ends, just allocate something */
 #if (VM_PHYSSEG_STRAT == VM_PSTRAT_BIGFIRST)
-	for (lcv = vm_nphysseg - 1 ; lcv >= 0 ; lcv--)
+	for (lcv = vm_nphysmem - 1 ; lcv >= 0 ; lcv--)
 #else
-	for (lcv = 0 ; lcv < vm_nphysseg ; lcv++)
+	for (lcv = 0 ; lcv < vm_nphysmem ; lcv++)
 #endif
 	{
 
@@ -723,12 +728,12 @@
 
 		/* nothi

CVS commit: [uebayasi-xip] src/sys

2010-11-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Nov 10 08:59:14 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
src/sys/uvm [uebayasi-xip]: uvm_page.h

Log Message:
Fix thinko; make vm_physseg ptr swap really work.


To generate a diff of this commit:
cvs rdiff -u -r1.252.2.8 -r1.252.2.9 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.141.2.6 -r1.141.2.7 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.211.2.21 -r1.211.2.22 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.681.2.6 -r1.681.2.7 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.24.2.7 -r1.24.2.8 src/sys/arch/ia64/ia64/pmap.c
cvs rdiff -u -r1.188.2.10 -r1.188.2.11 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.74.2.7 -r1.74.2.8 src/sys/arch/sh3/sh3/pmap.c
cvs rdiff -u -r1.59.2.33 -r1.59.2.34 src/sys/uvm/uvm_page.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.2.8 src/sys/arch/alpha/alpha/pmap.c:1.252.2.9
--- src/sys/arch/alpha/alpha/pmap.c:1.252.2.8	Wed Nov 10 08:04:59 2010
+++ src/sys/arch/alpha/alpha/pmap.c	Wed Nov 10 08:59:12 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.252.2.8 2010/11/10 08:04:59 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.252.2.9 2010/11/10 08:59:12 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.252.2.8 2010/11/10 08:04:59 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.252.2.9 2010/11/10 08:59:12 uebayasi Exp $");
 
 #include 
 #include 
@@ -1063,7 +1063,7 @@
 			vm_nphysseg--;
 			for (x = bank; x < vm_nphysseg; x++) {
 /* structure copy */
-*VM_PHYSMEM_PTR(x) = *VM_PHYSMEM_PTR(x + 1);
+VM_PHYSMEM_PTR_SWAP(x, x + 1);
 			}
 		}
 

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.141.2.6 src/sys/arch/amd64/amd64/machdep.c:1.141.2.7
--- src/sys/arch/amd64/amd64/machdep.c:1.141.2.6	Wed Nov 10 03:36:26 2010
+++ src/sys/arch/amd64/amd64/machdep.c	Wed Nov 10 08:59:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.141.2.6 2010/11/10 03:36:26 uebayasi Exp $	*/
+/*	$NetBSD: machdep.c,v 1.141.2.7 2010/11/10 08:59:12 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.141.2.6 2010/11/10 03:36:26 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.141.2.7 2010/11/10 08:59:12 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_PTR(x) = *VM_PHYSMEM_PTR(x + 1);
+			VM_PHYSMEM_PTR_SWAP(x, 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.21 src/sys/arch/arm/arm32/pmap.c:1.211.2.22
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.21	Wed Nov 10 08:04:59 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Nov 10 08:59:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.21 2010/11/10 08:04:59 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.22 2010/11/10 08:59:13 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
 #include 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.211.2.21 2010/11/10 08:04:59 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.211.2.22 2010/11/10 08:59:13 uebayasi Exp $");
 
 #define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
 
@@ -,8 +,8 @@
 			 * If we consumed the entire physseg, remove it.
 			 */
 			if (ps->avail_start == ps->avail_end) {
-for (--vm_nphysseg; i < vm_nphysseg; i++, ps++)
-	*(ps[0]) = *(ps[1]);
+for (--vm_nphysseg; i < vm_nphysseg; i++)
+	VM_PHYSMEM_PTR_SWAP(i, i + 1);
 			}
 			memset((void *)rpv->pv_va, 0, rpv->pv_size);
 			return;

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.681.2.6 src/sys/arch/i386/i386/machdep.c:1.681.2.7
--- src/sys/arch/i386/i386/machdep.c:1.681.2.6	Wed Nov 10 03:36:27 2010
+++ src/sys/arch/i386/i386/machdep.c	Wed Nov 10 08:59:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.681.2.6 2010/11/10 03:36:27 uebayasi Exp $	*/
+/*	$NetBSD: machdep.c,v 1.681.2.7 2010/11/10 08:59:13 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep

CVS commit: src/sys

2010-11-10 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Nov 10 09:27:25 UTC 2010

Modified Files:
src/sys/arch/acorn26/acorn26: pmap.c
src/sys/arch/alpha/alpha: machdep.c pmap.c
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/arm/arm32: pmap.c
src/sys/arch/i386/i386: machdep.c
src/sys/arch/ia64/ia64: machdep.c pmap.c
src/sys/arch/m68k/m68k: pmap_motorola.c
src/sys/arch/mips/mips: mips_machdep.c pmap.c
src/sys/arch/powerpc/ibm4xx: pmap.c
src/sys/arch/powerpc/isa: isadma_machdep.c
src/sys/arch/powerpc/oea: pmap.c
src/sys/arch/powerpc/powerpc: bus_dma.c
src/sys/arch/sh3/sh3: mem.c pmap.c
src/sys/arch/vax/vax: pmap.c
src/sys/arch/x68k/x68k: machdep.c mem.c
src/sys/uvm: uvm_page.h

Log Message:
Use more VM_PHYSMEM_*() accessors.  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/acorn26/acorn26/pmap.c
cvs rdiff -u -r1.327 -r1.328 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.253 -r1.254 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.154 -r1.155 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.217 -r1.218 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.696 -r1.697 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/ia64/ia64/machdep.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/ia64/ia64/pmap.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/m68k/m68k/pmap_motorola.c
cvs rdiff -u -r1.227 -r1.228 src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.190 -r1.191 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/isa/isadma_machdep.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/powerpc/bus_dma.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sh3/sh3/mem.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/sh3/sh3/pmap.c
cvs rdiff -u -r1.177 -r1.178 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.167 -r1.168 src/sys/arch/x68k/x68k/machdep.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x68k/x68k/mem.c
cvs rdiff -u -r1.62 -r1.63 src/sys/uvm/uvm_page.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/acorn26/acorn26/pmap.c
diff -u src/sys/arch/acorn26/acorn26/pmap.c:1.30 src/sys/arch/acorn26/acorn26/pmap.c:1.31
--- src/sys/arch/acorn26/acorn26/pmap.c:1.30	Sat Nov  7 07:27:40 2009
+++ src/sys/arch/acorn26/acorn26/pmap.c	Wed Nov 10 09:27:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.30 2009/11/07 07:27:40 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.31 2010/11/10 09:27:21 uebayasi Exp $ */
 /*-
  * Copyright (c) 1997, 1998, 2000 Ben Harris
  * All rights reserved.
@@ -102,7 +102,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30 2009/11/07 07:27:40 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.31 2010/11/10 09:27:21 uebayasi Exp $");
 
 #include  /* for cold */
 #include 
@@ -299,11 +299,11 @@
 	addr = 0;
 	size = round_page(size);
 	for (i = 0; i < vm_nphysseg; i++) {
-		if (vm_physmem[i].avail_start < vm_physmem[i].avail_end) {
+		if (VM_PHYSMEM_PTR(i)->avail_start < VM_PHYSMEM_PTR(i)->avail_end) {
 			addr = (vaddr_t)
 			((char*)MEMC_PHYS_BASE +
-ptoa(vm_physmem[i].avail_start));
-			vm_physmem[i].avail_start++;
+ptoa(VM_PHYSMEM_PTR(i)->avail_start));
+			VM_PHYSMEM_PTR(i)->avail_start++;
 			break;
 		}
 	}

Index: src/sys/arch/alpha/alpha/machdep.c
diff -u src/sys/arch/alpha/alpha/machdep.c:1.327 src/sys/arch/alpha/alpha/machdep.c:1.328
--- src/sys/arch/alpha/alpha/machdep.c:1.327	Sat Nov  6 11:46:00 2010
+++ src/sys/arch/alpha/alpha/machdep.c	Wed Nov 10 09:27:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.327 2010/11/06 11:46:00 uebayasi Exp $ */
+/* $NetBSD: machdep.c,v 1.328 2010/11/10 09:27:21 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.327 2010/11/06 11:46:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.328 2010/11/10 09:27:21 uebayasi Exp $");
 
 #include 
 #include 
@@ -604,7 +604,7 @@
 		vsize_t sz = (vsize_t)round_page(MSGBUFSIZE);
 		vsize_t reqsz = sz;
 
-		vps = &vm_physmem[vm_nphysseg - 1];
+		vps = VM_PHYSMEM_PTR(vm_nphysseg - 1);
 
 		/* shrink so that it'll fit in the last segment */
 		if ((vps->avail_end - vps->avail_start) < atop(sz))

Index: src/sys/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.253 src/sys/arch/alpha/alpha/pmap.c:1.254
--- src/sys/arch/alpha/alpha/pmap.c:1.253	Sat Oct 30 17:00:54 2010
+++ src/sys/arch/alpha/alpha/pmap.c	Wed Nov 10 09:27:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.253 2010/10/30 17:00:54 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.254 2010/11/10 09:27:21 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 200

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 
 
-__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 
 #include 



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 			/* 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 
 #include 

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 
 #include 
@@ -212,7 +211,7 @@
 #include 
 #include 
 
-__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

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 			/* 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 
 #include 
@@ -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 
-__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 
 #include 
 
-__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, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -

CVS commit: src/sys/uvm

2010-11-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Nov 10 01:24:47 UTC 2010

Modified Files:
src/sys/uvm: uvm_page.h

Log Message:
Prepare vm_physmem[] -> (*vm_physmem)[] migration, so that physical
segments can be changed at run-time.  Pointers are easier to update.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/uvm/uvm_page.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/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.61 src/sys/uvm/uvm_page.h:1.62
--- src/sys/uvm/uvm_page.h:1.61	Sat Sep 25 01:42:40 2010
+++ src/sys/uvm/uvm_page.h	Wed Nov 10 01:24:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.61 2010/09/25 01:42:40 matt Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.62 2010/11/10 01:24:46 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -255,6 +255,9 @@
  * physical memory config is stored in vm_physmem.
  */
 
+#define	VM_PHYSMEM_PTR(i)	(&vm_physmem[i])
+#define	VM_PHYSDEV_PTR(i)	(&vm_physdev[i])	/* XXX not yet */
+
 extern struct vm_physseg vm_physmem[VM_PHYSSEG_MAX];
 extern int vm_nphysseg;
 



CVS commit: src/sys/arch/powerpc/ibm4xx/dev

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

Modified Files:
src/sys/arch/powerpc/ibm4xx/dev: plb.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/ibm4xx/dev/plb.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/dev/plb.c
diff -u src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.16 src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.17
--- src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.16	Sat Nov  6 16:30:15 2010
+++ src/sys/arch/powerpc/ibm4xx/dev/plb.c	Tue Nov  9 06:48:19 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: plb.c,v 1.16 2010/11/06 16:30:15 uebayasi Exp $ */
+/* $NetBSD: plb.c,v 1.17 2010/11/09 06:48:19 uebayasi Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plb.c,v 1.16 2010/11/06 16:30:15 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plb.c,v 1.17 2010/11/09 06:48:19 uebayasi Exp $");
 
 #include "locators.h"
 #include "emac.h"
@@ -100,7 +100,7 @@
 	{ IBM405GPR,	"ecc", },
 	{ IBM405GPR,	"opb", },
 	{ IBM405GPR,	"pchb", },
-	{ IBM405GPR,"exb", },
+	{ IBM405GPR,	"exb", },
 
 	/* AMCC 405EX / EXR */
 	{ AMCC405EX,	"cpu", },



CVS commit: src/sys/arch/powerpc/powerpc

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

Modified Files:
src/sys/arch/powerpc/powerpc: rtas.c

Log Message:
Use VM_PAGE_TO_PHYS().


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/powerpc/rtas.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/rtas.c
diff -u src/sys/arch/powerpc/powerpc/rtas.c:1.8 src/sys/arch/powerpc/powerpc/rtas.c:1.9
--- src/sys/arch/powerpc/powerpc/rtas.c:1.8	Tue Apr  8 02:33:03 2008
+++ src/sys/arch/powerpc/powerpc/rtas.c	Tue Nov  9 06:47:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtas.c,v 1.8 2008/04/08 02:33:03 garbled Exp $ */
+/*	$NetBSD: rtas.c,v 1.9 2010/11/09 06:47:24 uebayasi Exp $ */
 
 /*
  * CHRP RTAS support routines
@@ -9,7 +9,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtas.c,v 1.8 2008/04/08 02:33:03 garbled Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtas.c,v 1.9 2010/11/09 06:47:24 uebayasi Exp $");
 
 #include 
 #include 
@@ -123,7 +123,7 @@
 	&pglist, 1, 0))
 		goto fail;
 
-	sc->ra_base_pa = TAILQ_FIRST(&pglist)->phys_addr;
+	sc->ra_base_pa = VM_PAGE_TO_PHYS(TAILQ_FIRST(&pglist));
 
 	ih = OF_open("/rtas");
 	if (ih == -1)



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 
-__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 
-__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 
 #include 
@@ -41,12 +41,7 @@
 #include 
 #include 
 
-<<< bus_space.c
-#include 
-#include 
-===
 #include 
->>> 1.23
 
 #define _POWERPC_BUS_SPACE_PRIVATE
 #include 

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 
-__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 
 #include 
 
-<<< bus_dma.c
-#include 
-#include 
-===
 #include 
->>> 1.56
 
 extern	paddr_t avail_end;
 

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.66.2.5 src/sys/arch/x86/x86/cpu.c:1.66.2.6
--- src/sys/arch/x86/

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

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

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

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.50.2.2 -r1.50.2.3 src/sys/uvm/uvm_meter.c

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

Modified files:

Index: src/sys/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.50.2.2 src/sys/uvm/uvm_meter.c:1.50.2.3
--- src/sys/uvm/uvm_meter.c:1.50.2.2	Fri Apr 30 14:44:38 2010
+++ src/sys/uvm/uvm_meter.c	Tue Nov  9 06:03:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.50.2.2 2010/04/30 14:44:38 uebayasi Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.50.2.3 2010/11/09 06:03:44 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.50.2.2 2010/04/30 14:44:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.50.2.3 2010/11/09 06:03:44 uebayasi Exp $");
 
 #include 
 #include 
@@ -49,8 +49,7 @@
 #include 
 #include 
 
-#include 
-#include 
+#include 
 #include 
 
 /*



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 
-__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 @@
 {
 	volati

CVS commit: [uebayasi-xip] src/share/man/man9

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

Modified Files:
src/share/man/man9 [uebayasi-xip]: uvm.9

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.102.2.2 -r1.102.2.3 src/share/man/man9/uvm.9

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

Modified files:

Index: src/share/man/man9/uvm.9
diff -u src/share/man/man9/uvm.9:1.102.2.2 src/share/man/man9/uvm.9:1.102.2.3
--- src/share/man/man9/uvm.9:1.102.2.2	Tue Nov  2 14:05:27 2010
+++ src/share/man/man9/uvm.9	Tue Nov  9 06:03:29 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uvm.9,v 1.102.2.2 2010/11/02 14:05:27 uebayasi Exp $
+.\"	$NetBSD: uvm.9,v 1.102.2.3 2010/11/09 06:03:29 uebayasi Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Froundation, Inc.
 .\" Copyright (c) 1998 Matthew R. Green
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd November 2, 2010
+.Dd November 7, 2010
 .Dt UVM 9
 .Os
 .Sh NAME
@@ -1008,8 +1008,6 @@
 /* vm_page counters */
 int npages; /* number of pages we manage */
 int free;   /* number of free pages */
-int active; /* number of active pages */
-int inactive;   /* number of pages that we free'd but may want back */
 int paging; /* number of pages in the process of being paged out */
 int wired;  /* number of wired pages */
 int reserve_pagedaemon; /* number of pages reserved for pagedaemon */



CVS commit: [uebayasi-xip] src/share/man/man4

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

Modified Files:
src/share/man/man4 [uebayasi-xip]: Makefile acpi.4 pciide.4
Added Files:
src/share/man/man4 [uebayasi-xip]: schide.4

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.516.2.3 -r1.516.2.4 src/share/man/man4/Makefile
cvs rdiff -u -r1.50.2.3 -r1.50.2.4 src/share/man/man4/acpi.4
cvs rdiff -u -r1.63 -r1.63.2.1 src/share/man/man4/pciide.4
cvs rdiff -u -r0 -r1.2.2.2 src/share/man/man4/schide.4

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

Modified files:

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.516.2.3 src/share/man/man4/Makefile:1.516.2.4
--- src/share/man/man4/Makefile:1.516.2.3	Sat Nov  6 08:05:44 2010
+++ src/share/man/man4/Makefile	Tue Nov  9 06:03:26 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.516.2.3 2010/11/06 08:05:44 uebayasi Exp $
+#	$NetBSD: Makefile,v 1.516.2.4 2010/11/09 06:03:26 uebayasi Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -49,7 +49,7 @@
 	qe.4 qec.4 qsphy.4 \
 	raid.4 ral.4 ray.4 rcons.4 re.4 rgephy.4 rlphy.4 rnd.4 route.4 \
 	rs5c372rtc.4 rtk.4 rtw.4 rum.4 \
-	satalink.4 sbus.4 scc.4 scsi.4 sd.4 se.4 seeprom.4 sem.4 \
+	satalink.4 sbus.4 scc.4 schide.4 scsi.4 sd.4 se.4 seeprom.4 sem.4 \
 	ses.4 sf.4 sfb.4 sgsmix.4 shb.4 \
 	shpcic.4 siisata.4 siop.4 sip.4 siside.4 sk.4 sl.4 slide.4 \
 	sm.4 smsh.4 sn.4 sony.4 spc.4 speaker.4 spif.4 sqphy.4 ss.4 \

Index: src/share/man/man4/acpi.4
diff -u src/share/man/man4/acpi.4:1.50.2.3 src/share/man/man4/acpi.4:1.50.2.4
--- src/share/man/man4/acpi.4:1.50.2.3	Sat Nov  6 08:05:44 2010
+++ src/share/man/man4/acpi.4	Tue Nov  9 06:03:26 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpi.4,v 1.50.2.3 2010/11/06 08:05:44 uebayasi Exp $
+.\" $NetBSD: acpi.4,v 1.50.2.4 2010/11/09 06:03:26 uebayasi Exp $
 .\"
 .\" Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 24, 2010
+.Dd November 7, 2010
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -241,6 +241,8 @@
 NS8250-, NS16450-, and NS16550-based serial ports.
 .It Xr fdc 4
 Floppy disk controllers.
+.It Xr fujitsu 4
+Fujitsu brightness, pointer, and hotkeys.
 .It Xr hpet 4
 High Precision Event Timer
 .Pq Tn HPET .

Index: src/share/man/man4/pciide.4
diff -u src/share/man/man4/pciide.4:1.63 src/share/man/man4/pciide.4:1.63.2.1
--- src/share/man/man4/pciide.4:1.63	Mon Oct 19 18:41:09 2009
+++ src/share/man/man4/pciide.4	Tue Nov  9 06:03:26 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pciide.4,v 1.63 2009/10/19 18:41:09 bouyer Exp $
+.\"	$NetBSD: pciide.4,v 1.63.2.1 2010/11/09 06:03:26 uebayasi Exp $
 .\"
 .\" Copyright (c) 1998,2003 Manuel Bouyer.
 .\"
@@ -22,7 +22,7 @@
 .\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 29, 2008
+.Dd November 7, 2010
 .Dt PCIIDE 4
 .Os
 .Sh NAME
@@ -74,6 +74,9 @@
 Intel 82801 (ICH/ICH0/ICH2/ICH3/ICH4/ICH5/ICH6) IDE Controllers:
 .Xr piixide 4
 .It
+Intel SCH IDE Controllers:
+.Xr schide 4
+.It
 NVIDIA nForce/nForce2 IDE Controllers:
 .Xr viaide 4
 .It
@@ -138,6 +141,7 @@
 .Xr piixide 4 ,
 .Xr pnpbios 4 ,
 .Xr satalink 4 ,
+.Xr schide 4 ,
 .Xr siisata 4 ,
 .Xr siside 4 ,
 .Xr slide 4 ,

Added files:

Index: src/share/man/man4/schide.4
diff -u /dev/null src/share/man/man4/schide.4:1.2.2.2
--- /dev/null	Tue Nov  9 06:03:26 2010
+++ src/share/man/man4/schide.4	Tue Nov  9 06:03:26 2010
@@ -0,0 +1,47 @@
+.\"	$NetBSD: schide.4,v 1.2.2.2 2010/11/09 06:03:26 uebayasi Exp $
+.\"
+.\" Copyright (c) 2003 Manuel Bouyer.
+.\"
+.\" 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 AUTHOR ``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 AUTHOR 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

CVS commit: [uebayasi-xip] src/sys/dev/tc

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

Modified Files:
src/sys/dev/tc [uebayasi-xip]: px.c

Log Message:
Reduce diff from trunk.


To generate a diff of this commit:
cvs rdiff -u -r1.37.2.1 -r1.37.2.2 src/sys/dev/tc/px.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/dev/tc/px.c
diff -u src/sys/dev/tc/px.c:1.37.2.1 src/sys/dev/tc/px.c:1.37.2.2
--- src/sys/dev/tc/px.c:1.37.2.1	Fri May 28 07:50:44 2010
+++ src/sys/dev/tc/px.c	Tue Nov  9 04:50:50 2010
@@ -1,4 +1,4 @@
-/* 	$NetBSD: px.c,v 1.37.2.1 2010/05/28 07:50:44 uebayasi Exp $	*/
+/* 	$NetBSD: px.c,v 1.37.2.2 2010/11/09 04:50:50 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.37.2.1 2010/05/28 07:50:44 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.37.2.2 2010/11/09 04:50:50 uebayasi Exp $");
 
 #include 
 #include 
@@ -42,7 +42,7 @@
 #include 
 #include 
 
-#include 
+#include 	/* XXX uvm_pageboot_alloc */
 
 #if defined(pmax)
 #include 



CVS commit: [uebayasi-xip] src

2010-11-07 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Nov  7 16:34:11 UTC 2010

Modified Files:
src/external/gpl3/binutils/usr.sbin/mdsetimage [uebayasi-xip]:
mdsetimage.8
src/usr.sbin/mdsetimage [uebayasi-xip]: mdsetimage.8

Log Message:
Sort options.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8
cvs rdiff -u -r1.9.48.1 -r1.9.48.2 src/usr.sbin/mdsetimage/mdsetimage.8

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

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1.2.1 src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1.2.2
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1.2.1	Thu Nov  4 07:29:59 2010
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8	Sun Nov  7 16:34:10 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mdsetimage.8,v 1.1.2.1 2010/11/04 07:29:59 uebayasi Exp $
+.\"	$NetBSD: mdsetimage.8,v 1.1.2.2 2010/11/07 16:34:10 uebayasi Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou
 .\" All rights reserved.
@@ -36,9 +36,9 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl svx
+.Op Fl b Ar bfdname
 .Op Fl I Ar image_symbol
 .Op Fl S Ar size_symbol
-.Op Fl b Ar bfdname
 .Ar kernel
 .Ar image
 .Sh DESCRIPTION
@@ -53,6 +53,10 @@
 will typically be used by the kernel
 as the root file system.
 .Pp
+To recognize kernel executable format, the
+.Fl b
+flag specifies BFD name of kernel.
+.Pp
 The
 .Fl I
 and
@@ -60,10 +64,6 @@
 flags specify the symbol names of image and size of memory disk
 drivers respectively.
 .Pp
-To recognize kernel executable format, the
-.Fl b
-flag specifies BFD name of kernel.
-.Pp
 If the
 .Fl s
 flags is given,

Index: src/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/usr.sbin/mdsetimage/mdsetimage.8:1.9.48.1 src/usr.sbin/mdsetimage/mdsetimage.8:1.9.48.2
--- src/usr.sbin/mdsetimage/mdsetimage.8:1.9.48.1	Thu Nov  4 07:30:00 2010
+++ src/usr.sbin/mdsetimage/mdsetimage.8	Sun Nov  7 16:34:11 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: mdsetimage.8,v 1.9.48.1 2010/11/04 07:30:00 uebayasi Exp $
+.\" $NetBSD: mdsetimage.8,v 1.9.48.2 2010/11/07 16:34:11 uebayasi Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou
 .\" All rights reserved.
@@ -35,10 +35,10 @@
 .Nd set kernel RAM disk image
 .Sh SYNOPSIS
 .Nm
+.Op Fl v
 .Op Fl I Ar image_symbol
 .Op Fl S Ar size_symbol
 .Op Fl T Ar address
-.Op Fl v
 .Ar kernel
 .Ar image
 .Sh DESCRIPTION



CVS commit: src/sys/arch/powerpc

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

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c
src/sys/arch/powerpc/include/ibm4xx: vmparam.h

Log Message:
Merge from uebayasi-xip:

revision 1.60.2.5
date: 2010/08/14 02:09:57;  author: uebayasi;  state: Exp;  lines: +2 -1
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.62 -r1.63 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.7 -r1.8 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/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.62 src/sys/arch/powerpc/ibm4xx/pmap.c:1.63
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.62	Thu Feb 25 23:31:47 2010
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Sat Nov  6 16:36:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.62 2010/02/25 23:31:47 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.63 2010/11/06 16:36:26 uebayasi Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.62 2010/02/25 23:31:47 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.63 2010/11/06 16:36:26 uebayasi Exp $");
 
 #include 
 #include 
@@ -1475,7 +1475,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.7 src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.8
--- src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.7	Sat Nov  6 15:42:48 2010
+++ src/sys/arch/powerpc/include/ibm4xx/vmparam.h	Sat Nov  6 16:36:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.7 2010/11/06 15:42:48 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.8 2010/11/06 16:36:27 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: src/sys/arch/powerpc/include/ibm4xx

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

Modified Files:
src/sys/arch/powerpc/include/ibm4xx: dcr4xx.h

Log Message:
More registers to support IBM405GPr "External Bus".


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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/include/ibm4xx/dcr4xx.h
diff -u src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.1 src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.2
--- src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.1	Thu Mar 18 13:47:04 2010
+++ src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h	Sat Nov  6 16:32:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcr4xx.h,v 1.1 2010/03/18 13:47:04 kiyohara Exp $	*/
+/*	$NetBSD: dcr4xx.h,v 1.2 2010/11/06 16:32:08 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_ */



CVS commit: src/sys/arch/powerpc

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

Modified Files:
src/sys/arch/powerpc/conf: files.ibm4xx
src/sys/arch/powerpc/ibm4xx/dev: plb.c
Added Files:
src/sys/arch/powerpc/ibm4xx/dev: exb.c exbvar.h

Log Message:
Add IBM405GPr "External Bus" driver.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/conf/files.ibm4xx
cvs rdiff -u -r0 -r1.2 src/sys/arch/powerpc/ibm4xx/dev/exb.c \
src/sys/arch/powerpc/ibm4xx/dev/exbvar.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/ibm4xx/dev/plb.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.11 src/sys/arch/powerpc/conf/files.ibm4xx:1.12
--- src/sys/arch/powerpc/conf/files.ibm4xx:1.11	Thu Mar 18 13:58:38 2010
+++ src/sys/arch/powerpc/conf/files.ibm4xx	Sat Nov  6 16:30:15 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ibm4xx,v 1.11 2010/03/18 13:58:38 kiyohara Exp $
+#	$NetBSD: files.ibm4xx,v 1.12 2010/11/06 16:30:15 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.15 src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.16
--- src/sys/arch/powerpc/ibm4xx/dev/plb.c:1.15	Thu Mar 18 13:47:04 2010
+++ src/sys/arch/powerpc/ibm4xx/dev/plb.c	Sat Nov  6 16:30:15 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: plb.c,v 1.15 2010/03/18 13:47:04 kiyohara Exp $ */
+/* $NetBSD: plb.c,v 1.16 2010/11/06 16:30:15 uebayasi Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plb.c,v 1.15 2010/03/18 13:47:04 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plb.c,v 1.16 2010/11/06 16:30:15 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", },

Added files:

Index: src/sys/arch/powerpc/ibm4xx/dev/exb.c
diff -u /dev/null src/sys/arch/powerpc/ibm4xx/dev/exb.c:1.2
--- /dev/null	Sat Nov  6 16:30:16 2010
+++ src/sys/arch/powerpc/ibm4xx/dev/exb.c	Sat Nov  6 16:30:15 2010
@@ -0,0 +1,138 @@
+/*	$Id: exb.c,v 1.2 2010/11/06 16:30:15 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 
+__KERNEL_RCSID(0, "$NetBSD: exb.c,v 1.2 2010/11/06 16:30:15 uebayasi Exp $");
+
+#include "locators.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+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 *);
+
+CFATTACH_DECL_NEW(exb, sizeof(struct exb_softc), exb_match, exb_attach,
+NULL, NULL);
+
+static struct powerpc_bus_space exb_bus_space_tag =
+{ _BUS_SPACE_BIG_ENDIAN | _BUS_SPACE_MEM_TYPE, 0 };
+
+static int
+exb_match(device_t parent, struct cfdata *cf, void *aux)
+{
+
+	return 

CVS commit: src/sys/arch/evbppc/compile

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

Modified Files:
src/sys/arch/evbppc/compile: walnut-mkimg.sh

Log Message:
Merge from uebayasi-xip:

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.4 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.4
--- 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	Sat Nov  6 16:23:35 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.4 2010/11/06 16:23:35 uebayasi Exp $
 
-# Convert a kernel 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
+size=0
+overwrite=0
 
 if [ $# -ne 2 ] ; then
-	echo usage: $0 kernel image 1>&2
+	echo usage: $0 input image 1>&2
 	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/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: src

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

Modified Files:
src/external/gpl3/binutils/usr.sbin/mdsetimage: mdsetimage.8
mdsetimage.c
src/usr.sbin/mdsetimage: mdsetimage.8 mdsetimage.c

Log Message:
Handle md(4)'s embedded root disk image and size symbol names other
than the default ones ("md_root_image" / "md_root_size").

(References to xmd(4) are deliberately removed.)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/mdsetimage/mdsetimage.8
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/mdsetimage/mdsetimage.c

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

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1 src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.2
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1	Tue Aug 18 20:22:20 2009
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8	Sat Nov  6 16:03:23 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mdsetimage.8,v 1.1 2009/08/18 20:22:20 skrll Exp $
+.\"	$NetBSD: mdsetimage.8,v 1.2 2010/11/06 16:03:23 uebayasi Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\"
 .\" <>
 .\"
-.Dd September 27, 2002
+.Dd November 4, 2010
 .Dt MDSETIMAGE 8
 .Os
 .Sh NAME
@@ -36,6 +36,8 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl svx
+.Op Fl I Ar image_symbol
+.Op Fl S Ar size_symbol
 .Op Fl b Ar bfdname
 .Ar kernel
 .Ar image
@@ -51,6 +53,13 @@
 will typically be used by the kernel
 as the root file system.
 .Pp
+The
+.Fl I
+and
+.Fl S
+flags specify the symbol names of image and size of memory disk
+drivers respectively.
+.Pp
 To recognize kernel executable format, the
 .Fl b
 flag specifies BFD name of kernel.
Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c:1.1 src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c:1.2
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c:1.1	Tue Aug 18 20:22:20 2009
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c	Sat Nov  6 16:03:23 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mdsetimage.c,v 1.1 2009/08/18 20:22:20 skrll Exp $ */
+/* $NetBSD: mdsetimage.c,v 1.2 2010/11/06 16:03:23 uebayasi Exp $ */
 /* from: NetBSD: mdsetimage.c,v 1.15 2001/03/21 23:46:48 cgd Exp $ */
 
 /*
@@ -38,7 +38,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1996\
  Christopher G. Demetriou.  All rights reserved.");
-__RCSID("$NetBSD: mdsetimage.c,v 1.1 2009/08/18 20:22:20 skrll Exp $");
+__RCSID("$NetBSD: mdsetimage.c,v 1.2 2010/11/06 16:03:23 uebayasi Exp $");
 #endif /* not lint */
 
 #include 
@@ -58,13 +58,9 @@
 struct symbols {
 	char *name;
 	size_t offset;
-} md_root_symbols[] = {
+};
 #define	X_MD_ROOT_IMAGE	0
-	{ "_md_root_image", 0 },
 #define	X_MD_ROOT_SIZE	1
-	{ "_md_root_size", 0 },
-	{ NULL, 0 }
-};
 
 #define	CHUNKSIZE	(64 * 1024)
 
@@ -94,11 +90,21 @@
 	char *bfdname = NULL;
 	bfd *abfd;
 	ssize_t left_to_copy;
+	struct symbols md_root_symbols[3] = { { 0 } };
+
+	md_root_symbols[X_MD_ROOT_IMAGE].name = "_md_root_image";
+	md_root_symbols[X_MD_ROOT_SIZE].name = "_md_root_size";
 
 	setprogname(argv[0]);
 
-	while ((ch = getopt(argc, argv, "b:svx")) != -1)
+	while ((ch = getopt(argc, argv, "I:S:b:svx")) != -1)
 		switch (ch) {
+		case 'I':
+			md_root_symbols[X_MD_ROOT_IMAGE].name = optarg;
+			break;
+		case 'S':
+			md_root_symbols[X_MD_ROOT_SIZE].name = optarg;
+			break;
 		case 'b':
 			bfdname = optarg;
 			break;

Index: src/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/usr.sbin/mdsetimage/mdsetimage.8:1.9 src/usr.sbin/mdsetimage/mdsetimage.8:1.10
--- src/usr.sbin/mdsetimage/mdsetimage.8:1.9	Sat Jan 19 03:35:05 2002
+++ src/usr.sbin/mdsetimage/mdsetimage.8	Sat Nov  6 16:03:23 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: mdsetimage.8,v 1.9 2002/01/19 03:35:05 wiz Exp $
+.\" $NetBSD: mdsetimage.8,v 1.10 2010/11/06 16:03:23 uebayasi Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\"
 .\" <>
 .\"
-.Dd October 3, 1996
+.Dd November 4, 2010
 .Dt MDSETIMAGE 8
 .Os
 .Sh NAME
@@ -35,6 +35,8 @@
 .Nd set kernel RAM disk image
 .Sh SYNOPSIS
 .Nm
+.Op Fl I Ar image_symbol
+.Op Fl S Ar size_symbol
 .Op Fl T Ar address
 .Op Fl v
 .Ar kernel
@@ -51,6 +53,13 @@
 will typically be used by the kernel
 as the root file system.
 .Pp
+The
+.Fl I
+and
+.Fl S
+flags specify the symbol names of image and size of memory disk
+drivers respectively.
+.Pp
 For a.out kernels only, the
 .Fl T
 flag specifies the starting address of kernel text.

Index: src/usr.sbin/mdsetimage/mdsetimage.c
diff -u src/usr.sbin/mdsetimage/mdse

CVS commit: src/sys/uvm

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 15:48:01 UTC 2010

Modified Files:
src/sys/uvm: uvm_pglist.h

Log Message:
Provide a forward declaration of "struct vm_page", whose internal
is opaque to uvm_pglist.h users.  Users don't need to pull in
uvm_page.h.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.h
diff -u src/sys/uvm/uvm_pglist.h:1.7 src/sys/uvm/uvm_pglist.h:1.8
--- src/sys/uvm/uvm_pglist.h:1.7	Wed Jun  4 12:45:28 2008
+++ src/sys/uvm/uvm_pglist.h	Sat Nov  6 15:48:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.h,v 1.7 2008/06/04 12:45:28 ad Exp $	*/
+/*	$NetBSD: uvm_pglist.h,v 1.8 2010/11/06 15:48:00 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
  * This defines the type of a page queue, e.g. active list, inactive
  * list, etc.
  */
+struct vm_page;
 TAILQ_HEAD(pglist, vm_page);
 LIST_HEAD(pgflist, vm_page);
 



CVS commit: src/sys

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 15:42:50 UTC 2010

Modified Files:
src/sys/arch/acorn26/include: vmparam.h
src/sys/arch/acorn32/include: vmparam.h
src/sys/arch/alpha/include: vmparam.h
src/sys/arch/amd64/include: vmparam.h
src/sys/arch/amiga/include: vmparam.h
src/sys/arch/atari/include: vmparam.h
src/sys/arch/cats/include: vmparam.h
src/sys/arch/cesfic/include: vmparam.h
src/sys/arch/evbarm/include: vmparam.h
src/sys/arch/hp300/include: vmparam.h
src/sys/arch/hpcarm/include: vmparam.h
src/sys/arch/hppa/include: vmparam.h
src/sys/arch/i386/include: vmparam.h
src/sys/arch/ia64/include: vmparam.h
src/sys/arch/iyonix/include: vmparam.h
src/sys/arch/luna68k/include: vmparam.h
src/sys/arch/mac68k/include: vmparam.h
src/sys/arch/mips/include: vmparam.h
src/sys/arch/mvme68k/include: vmparam.h
src/sys/arch/netwinder/include: vmparam.h
src/sys/arch/news68k/include: vmparam.h
src/sys/arch/next68k/include: vmparam.h
src/sys/arch/powerpc/include/booke: vmparam.h
src/sys/arch/powerpc/include/ibm4xx: vmparam.h
src/sys/arch/powerpc/include/oea: vmparam.h
src/sys/arch/sh3/include: vmparam.h
src/sys/arch/shark/include: vmparam.h
src/sys/arch/sparc/include: vmparam.h
src/sys/arch/sparc64/include: vmparam.h
src/sys/arch/sun2/include: vmparam.h
src/sys/arch/sun3/include: vmparam.h
src/sys/arch/vax/include: vmparam.h
src/sys/arch/x68k/include: vmparam.h
src/sys/arch/zaurus/include: vmparam.h
src/sys/uvm: uvm_page.c

Log Message:
Remove incomplete, never worked dynamic run-time memory registration
(uvm_page_physload(9)).  This functionality will be re-added later.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/acorn26/include/vmparam.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/acorn32/include/vmparam.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/alpha/include/vmparam.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amd64/include/vmparam.h
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/amiga/include/vmparam.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/atari/include/vmparam.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/cats/include/vmparam.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/cesfic/include/vmparam.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/evbarm/include/vmparam.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/hp300/include/vmparam.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/hpcarm/include/vmparam.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hppa/include/vmparam.h
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/i386/include/vmparam.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/include/vmparam.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/iyonix/include/vmparam.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/luna68k/include/vmparam.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/mac68k/include/vmparam.h
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mips/include/vmparam.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mvme68k/include/vmparam.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/netwinder/include/vmparam.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/news68k/include/vmparam.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/next68k/include/vmparam.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/include/booke/vmparam.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/ibm4xx/vmparam.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/oea/vmparam.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sh3/include/vmparam.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/shark/include/vmparam.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/sparc/include/vmparam.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sparc64/include/vmparam.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sun2/include/vmparam.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sun3/include/vmparam.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/vax/include/vmparam.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x68k/include/vmparam.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/include/vmparam.h
cvs rdiff -u -r1.156 -r1.157 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/sys/arch/acorn26/include/vmparam.h
diff -u src/sys/arch/acorn26/include/vmparam.h:1.9 src/sys/arch/acorn26/include/vmparam.h:1.10
--- src/sys/arch/acorn26/include/vmparam.h:1.9	Fri Mar  6 20:31:46 2009
+++ src/sys/arch/acorn26/include/vmparam.h	Sat Nov  6 15:42:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.9 2009/03/06 20:31:46 joerg Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.10 2010/11/06 15:42:43 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -100,8 +100,6 @@
 
 #define VM_PHYSSEG_STRAT	VM_PSTRAT_BIGFIRST
 
-#define VM_PHYSSEG_NOADD	/* We won't turn up extra memory during autoconfig */
-
 #define VM_NFREELIST		2
 #define VM_

CVS commit: [uebayasi-xip] src/share/man/man4

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

Modified Files:
src/share/man/man4 [uebayasi-xip]: xmd.4

Log Message:
Put the standard TNF copyright.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/share/man/man4/xmd.4

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

Modified files:

Index: src/share/man/man4/xmd.4
diff -u src/share/man/man4/xmd.4:1.1.2.3 src/share/man/man4/xmd.4:1.1.2.4
--- src/share/man/man4/xmd.4:1.1.2.3	Fri Nov  5 08:54:57 2010
+++ src/share/man/man4/xmd.4	Sat Nov  6 15:26:16 2010
@@ -1,6 +1,28 @@
-.\" $NetBSD: xmd.4,v 1.1.2.3 2010/11/05 08:54:57 uebayasi Exp $
+.\" $NetBSD: xmd.4,v 1.1.2.4 2010/11/06 15:26:16 uebayasi Exp $
 .\"
-.\" This file is in the public domain.
+.\" 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.
 .\"
 .Dd October 28, 2010
 .Dt XMD 4



CVS commit: src/sys/uvm

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 12:19:14 UTC 2010

Modified Files:
src/sys/uvm: uvm_object.h

Log Message:
Include uvm/uvm_pglist.h for struct pglist.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/uvm/uvm_object.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/uvm/uvm_object.h
diff -u src/sys/uvm/uvm_object.h:1.28 src/sys/uvm/uvm_object.h:1.29
--- src/sys/uvm/uvm_object.h:1.28	Sat Sep 25 01:42:40 2010
+++ src/sys/uvm/uvm_object.h	Sat Nov  6 12:19:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_object.h,v 1.28 2010/09/25 01:42:40 matt Exp $	*/
+/*	$NetBSD: uvm_object.h,v 1.29 2010/11/06 12:19:14 uebayasi Exp $	*/
 
 /*
  *
@@ -42,6 +42,7 @@
  */
 
 #include 
+#include 
 
 /*
  * uvm_object: all that is left of mach objects.



CVS commit: src/sys/uvm

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 12:18:17 UTC 2010

Modified Files:
src/sys/uvm: uvm_meter.c

Log Message:
Include uvm/uvm.h because this is part of UVM.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/uvm/uvm_meter.c

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

Modified files:

Index: src/sys/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.52 src/sys/uvm/uvm_meter.c:1.53
--- src/sys/uvm/uvm_meter.c:1.52	Fri Apr 16 03:21:49 2010
+++ src/sys/uvm/uvm_meter.c	Sat Nov  6 12:18:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.52 2010/04/16 03:21:49 rmind Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.53 2010/11/06 12:18:17 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.52 2010/04/16 03:21:49 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.53 2010/11/06 12:18:17 uebayasi Exp $");
 
 #include 
 #include 
@@ -49,7 +49,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 
 /*



CVS commit: src/sys/arch

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

Modified Files:
src/sys/arch/alpha/alpha: machdep.c
src/sys/arch/arm/arm32: bus_dma.c mem.c
src/sys/arch/atari/atari: bus.c
src/sys/arch/landisk/landisk: bus_dma.c
src/sys/arch/mips/mips: mips_machdep.c
src/sys/arch/powerpc/oea: cpu_subr.c
src/sys/arch/powerpc/powerpc: bus_dma.c bus_space.c pmap_subr.c
src/sys/arch/sh3/sh3: mem.c sh3_machdep.c
src/sys/arch/sparc/sparc: db_interface.c
src/sys/arch/sparc64/dev: iommu.c
src/sys/arch/sparc64/sparc64: cpu.c db_interface.c
src/sys/arch/vax/include: db_machdep.h
src/sys/arch/vax/vax: pmap.c
src/sys/arch/x86/x86: bus_dma.c cpu.c
src/sys/arch/xen/x86: cpu.c

Log Message:
Machine dependent code is considered as part of UVM.  Include
internal API header.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/arm/arm32/bus_dma.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/arm32/mem.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/atari/atari/bus.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/landisk/landisk/bus_dma.c
cvs rdiff -u -r1.226 -r1.227 src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/powerpc/oea/cpu_subr.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/powerpc/bus_dma.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/powerpc/bus_space.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/powerpc/pmap_subr.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/sh3/sh3/mem.c
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/sh3/sh3/sh3_machdep.c
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/sparc64/dev/iommu.c
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sparc64/sparc64/cpu.c
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/sparc64/sparc64/db_interface.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/vax/include/db_machdep.h
cvs rdiff -u -r1.176 -r1.177 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.50 -r1.51 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/alpha/alpha/machdep.c
diff -u src/sys/arch/alpha/alpha/machdep.c:1.326 src/sys/arch/alpha/alpha/machdep.c:1.327
--- src/sys/arch/alpha/alpha/machdep.c:1.326	Mon Feb  8 19:02:25 2010
+++ src/sys/arch/alpha/alpha/machdep.c	Sat Nov  6 11:46:00 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.326 2010/02/08 19:02:25 joerg Exp $ */
+/* $NetBSD: machdep.c,v 1.327 2010/11/06 11:46:00 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.326 2010/02/08 19:02:25 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.327 2010/11/06 11:46:00 uebayasi Exp $");
 
 #include 
 #include 
@@ -105,7 +105,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 
 #include 

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.53
--- 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	Sat Nov  6 11:46:00 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.53 2010/11/06 11:46:00 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include 
-__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.53 2010/11/06 11:46:00 uebayasi Exp $");
 
 #include 
 #include 
@@ -48,7 +48,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 #include 

Index: src/sys/arch/arm/arm32/mem.c
diff -u src/sys/arch/arm/arm32/mem.c:1.28 src/sys/arch/arm/arm32/mem.c:1.29
--- src/sys/arch/arm/arm32/mem.c:1.28	Tue Nov  2 06:07:05 2010
+++ src/sys/arch/arm/arm32/mem.c	Sat Nov  6 11:46:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.28 2010/11/02 06:07:05 uebayasi Exp $	*/
+/*	$NetBSD: mem.c,v 1.29 2010/11/06 11:46:00 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -76,7 +76,7 @@
 #include "opt_compat_netbsd.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.28 2010/11/02 06:07:05 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.29 2010/11/06 11:46:00 uebayasi Exp $");
 
 #include 
 #include 
@@ -90,7 +90,7 @@
 
 #include 
 
-#include 
+#include 
 
 #define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
 

Index: src/sys/arch/atari/atari/bus.c
diff -u src/sys/arch/atari/atari/bus.c:1.54 src/sys/arch/atari/atari/bus.c:1.55
--- src/sys/arch/atari/atari/bus.c:1.54	Sun Jun  6 04:50:06 2010
+++ src/sy

CVS commit: src/sys/arch/i386/i386

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

Modified Files:
src/sys/arch/i386/i386: compat_16_machdep.c dumpsys.c

Log Message:
These don't use UVM physical page API, don't need uvm/uvm_page.h.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/i386/compat_16_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/i386/dumpsys.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/i386/compat_16_machdep.c
diff -u src/sys/arch/i386/i386/compat_16_machdep.c:1.20 src/sys/arch/i386/i386/compat_16_machdep.c:1.21
--- src/sys/arch/i386/i386/compat_16_machdep.c:1.20	Sat Nov 21 03:11:00 2009
+++ src/sys/arch/i386/i386/compat_16_machdep.c	Sat Nov  6 11:40:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_16_machdep.c,v 1.20 2009/11/21 03:11:00 rmind Exp $	*/
+/*	$NetBSD: compat_16_machdep.c,v 1.21 2010/11/06 11:40:24 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.20 2009/11/21 03:11:00 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.21 2010/11/06 11:40:24 uebayasi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_vm86.h"
@@ -52,7 +52,6 @@
 #include 
 #endif
 #include 
-#include 
 
 #include 
 #include 

Index: src/sys/arch/i386/i386/dumpsys.c
diff -u src/sys/arch/i386/i386/dumpsys.c:1.11 src/sys/arch/i386/i386/dumpsys.c:1.12
--- src/sys/arch/i386/i386/dumpsys.c:1.11	Tue Oct  5 23:48:16 2010
+++ src/sys/arch/i386/i386/dumpsys.c	Sat Nov  6 11:40:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dumpsys.c,v 1.11 2010/10/05 23:48:16 jym Exp $	*/
+/*	$NetBSD: dumpsys.c,v 1.12 2010/11/06 11:40:25 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dumpsys.c,v 1.11 2010/10/05 23:48:16 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dumpsys.c,v 1.12 2010/11/06 11:40:25 uebayasi Exp $");
 
 #include 
 #include 
@@ -83,7 +83,6 @@
 #include 
 
 #include 
-#include 
 
 /*
  * Exports, needed by savecore, the debugger or elsewhere in the kernel.



CVS commit: src/sys/nfs

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

Modified Files:
src/sys/nfs: nfs_subs.c

Log Message:
Include uvm/uvm.h to use UVM internal type (struct vm_page).


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/nfs/nfs_subs.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/nfs/nfs_subs.c
diff -u src/sys/nfs/nfs_subs.c:1.219 src/sys/nfs/nfs_subs.c:1.220
--- src/sys/nfs/nfs_subs.c:1.219	Tue Mar  2 23:19:09 2010
+++ src/sys/nfs/nfs_subs.c	Sat Nov  6 11:00:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_subs.c,v 1.219 2010/03/02 23:19:09 pooka Exp $	*/
+/*	$NetBSD: nfs_subs.c,v 1.220 2010/11/06 11:00:29 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.219 2010/03/02 23:19:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.220 2010/11/06 11:00:29 uebayasi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -99,7 +99,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 #include 



CVS commit: src/sys/dev/isa

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

Modified Files:
src/sys/dev/isa: isv.c

Log Message:
Include uvm/uvm_external.h to access UVM external API (uvm_km_*(9)).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/isa/isv.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/dev/isa/isv.c
diff -u src/sys/dev/isa/isv.c:1.3 src/sys/dev/isa/isv.c:1.4
--- src/sys/dev/isa/isv.c:1.3	Fri Feb 27 23:13:32 2009
+++ src/sys/dev/isa/isv.c	Sat Nov  6 10:59:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: isv.c,v 1.3 2009/02/27 23:13:32 dyoung Exp $ */
+/*	$NetBSD: isv.c,v 1.4 2010/11/06 10:59:45 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,14 +30,15 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isv.c,v 1.3 2009/02/27 23:13:32 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isv.c,v 1.4 2010/11/06 10:59:45 uebayasi Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
+
+#include 
 
 #include 
 



CVS commit: src/sys/dev/tc

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

Modified Files:
src/sys/dev/tc: px.c

Log Message:
Include uvm/uvm.h to access UVM internal.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/tc/px.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/dev/tc/px.c
diff -u src/sys/dev/tc/px.c:1.37 src/sys/dev/tc/px.c:1.38
--- src/sys/dev/tc/px.c:1.37	Sat Aug 22 17:38:06 2009
+++ src/sys/dev/tc/px.c	Sat Nov  6 10:58:12 2010
@@ -1,4 +1,4 @@
-/* 	$NetBSD: px.c,v 1.37 2009/08/22 17:38:06 tsutsui Exp $	*/
+/* 	$NetBSD: px.c,v 1.38 2010/11/06 10:58:12 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.37 2009/08/22 17:38:06 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.38 2010/11/06 10:58:12 uebayasi Exp $");
 
 #include 
 #include 
@@ -42,7 +42,7 @@
 #include 
 #include 
 
-#include 
+#include 	/* XXX uvm_pageboot_alloc */
 
 #if defined(pmax)
 #include 



CVS commit: src/doc

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

Modified Files:
src/doc: BRANCHES

Log Message:
uebayasi-xip: update base.


To generate a diff of this commit:
cvs rdiff -u -r1.297 -r1.298 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.297 src/doc/BRANCHES:1.298
--- src/doc/BRANCHES:1.297	Thu Nov  4 04:33:35 2010
+++ src/doc/BRANCHES	Sat Nov  6 09:21:09 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.297 2010/11/04 04:33:35 uebayasi Exp $
+#	$NetBSD: BRANCHES,v 1.298 2010/11/06 09:21:09 uebayasi Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -1205,7 +1205,7 @@
 Status:		Active
 Start Date:	8 February 2010
 End Date:	
-Base Tag:	uebayasi-xip-base3 (-D20101022)
+Base Tag:	uebayasi-xip-base4 (2010-11-06 UTC)
 Maintainer:	Masao Uebayashi 
 Scope:		src/include src/sbin/mount src/sbin/mount_ffs
 		src/share/man/man4 src/share/man/man9 src/sys



CVS commit: [uebayasi-xip] src/sys

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 08:08:53 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/amd64/conf [uebayasi-xip]: GENERIC
src/sys/arch/amigappc/amigappc [uebayasi-xip]: machdep.c
src/sys/arch/arc/conf [uebayasi-xip]: files.arc
src/sys/arch/arc/pci [uebayasi-xip]: necpb.c
src/sys/arch/arm/arm32 [uebayasi-xip]: mem.c pmap.c
src/sys/arch/arm/marvell [uebayasi-xip]: kirkwood.c
src/sys/arch/bebox/bebox [uebayasi-xip]: autoconf.c machdep.c
src/sys/arch/bebox/conf [uebayasi-xip]: GENERIC
src/sys/arch/bebox/include [uebayasi-xip]: bootinfo.h
src/sys/arch/bebox/pci [uebayasi-xip]: pci_machdep.c
src/sys/arch/bebox/stand/boot [uebayasi-xip]: boot.c
src/sys/arch/dreamcast/dev [uebayasi-xip]: pvr.c pvrvar.h
src/sys/arch/evbarm/conf [uebayasi-xip]: ADI_BRH CP3100 IQ80310 IQ80321
TEAMASA_NPWR TEAMASA_NPWR_FC TWINTAIL
src/sys/arch/evbarm/integrator [uebayasi-xip]: int_bus_dma.c
src/sys/arch/evbppc/conf [uebayasi-xip]: Makefile.ev64260.inc
Makefile.explora.inc Makefile.obs405.inc Makefile.walnut.inc PMPPC
src/sys/arch/hppa/hppa [uebayasi-xip]: pmap.c
src/sys/arch/i386/conf [uebayasi-xip]: ALL GENERIC
src/sys/arch/i386/i386 [uebayasi-xip]: machdep.c vector.S
src/sys/arch/i386/pci [uebayasi-xip]: gcscide.c
src/sys/arch/i386/stand/lib [uebayasi-xip]: exec.c
src/sys/arch/i386/stand/misc [uebayasi-xip]: Makefile
src/sys/arch/ia64/ia64 [uebayasi-xip]: pmap.c
src/sys/arch/mips/mips [uebayasi-xip]: pmap.c
src/sys/arch/ofppc/ofppc [uebayasi-xip]: machdep.c
src/sys/arch/powerpc/oea [uebayasi-xip]: cpu_subr.c pmap.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: pmap_subr.c
src/sys/arch/sandpoint/sandpoint [uebayasi-xip]: iic_eumb.c
src/sys/arch/sh3/sh3 [uebayasi-xip]: pmap.c
src/sys/arch/sparc64/sparc64 [uebayasi-xip]: pmap.c
src/sys/arch/x86/include [uebayasi-xip]: powernow.h
src/sys/arch/xen/x86 [uebayasi-xip]: cpu.c
src/sys/compat/linux/arch/alpha [uebayasi-xip]: linux_fcntl.h
src/sys/compat/linux/arch/amd64 [uebayasi-xip]: linux_fcntl.h
src/sys/compat/linux/arch/arm [uebayasi-xip]: linux_fcntl.h
src/sys/compat/linux/arch/i386 [uebayasi-xip]: linux_fcntl.h
src/sys/compat/linux/arch/m68k [uebayasi-xip]: linux_fcntl.h
src/sys/compat/linux/arch/mips [uebayasi-xip]: linux_fcntl.h
src/sys/compat/linux/arch/powerpc [uebayasi-xip]: linux_fcntl.h
src/sys/compat/linux/common [uebayasi-xip]: linux_emuldata.h
linux_misc.c linux_misc.h linux_misc_notalpha.c linux_socket.c
linux_socket.h linux_statfs.h
src/sys/compat/linux32/arch/amd64 [uebayasi-xip]: linux32_machdep.c
linux32_syscall.h linux32_syscallargs.h linux32_syscalls.c
linux32_sysent.c syscalls.master
src/sys/compat/linux32/common [uebayasi-xip]: linux32_misc.c
linux32_types.h
src/sys/dev/acpi [uebayasi-xip]: acpi.c acpi_acad.c acpi_apm.c
acpi_bat.c acpi_button.c acpi_cpu.c acpi_cpu_pstate.c acpi_debug.c
acpi_display.c acpi_lid.c acpi_pci.c acpi_tz.c acpi_util.c
acpi_verbose.c acpidevs acpidevs_data.h acpivar.h asus_acpi.c
atk0110.c dalb_acpi.c files.acpi hpqlb_acpi.c thinkpad_acpi.c
src/sys/dev/acpi/wmi [uebayasi-xip]: files.wmi wmi_acpi.c wmi_acpivar.h
wmi_dell.c wmi_hp.c
src/sys/dev/ata [uebayasi-xip]: wd.c
src/sys/dev/dm [uebayasi-xip]: device-mapper.c dm.h dm_target_stripe.c
src/sys/dev/ic [uebayasi-xip]: sti.c stireg.h stivar.h wdcvar.h
src/sys/dev/marvell [uebayasi-xip]: mvsata_mv.c
src/sys/dev/pci [uebayasi-xip]: acardide.c aceride.c artsata.c cmdide.c
cypide.c files.pci geodeide.c hptide.c if_nfe.c if_nfevar.h
if_rtk_pci.c iteide.c ixpide.c jmide.c optiide.c pciide.c
pciide_common.c pciidevar.h pdcide.c pdcsata.c piixide.c radeonfb.c
radeonfb_bios.c radeonfbvar.h rccide.c satalink.c siside.c slide.c
stpcide.c svwsata.c toshide.c viaide.c
src/sys/dev/pcmcia [uebayasi-xip]: slhci_pcmcia.c
src/sys/dev/raidframe [uebayasi-xip]: raidframevar.h rf_copyback.c
rf_disks.c rf_netbsdkintf.c rf_reconstruct.c
src/sys/dev/sysmon [uebayasi-xip]: swsensor.c
src/sys/dev/tc [uebayasi-xip]: stic.c
src/sys/dev/usb [uebayasi-xip]: FILES ehci.c files.usb hid.c if_atu.c
if_aue.c if_axe.c if_cue.c if_kue.c if_kuereg.h if_rum.c
if_rumvar.h if_udav.c if_udavreg.h if_upl.c if_ural.c if_uralvar.h
if_url.c if_urlreg.h if_zyd.c if_zydreg.h moscom.c ohci.c ohcivar.h
pseye.c stuirda.c uark

CVS commit: [uebayasi-xip] src/share/man/man9

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 08:07:36 UTC 2010

Modified Files:
src/share/man/man9 [uebayasi-xip]: KASSERT.9

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.10.1 src/share/man/man9/KASSERT.9

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

Modified files:

Index: src/share/man/man9/KASSERT.9
diff -u src/share/man/man9/KASSERT.9:1.7 src/share/man/man9/KASSERT.9:1.7.10.1
--- src/share/man/man9/KASSERT.9:1.7	Fri Jul 11 13:20:17 2008
+++ src/share/man/man9/KASSERT.9	Sat Nov  6 08:07:36 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: KASSERT.9,v 1.7 2008/07/11 13:20:17 gdt Exp $
+.\" $NetBSD: KASSERT.9,v 1.7.10.1 2010/11/06 08:07:36 uebayasi Exp $
 .\"
 .\" Copyright (c) 2006 Igor Sobrado
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 10, 2006
+.Dd October 28, 2010
 .Dt KASSERT 9
 .Os
 .Sh NAME
@@ -68,6 +68,7 @@
 number the failure happened on.
 .Sh SEE ALSO
 .Xr config 1 ,
+.Xr CTASSERT 9 ,
 .Xr panic 9 ,
 .Xr printf 9
 .Sh AUTHORS



CVS commit: [uebayasi-xip] src/share/man/man4

2010-11-06 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Nov  6 08:05:45 UTC 2010

Modified Files:
src/share/man/man4 [uebayasi-xip]: Makefile acpi.4 acpivga.4 acpiwmi.4
fss.4 swwdog.4 wapbl.4
Added Files:
src/share/man/man4 [uebayasi-xip]: fujitsu.4 otus.4

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.516.2.2 -r1.516.2.3 src/share/man/man4/Makefile
cvs rdiff -u -r1.50.2.2 -r1.50.2.3 src/share/man/man4/acpi.4
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/share/man/man4/acpivga.4
cvs rdiff -u -r1.4 -r1.4.2.1 src/share/man/man4/acpiwmi.4
cvs rdiff -u -r1.13 -r1.13.2.1 src/share/man/man4/fss.4
cvs rdiff -u -r0 -r1.4.2.2 src/share/man/man4/fujitsu.4
cvs rdiff -u -r0 -r1.3.2.2 src/share/man/man4/otus.4
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/share/man/man4/swwdog.4
cvs rdiff -u -r1.12 -r1.12.2.1 src/share/man/man4/wapbl.4

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

Modified files:

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.516.2.2 src/share/man/man4/Makefile:1.516.2.3
--- src/share/man/man4/Makefile:1.516.2.2	Fri Oct 22 07:11:53 2010
+++ src/share/man/man4/Makefile	Sat Nov  6 08:05:44 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.516.2.2 2010/10/22 07:11:53 uebayasi Exp $
+#	$NetBSD: Makefile,v 1.516.2.3 2010/11/06 08:05:44 uebayasi Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -24,7 +24,7 @@
 	dmphy.4 dpt.4 dpti.4 drm.4 drum.4 \
 	eap.4 ebus.4 edc.4 elmc.4 emuxki.4 en.4 envsys.4 ep.4 esh.4 esis.4 \
 	esa.4 esiop.4 esm.4 eso.4 etherip.4 exphy.4 \
-	fast_ipsec.4 fd.4 finsio.4 fpa.4 fms.4 fss.4 fxp.4 \
+	fast_ipsec.4 fd.4 finsio.4 fpa.4 fms.4 fss.4 fujitsu.4 fxp.4 \
 	gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \
 	glxtphy.4 gpib.4 gpio.4 gpiolock.4 gpiosim.4 gre.4 gphyter.4 gsip.4 \
 	hdaudio.4 hifn.4 hme.4 hpqlb.4 hptide.4 \
@@ -41,7 +41,7 @@
 	mtio.4 multicast.4 mvsata.4 \
 	nadb.4 ne.4 neo.4 netintro.4 nfe.4 nfsmb.4 njata.4 njs.4 \
 	nsclpcsio.4 nsp.4 nsphy.4 nsphyter.4 ntwoc.4 null.4 nsmb.4 \
-	oak.4 oosiop.4 opl.4 options.4 optiide.4 osiop.4 \
+	oak.4 oosiop.4 opl.4 options.4 optiide.4 osiop.4 otus.4 \
 	pad.4 pas.4 pcdisplay.4 pciide.4 pckbc.4 pckbd.4 pcn.4 pcppi.4 \
 	pcscp.4 pcweasel.4 pdcide.4 pdcsata.4 piixide.4 piixpcib.4 piixpm.4 \
 	pim.4 plip.4 pms.4 pmu.4 pnaphy.4 ppbus.4 ppp.4 pppoe.4 pseye.4 \
@@ -148,7 +148,9 @@
 
 MLINKS+=acpiec.4 acpiecdt.4
 MLINKS+=acpivga.4 acpiout.4
-MLINKS+=acpiwmi.4 wmidell.4 acpiwmi.4 wmihp.4
+MLINKS+=acpiwmi.4 wmidell.4 \
+	acpiwmi.4 wmihp.4 \
+	acpiwmi.4 wmimsi.4
 MLINKS+=aibs.4 aiboost.4
 MLINKS+=ata.4 atabus.4
 MLINKS+=audio.4 audioctl.4
@@ -172,6 +174,7 @@
 MLINKS+=dbcool.4 adt7476.4
 MLINKS+=fd.4 stderr.4 fd.4 stdin.4 fd.4 stdout.4
 MLINKS+=fpa.4 fea.4 fpa.4 fta.4
+MLINKS+=fujitsu.4 fujbp.4 fujitsu.4 fujhk.4
 MLINKS+=hdaudio.4 hdafg.4
 MLINKS+=hdaudio.4 hdaudiobus.4
 MLINKS+=icp.4 icpsp.4

Index: src/share/man/man4/acpi.4
diff -u src/share/man/man4/acpi.4:1.50.2.2 src/share/man/man4/acpi.4:1.50.2.3
--- src/share/man/man4/acpi.4:1.50.2.2	Fri Oct 22 07:11:53 2010
+++ src/share/man/man4/acpi.4	Sat Nov  6 08:05:44 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpi.4,v 1.50.2.2 2010/10/22 07:11:53 uebayasi Exp $
+.\" $NetBSD: acpi.4,v 1.50.2.3 2010/11/06 08:05:44 uebayasi Exp $
 .\"
 .\" Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 6, 2010
+.Dd October 24, 2010
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -225,6 +225,9 @@
 .It Xr acpitz 4
 .Tn ACPI
 thermal zones.
+.It Xr acpivga 4
+.Tn ACPI
+display adapter and output devices.
 .It Xr acpiwmi 4
 .Tn ACPI
 support for Windows Management Instrumentation.
@@ -442,6 +445,7 @@
 .It Li ACPI_LID_COMPONENT Ta ACPI_LV_OPTIMIZATIONS
 .It Li ACPI_RESOURCE_COMPONENT Ta ACPI_LV_VERBOSITY2 *
 .It Li ACPI_TZ_COMPONENT Ta
+.It Li ACPI_DISPLAY_COMPONENT Ta
 .It Li ACPI_ALL_DRIVERS * Ta ACPI_LV_MUTEX
 .It Ta ACPI_LV_THREADS
 .It Ta ACPI_LV_IO
@@ -569,6 +573,8 @@
 .%A Len Brown
 .%T ACPI in Linux - Myths vs. Reality
 .%D June 27-30, 2007
+.%O Proceedings of the Linux Symposium
+.%P 65-74
 .%U http://www.linuxsymposium.org/archives/OLS/Reprints-2007/brown_1-Reprint.pdf
 .Re
 .Rs
@@ -577,7 +583,8 @@
 .%T Sleeping Beauty - NetBSD on Modern Laptops
 .%D February 3, 2008
 .%O Proceedings of AsiaBSDCon 2008
-.%P pp. 127-134
+.%P 127-134
+.%U http://2008.asiabsdcon.org/papers/P9A-paper.pdf
 .Re
 .Sh HISTORY
 The

Index: src/share/man/man4/acpivga.4
diff -u src/share/man/man4/acpivga.4:1.1.2.2 src/share/man/man4/acpivga.4:1.1.2.3
--- src/share/man/man4/acpivga.4:1.1.2.2	Fri Oct 22 07:11:53 2010
+++ src/share/man/man4/acpivga.4	Sat Nov  6 08:05:44 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpivga.4,v 1.1.2.2 2010/10/22 07:11:53 uebayasi Exp $
+.\" $NetBSD: acpivga.4,v 1.1.2.3 

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

2010-11-05 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 
-__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 
 #include 
@@ -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 
 
-__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/share/man/man9

2010-11-05 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov  5 08:55:57 UTC 2010

Modified Files:
src/share/man/man9 [uebayasi-xip]: disk.9

Log Message:
Document DIOCGPHYSSEG.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.2.1 src/share/man/man9/disk.9

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

Modified files:

Index: src/share/man/man9/disk.9
diff -u src/share/man/man9/disk.9:1.35 src/share/man/man9/disk.9:1.35.2.1
--- src/share/man/man9/disk.9:1.35	Wed Dec 30 14:53:02 2009
+++ src/share/man/man9/disk.9	Fri Nov  5 08:55:57 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: disk.9,v 1.35 2009/12/30 14:53:02 wiz Exp $
+.\"	$NetBSD: disk.9,v 1.35.2.1 2010/11/05 08:55:57 uebayasi Exp $
 .\"
 .\" Copyright (c) 1995, 1996 Jason R. Thorpe.
 .\" All rights reserved.
@@ -30,7 +30,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd December 30, 2009
+.Dd November 5, 2010
 .Dt DISK 9
 .Os
 .Sh NAME
@@ -299,6 +299,11 @@
 Set disk buffer queue strategy.
 .It Dv DIOCGDISKINFO "struct plistref"
 Get disk-info dictionary.
+.It Dv DIOCGPHYSSEG "void *phys"
+Return a VM physical segment cookie allocated for the device to
+VFS, to support
+.Xr xip 4
+functionality.
 .El
 .Sh USING THE FRAMEWORK
 This section includes a description on basic use of the framework



CVS commit: [uebayasi-xip] src/share/man/man4

2010-11-05 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov  5 08:55:26 UTC 2010

Added Files:
src/share/man/man4 [uebayasi-xip]: xip.4

Log Message:
Brief introduction of xip(4).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/share/man/man4/xip.4

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

Added files:

Index: src/share/man/man4/xip.4
diff -u /dev/null src/share/man/man4/xip.4:1.1.2.1
--- /dev/null	Fri Nov  5 08:55:26 2010
+++ src/share/man/man4/xip.4	Fri Nov  5 08:55:26 2010
@@ -0,0 +1,94 @@
+.\" $NetBSD: xip.4,v 1.1.2.1 2010/11/05 08:55:26 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.
+.\"
+.Dd November 4, 2010
+.Dt XIP 4
+.Os
+.
+.Sh NAME
+.Nm XIP
+.Nd eXecute-In-Place
+.
+.Sh SYNOPSIS
+.Cd options XIP
+.
+.Sh DESCRIPTION
+The
+.Nm
+option enables a functionality for the kernel to execute programs
+directly from memory-addressable device pages.
+Normally the kernel allocates memory pages (page cache) and copies
+file contents onto them, because most filesystem storage devices
+are accessed by I/O.
+There are devices whole data can be memory-mapped.
+.Pp
+By using
+.Nm ,
+the kernel maps those file contents directly into user process's
+address space.
+This brings us to save memory used for page caches, and shorten
+program load time compared to slow I/O storage devices.
+.Pp
+Needless to say, not all block devices can be capable of XIP.
+Only memory-mappable block devices, i.e., NOR FlashROM, and RAM
+based memory disk.
+To support XIP, block device drivers need to allocate a VM device
+physical segment beforehand, and return it at the request of
+DIOCGPHYSSEG ioctl, called from VFS.
+VM device physical segment is allocated by calling the
+.Xr bus_space_physload_device
+function in
+.Xr bus_space 9
+API.
+.
+.Sh SEE ALSO
+.Xr flash 4 ,
+.Xr xmd 4 ,
+.Xr mount 8 ,
+.Xr bus_space 9 ,
+.Xr disk 9 ,
+.Xr uvm 9
+.
+.Sh CAVEATS
+.Pp
+Don't confuse memory-mappable NOR FlashROM and FlashROM based
+storage device.  To access the latter, CPU uses I/O instead of
+MMIO.
+.
+.Sh HISTORY
+.Pp
+.Nm
+first appeared in
+.Nx 6.0 .
+.
+.Sh AUTHORS
+The
+.Nm
+support was added by Masao Uebayashi.
+.
+.Sh BUGS
+.Pp
+Write operation is not supported.



CVS commit: [uebayasi-xip] src/share/man/man4

2010-11-05 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Nov  5 08:54:57 UTC 2010

Modified Files:
src/share/man/man4 [uebayasi-xip]: xmd.4

Log Message:
Document HOWTO.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/share/man/man4/xmd.4

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

Modified files:

Index: src/share/man/man4/xmd.4
diff -u src/share/man/man4/xmd.4:1.1.2.2 src/share/man/man4/xmd.4:1.1.2.3
--- src/share/man/man4/xmd.4:1.1.2.2	Thu Oct 28 03:27:55 2010
+++ src/share/man/man4/xmd.4	Fri Nov  5 08:54:57 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: xmd.4,v 1.1.2.2 2010/10/28 03:27:55 uebayasi Exp $
+.\" $NetBSD: xmd.4,v 1.1.2.3 2010/11/05 08:54:57 uebayasi Exp $
 .\"
 .\" This file is in the public domain.
 .\"
@@ -24,11 +24,77 @@
 device may be used as a disk.
 .Nm
 disks should be mounted as read-only to enable XIP.
+.Sh EXAMPLES
+.Bl -enum
+.It
+Prepare a kernel compiled with the
+.Xr xip 4
+option:
+.Bd -literal -offset indent
+options XIP
+pseudo-device xmd 1
+options XMD_ROOT_SIZE XXX
+.Ed
+.It
+Prepare an
+.Xr ffs 4
+image, typically created by
+.Xr makefs 8 :
+.Bd -literal -offset indent
+% cd /
+% makefs /tmp/xmd.fs bin
+.Ed
+.It
+Embed the
+.Xr ffs 4
+image into the kernel image:
+.Bd -literal -offset indent
+% mdsetimage -I _xmd_root_image -S _xmd_root_size /tmp/netbsd.xmd /tmp/xmd.fs
+.Ed
+.It
+Run the kernel, prepare device file entry:
+.Bd -literal -offset indent
+% mknod /dev/xmd0a b XXX XXX
+.Ed
+.It
+Mount the
+.Xr xmd
+disk partition as XIP:
+.Bd -literal -offset indent
+% mount -o ro,xip /dev/xmd0a /xmd
+.Ed
+.It
+Execute a program and see if it works as expected:
+.Bd -literal -offset indent
+% time -l /xmd/date
+Fri Oct 15 09:08:57 GMT 2010
+0.02 real 0.00 user 0.00 sys
+ 0  maximum resident set size
+ 0  average shared memory size
+ 0  average unshared data size
+ 0  average unshared stack size
+72  page reclaims
+ 0  page faults
+ 0  swaps
+ 0  block input operations
+ 0  block output operations
+ 2  messages sent
+ 2  messages received
+ 0  signals received
+ 2  voluntary context switches
+ 1  involuntary context switches
+%
+.Ed
+.Pp
+Note the "page faults" counter shows that no I/O paging activity
+was executed during the process's lifetime.
+.El
 .Sh SEE ALSO
 .Xr md 4 ,
 .Xr options 4 ,
 .Xr mdsetimage 8
 .Sh BUGS
+.Pp
 Due to the design of XIP, device pages in a physical segment must
 be contiguous.
 This leads to a restriction that the page array in the
@@ -37,3 +103,7 @@
 It is highly expectable that the
 .Nm
 kernel module will not work.
+.Pp
+Only one instace can be compiled in one kernel.
+You can add more by modifying the source code (src/sys/dev/xmd.c)
+directly, but there's no good user interface to configure it.



CVS commit: src/sys/arch/evbarm/integrator

2010-11-04 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov  4 12:16:15 UTC 2010

Modified Files:
src/sys/arch/evbarm/integrator: int_bus_dma.c

Log Message:
Fix DEBUG kernel build.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/integrator/int_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/evbarm/integrator/int_bus_dma.c
diff -u src/sys/arch/evbarm/integrator/int_bus_dma.c:1.16 src/sys/arch/evbarm/integrator/int_bus_dma.c:1.17
--- src/sys/arch/evbarm/integrator/int_bus_dma.c:1.16	Mon Mar  5 08:37:38 2007
+++ src/sys/arch/evbarm/integrator/int_bus_dma.c	Thu Nov  4 12:16:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: int_bus_dma.c,v 1.16 2007/03/05 08:37:38 matt Exp $	*/
+/*	$NetBSD: int_bus_dma.c,v 1.17 2010/11/04 12:16:15 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
 #define	_ARM32_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: int_bus_dma.c,v 1.16 2007/03/05 08:37:38 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: int_bus_dma.c,v 1.17 2010/11/04 12:16:15 uebayasi Exp $");
 
 #include 
 #include 
@@ -87,6 +87,7 @@
 #define ID_BUFTYPE_UIO		3
 #define ID_BUFTYPE_RAW		4
 
+#undef	DEBUG
 #define DEBUG(x)
 
 static struct arm32_dma_range integrator_dma_ranges[DRAM_BLOCKS];



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

2010-11-04 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov  4 11:57:49 UTC 2010

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

Log Message:
Style.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.59 -r1.153.2.60 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.59 src/sys/uvm/uvm_page.c:1.153.2.60
--- src/sys/uvm/uvm_page.c:1.153.2.59	Thu Nov  4 08:47:38 2010
+++ src/sys/uvm/uvm_page.c	Thu Nov  4 11:57:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.59 2010/11/04 08:47:38 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.60 2010/11/04 11:57:49 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.59 2010/11/04 08:47:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.60 2010/11/04 11:57:49 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -2208,8 +2208,7 @@
 uvm_pageismanaged(paddr_t pa)
 {
 
-	return
-	(vm_physseg_find(atop(pa), NULL) != -1);
+	return vm_physseg_find(atop(pa), NULL) != -1;
 }
 
 /*
@@ -2221,8 +2220,7 @@
 uvm_pageismanaged_device(paddr_t pa)
 {
 
-	return
-	(vm_physseg_find_device(atop(pa), NULL) != -1);
+	return vm_physseg_find_device(atop(pa), NULL) != -1;
 }
 
 /*



CVS commit: [uebayasi-xip] src/sys

2010-11-04 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov  4 08:47:38 UTC 2010

Modified Files:
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/miscfs/genfs [uebayasi-xip]: genfs_io.c
src/sys/uvm [uebayasi-xip]: uvm_bio.c uvm_fault.c uvm_page.c uvm_page.h

Log Message:
Split physical device segment pages from "managed" to "managed
device".  Cache that information as a flag PG_DEVICE so that callers
don't need to walk physsegs everytime.

Remove PQ_FIXED, which means that page daemon doesn't need to know
device segment pages at all.  But still fault handlers need to know
them.

I think this is what I can do best now.


To generate a diff of this commit:
cvs rdiff -u -r1.55.2.5 -r1.55.2.6 src/sys/arch/m68k/m68k/pmap_motorola.c
cvs rdiff -u -r1.188.2.6 -r1.188.2.7 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.60.2.7 -r1.60.2.8 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.36.2.28 -r1.36.2.29 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.68.2.11 -r1.68.2.12 src/sys/uvm/uvm_bio.c
cvs rdiff -u -r1.166.2.21 -r1.166.2.22 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.153.2.58 -r1.153.2.59 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.59.2.32 -r1.59.2.33 src/sys/uvm/uvm_page.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/m68k/m68k/pmap_motorola.c
diff -u src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.5 src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.6
--- src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.5	Sun Oct 31 03:46:17 2010
+++ src/sys/arch/m68k/m68k/pmap_motorola.c	Thu Nov  4 08:47:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.c,v 1.55.2.5 2010/10/31 03:46:17 uebayasi Exp $*/
+/*	$NetBSD: pmap_motorola.c,v 1.55.2.6 2010/11/04 08:47:36 uebayasi Exp $*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -119,7 +119,7 @@
 #include "opt_m68k_arch.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.55.2.5 2010/10/31 03:46:17 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.55.2.6 2010/11/04 08:47:36 uebayasi Exp $");
 
 #include 
 #include 
@@ -285,7 +285,8 @@
 struct pv_entry *pmap_alloc_pv(void);
 void	pmap_free_pv(struct pv_entry *);
 
-#define	PAGE_IS_MANAGED(pa)	(pmap_initialized && uvm_pageismanaged(pa))
+#define	PAGE_IS_MANAGED(pa)	(pmap_initialized && \
+	(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.6 src/sys/arch/mips/mips/pmap.c:1.188.2.7
--- src/sys/arch/mips/mips/pmap.c:1.188.2.6	Sun Oct 31 03:46:18 2010
+++ src/sys/arch/mips/mips/pmap.c	Thu Nov  4 08:47:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.188.2.6 2010/10/31 03:46:18 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.188.2.7 2010/11/04 08:47:37 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.188.2.6 2010/10/31 03:46:18 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.188.2.7 2010/11/04 08:47:37 uebayasi Exp $");
 
 /*
  *	Manages physical address maps.
@@ -225,7 +225,8 @@
 
 bool		pmap_initialized = false;
 
-#define PAGE_IS_MANAGED(pa)	(pmap_initialized && uvm_pageismanaged(pa))
+#define PAGE_IS_MANAGED(pa)	(pmap_initialized && \
+	(uvm_pageismanaged(pa) || uvm_pageismanaged_device(pa))
 
 #define PMAP_IS_ACTIVE(pm)		\
 	((pm) == pmap_kernel() || 	\
@@ -1553,7 +1554,7 @@
 pmap_mmap(vaddr_t addr, off_t off)
 {
 
-	return mips_btop(vtophys(addr + off));
+	return mips_btop(MIPS_KSEG0_TO_PHYS(addr + off));
 }
 
 /*

Index: src/sys/arch/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.7 src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.8
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.60.2.7	Sun Oct 31 03:46:18 2010
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Thu Nov  4 08:47:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.60.2.7 2010/10/31 03:46:18 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.60.2.8 2010/11/04 08:47:37 uebayasi Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.60.2.7 2010/10/31 03:46:18 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.60.2.8 2010/11/04 08:47:37 uebayasi Exp $");
 
 #include "opt_xip.h"
 
@@ -851,7 +851,8 @@
 	if (flags & PMAP_WIRED)
 		flags |= prot;
 
-	managed = ((flags & PMAP_NOCACHE) == 0) && uvm_pageismanaged(pa);
+	managed = ((flags & PMAP_NOCACHE) == 0) &&
+	(uvm_pageismanaged(pa) || uvm_pageismanaged_device(pa));
 
 	/*
 	 * Generate TTE.

Index: src/sys/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.36.2.28 src/sys/miscfs/genfs/genfs_io.c:1.36.2.29
--- src/sys/miscfs/genfs/genfs_io.c:1.36.2.28	Thu Nov  4 07:31

CVS commit: [uebayasi-xip] src/sys/miscfs/genfs

2010-11-04 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov  4 07:31:27 UTC 2010

Modified Files:
src/sys/miscfs/genfs [uebayasi-xip]: genfs_io.c

Log Message:
Remove a XXX comment which is only confusing.


To generate a diff of this commit:
cvs rdiff -u -r1.36.2.27 -r1.36.2.28 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.36.2.27 src/sys/miscfs/genfs/genfs_io.c:1.36.2.28
--- src/sys/miscfs/genfs/genfs_io.c:1.36.2.27	Fri Oct 22 07:22:34 2010
+++ src/sys/miscfs/genfs/genfs_io.c	Thu Nov  4 07:31:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.36.2.27 2010/10/22 07:22:34 uebayasi Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.36.2.28 2010/11/04 07:31:27 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.27 2010/10/22 07:22:34 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.28 2010/11/04 07:31:27 uebayasi Exp $");
 
 #include "opt_xip.h"
 
@@ -781,9 +781,6 @@
  *  Return "direct pages" of XIP vnode.  The block addresses of XIP
  *  vnode pages are returned back to the VM fault handler as the
  *	actually mapped physical addresses.
- *
- * XXX Should be merged into genfs_do_getpages() after
- * XXX genfs_do_getpages() and genfs_do_io() are merged.
  */
 static int
 genfs_do_getpages_xip(void *v)



CVS commit: [uebayasi-xip] src

2010-11-04 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov  4 07:30:00 UTC 2010

Modified Files:
src/external/gpl3/binutils/usr.sbin/mdsetimage [uebayasi-xip]:
mdsetimage.8 mdsetimage.c
src/sys/dev [uebayasi-xip]: xmd.c
src/usr.sbin/mdsetimage [uebayasi-xip]: mdsetimage.8 mdsetimage.c

Log Message:
xmd(4), mdsetimage(8): handle memory disk symbol names other than
the md(4)'s historical ones.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.2.1 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/dev/xmd.c
cvs rdiff -u -r1.9 -r1.9.48.1 src/usr.sbin/mdsetimage/mdsetimage.8
cvs rdiff -u -r1.19 -r1.19.2.1 src/usr.sbin/mdsetimage/mdsetimage.c

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

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1 src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1.2.1
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8:1.1	Tue Aug 18 20:22:20 2009
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8	Thu Nov  4 07:29:59 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mdsetimage.8,v 1.1 2009/08/18 20:22:20 skrll Exp $
+.\"	$NetBSD: mdsetimage.8,v 1.1.2.1 2010/11/04 07:29:59 uebayasi Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\"
 .\" <>
 .\"
-.Dd September 27, 2002
+.Dd November 4, 2010
 .Dt MDSETIMAGE 8
 .Os
 .Sh NAME
@@ -36,6 +36,8 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl svx
+.Op Fl I Ar image_symbol
+.Op Fl S Ar size_symbol
 .Op Fl b Ar bfdname
 .Ar kernel
 .Ar image
@@ -51,6 +53,13 @@
 will typically be used by the kernel
 as the root file system.
 .Pp
+The
+.Fl I
+and
+.Fl S
+flags specify the symbol names of image and size of memory disk
+drivers respectively.
+.Pp
 To recognize kernel executable format, the
 .Fl b
 flag specifies BFD name of kernel.
@@ -80,4 +89,5 @@
 This is the opposite of the default behavior.
 .Sh SEE ALSO
 .Xr md 4 ,
+.Xr xmd 4 ,
 .Xr mdconfig 8
Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c:1.1 src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c:1.1.2.1
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c:1.1	Tue Aug 18 20:22:20 2009
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c	Thu Nov  4 07:30:00 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mdsetimage.c,v 1.1 2009/08/18 20:22:20 skrll Exp $ */
+/* $NetBSD: mdsetimage.c,v 1.1.2.1 2010/11/04 07:30:00 uebayasi Exp $ */
 /* from: NetBSD: mdsetimage.c,v 1.15 2001/03/21 23:46:48 cgd Exp $ */
 
 /*
@@ -38,7 +38,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1996\
  Christopher G. Demetriou.  All rights reserved.");
-__RCSID("$NetBSD: mdsetimage.c,v 1.1 2009/08/18 20:22:20 skrll Exp $");
+__RCSID("$NetBSD: mdsetimage.c,v 1.1.2.1 2010/11/04 07:30:00 uebayasi Exp $");
 #endif /* not lint */
 
 #include 
@@ -58,13 +58,9 @@
 struct symbols {
 	char *name;
 	size_t offset;
-} md_root_symbols[] = {
+};
 #define	X_MD_ROOT_IMAGE	0
-	{ "_md_root_image", 0 },
 #define	X_MD_ROOT_SIZE	1
-	{ "_md_root_size", 0 },
-	{ NULL, 0 }
-};
 
 #define	CHUNKSIZE	(64 * 1024)
 
@@ -94,11 +90,21 @@
 	char *bfdname = NULL;
 	bfd *abfd;
 	ssize_t left_to_copy;
+	struct symbols md_root_symbols[3] = { { 0 } };
+
+	md_root_symbols[X_MD_ROOT_IMAGE].name = "_md_root_image";
+	md_root_symbols[X_MD_ROOT_SIZE].name = "_md_root_size";
 
 	setprogname(argv[0]);
 
-	while ((ch = getopt(argc, argv, "b:svx")) != -1)
+	while ((ch = getopt(argc, argv, "I:S:b:svx")) != -1)
 		switch (ch) {
+		case 'I':
+			md_root_symbols[X_MD_ROOT_IMAGE].name = optarg;
+			break;
+		case 'S':
+			md_root_symbols[X_MD_ROOT_SIZE].name = optarg;
+			break;
 		case 'b':
 			bfdname = optarg;
 			break;

Index: src/sys/dev/xmd.c
diff -u src/sys/dev/xmd.c:1.1.2.5 src/sys/dev/xmd.c:1.1.2.6
--- src/sys/dev/xmd.c:1.1.2.5	Sat Oct 30 08:51:10 2010
+++ src/sys/dev/xmd.c	Thu Nov  4 07:30:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmd.c,v 1.1.2.5 2010/10/30 08:51:10 uebayasi Exp $	*/
+/*	$NetBSD: xmd.c,v 1.1.2.6 2010/11/04 07:30:00 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 Tsubai Masanari.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xmd.c,v 1.1.2.5 2010/10/30 08:51:10 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xmd.c,v 1.1.2.6 2010/11/04 07:30:00 uebayasi Exp $");
 
 #include "opt_xip.h"
 #include "opt_xmd.h"
@@ -86,9 +86,9 @@
 CFATTACH_DECL3_NEW(xmd, sizeof(struct xmd_softc),
 NULL, xmd_attach, xmd_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN);
 
-const char md_root_image[XMD_ROOT_SIZE << DEV_BSHIFT] __aligned(PAGE_SIZE) =
+const char xmd_root_image[XMD_ROOT_SIZE << DEV_BSHIFT] __aligned(PAGE_SIZE)

CVS commit: src/doc

2010-11-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov  4 04:33:35 UTC 2010

Modified Files:
src/doc: BRANCHES

Log Message:
uebayasi-xip: add mdsetimage directories.


To generate a diff of this commit:
cvs rdiff -u -r1.296 -r1.297 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.296 src/doc/BRANCHES:1.297
--- src/doc/BRANCHES:1.296	Fri Oct 29 16:15:40 2010
+++ src/doc/BRANCHES	Thu Nov  4 04:33:35 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.296 2010/10/29 16:15:40 uebayasi Exp $
+#	$NetBSD: BRANCHES,v 1.297 2010/11/04 04:33:35 uebayasi Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -1210,6 +1210,8 @@
 Scope:		src/include src/sbin/mount src/sbin/mount_ffs
 		src/share/man/man4 src/share/man/man9 src/sys
 		src/share/man/man5/statvfs.5
+		src/external/gpl3/binutils/usr.sbin/mdsetimage
+		src/usr.sbin/mdsetimage
 Notes:		Goals:
 		- Clean up oddities in fault handler
 		- Add a notion of device page



CVS commit: src/sys/arch/arm/arm32

2010-11-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Nov  3 16:59:19 UTC 2010

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Fix build of IXM1200 too.  Pointed out by cegger, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 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.216 src/sys/arch/arm/arm32/pmap.c:1.217
--- src/sys/arch/arm/arm32/pmap.c:1.216	Tue Nov  2 06:33:22 2010
+++ src/sys/arch/arm/arm32/pmap.c	Wed Nov  3 16:59:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.216 2010/11/02 06:33:22 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.217 2010/11/03 16:59:19 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
 #include 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.216 2010/11/02 06:33:22 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.217 2010/11/03 16:59:19 uebayasi Exp $");
 
 #define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
 
@@ -2577,7 +2577,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();



CVS commit: src/sys/miscfs/genfs

2010-11-02 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Nov  3 04:32:50 UTC 2010

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
genfs_getpages: restore vm_page array correctly in PGO_LOCKED error
code path.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.40 src/sys/miscfs/genfs/genfs_io.c:1.41
--- src/sys/miscfs/genfs/genfs_io.c:1.40	Wed Sep  1 16:56:19 2010
+++ src/sys/miscfs/genfs/genfs_io.c	Wed Nov  3 04:32:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.40 2010/09/01 16:56:19 chs Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.41 2010/11/03 04:32:50 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.40 2010/09/01 16:56:19 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.41 2010/11/03 04:32:50 uebayasi Exp $");
 
 #include 
 #include 
@@ -236,9 +236,10 @@
 			for (i = 0; i < npages; i++) {
 pg = ap->a_m[i];
 
-if (pg != NULL || pg != PGO_DONTCARE) {
+if (pg != NULL && pg != PGO_DONTCARE) {
 	ap->a_m[i] = NULL;
 }
+KASSERT(pg == NULL || pg == PGO_DONTCARE);
 			}
 		} else {
 			genfs_node_unlock(vp);



CVS commit: [uebayasi-xip] src

2010-11-02 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov  2 14:05:28 UTC 2010

Modified Files:
src/share/man/man9 [uebayasi-xip]: uvm.9
src/sys/arch/arm/imx [uebayasi-xip]: imx31_space.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: bus_space.c
src/sys/common/pmap [uebayasi-xip]: pmap_common.c
src/sys/uvm [uebayasi-xip]: uvm_extern.h uvm_page.c

Log Message:
Drop the 'paddr_t avail_start' and 'paddr_t avail_end' arguments
from uvm_page_physload_device(9).

Those two arguments are used by uvm_page_physload(9) to specify a
range of physical memory available for general purpose pages (pages
which are linked to freelists).  Totally irrelevant to device
segments.


To generate a diff of this commit:
cvs rdiff -u -r1.102.2.1 -r1.102.2.2 src/share/man/man9/uvm.9
cvs rdiff -u -r1.3.2.5 -r1.3.2.6 src/sys/arch/arm/imx/imx31_space.c
cvs rdiff -u -r1.20.20.2 -r1.20.20.3 src/sys/arch/powerpc/powerpc/bus_space.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/common/pmap/pmap_common.c
cvs rdiff -u -r1.161.2.9 -r1.161.2.10 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.153.2.57 -r1.153.2.58 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/share/man/man9/uvm.9
diff -u src/share/man/man9/uvm.9:1.102.2.1 src/share/man/man9/uvm.9:1.102.2.2
--- src/share/man/man9/uvm.9:1.102.2.1	Thu Oct 21 17:16:28 2010
+++ src/share/man/man9/uvm.9	Tue Nov  2 14:05:27 2010
@@ -1,5 +1,6 @@
-.\"	$NetBSD: uvm.9,v 1.102.2.1 2010/10/21 17:16:28 uebayasi Exp $
+.\"	$NetBSD: uvm.9,v 1.102.2.2 2010/11/02 14:05:27 uebayasi Exp $
 .\"
+.\" Copyright (c) 2010 The NetBSD Froundation, Inc.
 .\" Copyright (c) 1998 Matthew R. Green
 .\" All rights reserved.
 .\"
@@ -24,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd October 21, 2010
+.Dd November 2, 2010
 .Dt UVM 9
 .Os
 .Sh NAME
@@ -659,7 +660,7 @@
 .It Ft void
 .Fn uvm_page_physunload "void *physseg" ;
 .It Ft void *
-.Fn uvm_page_physload_device "paddr_t start" "paddr_t end" "paddr_t avail_start" "paddr_t avail_end" "int prot" "int flags" ;
+.Fn uvm_page_physload_device "paddr_t start" "paddr_t end" "int prot" "int flags" ;
 .It Ft void
 .Fn uvm_page_physunload_device "void *physseg" ;
 .El
@@ -707,11 +708,7 @@
 .Fa start
 and
 .Fa end
-of the physical addresses of the segment, and the
-.Fa avail_start
-and
-.Fa avail_end
-addresses of pages not already in use.
+of the physical addresses of the segment.
 The
 .Fa prot
 describes the potential protection (region accessibility) of the

Index: src/sys/arch/arm/imx/imx31_space.c
diff -u src/sys/arch/arm/imx/imx31_space.c:1.3.2.5 src/sys/arch/arm/imx/imx31_space.c:1.3.2.6
--- src/sys/arch/arm/imx/imx31_space.c:1.3.2.5	Wed Jul 28 04:16:12 2010
+++ src/sys/arch/arm/imx/imx31_space.c	Tue Nov  2 14:05:27 2010
@@ -1,7 +1,7 @@
-/* $Id: imx31_space.c,v 1.3.2.5 2010/07/28 04:16:12 uebayasi Exp $ */
+/* $Id: imx31_space.c,v 1.3.2.6 2010/11/02 14:05:27 uebayasi Exp $ */
 
 /* derived from: */
-/*	$NetBSD: imx31_space.c,v 1.3.2.5 2010/07/28 04:16:12 uebayasi Exp $ */
+/*	$NetBSD: imx31_space.c,v 1.3.2.6 2010/11/02 14:05:27 uebayasi Exp $ */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -306,7 +306,7 @@
 	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, prot, flags);
+	return uvm_page_physload_device(start, end, prot, flags);
 }
 
 void

Index: src/sys/arch/powerpc/powerpc/bus_space.c
diff -u src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.2 src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.3
--- src/sys/arch/powerpc/powerpc/bus_space.c:1.20.20.2	Wed Aug 11 13:20:08 2010
+++ src/sys/arch/powerpc/powerpc/bus_space.c	Tue Nov  2 14:05:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.20.20.2 2010/08/11 13:20:08 uebayasi Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.20.20.3 2010/11/02 14:05:28 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.20.20.2 2010/08/11 13:20:08 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.20.20.3 2010/11/02 14:05:28 uebayasi Exp $");
 
 #include 
 #include 
@@ -793,7 +793,7 @@
 	const paddr_t start = memio_mmap(t, bpa, 0, prot, flags) >> PAGE_SHIFT;
 	const paddr_t end = memio_mmap(t, bpa + size, 0, prot, flags) >> PAGE_SHIFT;
 
-	return uvm_page_physload_device(start, end, start, end, prot, flags);
+	return uvm_page_physload_device(start, end, prot, flags);
 }
 
 static void

Index: src/sys/common/pmap/pmap_common.c
diff -u src/sys/common/pmap/pmap_common.c:1.1.2.1 src/sys/common/pmap/pmap_common.c:1.1.2.2
--- src/sys/common/pmap/pmap_common.c:1.1.2.1	Sat Oct 30 08:41:14 2010
+++ src/sys/common/pmap/pmap_common.c	Tue Nov  2 14:05:28 2010
@@ -1,4 +1,4

CVS commit: src/sys/arch/sparc64/sparc64

2010-11-02 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov  2 13:09:29 UTC 2010

Modified Files:
src/sys/arch/sparc64/sparc64: pmap.c

Log Message:
Oops, fix build !DIAGNOSTICS again.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 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/sparc64/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.267 src/sys/arch/sparc64/sparc64/pmap.c:1.268
--- src/sys/arch/sparc64/sparc64/pmap.c:1.267	Tue Nov  2 12:21:07 2010
+++ src/sys/arch/sparc64/sparc64/pmap.c	Tue Nov  2 13:09:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.267 2010/11/02 12:21:07 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.268 2010/11/02 13:09:29 uebayasi Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.267 2010/11/02 12:21:07 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.268 2010/11/02 13:09:29 uebayasi Exp $");
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -1446,7 +1446,9 @@
 
 	/* 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 *md = VM_PAGE_TO_MD(pg);
+#endif
 
 		KASSERT((pg->flags & PG_MARKER) == 0);
 		nextpg = TAILQ_NEXT(pg, listq.queue);



CVS commit: src/sys/arch/sparc64/sparc64

2010-11-02 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov  2 12:21:07 UTC 2010

Modified Files:
src/sys/arch/sparc64/sparc64: pmap.c

Log Message:
Fix DIAGNOSTIC build.  Pointed out by Juergen Hannken-Illjes.


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 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/sparc64/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.266 src/sys/arch/sparc64/sparc64/pmap.c:1.267
--- src/sys/arch/sparc64/sparc64/pmap.c:1.266	Sat Oct 30 18:30:55 2010
+++ src/sys/arch/sparc64/sparc64/pmap.c	Tue Nov  2 12:21:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.266 2010/10/30 18:30:55 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.267 2010/11/02 12:21:07 uebayasi Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.266 2010/10/30 18:30:55 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.267 2010/11/02 12:21:07 uebayasi Exp $");
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -1446,6 +1446,8 @@
 
 	/* we could be a little smarter and leave pages zeroed */
 	for (pg = TAILQ_FIRST(&pm->pm_obj.memq); pg != NULL; pg = nextpg) {
+		struct vm_page_md *md = VM_PAGE_TO_MD(pg);
+
 		KASSERT((pg->flags & PG_MARKER) == 0);
 		nextpg = TAILQ_NEXT(pg, listq.queue);
 		TAILQ_REMOVE(&pm->pm_obj.memq, pg, listq.queue);



CVS commit: src/sys/arch/arm/arm32

2010-11-01 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov  2 06:33:22 UTC 2010

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Fix build of XScale.


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 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.215 src/sys/arch/arm/arm32/pmap.c:1.216
--- src/sys/arch/arm/arm32/pmap.c:1.215	Sat Oct 30 16:14:08 2010
+++ src/sys/arch/arm/arm32/pmap.c	Tue Nov  2 06:33:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.215 2010/10/30 16:14:08 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.216 2010/11/02 06:33:22 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
 #include 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.215 2010/10/30 16:14:08 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.216 2010/11/02 06:33:22 uebayasi Exp $");
 
 #define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
 
@@ -4715,9 +4715,9 @@
 void
 pmap_copy_page_xscale(paddr_t src, paddr_t dst)
 {
-	struct vm_page *src_pg = PHYS_TO_VM_PAGE(src);
+	struct vm_page_md *src_md = VM_PAGE_TO_MD(PHYS_TO_VM_PAGE(src));
 #ifdef DEBUG
-	struct vm_page *dst_pg = PHYS_TO_VM_PAGE(dst);
+	struct vm_page_md *dst_md = VM_PAGE_TO_MD(PHYS_TO_VM_PAGE(dst));
 
 	if (!SLIST_EMPTY(&dst_md->pvh_list))
 		panic("pmap_copy_page: dst page has mappings");



CVS commit: src/sys/arch/evbppc/conf

2010-11-01 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov  2 06:31:48 UTC 2010

Modified Files:
src/sys/arch/evbppc/conf: PMPPC

Log Message:
Don't build flash because it's not implemented.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbppc/conf/PMPPC

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/PMPPC
diff -u src/sys/arch/evbppc/conf/PMPPC:1.15 src/sys/arch/evbppc/conf/PMPPC:1.16
--- src/sys/arch/evbppc/conf/PMPPC:1.15	Sat May  8 22:16:27 2010
+++ src/sys/arch/evbppc/conf/PMPPC	Tue Nov  2 06:31:48 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: PMPPC,v 1.15 2010/05/08 22:16:27 mrg Exp $
+#	$NetBSD: PMPPC,v 1.16 2010/11/02 06:31:48 uebayasi Exp $
 #
 #	PMPPC
 #
@@ -142,7 +142,7 @@
 cs0	at mainbus0 addr 0x7fe0
 
 # flash driver not implemented
-flash0	at mainbus0 addr 0x7000
+#flash0	at mainbus0 addr 0x7000
 
 # UARTs
 com0	at cpc0 addr 0xff600300



CVS commit: src/sys/arch/arm

2010-11-01 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Nov  2 06:07:06 UTC 2010

Modified Files:
src/sys/arch/arm/arm32: mem.c
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Fix build of evbarm.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/arm32/mem.c
cvs rdiff -u -r1.95 -r1.96 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.27 src/sys/arch/arm/arm32/mem.c:1.28
--- src/sys/arch/arm/arm32/mem.c:1.27	Sat Oct 30 18:35:38 2010
+++ src/sys/arch/arm/arm32/mem.c	Tue Nov  2 06:07:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.27 2010/10/30 18:35:38 uebayasi Exp $	*/
+/*	$NetBSD: mem.c,v 1.28 2010/11/02 06:07:05 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -76,7 +76,7 @@
 #include "opt_compat_netbsd.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.27 2010/10/30 18:35:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.28 2010/11/02 06:07:05 uebayasi Exp $");
 
 #include 
 #include 
@@ -146,7 +146,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(VM_PAGE_TO_MD(pg)))
 	o = VM_PAGE_TO_MD(pg)->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.95 src/sys/arch/arm/include/arm32/pmap.h:1.96
--- src/sys/arch/arm/include/arm32/pmap.h:1.95	Wed Jun 16 22:06:53 2010
+++ src/sys/arch/arm/include/arm32/pmap.h	Tue Nov  2 06:07:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.95 2010/06/16 22:06:53 jmcneill Exp $	*/
+/*	$NetBSD: pmap.h,v 1.96 2010/11/02 06:07:06 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

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

Modified Files:
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
src/sys/uvm [uebayasi-xip]: uvm_device.c uvm_pmap.h

Log Message:
We already have a flag PMAP_NOCACHE.  s/PMAP_UNMANAGED/PMAN_NOCACHE/.
Pointed out by Chuck Silvers, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.211.2.17 -r1.211.2.18 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.63.2.8 -r1.63.2.9 src/sys/arch/hppa/hppa/pmap.c
cvs rdiff -u -r1.55.2.4 -r1.55.2.5 src/sys/arch/m68k/m68k/pmap_motorola.c
cvs rdiff -u -r1.188.2.5 -r1.188.2.6 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.60.2.6 -r1.60.2.7 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.74.2.4 -r1.74.2.5 src/sys/arch/sh3/sh3/pmap.c
cvs rdiff -u -r1.250.2.5 -r1.250.2.6 src/sys/arch/sparc64/sparc64/pmap.c
cvs rdiff -u -r1.100.2.5 -r1.100.2.6 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.57.2.2 -r1.57.2.3 src/sys/uvm/uvm_device.c
cvs rdiff -u -r1.32.2.5 -r1.32.2.6 src/sys/uvm/uvm_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/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.211.2.17 src/sys/arch/arm/arm32/pmap.c:1.211.2.18
--- src/sys/arch/arm/arm32/pmap.c:1.211.2.17	Sun Oct 31 03:43:02 2010
+++ src/sys/arch/arm/arm32/pmap.c	Sun Oct 31 03:46:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.211.2.17 2010/10/31 03:43:02 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.211.2.18 2010/10/31 03:46:16 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.211.2.17 2010/10/31 03:43:02 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.211.2.18 2010/10/31 03:46:16 uebayasi Exp $");
 
 #ifdef PMAP_DEBUG
 
@@ -2777,7 +2777,7 @@
 	 * Get a pointer to the page.  Later on in this function, we
 	 * test for a managed page by checking pg != NULL.
 	 */
-	pg = (pmap_initialized && ((flags & PMAP_UNMANAGED) == 0)) ?
+	pg = (pmap_initialized && ((flags & PMAP_NOCACHE) == 0)) ?
 	PHYS_TO_VM_PAGE(pa) : NULL;
 
 	nflags = 0;

Index: src/sys/arch/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.63.2.8 src/sys/arch/hppa/hppa/pmap.c:1.63.2.9
--- src/sys/arch/hppa/hppa/pmap.c:1.63.2.8	Sat Oct 30 08:41:07 2010
+++ src/sys/arch/hppa/hppa/pmap.c	Sun Oct 31 03:46:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.63.2.8 2010/10/30 08:41:07 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.63.2.9 2010/10/31 03:46:17 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.63.2.8 2010/10/30 08:41:07 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.63.2.9 2010/10/31 03:46:17 uebayasi Exp $");
 
 #include "opt_xip.h"
 
@@ -1232,7 +1232,7 @@
 			ptp->wire_count++;
 	}
 
-	if (pmap_initialized && ((flags & PMAP_UNMANAGED) == 0) &&
+	if (pmap_initialized && ((flags & PMAP_NOCACHE) == 0) &&
 	(pg = PHYS_TO_VM_PAGE(pa))) {
 		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 

Index: src/sys/arch/m68k/m68k/pmap_motorola.c
diff -u src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.4 src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.5
--- src/sys/arch/m68k/m68k/pmap_motorola.c:1.55.2.4	Sat Oct 30 08:41:08 2010
+++ src/sys/arch/m68k/m68k/pmap_motorola.c	Sun Oct 31 03:46:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.c,v 1.55.2.4 2010/10/30 08:41:08 uebayasi Exp $*/
+/*	$NetBSD: pmap_motorola.c,v 1.55.2.5 2010/10/31 03:46:17 uebayasi Exp $*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -119,7 +119,7 @@
 #include "opt_m68k_arch.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.55.2.4 2010/10/30 08:41:08 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.55.2.5 2010/10/31 03:46:17 uebayasi Exp $");
 
 #include 
 #include 
@@ -1272,7 +1272,7 @@
 	 * Note that we raise IPL while manipulating pv_table
 	 * since pmap_enter can be called at interrupt time.
 	 */
-	if (PAGE_IS_MANAGED(pa) && ((flags & PMAP_UNMANAGED) == 0)) {
+	if (PAGE_IS_MANAGED(pa) && ((flags & PMAP_NOCACHE) == 0)) {
 		struct pv_header *pvh;
 		struct pv_entry *pv, *npv;
 		int s;

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.188.2.5 src/sys/arch/mips/mips/pmap.c:1.188.2.6
--- src/sys/arch/mips/mips/pmap.c:1.188.2.5	Sat Oct 30 08:41:09 2010
+++ src/sys/arch/mips/mips/pmap.c	Sun Oct 31 03:46:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.188.2.5 201

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 
 #include 
 
-__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)

CVS commit: src/sys/arch/arm/arm32

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 18:35:38 UTC 2010

Modified Files:
src/sys/arch/arm/arm32: mem.c

Log Message:
Use VM_PAGE_TO_MD() to locate struct vm_page_md.  No functional
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 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 src/sys/arch/arm/arm32/mem.c:1.27
--- src/sys/arch/arm/arm32/mem.c:1.26	Wed Nov 19 06:24:04 2008
+++ src/sys/arch/arm/arm32/mem.c	Sat Oct 30 18:35:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.26 2008/11/19 06:24:04 matt Exp $	*/
+/*	$NetBSD: mem.c,v 1.27 2010/10/30 18:35:38 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -76,7 +76,7 @@
 #include "opt_compat_netbsd.h"
 
 #include 
-__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.27 2010/10/30 18:35:38 uebayasi Exp $");
 
 #include 
 #include 
@@ -92,6 +92,8 @@
 
 #include 
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 extern vaddr_t memhook;			/* in pmap.c (poor name!) */
 extern kmutex_t memlock;		/* in pmap.c */
 extern void *zeropage;			/* in pmap.c */
@@ -145,7 +147,7 @@
 struct vm_page *pg;
 pg = PHYS_TO_VM_PAGE(trunc_page(v));
 if (pg != NULL && pmap_is_page_colored_p(pg))
-	o = pg->mdpage.pvh_attrs;
+	o = VM_PAGE_TO_MD(pg)->pvh_attrs;
 else
 	o = v;
 m += o & arm_cache_prefer_mask;



CVS commit: src/sys/arch/sparc64/sparc64

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 18:30:55 UTC 2010

Modified Files:
src/sys/arch/sparc64/sparc64: pmap.c

Log Message:
Use VM_PAGE_TO_MD() to locate struct vm_page_md.  No functional
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 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/sparc64/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.265 src/sys/arch/sparc64/sparc64/pmap.c:1.266
--- src/sys/arch/sparc64/sparc64/pmap.c:1.265	Thu Jul 29 10:54:50 2010
+++ src/sys/arch/sparc64/sparc64/pmap.c	Sat Oct 30 18:30:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.265 2010/07/29 10:54:50 hannken Exp $	*/
+/*	$NetBSD: pmap.c,v 1.266 2010/10/30 18:30:55 uebayasi Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.265 2010/07/29 10:54:50 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.266 2010/10/30 18:30:55 uebayasi Exp $");
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -73,6 +73,8 @@
 #define db_printf	printf
 #endif
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 #define	MEG		(1<<20) /* 1MB */
 #define	KB		(1<<10)	/* 1KB */
 
@@ -1447,7 +1449,7 @@
 		KASSERT((pg->flags & PG_MARKER) == 0);
 		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);
 		dcache_flush_page_cpuset(VM_PAGE_TO_PHYS(pg), pmap_cpus_active);
 		uvm_pagefree(pg);
 	}
@@ -1714,7 +1716,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)
@@ -2132,8 +2136,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)
@@ -2472,6 +2478,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;
@@ -2484,7 +2491,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 */
@@ -2553,6 +2560,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;
@@ -2566,7 +2574,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;
@@ -2619,7 +2627,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);
@@ -2644,11 +2652,12 @@
 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;
 
 	/* 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
@@ -2698,13 +2707,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;
 
@@ -2746,11 +2756,12 @@
 bool
 pmap_is_referenced(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pv;
 	bool res = false;
 
 	/* Check if any mapping has been referenced */
-	pv = &pg->mdpage.mdpg_pvh;
+	pv = &md->mdpg_pvh;
 	if (pv->pv_va & PV_REF)
 		return true;
 
@@ -2822,6 +2833,7 @@
 void
 pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	int64_t clear, set;
 	int64_t data = 0;
 	int rv;
@@ -2834,7 +2846,7 @@
 	("pmap_page_protect: pg %p prot %x\n", pg, prot));
 
 	mutex_enter(&pmap_lock);
-	pv = &pg->mdpage.mdpg_pvh;
+	pv = &md->mdpg_pvh;
 	if (prot & (VM_PROT_READ|VM_PROT_EXECUTE)) {
 		/* copy_on_write */
 
@@ -3192,11 +3204,12 @@
 pmap_enter_pv(struct pmap *pmap, vaddr_t va, paddr_t pa, struct vm_page *pg,
 	  pv_entry_t npv)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	pv_entry_t pvh;
 

CVS commit: src/sys/arch/sh3/sh3

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 18:15:04 UTC 2010

Modified Files:
src/sys/arch/sh3/sh3: pmap.c

Log Message:
Use VM_PAGE_TO_MD() to locate struct vm_page_md.  No functional
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 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.75
--- src/sys/arch/sh3/sh3/pmap.c:1.74	Sat Nov  7 07:27:46 2009
+++ src/sys/arch/sh3/sh3/pmap.c	Sat Oct 30 18:15:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.74 2009/11/07 07:27:46 cegger Exp $	*/
+/*	$NetBSD: pmap.c,v 1.75 2010/10/30 18:15:04 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__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.75 2010/10/30 18:15:04 uebayasi Exp $");
 
 #include 
 #include 
@@ -43,6 +43,8 @@
 #include 
 #include 
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 #ifdef DEBUG
 #define	STATIC
 #else
@@ -339,7 +341,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 +485,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 +497,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 +549,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 +701,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 +791,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 +834,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 +1027,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: src/sys/arch/powerpc

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

Modified Files:
src/sys/arch/powerpc/oea: pmap.c
src/sys/arch/powerpc/powerpc: pmap_subr.c

Log Message:
Use VM_PAGE_TO_MD() to locate struct vm_page_md.  No functional
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/powerpc/pmap_subr.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/oea/pmap.c
diff -u src/sys/arch/powerpc/oea/pmap.c:1.71 src/sys/arch/powerpc/oea/pmap.c:1.72
--- src/sys/arch/powerpc/oea/pmap.c:1.71	Thu Feb 25 23:31:47 2010
+++ src/sys/arch/powerpc/oea/pmap.c	Sat Oct 30 18:08:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.71 2010/02/25 23:31:47 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.72 2010/10/30 18:08:48 uebayasi Exp $	*/
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.71 2010/02/25 23:31:47 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.72 2010/10/30 18:08:48 uebayasi Exp $");
 
 #define	PMAP_NOOPNAMES
 
@@ -91,6 +91,8 @@
 #include 
 #include 
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 #ifdef ALTIVEC
 int pmap_use_altivec;
 #endif
@@ -690,38 +692,48 @@
 pa_to_pvoh(paddr_t pa, struct vm_page **pg_p)
 {
 	struct vm_page *pg;
+	struct vm_page_md *md;
 
 	pg = PHYS_TO_VM_PAGE(pa);
 	if (pg_p != NULL)
 		*pg_p = pg;
 	if (pg == NULL)
 		return &pmap_pvo_unmanaged;
-	return &pg->mdpage.mdpg_pvoh;
+	md = VM_PAGE_TO_MD(pg);
+	return &md->mdpg_pvoh;
 }
 
 static inline struct pvo_head *
 vm_page_to_pvoh(struct vm_page *pg)
 {
-	return &pg->mdpage.mdpg_pvoh;
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+	return &md->mdpg_pvoh;
 }
 
 
 static inline void
 pmap_attr_clear(struct vm_page *pg, int ptebit)
 {
-	pg->mdpage.mdpg_attrs &= ~ptebit;
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+	md->mdpg_attrs &= ~ptebit;
 }
 
 static inline int
 pmap_attr_fetch(struct vm_page *pg)
 {
-	return pg->mdpage.mdpg_attrs;
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+	return md->mdpg_attrs;
 }
 
 static inline void
 pmap_attr_save(struct vm_page *pg, int ptebit)
 {
-	pg->mdpage.mdpg_attrs |= ptebit;
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+	md->mdpg_attrs |= ptebit;
 }
 
 static inline int

Index: src/sys/arch/powerpc/powerpc/pmap_subr.c
diff -u src/sys/arch/powerpc/powerpc/pmap_subr.c:1.22 src/sys/arch/powerpc/powerpc/pmap_subr.c:1.23
--- src/sys/arch/powerpc/powerpc/pmap_subr.c:1.22	Thu Jan 28 12:37:45 2010
+++ src/sys/arch/powerpc/powerpc/pmap_subr.c	Sat Oct 30 18:08:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_subr.c,v 1.22 2010/01/28 12:37:45 phx Exp $	*/
+/*	$NetBSD: pmap_subr.c,v 1.23 2010/10/30 18:08:48 uebayasi Exp $	*/
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap_subr.c,v 1.22 2010/01/28 12:37:45 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_subr.c,v 1.23 2010/10/30 18:08:48 uebayasi Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_altivec.h"
@@ -51,6 +51,8 @@
 #endif
 #include 
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 #define	MFMSR()		mfmsr()
 #define	MTMSR(psl)	__asm volatile("sync; mtmsr %0; isync" :: "r"(psl))
 
@@ -292,14 +294,15 @@
 		 * of this page since the page contents will have changed.
 		 */
 		struct vm_page *pg = PHYS_TO_VM_PAGE(pa);
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 		KDASSERT(pg != NULL);
-		KDASSERT(LIST_EMPTY(&pg->mdpage.mdpg_pvoh));
+		KDASSERT(LIST_EMPTY(&md->mdpg_pvoh));
 #ifdef PMAPCOUNTERS
-		if (pg->mdpage.mdpg_attrs & PTE_EXEC) {
+		if (md->mdpg_attrs & PTE_EXEC) {
 			PMAPCOUNT(exec_uncached_zero_page);
 		}
 #endif
-		pg->mdpage.mdpg_attrs &= ~PTE_EXEC;
+		md->mdpg_attrs &= ~PTE_EXEC;
 	}
 #endif
 
@@ -372,14 +375,15 @@
 		 * changed.
 		 */
 		struct vm_page *pg = PHYS_TO_VM_PAGE(dst);
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 		KDASSERT(pg != NULL);
-		KDASSERT(LIST_EMPTY(&pg->mdpage.mdpg_pvoh));
+		KDASSERT(LIST_EMPTY(&md->mdpg_pvoh));
 #ifdef PMAPCOUNTERS
-		if (pg->mdpage.mdpg_attrs & PTE_EXEC) {
+		if (md->mdpg_attrs & PTE_EXEC) {
 			PMAPCOUNT(exec_uncached_copy_page);
 		}
 #endif
-		pg->mdpage.mdpg_attrs &= ~PTE_EXEC;
+		md->mdpg_attrs &= ~PTE_EXEC;
 	}
 #endif
 



CVS commit: src/sys/arch/mips/mips

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 17:44:04 UTC 2010

Modified Files:
src/sys/arch/mips/mips: pmap.c

Log Message:
Use VM_PAGE_TO_MD() to locate struct vm_page_md.  No functional
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.190 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.189 src/sys/arch/mips/mips/pmap.c:1.190
--- src/sys/arch/mips/mips/pmap.c:1.189	Tue Jul  6 20:50:34 2010
+++ src/sys/arch/mips/mips/pmap.c	Sat Oct 30 17:44:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.189 2010/07/06 20:50:34 cegger Exp $	*/
+/*	$NetBSD: pmap.c,v 1.190 2010/10/30 17:44:04 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.189 2010/07/06 20:50:34 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.190 2010/10/30 17:44:04 uebayasi Exp $");
 
 /*
  *	Manages physical address maps.
@@ -134,6 +134,8 @@
 #include 
 #include 
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 CTASSERT(MIPS_KSEG0_START < 0);
 CTASSERT((intptr_t)MIPS_PHYS_TO_KSEG0(0x1000) < 0);
 CTASSERT(MIPS_KSEG1_START < 0);
@@ -265,6 +267,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 +280,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 +526,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 +865,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 +883,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 +899,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 +1084,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 +1096,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);
 
@@ -1192,7 +1198,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)
@@ -1646,7 +1653,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);
@@ -1748,6 +1756,7 @@
 bool
 pmap_clear_reference(struct vm_page *pg)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	int *attrp;
 	bool rv;
 
@@ -1756,7 +1765,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;
@@ -1771,8 +1780,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;
 }
 
 /*
@@ -1781,6 +1791,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;
@@ -1793,13 +1804,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;
 	}
@@ -1849,8 +1860,9 @@

CVS commit: src/sys/arch/ia64/ia64

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 17:27:17 UTC 2010

Modified Files:
src/sys/arch/ia64/ia64: pmap.c

Log Message:
Use VM_PAGE_TO_MD() to locate struct vm_page_md.  No functional
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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 src/sys/arch/ia64/ia64/pmap.c:1.25
--- src/sys/arch/ia64/ia64/pmap.c:1.24	Sat Nov  7 07:27:44 2009
+++ src/sys/arch/ia64/ia64/pmap.c	Sat Oct 30 17:27:17 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.24 2009/11/07 07:27:44 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.25 2010/10/30 17:27:17 uebayasi Exp $ */
 
 
 /*-
@@ -85,7 +85,7 @@
 
 #include 
 
-__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.25 2010/10/30 17:27:17 uebayasi Exp $");
 
 #include 
 #include 
@@ -102,6 +102,8 @@
 #include 
 #include 
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 
 /*
  * Kernel virtual memory management.
@@ -1233,6 +1235,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 +1244,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 +1269,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 +1279,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 +1493,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 +1510,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 +1977,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 +1996,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 +2019,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 +2029,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 +2100,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 +2129,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 r

CVS commit: src/sys/arch/hppa/hppa

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 17:20:44 UTC 2010

Modified Files:
src/sys/arch/hppa/hppa: pmap.c

Log Message:
Use VM_PAGE_TO_MD() to locate struct vm_page_md.  No functional
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 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.76 src/sys/arch/hppa/hppa/pmap.c:1.77
--- src/sys/arch/hppa/hppa/pmap.c:1.76	Mon Jun 21 14:43:34 2010
+++ src/sys/arch/hppa/hppa/pmap.c	Sat Oct 30 17:20:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.76 2010/06/21 14:43:34 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.77 2010/10/30 17:20:43 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.76 2010/06/21 14:43:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2010/10/30 17:20:43 uebayasi Exp $");
 
 #include "opt_cputype.h"
 
@@ -91,6 +91,8 @@
 #include 
 #endif
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 #ifdef PMAPDEBUG
 
 #define	static	/**/
@@ -497,27 +499,30 @@
 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);
-	db_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);
+	db_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)
 		db_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
 
 int
 pmap_check_alias(struct vm_page *pg, vaddr_t va, pt_entry_t pte)
 {
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 	struct pv_entry *pve;
 	int ret = 0;
 
 	/* check for non-equ aliased mappings */
-	for (pve = pg->mdpage.pvh_list; pve; pve = pve->pv_next) {
+	for (pve = md->pvh_list; pve; pve = pve->pv_next) {
 		vaddr_t pva = pve->pv_va & PV_VAMASK;
 
 		pte |= pmap_vp_find(pve->pv_pmap, pva);
@@ -566,26 +571,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;
@@ -1109,7 +1117,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(sheep);
+			for (haggis = md->pvh_list; haggis != NULL; )
 if (haggis->pv_pmap == pmap) {
 
 	DPRINTF(PDB_FOLLOW, (" 0x%lx",
@@ -1123,7 +1132,7 @@
 	 * exploit the sacred knowledge of
 	 * lambeous ozzmosis
 	 */
-	haggis = sheep->mdpage.pvh_list;
+	haggis = md->pvh_list;
 } else
 	haggis = haggis->pv_next;
 		}
@@ -1206,10 +1215,11 @@
 		}
 
 		pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte));
-		mutex_enter(&pg->mdpage.pvh_lock);
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+		mutex_enter(&md->pvh_lock);
 		pve = pmap_pv_remove(pg, pmap, va);
-		pg->mdpage.pvh_attrs |= pmap_pvh_attrs(pte);
-		mutex_exit(&pg->mdpage.pvh_lock);
+		md->pvh_attrs |= pmap_pvh_attrs(pte);
+		mutex_exit(&md->pvh_lock);
 	} else {
 		DPRINTF(PDB_ENTER, ("%s: new mapping 0x%lx -> 0x%lx\n",
 		__func__, va, pa));
@@ -1223,21 +1233,22 @@
 	}
 
 	if (pmap_initialized && (pg = PHYS_TO_VM_PAGE(pa))) {
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 
 		if (!pve && !(pve = pmap_pv_alloc())) {
 			if (flags & PMAP_CANFAIL) {
- mutex_exit(&pg->mdpage.pvh_lock);
+ mutex_exit(&md->pvh_lock);
  PMAP_UNLOCK(pmap);
 return (ENOMEM);
 			}
 			panic("%s: no pv entries available", __func__);
 		}
 pte |= PTE_PROT(pmap_prot(pmap, prot));
-		mutex_enter(&pg->mdpage.pvh_lock);
+		mutex_enter(&md->pvh_lock);
 	

CVS commit: src/sys/arch/alpha/alpha

2010-10-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 30 17:00:55 UTC 2010

Modified Files:
src/sys/arch/alpha/alpha: pmap.c

Log Message:
Use VM_PAGE_TO_MD() to locate struct vm_page_md.  No functional
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/arch/alpha/alpha/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 src/sys/arch/alpha/alpha/pmap.c:1.253
--- src/sys/arch/alpha/alpha/pmap.c:1.252	Thu Nov 26 00:19:11 2009
+++ src/sys/arch/alpha/alpha/pmap.c	Sat Oct 30 17:00:54 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.252 2009/11/26 00:19:11 matt Exp $ */
+/* $NetBSD: pmap.c,v 1.253 2010/10/30 17:00:54 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
 
 #include 			/* 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.253 2010/10/30 17:00:54 uebayasi Exp $");
 
 #include 
 #include 
@@ -159,6 +159,8 @@
 #include 
 #endif
 
+#define	VM_PAGE_TO_MD(pg)	(&(pg)->mdpage)
+
 #ifdef DEBUG
 #define	PDB_FOLLOW	0x0001
 #define	PDB_INIT	0x0002
@@ -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 @@
 pmap_pv_dump(paddr_t pa)
 {
 	struct vm_page *pg;
+	struct vm_page_md *md;
 	pv_entry_t 

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

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

Modified Files:
src/sys/dev [uebayasi-xip]: xmd.c
Removed Files:
src/sys/dev [uebayasi-xip]: xmdvar.h

Log Message:
Adapt to thew new pmap(9) interfaces.

Don't conditionalize few lines of code for modularity.  As suggested
by Chuck Silvers.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/dev/xmd.c
cvs rdiff -u -r1.1.2.1 -r0 src/sys/dev/xmdvar.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/dev/xmd.c
diff -u src/sys/dev/xmd.c:1.1.2.4 src/sys/dev/xmd.c:1.1.2.5
--- src/sys/dev/xmd.c:1.1.2.4	Sat Aug 28 16:27:02 2010
+++ src/sys/dev/xmd.c	Sat Oct 30 08:51:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmd.c,v 1.1.2.4 2010/08/28 16:27:02 uebayasi Exp $	*/
+/*	$NetBSD: xmd.c,v 1.1.2.5 2010/10/30 08:51:10 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 Tsubai Masanari.  All rights reserved.
@@ -28,15 +28,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xmd.c,v 1.1.2.4 2010/08/28 16:27:02 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xmd.c,v 1.1.2.5 2010/10/30 08:51:10 uebayasi Exp $");
 
 #include "opt_xip.h"
 #include "opt_xmd.h"
 
-#ifndef XIP
-#error xmd(4) needs options XIP
-#endif
-
 #include 
 #include 
 #include 
@@ -53,7 +49,7 @@
 
 #include 
 
-#include 
+#include 
 
 struct xmd_softc {
 	vaddr_t sc_addr;
@@ -127,9 +123,7 @@
 	sc->sc_addr = (vaddr_t)md_root_image;
 	sc->sc_size = (size_t)md_root_size;
 
-#ifdef XIP
-	sc->sc_phys = xmd_machdep_physload(sc->sc_addr, sc->sc_size);
-#endif
+	sc->sc_phys = pmap_physload_device(sc->sc_addr, sc->sc_size, PROT_READ, 0);
 
 	disk_init(&sc->sc_dkdev, device_xname(self), NULL);
 	disk_attach(&sc->sc_dkdev);
@@ -159,9 +153,7 @@
 	disk_detach(&sc->sc_dkdev);
 	disk_destroy(&sc->sc_dkdev);
 
-#ifdef XIP
-	xmd_machdep_physunload(sc->sc_phys);
-#endif
+	pmap_physunload_device(sc->sc_phys);
 
 	return 0;
 }
@@ -210,14 +202,12 @@
 		return -1;
 
 	switch (cmd) {
-#ifdef XIP
 	case DIOCGPHYSSEG:
 		if (sc->sc_phys == NULL)
 			error = EINVAL;
 		else
 			*(void **)data = sc->sc_phys;
 		break;
-#endif
 
 	case DIOCGDINFO:
 		*(struct disklabel *)data = *sc->sc_dkdev.dk_label;
@@ -261,7 +251,7 @@
 	if ((u_int64_t)off >= sc->sc_size)
 		return -1;
 
-	return xmd_machdep_mmap(sc->sc_addr, off, prot);
+	return pmap_mmap(sc->sc_addr, off);
 }
 
 static void



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

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

Modified Files:
src/share/man/man9 [uebayasi-xip]: pmap.9
src/sys/arch/acorn26/acorn26 [uebayasi-xip]: mem.c pmap.c
src/sys/arch/alpha/alpha [uebayasi-xip]: mem.c pmap.c
src/sys/arch/amd64/amd64 [uebayasi-xip]: mem.c
src/sys/arch/arm/arm32 [uebayasi-xip]: mem.c pmap.c
src/sys/arch/arm/conf [uebayasi-xip]: files.arm
src/sys/arch/cesfic/cesfic [uebayasi-xip]: mem.c
src/sys/arch/hp300/hp300 [uebayasi-xip]: mem.c
src/sys/arch/hp700/dev [uebayasi-xip]: mem.c
src/sys/arch/hppa/hppa [uebayasi-xip]: pmap.c
src/sys/arch/i386/i386 [uebayasi-xip]: mem.c
src/sys/arch/luna68k/luna68k [uebayasi-xip]: mem.c
src/sys/arch/m68k/m68k [uebayasi-xip]: pmap_motorola.c
src/sys/arch/mac68k/mac68k [uebayasi-xip]: mem.c
src/sys/arch/mips/conf [uebayasi-xip]: files.mips
src/sys/arch/mips/mips [uebayasi-xip]: pmap.c
src/sys/arch/mvme68k/mvme68k [uebayasi-xip]: mem.c
src/sys/arch/news68k/news68k [uebayasi-xip]: mem.c
src/sys/arch/next68k/next68k [uebayasi-xip]: mem.c
src/sys/arch/powerpc/ibm4xx [uebayasi-xip]: pmap.c
src/sys/arch/powerpc/oea [uebayasi-xip]: pmap.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: mem.c
src/sys/arch/sh3/sh3 [uebayasi-xip]: mem.c pmap.c
src/sys/arch/sparc64/sparc64 [uebayasi-xip]: pmap.c
src/sys/arch/sun2/sun2 [uebayasi-xip]: mem.c pmap.c
src/sys/arch/sun3/sun3 [uebayasi-xip]: mem.c pmap.c
src/sys/arch/sun3/sun3x [uebayasi-xip]: mem.c pmap.c
src/sys/arch/usermode/usermode [uebayasi-xip]: pmap.c
src/sys/arch/vax/vax [uebayasi-xip]: mem.c pmap.c
src/sys/arch/x68k/x68k [uebayasi-xip]: mem.c
src/sys/arch/x86/x86 [uebayasi-xip]: pmap.c
src/sys/arch/xen/conf [uebayasi-xip]: files.xen
src/sys/uvm [uebayasi-xip]: files.uvm uvm_pmap.h
Added Files:
src/sys/common/pmap [uebayasi-xip]: pmap_common.c
Removed Files:
src/sys/arch/arm/arm [uebayasi-xip]: xmd_machdep.c
src/sys/arch/mips/mips [uebayasi-xip]: xmd_machdep.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: xmd_machdep.c
src/sys/arch/x86/x86 [uebayasi-xip]: xmd_machdep.c

Log Message:
Implement pmap_physload_device(9) to replace xmd(4) MD backend.
Implement pmap_mmap(9) and use it from mem(4) and xmd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.1 -r1.42.2.2 src/share/man/man9/pmap.9
cvs rdiff -u -r1.14 -r1.14.2.1 src/sys/arch/acorn26/acorn26/mem.c
cvs rdiff -u -r1.30.2.4 -r1.30.2.5 src/sys/arch/acorn26/acorn26/pmap.c
cvs rdiff -u -r1.40 -r1.40.2.1 src/sys/arch/alpha/alpha/mem.c
cvs rdiff -u -r1.252.2.4 -r1.252.2.5 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/arch/amd64/amd64/mem.c
cvs rdiff -u -r1.1.2.1 -r0 src/sys/arch/arm/arm/xmd_machdep.c
cvs rdiff -u -r1.26.6.5 -r1.26.6.6 src/sys/arch/arm/arm32/mem.c
cvs rdiff -u -r1.211.2.15 -r1.211.2.16 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.97.2.4 -r1.97.2.5 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.13 -r1.13.2.1 src/sys/arch/cesfic/cesfic/mem.c
cvs rdiff -u -r1.48 -r1.48.40.1 src/sys/arch/hp300/hp300/mem.c
cvs rdiff -u -r1.21.2.2 -r1.21.2.3 src/sys/arch/hp700/dev/mem.c
cvs rdiff -u -r1.63.2.7 -r1.63.2.8 src/sys/arch/hppa/hppa/pmap.c
cvs rdiff -u -r1.72 -r1.72.2.1 src/sys/arch/i386/i386/mem.c
cvs rdiff -u -r1.15 -r1.15.2.1 src/sys/arch/luna68k/luna68k/mem.c
cvs rdiff -u -r1.55.2.3 -r1.55.2.4 src/sys/arch/m68k/m68k/pmap_motorola.c
cvs rdiff -u -r1.40 -r1.40.4.1 src/sys/arch/mac68k/mac68k/mem.c
cvs rdiff -u -r1.64.2.1 -r1.64.2.2 src/sys/arch/mips/conf/files.mips
cvs rdiff -u -r1.188.2.4 -r1.188.2.5 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.1.2.1 -r0 src/sys/arch/mips/mips/xmd_machdep.c
cvs rdiff -u -r1.27 -r1.27.30.1 src/sys/arch/mvme68k/mvme68k/mem.c
cvs rdiff -u -r1.19 -r1.19.64.1 src/sys/arch/news68k/news68k/mem.c
cvs rdiff -u -r1.25 -r1.25.64.1 src/sys/arch/next68k/next68k/mem.c
cvs rdiff -u -r1.60.2.5 -r1.60.2.6 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.69.2.3 -r1.69.2.4 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.29 -r1.29.64.1 src/sys/arch/powerpc/powerpc/mem.c
cvs rdiff -u -r1.1.2.2 -r0 src/sys/arch/powerpc/powerpc/xmd_machdep.c
cvs rdiff -u -r1.26.64.2 -r1.26.64.3 src/sys/arch/sh3/sh3/mem.c
cvs rdiff -u -r1.74.2.3 -r1.74.2.4 src/sys/arch/sh3/sh3/pmap.c
cvs rdiff -u -r1.250.2.4 -r1.250.2.5 src/sys/arch/sparc64/sparc64/pmap.c
cvs rdiff -u -r1.16 -r1.16.62.1 src/sys/arch/sun2/sun2/mem.c
cvs rdiff -u -r1.43 -r1.43.2.1 src/sys/arch/sun2/sun2/pmap.c
cvs rdiff -u -r1.51.64.1 -r1.51.64.2 src/sys/arch/sun3/sun3/mem.c
cvs rdiff -u -r1.164.2.1 -r1.164.2.2 src/sys/arch/sun3/sun3/pmap.c
cvs rdiff -u -r1.33.64.1 -r1.33.64.2 src/sys/arch/sun3/sun3x/mem.c
cvs rdiff -u -r1.110.2.1 -r1.110.2.2 src/sys/arch/sun3/sun3x/pmap.c
cvs rdiff -u -r1.5 -r1.5.2.1 src/sys/arch/usermod

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/uvm

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

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_extern.h

Log Message:
Put back #include  for now, to avoid build erros.

This should be removed again later, because exposing page-level
definitions out of UVM is totally unnecessary.


To generate a diff of this commit:
cvs rdiff -u -r1.161.2.8 -r1.161.2.9 src/sys/uvm/uvm_extern.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.161.2.8 src/sys/uvm/uvm_extern.h:1.161.2.9
--- src/sys/uvm/uvm_extern.h:1.161.2.8	Mon Jul 26 10:11:39 2010
+++ src/sys/uvm/uvm_extern.h	Sat Oct 30 05:56:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.161.2.8 2010/07/26 10:11:39 uebayasi Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.161.2.9 2010/10/30 05:56:00 uebayasi Exp $	*/
 
 /*
  *
@@ -476,6 +476,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



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: src/sys/arch/evbppc/conf

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

Modified Files:
src/sys/arch/evbppc/conf: Makefile.ev64260.inc Makefile.explora.inc
Makefile.obs405.inc Makefile.walnut.inc

Log Message:
Handle kernel file names other than "netbsd".


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/conf/Makefile.ev64260.inc \
src/sys/arch/evbppc/conf/Makefile.explora.inc \
src/sys/arch/evbppc/conf/Makefile.walnut.inc
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbppc/conf/Makefile.obs405.inc

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/Makefile.ev64260.inc
diff -u src/sys/arch/evbppc/conf/Makefile.ev64260.inc:1.4 src/sys/arch/evbppc/conf/Makefile.ev64260.inc:1.5
--- src/sys/arch/evbppc/conf/Makefile.ev64260.inc:1.4	Thu Nov 24 12:54:29 2005
+++ src/sys/arch/evbppc/conf/Makefile.ev64260.inc	Sat Oct 30 03:46:03 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ev64260.inc,v 1.4 2005/11/24 12:54:29 dbj Exp $
+#	$NetBSD: Makefile.ev64260.inc,v 1.5 2010/10/30 03:46:03 uebayasi Exp $
 
 MKIMG?=	${HOST_SH} ${THISPPC}/compile/walnut-mkimg.sh
 
@@ -8,6 +8,6 @@
 SYSTEM_FIRST_SFILE=	${THISPPC}/${BOARDTYPE}/${BOARDTYPE}_locore.S
 
 SYSTEM_LD_TAIL_EXTRA+=; \
-	echo ${MKIMG} netbsd netbsd.img ; \
+	echo ${MKIMG} $@ $...@.img ; \
 	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \
 		${MKIMG} $@ $...@.img
Index: src/sys/arch/evbppc/conf/Makefile.explora.inc
diff -u src/sys/arch/evbppc/conf/Makefile.explora.inc:1.4 src/sys/arch/evbppc/conf/Makefile.explora.inc:1.5
--- src/sys/arch/evbppc/conf/Makefile.explora.inc:1.4	Thu Nov 24 12:54:29 2005
+++ src/sys/arch/evbppc/conf/Makefile.explora.inc	Sat Oct 30 03:46:03 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.explora.inc,v 1.4 2005/11/24 12:54:29 dbj Exp $
+#	$NetBSD: Makefile.explora.inc,v 1.5 2010/10/30 03:46:03 uebayasi Exp $
 
 CFLAGS+=-mcpu=403
 AFLAGS+=-mcpu=403
@@ -7,5 +7,5 @@
 SYSTEM_FIRST_SFILE=	${THISPPC}/explora/explora_start.S
 
 SYSTEM_LD_TAIL_EXTRA+=; \
-	echo ${OBJCOPY} --adjust-vma 0x8100 netbsd netbsd.img ; \
-	${OBJCOPY} --adjust-vma 0x8100 netbsd netbsd.img
+	echo ${OBJCOPY} --adjust-vma 0x8100 $@ $...@.img ; \
+	${OBJCOPY} --adjust-vma 0x8100 $@ $...@.img
Index: src/sys/arch/evbppc/conf/Makefile.walnut.inc
diff -u src/sys/arch/evbppc/conf/Makefile.walnut.inc:1.4 src/sys/arch/evbppc/conf/Makefile.walnut.inc:1.5
--- src/sys/arch/evbppc/conf/Makefile.walnut.inc:1.4	Thu Nov 24 12:54:29 2005
+++ src/sys/arch/evbppc/conf/Makefile.walnut.inc	Sat Oct 30 03:46:03 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.walnut.inc,v 1.4 2005/11/24 12:54:29 dbj Exp $
+#	$NetBSD: Makefile.walnut.inc,v 1.5 2010/10/30 03:46:03 uebayasi Exp $
 
 MKIMG?=	${HOST_SH} ${THISPPC}/compile/walnut-mkimg.sh
 CFLAGS+=-mcpu=403
@@ -9,6 +9,6 @@
 SYSTEM_FIRST_SFILE=	${THISPPC}/walnut/walnut_start.S
 
 SYSTEM_LD_TAIL_EXTRA+=; \
-	echo ${MKIMG} netbsd netbsd.img ; \
+	echo ${MKIMG} $@ $...@.img ; \
 	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \
 		${MKIMG} $@ $...@.img

Index: src/sys/arch/evbppc/conf/Makefile.obs405.inc
diff -u src/sys/arch/evbppc/conf/Makefile.obs405.inc:1.5 src/sys/arch/evbppc/conf/Makefile.obs405.inc:1.6
--- src/sys/arch/evbppc/conf/Makefile.obs405.inc:1.5	Thu Mar 18 14:15:38 2010
+++ src/sys/arch/evbppc/conf/Makefile.obs405.inc	Sat Oct 30 03:46:03 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.obs405.inc,v 1.5 2010/03/18 14:15:38 kiyohara Exp $
+#	$NetBSD: Makefile.obs405.inc,v 1.6 2010/10/30 03:46:03 uebayasi Exp $
 
 CFLAGS+=-mcpu=405
 AFLAGS+=-mcpu=405
@@ -14,7 +14,7 @@
 SYSTEM_FIRST_SFILE=	${THISPPC}/obs405/obs200_locore.S
 
 SYSTEM_LD_TAIL_EXTRA+=; \
-	echo ${MKIMG} netbsd netbsd.img ; \
+	echo ${MKIMG} $@ $...@.img ; \
 	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \
 		${MKIMG} $@ $...@.img
 
@@ -29,7 +29,7 @@
 SYSTEM_FIRST_SFILE=	${POWERPC}/${PPCDIR}/openbios/locore.S
 
 SYSTEM_LD_TAIL_EXTRA+=; \
-	echo ${MKIMG} netbsd netbsd.img ; \
+	echo ${MKIMG} $@ $...@.img ; \
 	OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \
 		${MKIMG} $@ $...@.img
 



CVS commit: src/doc

2010-10-29 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Oct 29 16:15:41 UTC 2010

Modified Files:
src/doc: BRANCHES

Log Message:
Update.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.295 src/doc/BRANCHES:1.296
--- src/doc/BRANCHES:1.295	Thu Oct 21 08:45:29 2010
+++ src/doc/BRANCHES	Fri Oct 29 16:15:40 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.295 2010/10/21 08:45:29 uebayasi Exp $
+#	$NetBSD: BRANCHES,v 1.296 2010/10/29 16:15:40 uebayasi Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -1205,7 +1205,7 @@
 Status:		Active
 Start Date:	8 February 2010
 End Date:	
-Base Tag:	uebayasi-xip-base1
+Base Tag:	uebayasi-xip-base3 (-D20101022)
 Maintainer:	Masao Uebayashi 
 Scope:		src/include src/sbin/mount src/sbin/mount_ffs
 		src/share/man/man4 src/share/man/man9 src/sys



CVS commit: [uebayasi-xip] src/share/man/man4

2010-10-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct 28 03:27:55 UTC 2010

Modified Files:
src/share/man/man4 [uebayasi-xip]: xmd.4

Log Message:
Note that underlying char array must be physically contiguous.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/share/man/man4/xmd.4

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

Modified files:

Index: src/share/man/man4/xmd.4
diff -u src/share/man/man4/xmd.4:1.1.2.1 src/share/man/man4/xmd.4:1.1.2.2
--- src/share/man/man4/xmd.4:1.1.2.1	Thu Aug 19 12:36:59 2010
+++ src/share/man/man4/xmd.4	Thu Oct 28 03:27:55 2010
@@ -1,8 +1,8 @@
-.\" $NetBSD: xmd.4,v 1.1.2.1 2010/08/19 12:36:59 uebayasi Exp $
+.\" $NetBSD: xmd.4,v 1.1.2.2 2010/10/28 03:27:55 uebayasi Exp $
 .\"
 .\" This file is in the public domain.
 .\"
-.Dd August 19, 2010
+.Dd October 28, 2010
 .Dt XMD 4
 .Os
 .Sh NAME
@@ -28,3 +28,12 @@
 .Xr md 4 ,
 .Xr options 4 ,
 .Xr mdsetimage 8
+.Sh BUGS
+Due to the design of XIP, device pages in a physical segment must
+be contiguous.
+This leads to a restriction that the page array in the
+.Nm
+driver must be also contiguous.
+It is highly expectable that the
+.Nm
+kernel module will not work.



CVS commit: [uebayasi-xip] src/sys

2010-10-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Oct 27 14:13:57 UTC 2010

Modified Files:
src/sys/arch/amd64/conf [uebayasi-xip]: majors.amd64
src/sys/arch/evbppc/conf [uebayasi-xip]: majors.evbppc
src/sys/arch/hpcmips/conf [uebayasi-xip]: majors.hpcmips
src/sys/arch/i386/conf [uebayasi-xip]: majors.i386
src/sys/conf [uebayasi-xip]: majors

Log Message:
Move flash(4)/xmd(4) majors to MI, as suggested by Chuck Silvers.


To generate a diff of this commit:
cvs rdiff -u -r1.21.6.1 -r1.21.6.2 src/sys/arch/amd64/conf/majors.amd64
cvs rdiff -u -r1.28.6.2 -r1.28.6.3 src/sys/arch/evbppc/conf/majors.evbppc
cvs rdiff -u -r1.27 -r1.27.6.1 src/sys/arch/hpcmips/conf/majors.hpcmips
cvs rdiff -u -r1.37.6.2 -r1.37.6.3 src/sys/arch/i386/conf/majors.i386
cvs rdiff -u -r1.47.2.3 -r1.47.2.4 src/sys/conf/majors

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.6.1 src/sys/arch/amd64/conf/majors.amd64:1.21.6.2
--- src/sys/arch/amd64/conf/majors.amd64:1.21.6.1	Fri Aug 27 09:41:52 2010
+++ src/sys/arch/amd64/conf/majors.amd64	Wed Oct 27 14:13:56 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.amd64,v 1.21.6.1 2010/08/27 09:41:52 uebayasi Exp $
+#	$NetBSD: majors.amd64,v 1.21.6.2 2010/10/27 14:13:56 uebayasi Exp $
 #
 # Device majors for amd64
 #
@@ -89,7 +89,6 @@
 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:

Index: src/sys/arch/evbppc/conf/majors.evbppc
diff -u src/sys/arch/evbppc/conf/majors.evbppc:1.28.6.2 src/sys/arch/evbppc/conf/majors.evbppc:1.28.6.3
--- src/sys/arch/evbppc/conf/majors.evbppc:1.28.6.2	Thu Aug 19 12:36:58 2010
+++ src/sys/arch/evbppc/conf/majors.evbppc	Wed Oct 27 14:13:57 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.evbppc,v 1.28.6.2 2010/08/19 12:36:58 uebayasi Exp $
+#	$NetBSD: majors.evbppc,v 1.28.6.3 2010/10/27 14:13:57 uebayasi Exp $
 #
 # Device majors for evbppc
 # (When possible, make entries the same as macppc)
@@ -80,8 +80,6 @@
 
 device-major	nsmb		char 98			nsmb
 device-major 	xlcom 		char 99 		xlcom
-device-major 	flash 		char 100  block 15 	flash
-device-major	xmd		char 101  block 16	xmd
 
 # Majors up to 143 are reserved for machine-dependant drivers.
 # New machine-independent driver majors are assigned in 

Index: src/sys/arch/hpcmips/conf/majors.hpcmips
diff -u src/sys/arch/hpcmips/conf/majors.hpcmips:1.27 src/sys/arch/hpcmips/conf/majors.hpcmips:1.27.6.1
--- src/sys/arch/hpcmips/conf/majors.hpcmips:1.27	Wed Nov 12 12:36:01 2008
+++ src/sys/arch/hpcmips/conf/majors.hpcmips	Wed Oct 27 14:13:57 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.hpcmips,v 1.27 2008/11/12 12:36:01 ad Exp $
+#	$NetBSD: majors.hpcmips,v 1.27.6.1 2010/10/27 14:13:57 uebayasi Exp $
 #
 # Device majors for hpcmips
 #
@@ -57,7 +57,6 @@
 device-major	sequencer	char 53			sequencer
 device-major	pci		char 54			pci
 device-major	ksyms		char 55			ksyms
-device-major	flash		char 100		flash
 device-major	vr4181aiu	char 101		vr4181aiu
 device-major	wsfont		char 102		wsfont
 device-major	ses		char 103		ses

Index: src/sys/arch/i386/conf/majors.i386
diff -u src/sys/arch/i386/conf/majors.i386:1.37.6.2 src/sys/arch/i386/conf/majors.i386:1.37.6.3
--- src/sys/arch/i386/conf/majors.i386:1.37.6.2	Fri Aug 20 07:04:38 2010
+++ src/sys/arch/i386/conf/majors.i386	Wed Oct 27 14:13:57 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.i386,v 1.37.6.2 2010/08/20 07:04:38 uebayasi Exp $
+#	$NetBSD: majors.i386,v 1.37.6.3 2010/10/27 14:13:57 uebayasi Exp $
 #
 # Device majors for i386
 #
@@ -104,7 +104,6 @@
 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/conf/majors
diff -u src/sys/conf/majors:1.47.2.3 src/sys/conf/majors:1.47.2.4
--- src/sys/conf/majors:1.47.2.3	Fri Oct 22 07:21:49 2010
+++ src/sys/conf/majors	Wed Oct 27 14:13:56 2010
@@ -1,4 +1,4 @@
-# $NetBSD: majors,v 1.47.2.3 2010/10/22 07:21:49 uebayasi Exp $
+# $NetBSD: majors,v 1.47.2.4 2010/10/27 14:13:56 uebayasi Exp $
 #
 # Device majors for Machine-Independent drivers.
 #
@@ -44,3 +44,5 @@
 device-major uhso  char 196		   uhso
 device-major rumpblk   char 197 block 197  rumpblk
 device-major npf   char 198		   npf
+device-major flash char 199	block 199  flash
+device-major xmd   char 200	block 200  xmd



CVS commit: src/sys

2010-10-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Oct 27 14:08:09 UTC 2010

Modified Files:
src/sys/arch/hpcmips/conf: majors.hpcmips
src/sys/conf: majors

Log Message:
Reserve an MI major for coming flash(4).

hpcmips defines one in MD majors, but it's not listed in
etc/etc.hpcmips/MAKEDEV.conf, so I assume actual files are never
created in users' filesystems.

Prompted By:pooka


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/hpcmips/conf/majors.hpcmips
cvs rdiff -u -r1.52 -r1.53 src/sys/conf/majors

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/hpcmips/conf/majors.hpcmips
diff -u src/sys/arch/hpcmips/conf/majors.hpcmips:1.29 src/sys/arch/hpcmips/conf/majors.hpcmips:1.30
--- src/sys/arch/hpcmips/conf/majors.hpcmips:1.29	Sat Mar  6 23:45:39 2010
+++ src/sys/arch/hpcmips/conf/majors.hpcmips	Wed Oct 27 14:08:08 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.hpcmips,v 1.29 2010/03/06 23:45:39 plunky Exp $
+#	$NetBSD: majors.hpcmips,v 1.30 2010/10/27 14:08:08 uebayasi Exp $
 #
 # Device majors for hpcmips
 #
@@ -57,7 +57,6 @@
 device-major	sequencer	char 53			sequencer
 device-major	pci		char 54			pci
 device-major	ksyms		char 55			ksyms
-device-major	flash		char 100		flash
 device-major	vr4181aiu	char 101		vr4181aiu
 device-major	wsfont		char 102		wsfont
 device-major	ses		char 103		ses

Index: src/sys/conf/majors
diff -u src/sys/conf/majors:1.52 src/sys/conf/majors:1.53
--- src/sys/conf/majors:1.52	Sun Aug 22 18:56:21 2010
+++ src/sys/conf/majors	Wed Oct 27 14:08:08 2010
@@ -1,4 +1,4 @@
-# $NetBSD: majors,v 1.52 2010/08/22 18:56:21 rmind Exp $
+# $NetBSD: majors,v 1.53 2010/10/27 14:08:08 uebayasi Exp $
 #
 # Device majors for Machine-Independent drivers.
 #
@@ -44,3 +44,4 @@
 device-major uhso  char 196		   uhso
 device-major rumpblk   char 197 block 197  rumpblk
 device-major npf   char 198		   npf
+device-major flash char 199 block 199  flash



CVS commit: [uebayasi-xip] src/sys/ufs/ffs

2010-10-25 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Mon Oct 25 08:07:22 UTC 2010

Modified Files:
src/sys/ufs/ffs [uebayasi-xip]: ffs_vfsops.c

Log Message:
Fragment size doesn't need to be page-aligned.

Return EINVAL if read-only mount option is not set, other failures
reported as ENXIO.


To generate a diff of this commit:
cvs rdiff -u -r1.257.2.12 -r1.257.2.13 src/sys/ufs/ffs/ffs_vfsops.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/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.12 src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.13
--- src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.12	Thu Oct 21 17:45:21 2010
+++ src/sys/ufs/ffs/ffs_vfsops.c	Mon Oct 25 08:07:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.257.2.12 2010/10/21 17:45:21 uebayasi Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.257.2.13 2010/10/25 08:07:22 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257.2.12 2010/10/21 17:45:21 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257.2.13 2010/10/25 08:07:22 uebayasi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1183,23 +1183,29 @@
 	mp->mnt_iflag |= IMNT_MPSAFE;
 #ifdef XIP
 #define	FS_IS_PAGE_ALIGNED_P(fs) \
-	(((fs)->fs_bsize & PAGE_MASK) == 0 && \
-	 ((fs)->fs_fsize & PAGE_MASK) == 0)
+	(((fs)->fs_bsize & PAGE_MASK) == 0)
 
 	void *seg = NULL;
 
 	if ((mp->mnt_flag & MNT_XIP) != 0) {
-		if ((mp->mnt_flag & MNT_RDONLY) != 0 &&
-		VOP_IOCTL(devvp, DIOCGPHYSSEG, &seg, FREAD, cred) == 0 &&
-		seg != NULL &&
-		FS_IS_PAGE_ALIGNED_P(fs)) {
-			mp->mnt_flag |= MNT_XIP;
-			devvp->v_physseg = seg;
-		} else {
+		if ((mp->mnt_flag & MNT_RDONLY) == 0) {
+			error = EINVAL;
+			goto xip_check_done;
+		}
+		if (VOP_IOCTL(devvp, DIOCGPHYSSEG, &seg, FREAD, cred) != 0 ||
+		seg == NULL ||
+		!FS_IS_PAGE_ALIGNED_P(fs)) {
 			error = ENXIO;
+			goto xip_check_done;
+		}
+
+xip_check_done:
+		if (error != 0) {
 			free(fs->fs_csp, M_UFSMNT);
 			goto out;
 		}
+		mp->mnt_flag |= MNT_XIP;
+		devvp->v_physseg = seg;
 	}
 #endif
 #ifdef FFS_EI



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

2010-10-22 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 23 02:34:17 UTC 2010

Modified Files:
src/sys/kern [uebayasi-xip]: vfs_syscalls.c

Log Message:
Propagate MNT_XIP in mount flags.


To generate a diff of this commit:
cvs rdiff -u -r1.403.2.5 -r1.403.2.6 src/sys/kern/vfs_syscalls.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/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.403.2.5 src/sys/kern/vfs_syscalls.c:1.403.2.6
--- src/sys/kern/vfs_syscalls.c:1.403.2.5	Fri Oct 22 07:22:32 2010
+++ src/sys/kern/vfs_syscalls.c	Sat Oct 23 02:34:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.403.2.5 2010/10/22 07:22:32 uebayasi Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.403.2.6 2010/10/23 02:34:17 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.403.2.5 2010/10/22 07:22:32 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.403.2.6 2010/10/23 02:34:17 uebayasi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -200,12 +200,12 @@
 	  ~(MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
 	MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
 	MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-	MNT_LOG);
+	MNT_LOG | MNT_XIP);
 	mp->mnt_flag |= flags &
 	   (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
 	MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
 	MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-	MNT_LOG | MNT_IGNORE);
+	MNT_LOG | MNT_XIP | MNT_IGNORE);
 
 	error = VFS_MOUNT(mp, path, data, data_len);
 
@@ -343,7 +343,7 @@
 	   (MNT_FORCE | MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
 	MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
 	MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-	MNT_LOG | MNT_IGNORE | MNT_RDONLY);
+	MNT_LOG | MNT_XIP | MNT_IGNORE | MNT_RDONLY);
 
 	mutex_enter(&mp->mnt_updating);
 	error = VFS_MOUNT(mp, path, data, data_len);



CVS commit: [uebayasi-xip] src/sys/dev/isa

2010-10-22 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 23 02:23:39 UTC 2010

Modified Files:
src/sys/dev/isa [uebayasi-xip]: isv.c

Log Message:
Include uvm_extern.h, not uvm.h.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/dev/isa/isv.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/dev/isa/isv.c
diff -u src/sys/dev/isa/isv.c:1.3 src/sys/dev/isa/isv.c:1.3.2.1
--- src/sys/dev/isa/isv.c:1.3	Fri Feb 27 23:13:32 2009
+++ src/sys/dev/isa/isv.c	Sat Oct 23 02:23:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: isv.c,v 1.3 2009/02/27 23:13:32 dyoung Exp $ */
+/*	$NetBSD: isv.c,v 1.3.2.1 2010/10/23 02:23:38 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,14 +30,15 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isv.c,v 1.3 2009/02/27 23:13:32 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isv.c,v 1.3.2.1 2010/10/23 02:23:38 uebayasi Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
+
+#include 
 
 #include 
 



CVS commit: [uebayasi-xip] src/include

2010-10-22 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Oct 22 11:32:57 UTC 2010

Modified Files:
src/include [uebayasi-xip]: mntopts.h

Log Message:
Put back MOPT_XIP.


To generate a diff of this commit:
cvs rdiff -u -r1.13.4.2 -r1.13.4.3 src/include/mntopts.h

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

Modified files:

Index: src/include/mntopts.h
diff -u src/include/mntopts.h:1.13.4.2 src/include/mntopts.h:1.13.4.3
--- src/include/mntopts.h:1.13.4.2	Tue Aug 17 06:40:01 2010
+++ src/include/mntopts.h	Fri Oct 22 11:32:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mntopts.h,v 1.13.4.2 2010/08/17 06:40:01 uebayasi Exp $	*/
+/*	$NetBSD: mntopts.h,v 1.13.4.3 2010/10/22 11:32:57 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1994
@@ -57,6 +57,7 @@
 #define MOPT_SOFTDEP		{ "softdep",	0, MNT_SOFTDEP, 0 }
 #define MOPT_LOG		{ "log",	0, MNT_LOG, 0 }
 #define MOPT_IGNORE		{ "hidden",	0, MNT_IGNORE, 0 }
+#define MOPT_XIP		{ "xip",	0, MNT_XIP, 0 }
 
 /* Control flags. */
 #define MOPT_FORCE		{ "force",	0, MNT_FORCE, 0 }



CVS commit: [uebayasi-xip] src/sys/rump/librump/rumpkern/opt

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

Removed Files:
src/sys/rump/librump/rumpkern/opt [uebayasi-xip]: opt_direct_page.h

Log Message:
options DIRECT_PAGE is gone.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r0 \
src/sys/rump/librump/rumpkern/opt/opt_direct_page.h

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/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/share/man/man9/man9.i386

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

Removed Files:
src/share/man/man9/man9.i386 [uebayasi-xip]: nmi.9

Log Message:
Merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/share/man/man9/man9.i386/nmi.9

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

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

Modified Files:
src/sys/arch/alpha/alpha [uebayasi-xip]: dec_6600.c
src/sys/arch/alpha/common [uebayasi-xip]: sgmap_typedep.c
src/sys/arch/alpha/include [uebayasi-xip]: alpha_cpu.h elf_machdep.h
logout.h
src/sys/arch/alpha/pci [uebayasi-xip]: tsc.c tsp_pci.c tsreg.h tsvar.h
src/sys/arch/alpha/stand/common [uebayasi-xip]: boot.c
src/sys/arch/alpha/stand/ustarboot [uebayasi-xip]: Makefile
src/sys/arch/amd64/amd64 [uebayasi-xip]: locore.S machdep.c
netbsd32_machdep.c
src/sys/arch/amd64/conf [uebayasi-xip]: GENERIC
src/sys/arch/amd64/include [uebayasi-xip]: segments.h
src/sys/arch/amiga/amiga [uebayasi-xip]: machdep.c
src/sys/arch/amiga/conf [uebayasi-xip]: std.amiga
src/sys/arch/amiga/dev [uebayasi-xip]: bzivsc.c bzsc.c bztzsc.c
cbiisc.c cbsc.c flsc.c if_bah_zbus.c sbic.c
src/sys/arch/amigappc/conf [uebayasi-xip]: files.amigappc
src/sys/arch/arm/arm [uebayasi-xip]: cpufunc.c
src/sys/arch/arm/arm32 [uebayasi-xip]: cpu.c
src/sys/arch/arm/conf [uebayasi-xip]: files.arm
src/sys/arch/arm/include [uebayasi-xip]: armreg.h cpuconf.h cpufunc.h
src/sys/arch/arm/omap [uebayasi-xip]: files.omap2 omap2_gpmc.c
omap2_gpmcreg.h omap2_gpmcvar.h omap2_intr.h omap2_obio.c
omap2_reg.h
src/sys/arch/arm/pic [uebayasi-xip]: pic.c
src/sys/arch/arm/sa11x0 [uebayasi-xip]: sa11x0_com.c
src/sys/arch/arm/xscale [uebayasi-xip]: pxa2x0_mci.c
src/sys/arch/atari/atari [uebayasi-xip]: machdep.c
src/sys/arch/atari/conf [uebayasi-xip]: std.atari std.hades std.milan
src/sys/arch/atari/stand/tostools/libtos [uebayasi-xip]: exec_elf.h
src/sys/arch/bebox/conf [uebayasi-xip]: GENERIC INSTALL files.bebox
majors.bebox std.bebox
src/sys/arch/bebox/stand/boot [uebayasi-xip]: Makefile boot.c boot.h
conf.c devopen.c fd.c filesystem.c io.c version vreset.c
src/sys/arch/cesfic/cesfic [uebayasi-xip]: machdep.c
src/sys/arch/cesfic/conf [uebayasi-xip]: std.cesfic
src/sys/arch/dreamcast/conf [uebayasi-xip]: GENERIC
Makefile.dreamcast.inc std.dreamcast
src/sys/arch/dreamcast/dev [uebayasi-xip]: gdrom.c pvr.c
src/sys/arch/dreamcast/dev/g2 [uebayasi-xip]: g2rtc.c
src/sys/arch/dreamcast/dev/maple [uebayasi-xip]: maple.c maple.h
maplevar.h mkbd.c mkbdvar.h mlcd.c mmemcard.c mms.c
src/sys/arch/dreamcast/dreamcast [uebayasi-xip]: machdep.c
src/sys/arch/evbarm/beagle [uebayasi-xip]: beagle_machdep.c
src/sys/arch/evbarm/conf [uebayasi-xip]: BEAGLEBOARD GUMSTIX OVERO
files.evbarm files.g42xxeb files.gumstix files.overo
src/sys/arch/evbarm/gumstix [uebayasi-xip]: gumstix_machdep.c
gumstix_start.S gumstixreg.h gxio.c if_sm_gxio.c if_smsh_gxio.c
src/sys/arch/hp300/conf [uebayasi-xip]: GENERIC std.hp300
src/sys/arch/hp300/hp300 [uebayasi-xip]: machdep.c
src/sys/arch/hp700/conf [uebayasi-xip]: GENERIC
src/sys/arch/hpcarm/conf [uebayasi-xip]: WZERO3
src/sys/arch/hpcarm/dev [uebayasi-xip]: j720pcic.c
src/sys/arch/hppa/include [uebayasi-xip]: ieee.h
src/sys/arch/i386/conf [uebayasi-xip]: ALL GENERIC MONOLITHIC
src/sys/arch/i386/i386 [uebayasi-xip]: dumpsys.c machdep.c
src/sys/arch/i386/include [uebayasi-xip]: kcore.h pte.h types.h
src/sys/arch/i386/stand/boot [uebayasi-xip]: Makefile.boot
src/sys/arch/i386/stand/bootxx [uebayasi-xip]: Makefile
src/sys/arch/i386/stand/lib [uebayasi-xip]: exec.c
src/sys/arch/luna68k/conf [uebayasi-xip]: std.luna68k
src/sys/arch/luna68k/luna68k [uebayasi-xip]: machdep.c
src/sys/arch/m68k/conf [uebayasi-xip]: files.m68k
src/sys/arch/m68k/include [uebayasi-xip]: ieee.h
src/sys/arch/m68k/m68k [uebayasi-xip]: kobj_machdep.c m68k_syscall.c
src/sys/arch/mac68k/conf [uebayasi-xip]: std.mac68k
src/sys/arch/mac68k/mac68k [uebayasi-xip]: machdep.c
src/sys/arch/macppc/dev [uebayasi-xip]: awacs.c deq.c obio.c pmu.c
smartbat.c snapper.c
src/sys/arch/macppc/macppc [uebayasi-xip]: machdep.c
src/sys/arch/macppc/stand/ofwboot [uebayasi-xip]: boot.c ofdev.c
version
src/sys/arch/mips/mips [uebayasi-xip]: in_cksum.c
src/sys/arch/mvme68k/conf [uebayasi-xip]: std.mvme68k
src/sys/arch/mvme68k/mvme68k [uebayasi-xip]: machdep.c
src/sys/arch/news68k/conf [uebayasi-xip]: GENERIC std.news68k
src/sys/arch/news68k/news68k [uebayasi-xip]: machdep.c
src/sys/arch/news68k/stand/boot [uebayasi-xip]: boot.c
src/sys/arch/newsmips/stand/boot [uebayasi-xip]: boot.c
src/sys/arch/next68k/conf [uebayasi-xip]: std.next68k

CVS commit: [uebayasi-xip] src/sys/ufs/ffs

2010-10-21 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct 21 17:45:21 UTC 2010

Modified Files:
src/sys/ufs/ffs [uebayasi-xip]: ffs_vfsops.c

Log Message:
Handle XIP mount error properly.


To generate a diff of this commit:
cvs rdiff -u -r1.257.2.11 -r1.257.2.12 src/sys/ufs/ffs/ffs_vfsops.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/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.11 src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.12
--- src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.11	Thu Oct 21 08:45:04 2010
+++ src/sys/ufs/ffs/ffs_vfsops.c	Thu Oct 21 17:45:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.257.2.11 2010/10/21 08:45:04 uebayasi Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.257.2.12 2010/10/21 17:45:21 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257.2.11 2010/10/21 08:45:04 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257.2.12 2010/10/21 17:45:21 uebayasi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1186,15 +1186,20 @@
 	(((fs)->fs_bsize & PAGE_MASK) == 0 && \
 	 ((fs)->fs_fsize & PAGE_MASK) == 0)
 
-	void *physseg = NULL;
+	void *seg = NULL;
 
-	if ((mp->mnt_flag & MNT_XIP) != 0 &&
-	(mp->mnt_flag & MNT_RDONLY) != 0 &&
-	VOP_IOCTL(devvp, DIOCGPHYSSEG, &physseg, FREAD, cred) == 0 &&
-	physseg != NULL &&
-	FS_IS_PAGE_ALIGNED_P(fs)) {
-		mp->mnt_flag |= MNT_XIP;
-		devvp->v_physseg = physseg;
+	if ((mp->mnt_flag & MNT_XIP) != 0) {
+		if ((mp->mnt_flag & MNT_RDONLY) != 0 &&
+		VOP_IOCTL(devvp, DIOCGPHYSSEG, &seg, FREAD, cred) == 0 &&
+		seg != NULL &&
+		FS_IS_PAGE_ALIGNED_P(fs)) {
+			mp->mnt_flag |= MNT_XIP;
+			devvp->v_physseg = seg;
+		} else {
+			error = ENXIO;
+			free(fs->fs_csp, M_UFSMNT);
+			goto out;
+		}
 	}
 #endif
 #ifdef FFS_EI



CVS commit: [uebayasi-xip] src/share/man/man9

2010-10-21 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct 21 17:16:28 UTC 2010

Modified Files:
src/share/man/man9 [uebayasi-xip]: uvm.9

Log Message:
Document uvm_page_physload_device(9).


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.102.2.1 src/share/man/man9/uvm.9

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

Modified files:

Index: src/share/man/man9/uvm.9
diff -u src/share/man/man9/uvm.9:1.102 src/share/man/man9/uvm.9:1.102.2.1
--- src/share/man/man9/uvm.9:1.102	Sat Apr 17 06:38:13 2010
+++ src/share/man/man9/uvm.9	Thu Oct 21 17:16:28 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uvm.9,v 1.102 2010/04/17 06:38:13 jruoho Exp $
+.\"	$NetBSD: uvm.9,v 1.102.2.1 2010/10/21 17:16:28 uebayasi Exp $
 .\"
 .\" Copyright (c) 1998 Matthew R. Green
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 17, 2010
+.Dd October 21, 2010
 .Dt UVM 9
 .Os
 .Sh NAME
@@ -556,8 +556,6 @@
 .Fn uvm_pglistalloc "psize_t size" "paddr_t low" "paddr_t high" "paddr_t alignment" "paddr_t boundary" "struct pglist *rlist" "int nsegs" "int waitok" ;
 .It Ft void
 .Fn uvm_pglistfree "struct pglist *list" ;
-.It Ft void
-.Fn uvm_page_physload "paddr_t start" "paddr_t end" "paddr_t avail_start" "paddr_t avail_end" "int free_list" ;
 .El
 .Pp
 .Fn uvm_pagealloc
@@ -654,6 +652,17 @@
 the page to serve future
 .Dv UVM_PGA_ZERO
 requests efficiently.
+.Sh PHYSICAL PAGE REGISTRATION
+.Bl -ohang
+.It Ft void *
+.Fn uvm_page_physload "paddr_t start" "paddr_t end" "paddr_t avail_start" "paddr_t avail_end" "int free_list" ;
+.It Ft void
+.Fn uvm_page_physunload "void *physseg" ;
+.It Ft void *
+.Fn uvm_page_physload_device "paddr_t start" "paddr_t end" "paddr_t avail_start" "paddr_t avail_end" "int prot" "int flags" ;
+.It Ft void
+.Fn uvm_page_physunload_device "void *physseg" ;
+.El
 .Pp
 .Fn uvm_page_physload
 loads physical memory segments into VM space on the specified
@@ -664,13 +673,70 @@
 .Fa start
 and
 .Fa end
-of the physical addresses of the segment, and the available start and end
+of the physical addresses of the segment, and the
+.Fa avail_start
+and
+.Fa avail_end
 addresses of pages not already in use.
 If a system has memory banks of
 different speeds the slower memory should be given a higher
 .Fa free_list
 value.
 .\" XXX expand on "system boot time"!
+.Fn uvm_page_physload
+returns a cookie pointing to the allocated physical memory segment
+object.
+.Pp
+.Fn uvm_page_physunload
+unloads a physical memory segment given as
+.Fa physseg ,
+which is returned by
+.Fn uvm_page_physload .
+.Pp
+.Fn uvm_page_physload_device
+loads physical device segments into VM space.
+The loaded pages are registered as device pages, not as general
+purpose physical memory pages.
+Device pages are pages that exist in a device, are accessible as
+memory-mapped I/O, and are potentially mapped into user's address
+spaces with cache enabled.
+Typical use case is XIP, where files in a device are directly
+executed without being copied onto RAM (page cache).
+.Pp
+The arguments describe the
+.Fa start
+and
+.Fa end
+of the physical addresses of the segment, and the
+.Fa avail_start
+and
+.Fa avail_end
+addresses of pages not already in use.
+The
+.Fa prot
+describes the potential protection (region accessibility) of the
+segment specified by OR'ing the following values:
+.Bl -tag -width UVM_PROT_WRITEXX
+.It Dv UVM_PROT_READ
+Pages may be read.
+.It Dv UVM_PROT_WRITE
+Pages may be written.
+.It Dv UVM_PROT_EXEC
+Pages may be executed.
+.El
+.Pp
+The
+.Fa flags
+argument is reserved for future use.
+.Fn uvm_page_physload_device
+returns a cookie pointing to the allocated physical device segment
+object.
+.Pp
+.Fn uvm_page_physunload_device
+unloads a physical device segment given as
+.Fa physseg ,
+which is returned by
+.Fn uvm_page_physload_device .
 .Sh PROCESSES
 .Bl -ohang
 .It Ft void



CVS commit: src/doc

2010-10-21 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct 21 08:45:30 UTC 2010

Modified Files:
src/doc: BRANCHES

Log Message:
Update uebayasi-xip.


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.294 src/doc/BRANCHES:1.295
--- src/doc/BRANCHES:1.294	Sat Oct  9 05:24:55 2010
+++ src/doc/BRANCHES	Thu Oct 21 08:45:29 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.294 2010/10/09 05:24:55 yamt Exp $
+#	$NetBSD: BRANCHES,v 1.295 2010/10/21 08:45:29 uebayasi Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -1208,7 +1208,8 @@
 Base Tag:	uebayasi-xip-base1
 Maintainer:	Masao Uebayashi 
 Scope:		src/include src/sbin/mount src/sbin/mount_ffs
-		src/share/man/man9 src/sys
+		src/share/man/man4 src/share/man/man9 src/sys
+		src/share/man/man5/statvfs.5
 Notes:		Goals:
 		- Clean up oddities in fault handler
 		- Add a notion of device page



CVS commit: [uebayasi-xip] src

2010-10-21 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Oct 21 08:45:05 UTC 2010

Modified Files:
src/sbin/mount [uebayasi-xip]: mount.8
src/sbin/mount_ffs [uebayasi-xip]: mount_ffs.c
src/share/man/man5 [uebayasi-xip]: statvfs.5
src/sys/sys [uebayasi-xip]: fstypes.h statvfs.h
src/sys/ufs/ffs [uebayasi-xip]: ffs_vfsops.c

Log Message:
After consideration, put back "xip" mount option.

The internal behavior is totally different between with and without
the option; automatic detection and/or fall-through are not user
friendly.  mount(8) returning the "xip" flag is also informative.


To generate a diff of this commit:
cvs rdiff -u -r1.69.2.2 -r1.69.2.3 src/sbin/mount/mount.8
cvs rdiff -u -r1.25.10.2 -r1.25.10.3 src/sbin/mount_ffs/mount_ffs.c
cvs rdiff -u -r1.12 -r1.12.2.1 src/share/man/man5/statvfs.5
cvs rdiff -u -r1.26.14.3 -r1.26.14.4 src/sys/sys/fstypes.h
cvs rdiff -u -r1.15 -r1.15.14.1 src/sys/sys/statvfs.h
cvs rdiff -u -r1.257.2.10 -r1.257.2.11 src/sys/ufs/ffs/ffs_vfsops.c

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

Modified files:

Index: src/sbin/mount/mount.8
diff -u src/sbin/mount/mount.8:1.69.2.2 src/sbin/mount/mount.8:1.69.2.3
--- src/sbin/mount/mount.8:1.69.2.2	Fri May 28 09:14:55 2010
+++ src/sbin/mount/mount.8	Thu Oct 21 08:45:04 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mount.8,v 1.69.2.2 2010/05/28 09:14:55 uebayasi Exp $
+.\"	$NetBSD: mount.8,v 1.69.2.3 2010/10/21 08:45:04 uebayasi Exp $
 .\"
 .\" Copyright (c) 1980, 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -299,6 +299,8 @@
 The same as
 .Fl u ;
 indicate that the status of an already mounted file system should be changed.
+.It Cm xip
+Enable eXecute-In-Place if the block device supports it.
 .El
 .Pp
 Any additional options specific to a given file system type (see the

Index: src/sbin/mount_ffs/mount_ffs.c
diff -u src/sbin/mount_ffs/mount_ffs.c:1.25.10.2 src/sbin/mount_ffs/mount_ffs.c:1.25.10.3
--- src/sbin/mount_ffs/mount_ffs.c:1.25.10.2	Fri May 28 09:14:55 2010
+++ src/sbin/mount_ffs/mount_ffs.c	Thu Oct 21 08:45:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_ffs.c,v 1.25.10.2 2010/05/28 09:14:55 uebayasi Exp $	*/
+/*	$NetBSD: mount_ffs.c,v 1.25.10.3 2010/10/21 08:45:04 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)mount_ufs.c	8.4 (Berkeley) 4/26/95";
 #else
-__RCSID("$NetBSD: mount_ffs.c,v 1.25.10.2 2010/05/28 09:14:55 uebayasi Exp $");
+__RCSID("$NetBSD: mount_ffs.c,v 1.25.10.3 2010/10/21 08:45:04 uebayasi Exp $");
 #endif
 #endif /* not lint */
 
@@ -74,6 +74,7 @@
 	MOPT_SOFTDEP,
 	MOPT_LOG,
 	MOPT_GETARGS,
+	MOPT_XIP,
 	MOPT_NULL,
 };
 

Index: src/share/man/man5/statvfs.5
diff -u src/share/man/man5/statvfs.5:1.12 src/share/man/man5/statvfs.5:1.12.2.1
--- src/share/man/man5/statvfs.5:1.12	Mon Mar 22 18:58:32 2010
+++ src/share/man/man5/statvfs.5	Thu Oct 21 08:45:04 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: statvfs.5,v 1.12 2010/03/22 18:58:32 joerg Exp $
+.\"	$NetBSD: statvfs.5,v 1.12.2.1 2010/10/21 08:45:04 uebayasi Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)statfs.2	8.5 (Berkeley) 5/24/95
 .\"
-.Dd April 10, 2009
+.Dd October 20, 2010
 .Dt STATVFS 5
 .Os
 .Sh NAME
@@ -109,14 +109,16 @@
 No filesystem I/O is done synchronously.
 .It Dv ST_NOCOREDUMP
 Don't write core dumps to this file system.
+.It Dv ST_XIP
+Use XIP (eXecute-In-Place).
+.It Dv ST_LOG
+Use logging (journalling).
 .It Dv ST_NOATIME
 Never update access times.
 .It Dv ST_SYMPERM
 Recognize symbolic link permission.
 .It Dv ST_NODEVMTIME
 Never update modification times for device files.
-.It Dv ST_LOG
-Use logging (journalling).
 .It Dv ST_LOCAL
 The filesystem resides locally.
 .It Dv ST_QUOTA

Index: src/sys/sys/fstypes.h
diff -u src/sys/sys/fstypes.h:1.26.14.3 src/sys/sys/fstypes.h:1.26.14.4
--- src/sys/sys/fstypes.h:1.26.14.3	Fri May 28 09:14:55 2010
+++ src/sys/sys/fstypes.h	Thu Oct 21 08:45:03 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstypes.h,v 1.26.14.3 2010/05/28 09:14:55 uebayasi Exp $	*/
+/*	$NetBSD: fstypes.h,v 1.26.14.4 2010/10/21 08:45:03 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -86,7 +86,6 @@
 #define	__MNT_UNUSED1	0x0002
 #define	__MNT_UNUSED2	0x0020
 #define	__MNT_UNUSED3	0x0080
-#define	__MNT_UNUSED4	0x0100
 
 #define	MNT_RDONLY	0x0001	/* read only filesystem */
 #define	MNT_SYNCHRONOUS	0x0002	/* file system written synchronously */
@@ -97,6 +96,7 @@
 #define	MNT_ASYNC	0x0040	/* file system written asynchronously */
 #define	MNT_NOCOREDUMP	0x8000	/* don't write core dumps to this FS */
 #define	MNT_IGNORE	0x0010	/* don't show entry in df */
+#define	MNT_XIP		0x0100	/* eXecute-In-Place */
 #define	MNT_LOG		0x0200	/* Use logging */
 #define	MNT_NOATIME	0x0400	/* Never update acc

CVS commit: src/usr.sbin/kgmon

2010-10-17 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Oct 17 16:13:56 UTC 2010

Modified Files:
src/usr.sbin/kgmon: kgmon.c

Log Message:
Typo in a error message.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/kgmon/kgmon.c

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

Modified files:

Index: src/usr.sbin/kgmon/kgmon.c
diff -u src/usr.sbin/kgmon/kgmon.c:1.24 src/usr.sbin/kgmon/kgmon.c:1.25
--- src/usr.sbin/kgmon/kgmon.c:1.24	Sun Jan 18 09:50:15 2009
+++ src/usr.sbin/kgmon/kgmon.c	Sun Oct 17 16:13:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgmon.c,v 1.24 2009/01/18 09:50:15 lukem Exp $	*/
+/*	$NetBSD: kgmon.c,v 1.25 2010/10/17 16:13:56 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1983, 1992, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "from: @(#)kgmon.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: kgmon.c,v 1.24 2009/01/18 09:50:15 lukem Exp $");
+__RCSID("$NetBSD: kgmon.c,v 1.25 2010/10/17 16:13:56 uebayasi Exp $");
 #endif
 #endif /* not lint */
 
@@ -348,7 +348,7 @@
 		kcountsize, i,
 		kflag ? kvm_geterr(kvp->kd) : strerror(errno));
 	if ((fwrite(tickbuf, kcountsize, 1, fp)) != 1)
-		err(EXIT_FAILURE, "writing tocks to gmon.out");
+		err(EXIT_FAILURE, "writing ticks to gmon.out");
 	free(tickbuf);
 
 	/*



<    3   4   5   6   7   8   9   10   11   12   >