Module Name: src
Committed By: rin
Date: Thu Sep 10 03:02:36 UTC 2020
Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/powerpc/ibm4xx/pmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.90 src/sys/arch/powerpc/ibm4xx/pmap.c:1.91
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.90 Mon Jul 6 10:40:21 2020
+++ src/sys/arch/powerpc/ibm4xx/pmap.c Thu Sep 10 03:02:36 2020
@@ -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 @@ static char *pmap_attrib;
#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 @@ pmap_page_protect(struct vm_page *pg, vm
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);
}
}