Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/ibm4xx Introduce PV_VA() macro to extract v...



details:   https://anonhg.NetBSD.org/src/rev/38c0dae60945
branches:  trunk
changeset: 938514:38c0dae60945
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Sep 10 03:02:36 2020 +0000

description:
Introduce PV_VA() macro to extract va from pv->pv_va by clearing
PV_WIRED flag, and use it where appropriate.

There should be no functional changes. Only for safety in future.

diffstat:

 sys/arch/powerpc/ibm4xx/pmap.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 30c59dfbe655 -r 38c0dae60945 sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c    Thu Sep 10 02:45:28 2020 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c    Thu Sep 10 03:02:36 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.90 2020/07/06 10:40:21 rin Exp $    */
+/*     $NetBSD: pmap.c,v 1.91 2020/09/10 03:02:36 rin Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.90 2020/07/06 10:40:21 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.91 2020/09/10 03:02:36 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -156,7 +156,8 @@
 #define PV_WIRE(pv)    ((pv)->pv_va |= PV_WIRED)
 #define PV_UNWIRE(pv)  ((pv)->pv_va &= ~PV_WIRED)
 #define PV_ISWIRED(pv) ((pv)->pv_va & PV_WIRED)
-#define PV_CMPVA(va,pv)        (!(((pv)->pv_va ^ (va)) & (~PV_WIRED)))
+#define PV_VA(pv)      ((pv)->pv_va & ~PV_WIRED)
+#define PV_CMPVA(va,pv)        (!(PV_VA(pv) ^ (va)))
 
 struct pv_entry {
        struct pv_entry *pv_next;       /* Linked list of mappings */
@@ -1115,14 +1116,14 @@
                npv = pv->pv_next;
 
                pm = pv->pv_pm;
-               va = pv->pv_va;
+               va = PV_VA(pv);
                pmap_protect(pm, va, va + PAGE_SIZE, prot);
        }
        /* Now check the head pv */
        if (pvh->pv_pm) {
                pv = pvh;
                pm = pv->pv_pm;
-               va = pv->pv_va;
+               va = PV_VA(pv);
                pmap_protect(pm, va, va + PAGE_SIZE, prot);
        }
 }



Home | Main Index | Thread Index | Old Index