Source-Changes-HG archive

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

[src/trunk]: src/sys/arch rename



details:   https://anonhg.NetBSD.org/src/rev/42f565a34fe8
branches:  trunk
changeset: 487556:42f565a34fe8
user:      soda <soda%NetBSD.org@localhost>
date:      Fri Jun 09 05:51:42 2000 +0000

description:
rename
        vad_to_pfn() -> mips_paddr_to_tlbpfn()
        pfn_to_vad() -> mips_tlbpfn_to_paddr()
as suggested by thorpej on port-mips Mar 27.

diffstat:

 sys/arch/arc/arc/minidebug.c      |   6 +++---
 sys/arch/arc/arc/wired_map.c      |   6 +++---
 sys/arch/mips/include/mips1_pte.h |   6 +++---
 sys/arch/mips/include/mips3_pte.h |  10 ++++++----
 sys/arch/mips/include/pte.h       |  26 +++++++++++++-------------
 sys/arch/mips/mips/pmap.c         |  31 ++++++++++++++++---------------
 sys/arch/mips/mips/trap.c         |   8 ++++----
 sys/arch/mips/mips/vm_machdep.c   |   6 +++---
 8 files changed, 51 insertions(+), 48 deletions(-)

diffs (truncated from 344 to 300 lines):

diff -r ebd7bb8e8f6f -r 42f565a34fe8 sys/arch/arc/arc/minidebug.c
--- a/sys/arch/arc/arc/minidebug.c      Fri Jun 09 05:41:56 2000 +0000
+++ b/sys/arch/arc/arc/minidebug.c      Fri Jun 09 05:51:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: minidebug.c,v 1.8 2000/02/22 11:25:57 soda Exp $       */
+/*     $NetBSD: minidebug.c,v 1.9 2000/06/09 05:51:51 soda Exp $       */
 /*     $OpenBSD: minidebug.c,v 1.2 1998/03/16 09:03:36 pefo Exp $      */
 
 /*-
@@ -968,11 +968,11 @@
                else {
                        printf("TLB*%2d vad 0x%08x ", tlbno, tlb.tlb_hi);
                }
-               printf("0=0x%08x ", pfn_to_vad(tlb.tlb_lo0));
+               printf("0=0x%08x ", mips_tlbpfn_to_paddr(tlb.tlb_lo0));
                printf("%c", tlb.tlb_lo0 & MIPS3_PG_M ? 'M' : ' ');
                printf("%c", tlb.tlb_lo0 & MIPS3_PG_G ? 'G' : ' ');
                printf(" atr %x ", (tlb.tlb_lo0 >> 3) & 7);
-               printf("1=0x%08x ", pfn_to_vad(tlb.tlb_lo1));
+               printf("1=0x%08x ", mips_tlbpfn_to_paddr(tlb.tlb_lo1));
                printf("%c", tlb.tlb_lo1 & MIPS3_PG_M ? 'M' : ' ');
                printf("%c", tlb.tlb_lo1 & MIPS3_PG_G ? 'G' : ' ');
                printf(" atr %x ", (tlb.tlb_lo1 >> 3) & 7);
diff -r ebd7bb8e8f6f -r 42f565a34fe8 sys/arch/arc/arc/wired_map.c
--- a/sys/arch/arc/arc/wired_map.c      Fri Jun 09 05:41:56 2000 +0000
+++ b/sys/arch/arc/arc/wired_map.c      Fri Jun 09 05:51:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wired_map.c,v 1.1 2000/06/09 05:17:26 soda Exp $       */
+/*     $NetBSD: wired_map.c,v 1.2 2000/06/09 05:51:52 soda Exp $       */
 
 /*-
  * Copyright (C) 2000 Shuichiro URATA.  All rights reserved.
@@ -90,11 +90,11 @@
        if (pa0 == 0)
                tlb.tlb_lo0 = MIPS3_PG_G;
        else
-               tlb.tlb_lo0 = mips3_vad_to_pfn(pa0) | MIPS3_PG_IOPAGE;
+               tlb.tlb_lo0 = mips3_paddr_to_tlbpfn(pa0) | MIPS3_PG_IOPAGE;
        if (pa1 == 0)
                tlb.tlb_lo1 = MIPS3_PG_G;
        else
-               tlb.tlb_lo1 = mips3_vad_to_pfn(pa1) | MIPS3_PG_IOPAGE;
+               tlb.tlb_lo1 = mips3_paddr_to_tlbpfn(pa1) | MIPS3_PG_IOPAGE;
        mips3_TLBWriteIndexedVPS(MIPS3_LOCORE_TLB_WIRED_ENTRIES + nwired,
            &tlb);
 
diff -r ebd7bb8e8f6f -r 42f565a34fe8 sys/arch/mips/include/mips1_pte.h
--- a/sys/arch/mips/include/mips1_pte.h Fri Jun 09 05:41:56 2000 +0000
+++ b/sys/arch/mips/include/mips1_pte.h Fri Jun 09 05:51:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mips1_pte.h,v 1.12 2000/06/09 04:37:51 soda Exp $      */
+/*     $NetBSD: mips1_pte.h,v 1.13 2000/06/09 05:51:42 soda Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -91,8 +91,8 @@
 #define        MIPS1_PG_CWPAGE 0
 #define        MIPS1_PG_IOPAGE (MIPS1_PG_D | MIPS1_PG_N)
 
-#define        mips1_pfn_to_vad(x)     ((x) & MIPS1_PG_FRAME)
-#define        mips1_vad_to_pfn(x)     (x)
+#define        mips1_tlbpfn_to_paddr(x)        ((x) & MIPS1_PG_FRAME)
+#define        mips1_paddr_to_tlbpfn(x)        (x)
 
 #define        MIPS1_PTE_TO_PADDR(pte) ((unsigned)(pte) & MIPS1_PG_FRAME)
 #define MIPS1_PAGE_IS_RDONLY(pte,va) ((int)(pte) & MIPS1_PG_RO)
diff -r ebd7bb8e8f6f -r 42f565a34fe8 sys/arch/mips/include/mips3_pte.h
--- a/sys/arch/mips/include/mips3_pte.h Fri Jun 09 05:41:56 2000 +0000
+++ b/sys/arch/mips/include/mips3_pte.h Fri Jun 09 05:51:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mips3_pte.h,v 1.12 2000/06/09 04:37:51 soda Exp $      */
+/*     $NetBSD: mips3_pte.h,v 1.13 2000/06/09 05:51:43 soda Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -117,12 +117,14 @@
 /* pte accessor macros */
 
 #define mips3_pfn_is_ext(x) ((x) & 0x3c000000)
