Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Move struct vm_page_md definition from vmparam.h to...



details:   https://anonhg.NetBSD.org/src/rev/82e509089141
branches:  trunk
changeset: 758731:82e509089141
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sun Nov 14 13:33:20 2010 +0000

description:
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.

diffstat:

 sys/arch/alpha/include/pmap.h          |  18 ++++++++++++-
 sys/arch/alpha/include/vmparam.h       |  18 +------------
 sys/arch/amd64/include/pmap.h          |  15 +++++++++-
 sys/arch/amd64/include/vmparam.h       |  13 +--------
 sys/arch/arm/include/arm32/pmap.h      |  46 +++++++++++++++++++++++++++++++++-
 sys/arch/arm/include/arm32/vmparam.h   |  43 +-------------------------------
 sys/arch/hppa/include/pmap.h           |  21 ++++++++++++++-
 sys/arch/hppa/include/vmparam.h        |  23 +----------------
 sys/arch/i386/include/pmap.h           |  13 ++++++++-
 sys/arch/i386/include/vmparam.h        |  13 +--------
 sys/arch/ia64/include/pmap.h           |  19 ++++++++++++++
 sys/arch/ia64/include/vmparam.h        |  24 +-----------------
 sys/arch/mips/include/pmap.h           |  17 +++++++++++-
 sys/arch/mips/include/vmparam.h        |  17 +-----------
 sys/arch/powerpc/include/oea/pmap.h    |  16 +++++++++++-
 sys/arch/powerpc/include/oea/vmparam.h |  18 -------------
 sys/arch/sh3/include/pmap.h            |  20 ++++++++++++++-
 sys/arch/sh3/include/vmparam.h         |  22 +---------------
 sys/arch/sparc/include/pmap.h          |  28 +++++++++++++++++++-
 sys/arch/sparc/include/vmparam.h       |  28 +-------------------
 sys/arch/sparc64/include/pmap.h        |  26 ++++++++++++++++++-
 sys/arch/sparc64/include/vmparam.h     |  30 +---------------------
 sys/arch/vax/include/pmap.h            |  12 ++++++++-
 sys/arch/vax/include/vmparam.h         |  13 +--------
 24 files changed, 250 insertions(+), 263 deletions(-)

diffs (truncated from 814 to 300 lines):

diff -r a2c8b4ec2ad6 -r 82e509089141 sys/arch/alpha/include/pmap.h
--- a/sys/arch/alpha/include/pmap.h     Sun Nov 14 11:19:49 2010 +0000
+++ b/sys/arch/alpha/include/pmap.h     Sun Nov 14 13:33:20 2010 +0000
@@ -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_ */
diff -r a2c8b4ec2ad6 -r 82e509089141 sys/arch/alpha/include/vmparam.h
--- a/sys/arch/alpha/include/vmparam.h  Sun Nov 14 11:19:49 2010 +0000
+++ b/sys/arch/alpha/include/vmparam.h  Sun Nov 14 13:33:20 2010 +0000
@@ -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_ */
diff -r a2c8b4ec2ad6 -r 82e509089141 sys/arch/amd64/include/pmap.h
--- a/sys/arch/amd64/include/pmap.h     Sun Nov 14 11:19:49 2010 +0000
+++ b/sys/arch/amd64/include/pmap.h     Sun Nov 14 13:33:20 2010 +0000
@@ -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>
 
diff -r a2c8b4ec2ad6 -r 82e509089141 sys/arch/amd64/include/vmparam.h
--- a/sys/arch/amd64/include/vmparam.h  Sun Nov 14 11:19:49 2010 +0000
+++ b/sys/arch/amd64/include/vmparam.h  Sun Nov 14 13:33:20 2010 +0000
@@ -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>
diff -r a2c8b4ec2ad6 -r 82e509089141 sys/arch/arm/include/arm32/pmap.h
--- a/sys/arch/arm/include/arm32/pmap.h Sun Nov 14 11:19:49 2010 +0000
+++ b/sys/arch/arm/include/arm32/pmap.h Sun Nov 14 13:33:20 2010 +0000
@@ -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_ */
diff -r a2c8b4ec2ad6 -r 82e509089141 sys/arch/arm/include/arm32/vmparam.h
--- a/sys/arch/arm/include/arm32/vmparam.h      Sun Nov 14 11:19:49 2010 +0000
+++ b/sys/arch/arm/include/arm32/vmparam.h      Sun Nov 14 13:33:20 2010 +0000
@@ -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 */
diff -r a2c8b4ec2ad6 -r 82e509089141 sys/arch/hppa/include/pmap.h
--- a/sys/arch/hppa/include/pmap.h      Sun Nov 14 11:19:49 2010 +0000
+++ b/sys/arch/hppa/include/pmap.h      Sun Nov 14 13:33:20 2010 +0000
@@ -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_ */
diff -r a2c8b4ec2ad6 -r 82e509089141 sys/arch/hppa/include/vmparam.h
--- a/sys/arch/hppa/include/vmparam.h   Sun Nov 14 11:19:49 2010 +0000
+++ b/sys/arch/hppa/include/vmparam.h   Sun Nov 14 13:33:20 2010 +0000
@@ -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;                                     \



Home | Main Index | Thread Index | Old Index