Module Name:    src
Committed By:   reinoud
Date:           Wed Sep 14 19:45:27 UTC 2011

Modified Files:
        src/sys/arch/usermode/usermode: pmap.c

Log Message:
Code audit revealed missing brackets and a silly old constant of 1024
lingering around. Fixed with the right values.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/usermode/usermode/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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.61 src/sys/arch/usermode/usermode/pmap.c:1.62
--- src/sys/arch/usermode/usermode/pmap.c:1.61	Wed Sep 14 18:28:36 2011
+++ src/sys/arch/usermode/usermode/pmap.c	Wed Sep 14 19:45:27 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.61 2011/09/14 18:28:36 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.62 2011/09/14 19:45:27 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <[email protected]>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.61 2011/09/14 18:28:36 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.62 2011/09/14 19:45:27 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -769,7 +769,7 @@
 	 * to the header.  Otherwise we must search the list for
 	 * the entry.  In either case we free the now unused entry.
 	 */
-	if (pmap == pv->pv_pmap && lpn == pv->pv_lpn) {
+	if ((pmap == pv->pv_pmap) && (lpn == pv->pv_lpn)) {
 		npv = pv->pv_next;
 		if (npv) {
 			/* Pull up first entry from chain. */
@@ -973,7 +973,7 @@
 
 	active_pmap = NULL;
 	pmap->pm_flags &=~ PM_ACTIVE;
-	for (i = 0; i < 1024; i++) {
+	for (i = 0; i < pm_nentries; i++) {
 		if (pmap->pm_entries[i] != NULL) {
 			pmap_page_deactivate(pmap->pm_entries[i]);
 //			MEMC_WRITE(pmap->pm_entries[i]->pv_deactivate);

Reply via email to