-#define mips3_vad_to_pfn(x) (((paddr_t)(x) >> MIPS3_PG_SHIFT) & MIPS3_PG_FRAME)
-#define mips3_pfn_to_vad(x) ((paddr_t)((x) & MIPS3_PG_FRAME) << MIPS3_PG_SHIFT)
+#define mips3_paddr_to_tlbpfn(x) \
+    (((paddr_t)(x) >> MIPS3_PG_SHIFT) & MIPS3_PG_FRAME)
+#define mips3_tlbpfn_to_paddr(x) \
+    ((paddr_t)((x) & MIPS3_PG_FRAME) << MIPS3_PG_SHIFT)
 #define mips3_vad_to_vpn(x) ((vaddr_t)(x) & MIPS3_PG_SVPN)
 #define mips3_vpn_to_vad(x) ((x) & MIPS3_PG_SVPN)
 
-#define MIPS3_PTE_TO_PADDR(pte) (mips3_pfn_to_vad(pte))
+#define MIPS3_PTE_TO_PADDR(pte) (mips3_tlbpfn_to_paddr(pte))
 #define MIPS3_PAGE_IS_RDONLY(pte,va) \
     (pmap_is_page_ro(pmap_kernel(), mips_trunc_page(va), (pte)))
 
diff -r ebd7bb8e8f6f -r 42f565a34fe8 sys/arch/mips/include/pte.h
--- a/sys/arch/mips/include/pte.h       Fri Jun 09 05:41:56 2000 +0000
+++ b/sys/arch/mips/include/pte.h       Fri Jun 09 05:51:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pte.h,v 1.9 2000/06/09 04:37:51 soda Exp $     */
+/*     $NetBSD: pte.h,v 1.10 2000/06/09 05:51:43 soda Exp $    */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -100,8 +100,8 @@
 #define        PTE_TO_PADDR(pte)       MIPS1_PTE_TO_PADDR((pte))
 #define        PAGE_IS_RDONLY(pte, va) MIPS1_PAGE_IS_RDONLY((pte), (va))
 
