Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/mips Let mips_pmap_{, un}map_poolpage do the tr...



details:   https://anonhg.NetBSD.org/src/rev/e3ba41d24015
branches:  trunk
changeset: 773059:e3ba41d24015
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jan 26 02:14:08 2012 +0000

description:
Let mips_pmap_{,un}map_poolpage do the translation work.

diffstat:

 sys/arch/mips/mips/pmap_segtab.c |  16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diffs (54 lines):

diff -r 7923ac2c7665 -r e3ba41d24015 sys/arch/mips/mips/pmap_segtab.c
--- a/sys/arch/mips/mips/pmap_segtab.c  Wed Jan 25 22:22:20 2012 +0000
+++ b/sys/arch/mips/mips/pmap_segtab.c  Thu Jan 26 02:14:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_segtab.c,v 1.3 2011/04/29 22:10:22 matt Exp $     */
+/*     $NetBSD: pmap_segtab.c,v 1.4 2012/01/26 02:14:08 matt Exp $     */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.3 2011/04/29 22:10:22 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.4 2012/01/26 02:14:08 matt Exp $");
 
 /*
  *     Manages physical address maps.
@@ -235,10 +235,8 @@
 #endif /* MIPS3_PLUS */
 #ifdef _LP64
                KASSERT(MIPS_XKPHYS_P(pte));
-               pa = MIPS_XKPHYS_TO_PHYS(pte);
-#else
-               pa = MIPS_KSEG0_TO_PHYS(pte);
 #endif
+               pa = mips_pmap_unmap_poolpage((vaddr_t)pte);
                uvm_pagefree(PHYS_TO_VM_PAGE(pa));
 
                stp->seg_tab[i] = NULL;
@@ -292,10 +290,8 @@
 
 #ifdef _LP64
                KASSERT(mips_options.mips3_xkphys_cached);
-               stp = (union segtab *)MIPS_PHYS_TO_XKPHYS_CACHED(stp_pa);
-#else
-               stp = (union segtab *)MIPS_PHYS_TO_KSEG0(stp_pa);
 #endif
+               stp = (union segtab *)mips_pmap_map_poolpage(stp_pa);
                const size_t n = NBPG / sizeof(union segtab);
                if (n > 1) {
                        /*
@@ -457,10 +453,8 @@
                const paddr_t pa = VM_PAGE_TO_PHYS(pg);
 #ifdef _LP64
                KASSERT(mips_options.mips3_xkphys_cached);
-               pte = (pt_entry_t *)MIPS_PHYS_TO_XKPHYS_CACHED(pa);
-#else
-               pte = (pt_entry_t *)MIPS_PHYS_TO_KSEG0(pa);
 #endif
+               pte = (pt_entry_t *)mips_pmap_map_poolpage(pa);
                pt_entry_t ** const pte_p =
                    &stp->seg_tab[(va >> SEGSHIFT) & (PMAP_SEGTABSIZE - 1)];
 #ifdef MULTIPROCESSOR



Home | Main Index | Thread Index | Old Index