From 6bba73019a49658559801260bdbba3a449a0e388 Mon Sep 17 00:00:00 2001 From: yamt Date: Thu, 8 Dec 2005 22:41:44 +0000 Subject: [PATCH] use VM_PAGE_TO_PHYS macro. --- sys/arch/acorn26/acorn26/pmap.c | 16 ++++++++-------- sys/arch/acorn32/acorn32/hydra.c | 6 +++--- sys/arch/arm/arm32/pmap.c | 17 +++++++++-------- sys/arch/mips/alchemy/dev/if_aumac.c | 6 +++--- sys/arch/powerpc/oea/pmap.c | 14 +++++++------- sys/arch/sh5/sh5/pmap.c | 10 +++++----- sys/arch/shark/ofw/ofw.c | 6 +++--- sys/dev/tc/px.c | 6 +++--- sys/kern/kern_verifiedexec.c | 6 +++--- 9 files changed, 44 insertions(+), 43 deletions(-) diff --git a/sys/arch/acorn26/acorn26/pmap.c b/sys/arch/acorn26/acorn26/pmap.c index 009b24654127..8c03205a6e63 100644 --- a/sys/arch/acorn26/acorn26/pmap.c +++ b/sys/arch/acorn26/acorn26/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.11 2004/04/23 02:58:28 simonb Exp $ */ +/* $NetBSD: pmap.c,v 1.12 2005/12/08 22:41:44 yamt Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 Ben Harris * All rights reserved. @@ -102,7 +102,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.11 2004/04/23 02:58:28 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.12 2005/12/08 22:41:44 yamt Exp $"); #include /* for cold */ #include @@ -783,11 +783,11 @@ pmap_is_modified(page) UVMHIST_FUNC("pmap_is_modified"); UVMHIST_CALLED(pmaphist); - ppn = atop(page->phys_addr); + ppn = atop(VM_PAGE_TO_PHYS(page)); rv = (pv_table[ppn].pv_pflags & PV_MODIFIED) != 0; #ifdef PMAP_DEBUG_MODIFIED if (!rv) { - pmap_md4_page(digest, page->phys_addr); + pmap_md4_page(digest, VM_PAGE_TO_PHYS(page)); if (memcmp(digest, pv_table[ppn].pv_md4sum, 16) != 0) { int i; @@ -813,7 +813,7 @@ pmap_is_referenced(page) UVMHIST_FUNC("pmap_is_referenced"); UVMHIST_CALLED(pmaphist); - ppn = atop(page->phys_addr); + ppn = atop(VM_PAGE_TO_PHYS(page)); return (pv_table[ppn].pv_pflags & PV_REFERENCED) != 0; } @@ -845,7 +845,7 @@ pmap_clear_modify(struct vm_page *page) UVMHIST_FUNC("pmap_clear_modify"); UVMHIST_CALLED(pmaphist); - ppn = atop(page->phys_addr); + ppn = atop(VM_PAGE_TO_PHYS(page)); rv = pmap_is_modified(page); #ifdef PMAP_DEBUG_MODIFIED pmap_md4_page(pv_table[ppn].pv_md4sum, ptoa(ppn)); @@ -869,7 +869,7 @@ pmap_clear_reference(struct vm_page *page) UVMHIST_FUNC("pmap_clear_reference"); UVMHIST_CALLED(pmaphist); - ppn = atop(page->phys_addr); + ppn = atop(VM_PAGE_TO_PHYS(page)); rv = pmap_is_referenced(page); if (rv) { pv_table[ppn].pv_pflags &= ~PV_REFERENCED; @@ -946,7 +946,7 @@ pmap_page_protect(struct vm_page *page, vm_prot_t prot) UVMHIST_FUNC("pmap_page_protect"); UVMHIST_CALLED(pmaphist); - ppn = atop(page->phys_addr); + ppn = atop(VM_PAGE_TO_PHYS(page)); if (prot == VM_PROT_NONE) { UVMHIST_LOG(pmaphist, "removing ppn %d\n", ppn, 0, 0, 0); npv = pv = &pv_table[ppn]; diff --git a/sys/arch/acorn32/acorn32/hydra.c b/sys/arch/acorn32/acorn32/hydra.c index 154bb35d899a..b6fef3893b7c 100644 --- a/sys/arch/acorn32/acorn32/hydra.c +++ b/sys/arch/acorn32/acorn32/hydra.c @@ -1,4 +1,4 @@ -/* $NetBSD: hydra.c,v 1.19 2005/08/26 13:19:34 drochner Exp $ */ +/* $NetBSD: hydra.c,v 1.20 2005/12/08 22:41:44 yamt Exp $ */ /*- * Copyright (c) 2002 Ben Harris @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: hydra.c,v 1.19 2005/08/26 13:19:34 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hydra.c,v 1.20 2005/12/08 22:41:44 yamt Exp $"); #include #include @@ -174,7 +174,7 @@ hydra_attach(struct device *parent, struct device *self, void *aux) return; } KASSERT(!TAILQ_EMPTY(&bootpglist)); - sc->sc_bootpage_pa = TAILQ_FIRST(&bootpglist)->phys_addr; + sc->sc_bootpage_pa = VM_PAGE_TO_PHYS(TAILQ_FIRST(&bootpglist)); sc->sc_bootpage_va = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, UVM_KMF_VAONLY); if (sc->sc_bootpage_va == 0) { diff --git a/sys/arch/arm/arm32/pmap.c b/sys/arch/arm/arm32/pmap.c index 7988cde9e697..6918b83c357a 100644 --- a/sys/arch/arm/arm32/pmap.c +++ b/sys/arch/arm/arm32/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.154 2005/07/04 00:42:37 bsh Exp $ */ +/* $NetBSD: pmap.c,v 1.155 2005/12/08 22:41:44 yamt Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -212,7 +212,7 @@ #include #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.154 2005/07/04 00:42:37 bsh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.155 2005/12/08 22:41:44 yamt Exp $"); #ifdef PMAP_DEBUG @@ -1540,7 +1540,7 @@ pmap_clearbit(struct vm_page *pg, u_int maskbits) NPDEBUG(PDB_BITS, printf("pmap_clearbit: pg %p (0x%08lx) mask 0x%x\n", - pg, pg->phys_addr, maskbits)); + pg, VM_PAGE_TO_PHYS(pg), maskbits)); PMAP_HEAD_TO_MAP_LOCK(); simple_lock(&pg->mdpage.pvh_slock); @@ -1804,7 +1804,8 @@ pmap_page_remove(struct vm_page *pg) u_int flags; NPDEBUG(PDB_FOLLOW, - printf("pmap_page_remove: pg %p (0x%08lx)\n", pg, pg->phys_addr)); + printf("pmap_page_remove: pg %p (0x%08lx)\n", pg, + VM_PAGE_TO_PHYS(pg))); PMAP_HEAD_TO_MAP_LOCK(); simple_lock(&pg->mdpage.pvh_slock); @@ -2672,7 +2673,7 @@ pmap_page_protect(struct vm_page *pg, vm_prot_t prot) NPDEBUG(PDB_PROTECT, printf("pmap_page_protect: pg %p (0x%08lx), prot 0x%x\n", - pg, pg->phys_addr, prot)); + pg, VM_PAGE_TO_PHYS(pg), prot)); switch(prot) { case VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE: @@ -2827,7 +2828,7 @@ pmap_fault_fixup(pmap_t pm, vaddr_t va, vm_prot_t ftype, int user) NPDEBUG(PDB_FOLLOW, printf("pmap_fault_fixup: mod emul. pm %p, va 0x%08lx, pa 0x%08lx\n", - pm, va, pg->phys_addr)); + pm, va, VM_PAGE_TO_PHYS(pg))); pg->mdpage.pvh_attrs |= PVF_REF | PVF_MOD; pv->pv_flags |= PVF_REF | PVF_MOD; @@ -2871,7 +2872,7 @@ pmap_fault_fixup(pmap_t pm, vaddr_t va, vm_prot_t ftype, int user) NPDEBUG(PDB_FOLLOW, printf("pmap_fault_fixup: ref emul. pm %p, va 0x%08lx, pa 0x%08lx\n", - pm, va, pg->phys_addr)); + pm, va, VM_PAGE_TO_PHYS(pg))); *ptep = (pte & ~L2_TYPE_MASK) | L2_S_PROTO; PTE_SYNC(ptep); @@ -5104,7 +5105,7 @@ pmap_dump_ncpg(pmap_t pm) continue; printf(" pa 0x%08lx: krw %d kro %d urw %d uro %d\n", - pg->phys_addr, + VM_PAGE_TO_PHYS(pg), pg->mdpage.krw_mappings, pg->mdpage.kro_mappings, pg->mdpage.urw_mappings, pg->mdpage.uro_mappings); diff --git a/sys/arch/mips/alchemy/dev/if_aumac.c b/sys/arch/mips/alchemy/dev/if_aumac.c index b88c5f3a3329..d0f398a41be6 100644 --- a/sys/arch/mips/alchemy/dev/if_aumac.c +++ b/sys/arch/mips/alchemy/dev/if_aumac.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_aumac.c,v 1.12 2004/10/30 18:08:34 thorpej Exp $ */ +/* $NetBSD: if_aumac.c,v 1.13 2005/12/08 22:41:44 yamt Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.12 2004/10/30 18:08:34 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.13 2005/12/08 22:41:44 yamt Exp $"); #include "bpfilter.h" @@ -284,7 +284,7 @@ aumac_attach(struct device *parent, struct device *self, void *aux) &pglist, 1, 0)) return; - bufaddr = TAILQ_FIRST(&pglist)->phys_addr; + bufaddr = VM_PAGE_TO_PHYS(TAILQ_FIRST(&pglist)); vbufaddr = (void *)MIPS_PHYS_TO_KSEG0(bufaddr); for (i = 0; i < AUMAC_NTXDESC; i++) { diff --git a/sys/arch/powerpc/oea/pmap.c b/sys/arch/powerpc/oea/pmap.c index 5e8b2df1e26d..c41170f6f48a 100644 --- a/sys/arch/powerpc/oea/pmap.c +++ b/sys/arch/powerpc/oea/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.33 2005/09/27 08:03:11 chs Exp $ */ +/* $NetBSD: pmap.c,v 1.34 2005/12/08 22:41:44 yamt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.33 2005/09/27 08:03:11 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.34 2005/12/08 22:41:44 yamt Exp $"); #include "opt_ppcarch.h" #include "opt_altivec.h" @@ -1942,7 +1942,7 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_t pa, vm_prot_t prot, int flags) printf(" marked-as-exec"); else if (pmapdebug & PMAPDEBUG_EXEC) printf("[pmap_enter: %#lx: marked-as-exec]\n", - pg->phys_addr); + VM_PAGE_TO_PHYS(pg)); #endif } @@ -2208,7 +2208,7 @@ pmap_page_protect(struct vm_page *pg, vm_prot_t prot) */ if ((prot & VM_PROT_READ) == 0) { DPRINTFN(EXEC, ("[pmap_page_protect: %#lx: clear-exec]\n", - pg->phys_addr)); + VM_PAGE_TO_PHYS(pg))); if (pmap_attr_fetch(pg) & PTE_EXEC) { PMAPCOUNT(exec_uncached_page_protect); pmap_attr_clear(pg, PTE_EXEC); @@ -2418,13 +2418,13 @@ pmap_clear_bit(struct vm_page *pg, int ptebit) if ((ptebit & PTE_CHG) && (rv & PTE_EXEC)) { if (LIST_EMPTY(pvoh)) { DPRINTFN(EXEC, ("[pmap_clear_bit: %#lx: clear-exec]\n", - pg->phys_addr)); + VM_PAGE_TO_PHYS(pg))); pmap_attr_clear(pg, PTE_EXEC); PMAPCOUNT(exec_uncached_clear_modify); } else { DPRINTFN(EXEC, ("[pmap_clear_bit: %#lx: syncicache]\n", - pg->phys_addr)); - pmap_syncicache(pg->phys_addr, PAGE_SIZE); + VM_PAGE_TO_PHYS(pg))); + pmap_syncicache(VM_PAGE_TO_PHYS(pg), PAGE_SIZE); PMAPCOUNT(exec_synced_clear_modify); } } diff --git a/sys/arch/sh5/sh5/pmap.c b/sys/arch/sh5/sh5/pmap.c index 92e6f2333ba2..01469c543bb2 100644 --- a/sys/arch/sh5/sh5/pmap.c +++ b/sys/arch/sh5/sh5/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.40 2005/11/24 13:08:34 yamt Exp $ */ +/* $NetBSD: pmap.c,v 1.41 2005/12/08 22:41:44 yamt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -103,7 +103,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.40 2005/11/24 13:08:34 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.41 2005/12/08 22:41:44 yamt Exp $"); #include "opt_ddb.h" #include "opt_kernel_ipt.h" @@ -2514,7 +2514,7 @@ pmap_page_protect(struct vm_page *pg, vm_prot_t prot) int idx, s; PMPRINTF(("pmap_page_protect: pa 0x%lx prot %x: ", - pg->phys_addr, prot)); + VM_PAGE_TO_PHYS(pg), prot)); /* * Since this routine only downgrades protection, if the @@ -2636,7 +2636,7 @@ pmap_query_bit(struct vm_page *pg, ptel_t ptebit) volatile pte_t *pt; int s, idx; - PMPRINTF(("pmap_query_bit: pa 0x%lx %s? - ", pg->phys_addr, + PMPRINTF(("pmap_query_bit: pa 0x%lx %s? - ", VM_PAGE_TO_PHYS(pg), (ptebit == SH5_PTEL_M) ? "modified" : "referenced")); if ((ptel_t)pmap_attr_fetch(pg) & ptebit) { @@ -2719,7 +2719,7 @@ pmap_clear_bit(struct vm_page *pg, ptel_t ptebit) int rv = 0; int s, idx; - PMPRINTF(("pmap_clear_bit: pa 0x%lx %s - ", pg->phys_addr, + PMPRINTF(("pmap_clear_bit: pa 0x%lx %s - ", VM_PAGE_TO_PHYS(pg), (ptebit == SH5_PTEL_M) ? "modified" : "referenced")); s = splvm(); diff --git a/sys/arch/shark/ofw/ofw.c b/sys/arch/shark/ofw/ofw.c index 278a2f4a23cc..de6f0bc9c739 100644 --- a/sys/arch/shark/ofw/ofw.c +++ b/sys/arch/shark/ofw/ofw.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofw.c,v 1.34 2005/01/05 10:25:43 tsutsui Exp $ */ +/* $NetBSD: ofw.c,v 1.35 2005/12/08 22:41:44 yamt Exp $ */ /* * Copyright 1997 @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.34 2005/01/05 10:25:43 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.35 2005/12/08 22:41:44 yamt Exp $"); #include #include @@ -1213,7 +1213,7 @@ ofw_callbackhandler(v) args->nreturns = 2; return; } - args_n_results[nargs + 2] = alloclist.tqh_first->phys_addr; + args_n_results[nargs + 2] = VM_PAGE_TO_PHYS(alloclist.tqh_first); #if 0 printf("(succeeded: pa = 0x%lx)\n", args_n_results[nargs + 2]); #endif diff --git a/sys/dev/tc/px.c b/sys/dev/tc/px.c index 06dc630ef1ee..9cf5f3b05933 100644 --- a/sys/dev/tc/px.c +++ b/sys/dev/tc/px.c @@ -1,4 +1,4 @@ -/* $NetBSD: px.c,v 1.24 2005/06/08 22:33:56 he Exp $ */ +/* $NetBSD: px.c,v 1.25 2005/12/08 22:41:45 yamt Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.24 2005/06/08 22:33:56 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: px.c,v 1.25 2005/12/08 22:41:45 yamt Exp $"); #include #include @@ -210,7 +210,7 @@ px_init(struct stic_info *si, int bootstrap) if (uvm_pglistalloc(PX_BUF_SIZE, 0, 8192*1024, PX_BUF_ALIGN, 0, &pglist, 1, 0) != 0) panic("px_init: allocation failure"); - bpa = TAILQ_FIRST(&pglist)->phys_addr; + bpa = VM_PAGE_TO_PHYS(TAILQ_FIRST(&pglist)); } si->si_vdac = (u_int32_t *)(kva + PX_VDAC_OFFSET); diff --git a/sys/kern/kern_verifiedexec.c b/sys/kern/kern_verifiedexec.c index 64d90875f9be..fc5ebf02aae8 100644 --- a/sys/kern/kern_verifiedexec.c +++ b/sys/kern/kern_verifiedexec.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_verifiedexec.c,v 1.46 2005/11/25 12:02:09 elad Exp $ */ +/* $NetBSD: kern_verifiedexec.c,v 1.47 2005/12/08 22:41:45 yamt Exp $ */ /*- * Copyright 2005 Elad Efrat @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.46 2005/11/25 12:02:09 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.47 2005/12/08 22:41:45 yamt Exp $"); #include "opt_verified_exec.h" @@ -541,7 +541,7 @@ veriexec_page_verify(struct veriexec_hash_entry *vhe, struct vattr *va, if (error) goto bad; - pmap_kenter_pa(kva, pg->phys_addr, VM_PROT_READ); + pmap_kenter_pa(kva, VM_PAGE_TO_PHYS(pg), VM_PROT_READ); page_fp = (u_char *) vhe->page_fp + (vhe->ops->hash_len * idx);