-#define        pfn_to_vad(x)           mips1_pfn_to_vad((vaddr_t)(x))
-#define        vad_to_pfn(x)           mips1_vad_to_pfn((x))
+#define        mips_tlbpfn_to_paddr(x)         mips1_tlbpfn_to_paddr((vaddr_t)(x))
+#define        mips_paddr_to_tlbpfn(x)         mips1_paddr_to_tlbpfn((x))
 #endif /* mips1 */
 
 
@@ -122,8 +122,8 @@
 #define        PTE_TO_PADDR(pte)       MIPS3_PTE_TO_PADDR((pte))
 #define        PAGE_IS_RDONLY(pte, va) MIPS3_PAGE_IS_RDONLY((pte), (va))
 
-#define        pfn_to_vad(x)           mips3_pfn_to_vad((vaddr_t)(x))
-#define        vad_to_pfn(x)           mips3_vad_to_pfn((x))
+#define        mips_tlbpfn_to_paddr(x)         mips3_tlbpfn_to_paddr((vaddr_t)(x))
+#define        mips_paddr_to_tlbpfn(x)         mips3_paddr_to_tlbpfn((x))
 #endif /* mips3 */
 
 /* MIPS1 and MIPS3 */
@@ -143,8 +143,8 @@
     mips_pg_global_bit(void);
 static __inline paddr_t PTE_TO_PADDR(unsigned int pte);
 
-static __inline paddr_t pfn_to_vad(unsigned int pfn);
-static __inline unsigned int vad_to_pfn(paddr_t pa);
+static __inline paddr_t mips_tlbpfn_to_paddr(unsigned int pfn);
+static __inline unsigned int mips_paddr_to_tlbpfn(paddr_t pa);
 
 
 static __inline int
@@ -250,21 +250,21 @@
 }
 
 static __inline paddr_t
-pfn_to_vad(pfn)
+mips_tlbpfn_to_paddr(pfn)
        unsigned int pfn;
 {
        if (CPUISMIPS3)
-               return (mips3_pfn_to_vad(pfn));
-       return (mips1_pfn_to_vad(pfn));
+               return (mips3_tlbpfn_to_paddr(pfn));
+       return (mips1_tlbpfn_to_paddr(pfn));
 }
 
 static __inline unsigned int
-vad_to_pfn(pa)
+mips_paddr_to_tlbpfn(pa)
        paddr_t pa;
 {
        if (CPUISMIPS3)
-               return (mips3_vad_to_pfn(pa));
-       return (mips1_vad_to_pfn(pa));
+               return (mips3_paddr_to_tlbpfn(pa));
+       return (mips1_paddr_to_tlbpfn(pa));
 }
 #endif
 
diff -r ebd7bb8e8f6f -r 42f565a34fe8 sys/arch/mips/mips/pmap.c
--- a/sys/arch/mips/mips/pmap.c Fri Jun 09 05:41:56 2000 +0000
+++ b/sys/arch/mips/mips/pmap.c Fri Jun 09 05:51:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.98 2000/06/09 04:37:52 soda Exp $   */
+/*     $NetBSD: pmap.c,v 1.99 2000/06/09 05:51:46 soda Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.98 2000/06/09 04:37:52 soda Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.99 2000/06/09 05:51:46 soda Exp $");
 
 /*
  *     Manages physical address maps.
@@ -715,7 +715,7 @@
                        if (mips_pg_wired(entry))
                                pmap->pm_stats.wired_count--;
                        pmap->pm_stats.resident_count--;
-                       pmap_remove_pv(pmap, sva, pfn_to_vad(entry));
+                       pmap_remove_pv(pmap, sva, mips_tlbpfn_to_paddr(entry));
                        if (CPUISMIPS3)
                                /* See above about G bit */
                                pte->pt_entry = MIPS3_PG_NV | MIPS3_PG_G;
@@ -773,7 +773,7 @@
                        if (mips_pg_wired(entry))
                                pmap->pm_stats.wired_count--;
                        pmap->pm_stats.resident_count--;
