svn commit: r225238 - projects/armv6/sys/arm/arm

Olivier Houchard cognet at FreeBSD.org
Sun Aug 28 23:43:59 UTC 2011


Author: cognet
Date: Sun Aug 28 23:43:58 2011
New Revision: 225238
URL: http://svn.freebsd.org/changeset/base/225238

Log:
  Only mark the page as dirty if it was mapped writable.
  While I'm there, remove some dead code, the page can't be NULL.

Modified:
  projects/armv6/sys/arm/arm/pmap-v6.c
  projects/armv6/sys/arm/arm/pmap.c

Modified: projects/armv6/sys/arm/arm/pmap-v6.c
==============================================================================
--- projects/armv6/sys/arm/arm/pmap-v6.c	Sun Aug 28 19:38:04 2011	(r225237)
+++ projects/armv6/sys/arm/arm/pmap-v6.c	Sun Aug 28 23:43:58 2011	(r225238)
@@ -2444,12 +2444,10 @@ pmap_protect(pmap_t pm, vm_offset_t sva,
 				pmap_set_prot(ptep, prot, !(pm == pmap_kernel()));
 				PTE_SYNC(ptep);
 
-				if (pg != NULL) {
-					f = pmap_modify_pv(pg, pm, sva,
-					    PVF_WRITE, 0);
+				f = pmap_modify_pv(pg, pm, sva,
+				    PVF_WRITE, 0);
+				if (f & PVF_WRITE)
 					vm_page_dirty(pg);
-				} else
-					f = PVF_REF | PVF_EXEC;
 
 				if (flush >= 0) {
 					flush++;

Modified: projects/armv6/sys/arm/arm/pmap.c
==============================================================================
--- projects/armv6/sys/arm/arm/pmap.c	Sun Aug 28 19:38:04 2011	(r225237)
+++ projects/armv6/sys/arm/arm/pmap.c	Sun Aug 28 23:43:58 2011	(r225238)
@@ -3241,15 +3241,13 @@ pmap_protect(pmap_t pm, vm_offset_t sva,
 				*ptep = pte;
 				PTE_SYNC(ptep);
 
-				if (pg != NULL) {
-					if (!(pg->oflags & VPO_UNMANAGED)) {
-						f = pmap_modify_pv(pg, pm, sva,
-						    PVF_WRITE, 0);
+				if (!(pg->oflags & VPO_UNMANAGED)) {
+					f = pmap_modify_pv(pg, pm, sva,
+					    PVF_WRITE, 0);
+					if (f & PVF_WRITE)
 						vm_page_dirty(pg);
-					} else
-						f = 0;
 				} else
-					f = PVF_REF | PVF_EXEC;
+					f = 0;
 
 				if (flush >= 0) {
 					flush++;


More information about the svn-src-projects mailing list