Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc Rename/enumerate the PTE protection bits to...



details:   https://anonhg.NetBSD.org/src/rev/817ce937b6a3
branches:  trunk
changeset: 511554:817ce937b6a3
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jun 21 18:03:37 2001 +0000

description:
Rename/enumerate the PTE protection bits to their real purposes.

diffstat:

 sys/arch/powerpc/include/mpc6xx/pte.h |   8 +++++---
 sys/arch/powerpc/mpc6xx/pmap.c        |  29 ++++++++++++-----------------
 2 files changed, 17 insertions(+), 20 deletions(-)

diffs (102 lines):

diff -r 151a5817bdd6 -r 817ce937b6a3 sys/arch/powerpc/include/mpc6xx/pte.h
--- a/sys/arch/powerpc/include/mpc6xx/pte.h     Thu Jun 21 16:55:20 2001 +0000
+++ b/sys/arch/powerpc/include/mpc6xx/pte.h     Thu Jun 21 18:03:37 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pte.h,v 1.3 2001/06/19 07:14:24 simonb Exp $   */
+/*     $NetBSD: pte.h,v 1.4 2001/06/21 18:03:37 matt Exp $     */
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -61,8 +61,10 @@
 #define        PTE_M           0x00000010
 #define        PTE_G           0x00000008
 #define        PTE_PP          0x00000003
-#define        PTE_RO          0x00000003
-#define        PTE_RW          0x00000002
+#define        PTE_SO          0x00000000      /* Super. Only       (U: XX, S: RW) */
+#define        PTE_SW          0x00000001      /* Super. Write-Only (U: RO, S: RW) */
+#define        PTE_BW          0x00000002      /* Supervisor        (U: RW, S: RW) */
+#define        PTE_BR          0x00000003      /* Both Read Only    (U: RO, S: RO) */
 
 #ifndef        _LOCORE
 typedef        struct pte pte_t;
diff -r 151a5817bdd6 -r 817ce937b6a3 sys/arch/powerpc/mpc6xx/pmap.c
--- a/sys/arch/powerpc/mpc6xx/pmap.c    Thu Jun 21 16:55:20 2001 +0000
+++ b/sys/arch/powerpc/mpc6xx/pmap.c    Thu Jun 21 18:03:37 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.13 2001/06/21 03:26:12 matt Exp $   */
+/*     $NetBSD: pmap.c,v 1.14 2001/06/21 18:03:37 matt Exp $   */
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -1495,9 +1495,9 @@
        }
 
        if (prot & VM_PROT_WRITE)
-               pte_lo |= PTE_RW;
+               pte_lo |= PTE_BW;
        else
-               pte_lo |= PTE_RO;
+               pte_lo |= PTE_BR;
 
        /*
         * Record mapping for later back-translation and pte spilling.
@@ -1543,9 +1543,9 @@
        }
 
        if (prot & VM_PROT_WRITE)
-               pte_lo |= PTE_RW;
+               pte_lo |= PTE_BW;
        else
-               pte_lo |= PTE_RO;
+               pte_lo |= PTE_BR;
 
        s = splvm();
        error = pmap_pvo_enter(pmap_kernel(), &pmap_upvo_pool, &pmap_pvo_kunmanaged,
@@ -1668,7 +1668,7 @@
                 * If the page is already read-only, no change
                 * needs to be made.
                 */
-               if ((pvo->pvo_pte.pte_lo & PTE_PP) == PTE_RO)
+               if ((pvo->pvo_pte.pte_lo & PTE_PP) == PTE_BR)
                        continue;
 #endif
                /*
@@ -1680,7 +1680,7 @@
                 * Change the protection of the page.
                 */
                pvo->pvo_pte.pte_lo &= ~PTE_PP;
-               pvo->pvo_pte.pte_lo |= PTE_RO;
+               pvo->pvo_pte.pte_lo |= PTE_BR;
 
                /*
                 * If the PVO is in the page table, update
@@ -1756,7 +1756,7 @@
                 */
                pt = pmap_pvo_to_pte(pvo, -1);
                pvo->pvo_pte.pte_lo &= ~PTE_PP;
-               pvo->pvo_pte.pte_lo |= PTE_RO;
+               pvo->pvo_pte.pte_lo |= PTE_BR;
                if (pt != NULL)
                        pmap_pte_change(pt, &pvo->pvo_pte, pvo->pvo_vaddr);
                PMAP_PVO_CHECK(pvo);            /* sanity check */
@@ -2023,15 +2023,10 @@
        printf("%c", (pt->pte_lo & PTE_M) ? 'm' : '.');
        printf("%c ", (pt->pte_lo & PTE_G) ? 'g' : '.');
        switch (pt->pte_lo & PTE_PP) {
-       case PTE_RO:
-               printf("ro]\n");
-               break;
-       case PTE_RW:
-               printf("rw]\n");
-               break;
-       default:
-               printf("na]\n");
-               break;
+       case PTE_BR: printf("br]\n"); break;
+       case PTE_BW: printf("bw]\n"); break;
+       case PTE_SO: printf("so]\n"); break;
+       case PTE_SW: printf("sw]\n"); break;
        }
 }
 



Home | Main Index | Thread Index | Old Index