-                       pmap_remove_pv(pmap, sva, pfn_to_vad(entry));
+                       pmap_remove_pv(pmap, sva, mips_tlbpfn_to_paddr(entry));
                        pte->pt_entry = mips_pg_nv_bit();
                        /*
                         * Flush the TLB for the given address.
@@ -999,9 +999,10 @@
                if (!mips_pg_v(entry))
                        return;
 #if 0
-printf(" flush %llx", (long long)pfn_to_vad(entry) + (va & PGOFSET));
+printf(" flush %llx", (long long)mips_tlbpfn_to_paddr(entry) + (va & PGOFSET));
 #endif
-               mips1_FlushICache(MIPS_PHYS_TO_KSEG0(mips1_pfn_to_vad(entry)
+               mips1_FlushICache(
+                   MIPS_PHYS_TO_KSEG0(mips1_tlbpfn_to_paddr(entry)
                    + (va & PGOFSET)),
                    len);
 #if 0
@@ -1223,9 +1224,9 @@
                pte = kvtopte(va);
 
                if (CPUISMIPS3)
-                       npte |= vad_to_pfn(pa) | MIPS3_PG_G;
+                       npte |= mips_paddr_to_tlbpfn(pa) | MIPS3_PG_G;
                else
-                       npte |= vad_to_pfn(pa) | MIPS1_PG_V | MIPS1_PG_G;
+                       npte |= mips_paddr_to_tlbpfn(pa) | MIPS1_PG_V | MIPS1_PG_G;
 
                if (wired) {
                        pmap->pm_stats.wired_count++;
@@ -1235,7 +1236,7 @@
                if (mips_pg_wired(pte->pt_entry))
                        panic("pmap_enter: kernel wired");
 #endif
-               if (pfn_to_vad(pte->pt_entry) != pa) {
+               if (mips_tlbpfn_to_paddr(pte->pt_entry) != pa) {
                        pmap_remove(pmap, va, va + NBPG);
 #ifdef DEBUG
                        enter_stats.mchange++;
@@ -1284,9 +1285,9 @@
         * MIPS pages in a MACH page.
         */
        if (CPUISMIPS3)
-               npte |= vad_to_pfn(pa);
+               npte |= mips_paddr_to_tlbpfn(pa);
        else
-               npte |= vad_to_pfn(pa) | MIPS1_PG_V;
+               npte |= mips_paddr_to_tlbpfn(pa) | MIPS1_PG_V;
 
        if (wired) {
                pmap->pm_stats.wired_count++;
@@ -1315,7 +1316,7 @@
 #endif
 
        asid = pmap->pm_asid << MIPS_TLB_PID_SHIFT;
-       if (pfn_to_vad(pte->pt_entry) != pa) {
+       if (mips_tlbpfn_to_paddr(pte->pt_entry) != pa) {
                pmap_remove(pmap, va, va + NBPG);
 #ifdef DEBUG
                enter_stats.mchange++;
@@ -1459,7 +1460,7 @@
                if (va < VM_MIN_KERNEL_ADDRESS || va >= virtual_end)
                        panic("pmap_extract");
 #endif
-               pa = pfn_to_vad(kvtopte(va)->pt_entry);
+               pa = mips_tlbpfn_to_paddr(kvtopte(va)->pt_entry);
        } else {
                pt_entry_t *pte;
 
@@ -1467,7 +1468,7 @@
                        return (FALSE);
                else {
                        pte += (va >> PGSHIFT) & (NPTEPG - 1);
-                       pa = pfn_to_vad(pte->pt_entry);
+                       pa = mips_tlbpfn_to_paddr(pte->pt_entry);
                }
        }
        pa |= va & PGOFSET;
@@ -2005,7 +2006,7 @@
                                                entry = 0;
                                }
                                if (!mips_pg_v(entry) ||
-                                   pfn_to_vad(entry) != pa)
+                                   mips_tlbpfn_to_paddr(entry) != pa)
                                        printf(
                "pmap_enter: found va %lx pa %lx in pv_table but != %x\n",
                                                va, pa, entry);
diff -r ebd7bb8e8f6f -r 42f565a34fe8 sys/arch/mips/mips/trap.c
--- a/sys/arch/mips/mips/trap.c Fri Jun 09 05:41:56 2000 +0000
+++ b/sys/arch/mips/mips/trap.c Fri Jun 09 05:51:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.139 2000/06/09 04:37:52 soda Exp $  */
+/*     $NetBSD: trap.c,v 1.140 2000/06/09 05:51:47 soda Exp $  */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.139 2000/06/09 04:37:52 soda Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.140 2000/06/09 05:51:47 soda Exp $");
 
 #include "opt_cputype.h"       /* which mips CPU levels do we support? */
 #include "opt_inet.h"
@@ -446,7 +446,7 @@



Home | Main Index | Thread Index | Old Index