Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys/arch/powerpc Use VM_PAGE_TO_MD(). Only compile t...
details: https://anonhg.NetBSD.org/src/rev/d746210ee909
branches: uebayasi-xip
changeset: 751612:d746210ee909
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Fri Feb 26 14:40:23 2010 +0000
description:
Use VM_PAGE_TO_MD(). Only compile tested.
diffstat:
sys/arch/powerpc/oea/pmap.c | 24 +++++++++++++++++-------
sys/arch/powerpc/powerpc/pmap_subr.c | 18 ++++++++++--------
2 files changed, 27 insertions(+), 15 deletions(-)
diffs (126 lines):
diff -r 938e4e4895b3 -r d746210ee909 sys/arch/powerpc/oea/pmap.c
--- a/sys/arch/powerpc/oea/pmap.c Thu Feb 25 17:15:56 2010 +0000
+++ b/sys/arch/powerpc/oea/pmap.c Fri Feb 26 14:40:23 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.69 2009/11/21 17:40:29 rmind Exp $ */
+/* $NetBSD: pmap.c,v 1.69.2.1 2010/02/26 14:40:23 uebayasi Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.69 2009/11/21 17:40:29 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.69.2.1 2010/02/26 14:40:23 uebayasi Exp $");
#define PMAP_NOOPNAMES
@@ -689,38 +689,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
diff -r 938e4e4895b3 -r d746210ee909 sys/arch/powerpc/powerpc/pmap_subr.c
--- a/sys/arch/powerpc/powerpc/pmap_subr.c Thu Feb 25 17:15:56 2010 +0000
+++ b/sys/arch/powerpc/powerpc/pmap_subr.c Fri Feb 26 14:40:23 2010 +0000
@@ -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.22.2.1 2010/02/26 14:40:23 uebayasi Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__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.22.2.1 2010/02/26 14:40:23 uebayasi Exp $");
#include "opt_multiprocessor.h"
#include "opt_altivec.h"
@@ -293,13 +293,14 @@
*/
struct vm_page *pg = PHYS_TO_VM_PAGE(pa);
KDASSERT(pg != NULL);
- KDASSERT(LIST_EMPTY(&pg->mdpage.mdpg_pvoh));
+ struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+ 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
@@ -373,13 +374,14 @@
*/
struct vm_page *pg = PHYS_TO_VM_PAGE(dst);
KDASSERT(pg != NULL);
- KDASSERT(LIST_EMPTY(&pg->mdpage.mdpg_pvoh));
+ struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+ 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
Home |
Main Index |
Thread Index |
Old Index