Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/include/oea Add POOL_VTOPHYS. Change vtoph...



details:   https://anonhg.NetBSD.org/src/rev/5147a32ea661
branches:  trunk
changeset: 545507:5147a32ea661
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Apr 09 22:37:32 2003 +0000

description:
Add POOL_VTOPHYS.  Change vtophys to return -1 if pmap_extract fails.
(callers of vtophys should always supply a valid VA so that
pmap_extract should never fail).

diffstat:

 sys/arch/powerpc/include/oea/pmap.h |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 0ee7a0a69f16 -r 5147a32ea661 sys/arch/powerpc/include/oea/pmap.h
--- a/sys/arch/powerpc/include/oea/pmap.h       Wed Apr 09 22:35:21 2003 +0000
+++ b/sys/arch/powerpc/include/oea/pmap.h       Wed Apr 09 22:37:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.3 2003/03/15 07:19:20 matt Exp $    */
+/*     $NetBSD: pmap.h,v 1.4 2003/04/09 22:37:32 matt Exp $    */
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -50,6 +50,8 @@
 typedef        struct pmap *pmap_t;
 
 #ifdef _KERNEL
+#include <sys/systm.h>
+
 extern register_t iosrtable[];
 extern int pmap_use_altivec;
 extern struct pmap kernel_pmap_;
@@ -89,6 +91,8 @@
 #define        PMAP_NC                 0x1000
 
 #define PMAP_STEAL_MEMORY
+static __inline paddr_t vtophys (vaddr_t);
+
 #if 1
 /*
  * Alternate mapping hooks for pool pages.  Avoids thrashing the TLB.
@@ -100,19 +104,18 @@
 #define        PMAP_MAP_POOLPAGE(pa)   (pa)
 #define        PMAP_UNMAP_POOLPAGE(pa) (pa)
 #endif
+#define POOL_VTOPHYS(va)       vtophys((vaddr_t) va)
 
-static __inline paddr_t vtophys (vaddr_t);
 
 static __inline paddr_t
 vtophys(vaddr_t va)
 {
        paddr_t pa;
 
-       /* XXX should check battable */
-
        if (pmap_extract(pmap_kernel(), va, &pa))
                return pa;
-       return va;
+       KASSERT(0);
+       return (paddr_t) -1;
 }
 
 #endif /* _KERNEL */



Home | Main Index | Thread Index | Old Index