Module Name: src
Committed By: uebayasi
Date: Sun Nov 14 13:33:23 UTC 2010
Modified Files:
src/sys/arch/alpha/include: pmap.h vmparam.h
src/sys/arch/amd64/include: pmap.h vmparam.h
src/sys/arch/arm/include/arm32: pmap.h vmparam.h
src/sys/arch/hppa/include: pmap.h vmparam.h
src/sys/arch/i386/include: pmap.h vmparam.h
src/sys/arch/ia64/include: pmap.h vmparam.h
src/sys/arch/mips/include: pmap.h vmparam.h
src/sys/arch/powerpc/include/oea: pmap.h vmparam.h
src/sys/arch/sh3/include: pmap.h vmparam.h
src/sys/arch/sparc/include: pmap.h vmparam.h
src/sys/arch/sparc64/include: pmap.h vmparam.h
src/sys/arch/vax/include: pmap.h vmparam.h
Log Message:
Move struct vm_page_md definition from vmparam.h to pmap.h, because
it's used only by pmap. vmparam.h has definitions for wider
audience.
All GENERIC kernels build tested, except ia64.
powerpc/include/booke/vmparam.h has one too, but it has no pmap.h,
so it's left as is.
To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/alpha/include/pmap.h
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/alpha/include/vmparam.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amd64/include/vmparam.h
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/include/arm32/vmparam.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/hppa/include/pmap.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hppa/include/vmparam.h
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/i386/include/pmap.h
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/i386/include/vmparam.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/include/pmap.h \
src/sys/arch/ia64/include/vmparam.h
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mips/include/vmparam.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/powerpc/include/oea/pmap.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/include/oea/vmparam.h
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sh3/include/pmap.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sh3/include/vmparam.h
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/sparc/include/pmap.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/sparc/include/vmparam.h
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sparc64/include/pmap.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sparc64/include/vmparam.h
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/vax/include/pmap.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/vax/include/vmparam.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/alpha/include/pmap.h
diff -u src/sys/arch/alpha/include/pmap.h:1.75 src/sys/arch/alpha/include/pmap.h:1.76
--- src/sys/arch/alpha/include/pmap.h:1.75 Mon Oct 26 03:51:43 2009
+++ src/sys/arch/alpha/include/pmap.h Sun Nov 14 13:33:20 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.75 2009/10/26 03:51:43 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.76 2010/11/14 13:33:20 uebayasi Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -349,6 +349,22 @@
} \
} while (0)
+/*
+ * pmap-specific data store in the vm_page structure.
+ */
+#define __HAVE_VM_PAGE_MD
+struct vm_page_md {
+ struct pv_entry *pvh_list; /* pv_entry list */
+ int pvh_attrs; /* page attributes */
+ unsigned pvh_refcnt;
+};
+
+#define VM_MDPAGE_INIT(pg) \
+do { \
+ (pg)->mdpage.pvh_list = NULL; \
+ (pg)->mdpage.pvh_refcnt = 0; \
+} while (/*CONSTCOND*/0)
+
#endif /* _KERNEL */
#endif /* _PMAP_MACHINE_ */
Index: src/sys/arch/alpha/include/vmparam.h
diff -u src/sys/arch/alpha/include/vmparam.h:1.34 src/sys/arch/alpha/include/vmparam.h:1.35
--- src/sys/arch/alpha/include/vmparam.h:1.34 Sat Nov 6 15:42:43 2010
+++ src/sys/arch/alpha/include/vmparam.h Sun Nov 14 13:33:20 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.34 2010/11/06 15:42:43 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.35 2010/11/14 13:33:20 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -151,20 +151,4 @@
#define VM_NFREELIST 1
#define VM_FREELIST_DEFAULT 0
-/*
- * pmap-specific data store in the vm_page structure.
- */
-#define __HAVE_VM_PAGE_MD
-struct vm_page_md {
- struct pv_entry *pvh_list; /* pv_entry list */
- int pvh_attrs; /* page attributes */
- unsigned pvh_refcnt;
-};
-
-#define VM_MDPAGE_INIT(pg) \
-do { \
- (pg)->mdpage.pvh_list = NULL; \
- (pg)->mdpage.pvh_refcnt = 0; \
-} while (/*CONSTCOND*/0)
-
#endif /* ! _ALPHA_VMPARAM_H_ */
Index: src/sys/arch/amd64/include/pmap.h
diff -u src/sys/arch/amd64/include/pmap.h:1.22 src/sys/arch/amd64/include/pmap.h:1.23
--- src/sys/arch/amd64/include/pmap.h:1.22 Sun Oct 26 00:08:15 2008
+++ src/sys/arch/amd64/include/pmap.h Sun Nov 14 13:33:20 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.22 2008/10/26 00:08:15 mrg Exp $ */
+/* $NetBSD: pmap.h,v 1.23 2010/11/14 13:33:20 uebayasi Exp $ */
/*
*
@@ -343,7 +343,18 @@
void pmap_prealloc_lowmem_ptps(void);
void pmap_changeprot_local(vaddr_t, vm_prot_t);
-#else /* __x86_64__ */
+#include <x86/pmap_pv.h>
+
+#define __HAVE_VM_PAGE_MD
+#define VM_MDPAGE_INIT(pg) \
+ memset(&(pg)->mdpage, 0, sizeof((pg)->mdpage)); \
+ PMAP_PAGE_INIT(&(pg)->mdpage.mp_pp)
+
+struct vm_page_md {
+ struct pmap_page mp_pp;
+};
+
+#else /* !__x86_64__ */
#include <i386/pmap.h>
Index: src/sys/arch/amd64/include/vmparam.h
diff -u src/sys/arch/amd64/include/vmparam.h:1.23 src/sys/arch/amd64/include/vmparam.h:1.24
--- src/sys/arch/amd64/include/vmparam.h:1.23 Sat Nov 6 15:42:44 2010
+++ src/sys/arch/amd64/include/vmparam.h Sun Nov 14 13:33:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.23 2010/11/06 15:42:44 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.24 2010/11/14 13:33:21 uebayasi Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -156,17 +156,6 @@
#define VM_FREELIST_FIRST4G 1
#define VM_FREELIST_FIRST16 2
-#include <x86/pmap_pv.h>
-
-#define __HAVE_VM_PAGE_MD
-#define VM_MDPAGE_INIT(pg) \
- memset(&(pg)->mdpage, 0, sizeof((pg)->mdpage)); \
- PMAP_PAGE_INIT(&(pg)->mdpage.mp_pp)
-
-struct vm_page_md {
- struct pmap_page mp_pp;
-};
-
#else /* !__x86_64__ */
#include <i386/vmparam.h>
Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.96 src/sys/arch/arm/include/arm32/pmap.h:1.97
--- src/sys/arch/arm/include/arm32/pmap.h:1.96 Tue Nov 2 06:07:06 2010
+++ src/sys/arch/arm/include/arm32/pmap.h Sun Nov 14 13:33:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.96 2010/11/02 06:07:06 uebayasi Exp $ */
+/* $NetBSD: pmap.h,v 1.97 2010/11/14 13:33:21 uebayasi Exp $ */
/*
* Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -762,6 +762,50 @@
*/
#define POOL_VTOPHYS(va) vtophys((vaddr_t) (va))
+#ifndef _LOCORE
+
+/*
+ * pmap-specific data store in the vm_page structure.
+ */
+#define __HAVE_VM_PAGE_MD
+struct vm_page_md {
+ SLIST_HEAD(,pv_entry) pvh_list; /* pv_entry list */
+ struct simplelock pvh_slock; /* lock on this head */
+ int pvh_attrs; /* page attributes */
+ u_int uro_mappings;
+ u_int urw_mappings;
+ union {
+ u_short s_mappings[2]; /* Assume kernel count <= 65535 */
+ u_int i_mappings;
+ } k_u;
+#define kro_mappings k_u.s_mappings[0]
+#define krw_mappings k_u.s_mappings[1]
+#define k_mappings k_u.i_mappings
+};
+
+/*
+ * Set the default color of each page.
+ */
+#if ARM_MMU_V6 > 0
+#define VM_MDPAGE_PVH_ATTRS_INIT(pg) \
+ (pg)->mdpage.pvh_attrs = (pg)->phys_addr & arm_cache_prefer_mask
+#else
+#define VM_MDPAGE_PVH_ATTRS_INIT(pg) \
+ (pg)->mdpage.pvh_attrs = 0
+#endif
+
+#define VM_MDPAGE_INIT(pg) \
+do { \
+ SLIST_INIT(&(pg)->mdpage.pvh_list); \
+ simple_lock_init(&(pg)->mdpage.pvh_slock); \
+ VM_MDPAGE_PVH_ATTRS_INIT(pg); \
+ (pg)->mdpage.uro_mappings = 0; \
+ (pg)->mdpage.urw_mappings = 0; \
+ (pg)->mdpage.k_mappings = 0; \
+} while (/*CONSTCOND*/0)
+
+#endif /* !_LOCORE */
+
#endif /* _KERNEL */
#endif /* _ARM32_PMAP_H_ */
Index: src/sys/arch/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.24 src/sys/arch/arm/include/arm32/vmparam.h:1.25
--- src/sys/arch/arm/include/arm32/vmparam.h:1.24 Fri Mar 6 20:31:47 2009
+++ src/sys/arch/arm/include/arm32/vmparam.h Sun Nov 14 13:33:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.24 2009/03/06 20:31:47 joerg Exp $ */
+/* $NetBSD: vmparam.h,v 1.25 2010/11/14 13:33:21 uebayasi Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -96,47 +96,6 @@
#define VM_MAX_KERNEL_BUF \
((virtual_end - virtual_avail) * 4 / 10)
#endif
-
-/*
- * pmap-specific data store in the vm_page structure.
- */
-#define __HAVE_VM_PAGE_MD
-struct vm_page_md {
- SLIST_HEAD(,pv_entry) pvh_list; /* pv_entry list */
- struct simplelock pvh_slock; /* lock on this head */
- int pvh_attrs; /* page attributes */
- u_int uro_mappings;
- u_int urw_mappings;
- union {
- u_short s_mappings[2]; /* Assume kernel count <= 65535 */
- u_int i_mappings;
- } k_u;
-#define kro_mappings k_u.s_mappings[0]
-#define krw_mappings k_u.s_mappings[1]
-#define k_mappings k_u.i_mappings
-};
-
-/*
- * Set the default color of each page.
- */
-#if ARM_MMU_V6 > 0
-#define VM_MDPAGE_PVH_ATTRS_INIT(pg) \
- (pg)->mdpage.pvh_attrs = (pg)->phys_addr & arm_cache_prefer_mask
-#else
-#define VM_MDPAGE_PVH_ATTRS_INIT(pg) \
- (pg)->mdpage.pvh_attrs = 0
-#endif
-
-
-#define VM_MDPAGE_INIT(pg) \
-do { \
- SLIST_INIT(&(pg)->mdpage.pvh_list); \
- simple_lock_init(&(pg)->mdpage.pvh_slock); \
- VM_MDPAGE_PVH_ATTRS_INIT(pg); \
- (pg)->mdpage.uro_mappings = 0; \
- (pg)->mdpage.urw_mappings = 0; \
- (pg)->mdpage.k_mappings = 0; \
-} while (/*CONSTCOND*/0)
#endif /* __ASSEMBLER__ */
#endif /* _KERNEL */
Index: src/sys/arch/hppa/include/pmap.h
diff -u src/sys/arch/hppa/include/pmap.h:1.28 src/sys/arch/hppa/include/pmap.h:1.29
--- src/sys/arch/hppa/include/pmap.h:1.28 Tue Jul 6 20:50:34 2010
+++ src/sys/arch/hppa/include/pmap.h Sun Nov 14 13:33:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.28 2010/07/06 20:50:34 cegger Exp $ */
+/* $NetBSD: pmap.h,v 1.29 2010/11/14 13:33:21 uebayasi Exp $ */
/* $OpenBSD: pmap.h,v 1.35 2007/12/14 18:32:23 deraadt Exp $ */
@@ -192,6 +192,25 @@
((((va) & 0xc0000000) != 0xc0000000) ? \
(pmap)->pm_space : HPPA_SID_KERNEL)
+#define __HAVE_VM_PAGE_MD
+
+struct pv_entry;
+
+struct vm_page_md {
+ struct kmutex pvh_lock; /* locks every pv on this list */
+ struct pv_entry *pvh_list; /* head of list (locked by pvh_lock) */
+ u_int pvh_attrs; /* to preserve ref/mod */
+ int pvh_aliases; /* alias counting */
+};
+
+#define VM_MDPAGE_INIT(pg) \
+do { \
+ mutex_init(&(pg)->mdpage.pvh_lock, MUTEX_NODEBUG, IPL_VM); \
+ (pg)->mdpage.pvh_list = NULL; \
+ (pg)->mdpage.pvh_attrs = 0; \
+ (pg)->mdpage.pvh_aliases = 0; \
+} while (0)
+
#endif /* _KERNEL */
#endif /* _HPPA_PMAP_H_ */
Index: src/sys/arch/hppa/include/vmparam.h
diff -u src/sys/arch/hppa/include/vmparam.h:1.17 src/sys/arch/hppa/include/vmparam.h:1.18
--- src/sys/arch/hppa/include/vmparam.h:1.17 Sun Nov 14 03:16:04 2010
+++ src/sys/arch/hppa/include/vmparam.h Sun Nov 14 13:33:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.17 2010/11/14 03:16:04 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.18 2010/11/14 13:33:21 uebayasi Exp $ */
/* $OpenBSD: vmparam.h,v 1.33 2006/06/04 17:21:24 miod Exp $ */
@@ -101,25 +101,4 @@
#define VM_FREELIST_DEFAULT 0
#define VM_FREELIST_ISADMA 1
-#if defined(_KERNEL) && !defined(_LOCORE)
-#define __HAVE_VM_PAGE_MD
-
-struct pv_entry;
-
-struct vm_page_md {
- struct kmutex pvh_lock; /* locks every pv on this list */
- struct pv_entry *pvh_list; /* head of list (locked by pvh_lock) */
- u_int pvh_attrs; /* to preserve ref/mod */
- int pvh_aliases; /* alias counting */
-};
-
-#define VM_MDPAGE_INIT(pg) \
-do { \
- mutex_init(&(pg)->mdpage.pvh_lock, MUTEX_NODEBUG, IPL_VM); \
- (pg)->mdpage.pvh_list = NULL; \
- (pg)->mdpage.pvh_attrs = 0; \
- (pg)->mdpage.pvh_aliases = 0; \
-} while (0)
-#endif
-
#endif /* _HPPA_VMPARAM_H_ */
Index: src/sys/arch/i386/include/pmap.h
diff -u src/sys/arch/i386/include/pmap.h:1.107 src/sys/arch/i386/include/pmap.h:1.108
--- src/sys/arch/i386/include/pmap.h:1.107 Sat Jul 24 00:45:55 2010
+++ src/sys/arch/i386/include/pmap.h Sun Nov 14 13:33:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.107 2010/07/24 00:45:55 jym Exp $ */
+/* $NetBSD: pmap.h,v 1.108 2010/11/14 13:33:21 uebayasi Exp $ */
/*
*
@@ -447,4 +447,15 @@
int pmap_exec_fixup(struct vm_map *, struct trapframe *, struct pcb *);
void pmap_ldt_cleanup(struct lwp *);
+#include <x86/pmap_pv.h>
+
+#define __HAVE_VM_PAGE_MD
+#define VM_MDPAGE_INIT(pg) \
+ memset(&(pg)->mdpage, 0, sizeof((pg)->mdpage)); \
+ PMAP_PAGE_INIT(&(pg)->mdpage.mp_pp)
+
+struct vm_page_md {
+ struct pmap_page mp_pp;
+};
+
#endif /* _I386_PMAP_H_ */
Index: src/sys/arch/i386/include/vmparam.h
diff -u src/sys/arch/i386/include/vmparam.h:1.71 src/sys/arch/i386/include/vmparam.h:1.72
--- src/sys/arch/i386/include/vmparam.h:1.71 Sat Nov 6 15:42:45 2010
+++ src/sys/arch/i386/include/vmparam.h Sun Nov 14 13:33:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.71 2010/11/06 15:42:45 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.72 2010/11/14 13:33:21 uebayasi Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -133,15 +133,4 @@
#endif /* XEN */
#define VM_FREELIST_DEFAULT 0
-#include <x86/pmap_pv.h>
-
-#define __HAVE_VM_PAGE_MD
-#define VM_MDPAGE_INIT(pg) \
- memset(&(pg)->mdpage, 0, sizeof((pg)->mdpage)); \
- PMAP_PAGE_INIT(&(pg)->mdpage.mp_pp)
-
-struct vm_page_md {
- struct pmap_page mp_pp;
-};
-
#endif /* _I386_VMPARAM_H_ */
Index: src/sys/arch/ia64/include/pmap.h
diff -u src/sys/arch/ia64/include/pmap.h:1.6 src/sys/arch/ia64/include/pmap.h:1.7
--- src/sys/arch/ia64/include/pmap.h:1.6 Mon Jul 20 04:41:37 2009
+++ src/sys/arch/ia64/include/pmap.h Sun Nov 14 13:33:22 2010
@@ -146,4 +146,23 @@
#define PMAP_VHPT_LOG2SIZE 16
+#include <sys/queue.h>
+#include <sys/mutex.h>
+/*
+ * pmap-specific data store in the vm_page structure.
+ */
+#define __HAVE_VM_PAGE_MD
+struct vm_page_md {
+ TAILQ_HEAD(,pv_entry) pv_list; /* pv_entry list */
+ int pv_list_count;
+ kmutex_t pv_mutex; /* lock on this head */
+ int pvh_attrs; /* page attributes */
+};
+
+#define VM_MDPAGE_INIT(pg) \
+do { \
+ TAILQ_INIT(&(pg)->mdpage.pv_list); \
+ mutex_init(&(pg)->mdpage.pv_mutex, MUTEX_DEFAULT, IPL_NONE); \
+} while (/*CONSTCOND*/0)
+
#endif /* _PMAP_MACHINE_ */
Index: src/sys/arch/ia64/include/vmparam.h
diff -u src/sys/arch/ia64/include/vmparam.h:1.6 src/sys/arch/ia64/include/vmparam.h:1.7
--- src/sys/arch/ia64/include/vmparam.h:1.6 Sat Nov 6 15:42:46 2010
+++ src/sys/arch/ia64/include/vmparam.h Sun Nov 14 13:33:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.6 2010/11/06 15:42:46 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.7 2010/11/14 13:33:22 uebayasi Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -109,26 +109,4 @@
/* virtual sizes (bytes) for various kernel submaps */
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
-#ifndef _LOCORE
-
-#include <sys/queue.h>
-#include <sys/mutex.h>
-/*
- * pmap-specific data store in the vm_page structure.
- */
-#define __HAVE_VM_PAGE_MD
-struct vm_page_md {
- TAILQ_HEAD(,pv_entry) pv_list; /* pv_entry list */
- int pv_list_count;
- kmutex_t pv_mutex; /* lock on this head */
- int pvh_attrs; /* page attributes */
-};
-
-#define VM_MDPAGE_INIT(pg) \
-do { \
- TAILQ_INIT(&(pg)->mdpage.pv_list); \
- mutex_init(&(pg)->mdpage.pv_mutex, MUTEX_DEFAULT, IPL_NONE); \
-} while (/*CONSTCOND*/0)
-#endif /*_LOCORE*/
-
#endif /* _VMPARAM_H_ */
Index: src/sys/arch/mips/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.58 src/sys/arch/mips/include/pmap.h:1.59
--- src/sys/arch/mips/include/pmap.h:1.58 Tue Jul 6 20:50:34 2010
+++ src/sys/arch/mips/include/pmap.h Sun Nov 14 13:33:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.58 2010/07/06 20:50:34 cegger Exp $ */
+/* $NetBSD: pmap.h,v 1.59 2010/11/14 13:33:22 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -205,5 +205,20 @@
#define PGC_NOCACHE 0x4000000000000000ULL
#endif
+#define __HAVE_VM_PAGE_MD
+
+/*
+ * pmap-specific data stored in the vm_page structure.
+ */
+struct vm_page_md {
+ struct pv_entry *pvh_list; /* pv_entry list */
+ u_int pvh_attrs; /* page attributes */
+};
+
+#define VM_MDPAGE_INIT(pg) \
+do { \
+ (pg)->mdpage.pvh_list = NULL; \
+} while (/* CONSTCOND */ 0)
+
#endif /* _KERNEL */
#endif /* _MIPS_PMAP_H_ */
Index: src/sys/arch/mips/include/vmparam.h
diff -u src/sys/arch/mips/include/vmparam.h:1.45 src/sys/arch/mips/include/vmparam.h:1.46
--- src/sys/arch/mips/include/vmparam.h:1.45 Sat Nov 6 15:42:47 2010
+++ src/sys/arch/mips/include/vmparam.h Sun Nov 14 13:33:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.45 2010/11/06 15:42:47 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.46 2010/11/14 13:33:22 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -201,21 +201,6 @@
/* VM_PHYSSEG_MAX defined by platform-dependent code. */
#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
-#define __HAVE_VM_PAGE_MD
-
-/*
- * pmap-specific data stored in the vm_page structure.
- */
-struct vm_page_md {
- struct pv_entry *pvh_list; /* pv_entry list */
- u_int pvh_attrs; /* page attributes */
-};
-
-#define VM_MDPAGE_INIT(pg) \
-do { \
- (pg)->mdpage.pvh_list = NULL; \
-} while (/* CONSTCOND */ 0)
-
#ifndef VM_NFREELIST
#define VM_NFREELIST 16 /* 16 distinct memory segments */
#define VM_FREELIST_DEFAULT 0
Index: src/sys/arch/powerpc/include/oea/pmap.h
diff -u src/sys/arch/powerpc/include/oea/pmap.h:1.18 src/sys/arch/powerpc/include/oea/pmap.h:1.19
--- src/sys/arch/powerpc/include/oea/pmap.h:1.18 Sat Nov 7 07:27:45 2009
+++ src/sys/arch/powerpc/include/oea/pmap.h Sun Nov 14 13:33:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.18 2009/11/07 07:27:45 cegger Exp $ */
+/* $NetBSD: pmap.h,v 1.19 2010/11/14 13:33:22 uebayasi Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -253,6 +253,20 @@
void pmap_zero_page(paddr_t);
void pmap_copy_page(paddr_t, paddr_t);
+LIST_HEAD(pvo_head, pvo_entry);
+
+#define __HAVE_VM_PAGE_MD
+
+struct vm_page_md {
+ struct pvo_head mdpg_pvoh;
+ unsigned int mdpg_attrs;
+};
+
+#define VM_MDPAGE_INIT(pg) do { \
+ LIST_INIT(&(pg)->mdpage.mdpg_pvoh); \
+ (pg)->mdpage.mdpg_attrs = 0; \
+} while (/*CONSTCOND*/0)
+
__END_DECLS
#endif /* _KERNEL */
#endif /* _LOCORE */
Index: src/sys/arch/powerpc/include/oea/vmparam.h
diff -u src/sys/arch/powerpc/include/oea/vmparam.h:1.15 src/sys/arch/powerpc/include/oea/vmparam.h:1.16
--- src/sys/arch/powerpc/include/oea/vmparam.h:1.15 Sat Nov 6 15:42:48 2010
+++ src/sys/arch/powerpc/include/oea/vmparam.h Sun Nov 14 13:33:22 2010
@@ -194,22 +194,4 @@
#define VM_FREELIST_FIRST16 2
#define VM_FREELIST_MAX 3
-#ifndef _LOCORE
-
-LIST_HEAD(pvo_head, pvo_entry);
-
-#define __HAVE_VM_PAGE_MD
-
-struct vm_page_md {
- struct pvo_head mdpg_pvoh;
- unsigned int mdpg_attrs;
-};
-
-#define VM_MDPAGE_INIT(pg) do { \
- LIST_INIT(&(pg)->mdpage.mdpg_pvoh); \
- (pg)->mdpage.mdpg_attrs = 0; \
-} while (/*CONSTCOND*/0)
-
-#endif /* _LOCORE */
-
#endif /* _POWERPC_OEA_VMPARAM_H_ */
Index: src/sys/arch/sh3/include/pmap.h
diff -u src/sys/arch/sh3/include/pmap.h:1.34 src/sys/arch/sh3/include/pmap.h:1.35
--- src/sys/arch/sh3/include/pmap.h:1.34 Wed Oct 21 21:12:02 2009
+++ src/sys/arch/sh3/include/pmap.h Sun Nov 14 13:33:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.34 2009/10/21 21:12:02 rmind Exp $ */
+/* $NetBSD: pmap.h,v 1.35 2010/11/14 13:33:22 uebayasi Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -83,4 +83,22 @@
pt_entry_t *__pmap_pte_lookup(pmap_t, vaddr_t);
pt_entry_t *__pmap_kpte_lookup(vaddr_t);
bool __pmap_pte_load(pmap_t, vaddr_t, int);
+
+/* pmap-specific data store in the vm_page structure. */
+#define __HAVE_VM_PAGE_MD
+#define PVH_REFERENCED 1
+#define PVH_MODIFIED 2
+
+struct pv_entry;
+struct vm_page_md {
+ SLIST_HEAD(, pv_entry) pvh_head;
+ int pvh_flags;
+};
+
+#define VM_MDPAGE_INIT(pg) \
+do { \
+ struct vm_page_md *pvh = &(pg)->mdpage; \
+ SLIST_INIT(&pvh->pvh_head); \
+ pvh->pvh_flags = 0; \
+} while (/*CONSTCOND*/0)
#endif /* !_SH3_PMAP_H_ */
Index: src/sys/arch/sh3/include/vmparam.h
diff -u src/sys/arch/sh3/include/vmparam.h:1.20 src/sys/arch/sh3/include/vmparam.h:1.21
--- src/sys/arch/sh3/include/vmparam.h:1.20 Sat Nov 6 15:42:48 2010
+++ src/sys/arch/sh3/include/vmparam.h Sun Nov 14 13:33:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.20 2010/11/06 15:42:48 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.21 2010/11/14 13:33:22 uebayasi Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -83,24 +83,4 @@
#define sh3_trunc_page(x) ((uint32_t)(x) & ~PGOFSET)
#define sh3_btop(x) ((uint32_t)(x) >> PGSHIFT)
#define sh3_ptob(x) ((uint32_t)(x) << PGSHIFT)
-
-/* pmap-specific data store in the vm_page structure. */
-#define __HAVE_VM_PAGE_MD
-#define PVH_REFERENCED 1
-#define PVH_MODIFIED 2
-
-#ifndef _LOCORE
-struct pv_entry;
-struct vm_page_md {
- SLIST_HEAD(, pv_entry) pvh_head;
- int pvh_flags;
-};
-
-#define VM_MDPAGE_INIT(pg) \
-do { \
- struct vm_page_md *pvh = &(pg)->mdpage; \
- SLIST_INIT(&pvh->pvh_head); \
- pvh->pvh_flags = 0; \
-} while (/*CONSTCOND*/0)
-#endif /* _LOCORE */
#endif /* !_SH3_VMPARAM_H_ */
Index: src/sys/arch/sparc/include/pmap.h
diff -u src/sys/arch/sparc/include/pmap.h:1.88 src/sys/arch/sparc/include/pmap.h:1.89
--- src/sys/arch/sparc/include/pmap.h:1.88 Sat Nov 21 04:16:51 2009
+++ src/sys/arch/sparc/include/pmap.h Sun Nov 14 13:33:23 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.88 2009/11/21 04:16:51 rmind Exp $ */
+/* $NetBSD: pmap.h,v 1.89 2010/11/14 13:33:23 uebayasi Exp $ */
/*
* Copyright (c) 1996
@@ -390,6 +390,32 @@
#endif /* SUN4M || SUN4D */
+#define __HAVE_VM_PAGE_MD
+
+/*
+ * For each managed physical page, there is a list of all currently
+ * valid virtual mappings of that page. Since there is usually one
+ * (or zero) mapping per page, the table begins with an initial entry,
+ * rather than a pointer; this head entry is empty iff its pv_pmap
+ * field is NULL.
+ */
+struct vm_page_md {
+ struct pvlist {
+ struct pvlist *pv_next; /* next pvlist, if any */
+ struct pmap *pv_pmap; /* pmap of this va */
+ vaddr_t pv_va; /* virtual address */
+ int pv_flags; /* flags (below) */
+ } pvlisthead;
+};
+#define VM_MDPAGE_PVHEAD(pg) (&(pg)->mdpage.pvlisthead)
+
+#define VM_MDPAGE_INIT(pg) do { \
+ (pg)->mdpage.pvlisthead.pv_next = NULL; \
+ (pg)->mdpage.pvlisthead.pv_pmap = NULL; \
+ (pg)->mdpage.pvlisthead.pv_va = 0; \
+ (pg)->mdpage.pvlisthead.pv_flags = 0; \
+} while(/*CONSTCOND*/0)
+
#endif /* _KERNEL */
#endif /* _SPARC_PMAP_H_ */
Index: src/sys/arch/sparc/include/vmparam.h
diff -u src/sys/arch/sparc/include/vmparam.h:1.41 src/sys/arch/sparc/include/vmparam.h:1.42
--- src/sys/arch/sparc/include/vmparam.h:1.41 Sat Nov 6 15:42:49 2010
+++ src/sys/arch/sparc/include/vmparam.h Sun Nov 14 13:33:23 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.41 2010/11/06 15:42:49 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.42 2010/11/14 13:33:23 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -118,30 +118,4 @@
#define VM_NFREELIST 1
#define VM_FREELIST_DEFAULT 0
-#define __HAVE_VM_PAGE_MD
-
-/*
- * For each managed physical page, there is a list of all currently
- * valid virtual mappings of that page. Since there is usually one
- * (or zero) mapping per page, the table begins with an initial entry,
- * rather than a pointer; this head entry is empty iff its pv_pmap
- * field is NULL.
- */
-struct vm_page_md {
- struct pvlist {
- struct pvlist *pv_next; /* next pvlist, if any */
- struct pmap *pv_pmap; /* pmap of this va */
- vaddr_t pv_va; /* virtual address */
- int pv_flags; /* flags (below) */
- } pvlisthead;
-};
-#define VM_MDPAGE_PVHEAD(pg) (&(pg)->mdpage.pvlisthead)
-
-#define VM_MDPAGE_INIT(pg) do { \
- (pg)->mdpage.pvlisthead.pv_next = NULL; \
- (pg)->mdpage.pvlisthead.pv_pmap = NULL; \
- (pg)->mdpage.pvlisthead.pv_va = 0; \
- (pg)->mdpage.pvlisthead.pv_flags = 0; \
-} while(/*CONSTCOND*/0)
-
#endif /* _SPARC_VMPARAM_H_ */
Index: src/sys/arch/sparc64/include/pmap.h
diff -u src/sys/arch/sparc64/include/pmap.h:1.52 src/sys/arch/sparc64/include/pmap.h:1.53
--- src/sys/arch/sparc64/include/pmap.h:1.52 Sat Mar 6 08:08:29 2010
+++ src/sys/arch/sparc64/include/pmap.h Sun Nov 14 13:33:23 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.52 2010/03/06 08:08:29 mrg Exp $ */
+/* $NetBSD: pmap.h,v 1.53 2010/11/14 13:33:23 uebayasi Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -210,6 +210,30 @@
extern int phys_installed_size;
extern struct mem_region *phys_installed;
+#define __HAVE_VM_PAGE_MD
+
+/*
+ * For each struct vm_page, there is a list of all currently valid virtual
+ * mappings of that page. An entry is a pv_entry_t.
+ */
+struct pmap;
+typedef struct pv_entry {
+ struct pv_entry *pv_next; /* next pv_entry */
+ struct pmap *pv_pmap; /* pmap where mapping lies */
+ vaddr_t pv_va; /* virtual address for mapping */
+} *pv_entry_t;
+/* PV flags encoded in the low bits of the VA of the first pv_entry */
+
+struct vm_page_md {
+ struct pv_entry mdpg_pvh;
+};
+#define VM_MDPAGE_INIT(pg) \
+do { \
+ (pg)->mdpage.mdpg_pvh.pv_next = NULL; \
+ (pg)->mdpage.mdpg_pvh.pv_pmap = NULL; \
+ (pg)->mdpage.mdpg_pvh.pv_va = 0; \
+} while (/*CONSTCOND*/0)
+
#endif /* _KERNEL */
#endif /* _LOCORE */
Index: src/sys/arch/sparc64/include/vmparam.h
diff -u src/sys/arch/sparc64/include/vmparam.h:1.31 src/sys/arch/sparc64/include/vmparam.h:1.32
--- src/sys/arch/sparc64/include/vmparam.h:1.31 Sat Nov 6 15:42:49 2010
+++ src/sys/arch/sparc64/include/vmparam.h Sun Nov 14 13:33:23 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.31 2010/11/06 15:42:49 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.32 2010/11/14 13:33:23 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -169,32 +169,4 @@
#define VM_NFREELIST 1
#define VM_FREELIST_DEFAULT 0
-#ifdef _KERNEL
-
-#define __HAVE_VM_PAGE_MD
-
-/*
- * For each struct vm_page, there is a list of all currently valid virtual
- * mappings of that page. An entry is a pv_entry_t.
- */
-struct pmap;
-typedef struct pv_entry {
- struct pv_entry *pv_next; /* next pv_entry */
- struct pmap *pv_pmap; /* pmap where mapping lies */
- vaddr_t pv_va; /* virtual address for mapping */
-} *pv_entry_t;
-/* PV flags encoded in the low bits of the VA of the first pv_entry */
-
-struct vm_page_md {
- struct pv_entry mdpg_pvh;
-};
-#define VM_MDPAGE_INIT(pg) \
-do { \
- (pg)->mdpage.mdpg_pvh.pv_next = NULL; \
- (pg)->mdpage.mdpg_pvh.pv_pmap = NULL; \
- (pg)->mdpage.mdpg_pvh.pv_va = 0; \
-} while (/*CONSTCOND*/0)
-
-#endif /* _KERNEL */
-
#endif
Index: src/sys/arch/vax/include/pmap.h
diff -u src/sys/arch/vax/include/pmap.h:1.78 src/sys/arch/vax/include/pmap.h:1.79
--- src/sys/arch/vax/include/pmap.h:1.78 Fri Nov 12 13:35:51 2010
+++ src/sys/arch/vax/include/pmap.h Sun Nov 14 13:33:23 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.78 2010/11/12 13:35:51 uebayasi Exp $ */
+/* $NetBSD: pmap.h,v 1.79 2010/11/14 13:33:23 uebayasi Exp $ */
/*
* Copyright (c) 1991 Regents of the University of California.
@@ -289,4 +289,14 @@
void pmap_bootstrap(void);
vaddr_t pmap_map(vaddr_t, vaddr_t, vaddr_t, int);
+#if 0
+#define __HAVE_VM_PAGE_MD
+
+struct vm_page_md {
+ unsigned int md_attrs;
+};
+
+#define VM_MDPAGE_INIT(pg) ((pg)->mdpage.md_attrs = 0)
+#endif
+
#endif /* PMAP_H */
Index: src/sys/arch/vax/include/vmparam.h
diff -u src/sys/arch/vax/include/vmparam.h:1.46 src/sys/arch/vax/include/vmparam.h:1.47
--- src/sys/arch/vax/include/vmparam.h:1.46 Sat Nov 6 15:42:50 2010
+++ src/sys/arch/vax/include/vmparam.h Sun Nov 14 13:33:23 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.46 2010/11/06 15:42:50 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.47 2010/11/14 13:33:23 uebayasi Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -108,15 +108,4 @@
#define USRIOSIZE (8 * VAX_NPTEPG) /* 512MB */
#define VM_PHYS_SIZE (USRIOSIZE*VAX_NBPG)
-#if 0
-#define __HAVE_VM_PAGE_MD
-
-struct vm_page_md {
- unsigned int md_attrs;
-};
-
-#define VM_MDPAGE_INIT(pg) ((pg)->mdpage.md_attrs = 0)
-#endif
-
-
#endif