Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/powerpc Use PMAP_MAP_POOLPAGE/PMAP_UNMAP_PO...



details:   https://anonhg.NetBSD.org/src/rev/abcf0c312e91
branches:  trunk
changeset: 766082:abcf0c312e91
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jun 15 05:48:31 2011 +0000

description:
Use PMAP_MAP_POOLPAGE/PMAP_UNMAP_POOLPAGE because it's cleaner.
Remove #ifdef _LP64 #endif leftover from mips

diffstat:

 sys/arch/powerpc/powerpc/vm_machdep.c |  13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diffs (52 lines):

diff -r 8124b6d844d0 -r abcf0c312e91 sys/arch/powerpc/powerpc/vm_machdep.c
--- a/sys/arch/powerpc/powerpc/vm_machdep.c     Wed Jun 15 05:29:32 2011 +0000
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c     Wed Jun 15 05:48:31 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.87 2011/06/14 05:49:14 matt Exp $     */
+/*     $NetBSD: vm_machdep.c,v 1.88 2011/06/15 05:48:31 matt Exp $     */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.87 2011/06/14 05:49:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.88 2011/06/15 05:48:31 matt Exp $");
 
 #include "opt_altivec.h"
 #include "opt_multiprocessor.h"
@@ -295,10 +295,8 @@
         */
        error = uvm_pglistalloc(USPACE, 0, ptoa(physmem), 0, 0, &pglist, 1, 1);
        if (error) {
-#ifdef _LP64
                if (!system)
                        return NULL;
-#endif
                panic("%s: uvm_pglistalloc failed: %d", __func__, error);
        }
 
@@ -310,11 +308,10 @@
        const paddr_t pa = VM_PAGE_TO_PHYS(pg);
 
        /*
-        * we need to return a direct-mapped VA for the pa.  But since
-        * we map vajpa 1:1 that's easy/
+        * We need to return a direct-mapped VA for the pa.
         */
 
-       return (void *)(uintptr_t) pa;
+       return (void *)(uintptr_t)PMAP_MAP_POOLPAGE(pa);
 }
 
 /*
@@ -331,7 +328,7 @@
         * Since the pages are physically contiguous, the vm_page structurs
         * will be as well.
         */
-       struct vm_page *pg = PHYS_TO_VM_PAGE((paddr_t)va);
+       struct vm_page *pg = PHYS_TO_VM_PAGE(PMAP_UNMAP_POOLPAGE(va));
        KASSERT(pg != NULL);
        for (size_t i = 0; i < UPAGES; i++, pg++) {
                uvm_pagefree(pg);



Home | Main Index | Thread Index | Old Index