Module Name:    src
Committed By:   skrll
Date:           Thu Jul 18 06:47:36 UTC 2019

Modified Files:
        src/sys/arch/aarch64/aarch64: pmapboot.c

Log Message:
Simplify conditionals when clearing the CONTIG flag in pmapboot_enter and
update the comments to be a little clearer.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/aarch64/pmapboot.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/aarch64/aarch64/pmapboot.c
diff -u src/sys/arch/aarch64/aarch64/pmapboot.c:1.3 src/sys/arch/aarch64/aarch64/pmapboot.c:1.4
--- src/sys/arch/aarch64/aarch64/pmapboot.c:1.3	Sat Dec 29 19:53:38 2018
+++ src/sys/arch/aarch64/aarch64/pmapboot.c	Thu Jul 18 06:47:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmapboot.c,v 1.3 2018/12/29 19:53:38 alnsn Exp $	*/
+/*	$NetBSD: pmapboot.c,v 1.4 2019/07/18 06:47:36 skrll Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu <r...@nerv.org>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmapboot.c,v 1.3 2018/12/29 19:53:38 alnsn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmapboot.c,v 1.4 2019/07/18 06:47:36 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -386,21 +386,21 @@ pmapboot_enter(vaddr_t va, paddr_t pa, p
  nextblk:
 #ifdef OPTIMIZE_TLB_CONTIG
 		/*
-		 * when overwrite pte, also contiguous bit before/after
-		 * this pte should be cleared.
+		 * when overwriting a pte entry the contiguous bit in entries
+		 * before/after the entry should be cleared.
 		 */
-		if ((ll != NULL) && (va == va_start) &&
-		    ((llidx & 15) != 0)) {
-			/* clear CONTIG flag in front of this pte entry */
-			for (i = (llidx & ~15); i < llidx; i++) {
-				ll[i] &= ~LX_BLKPAG_CONTIG;
+		if (ll != NULL) {
+			if (va == va_start && (llidx & 15) != 0) {
+				/* clear CONTIG flag before this pte entry */
+				for (i = (llidx & ~15); i < llidx; i++) {
+					ll[i] &= ~LX_BLKPAG_CONTIG;
+				}
 			}
-		}
-		if ((ll != NULL) && (va == va_end) &&
-		    ((llidx & 15) != 15)) {
-			/* clear CONTIG flag in back of this pte entry */
-			for (i = (llidx + 1); i < ((llidx + 16) & ~15); i++) {
-				ll[i] &= ~LX_BLKPAG_CONTIG;
+			if (va == va_end && (llidx & 15) != 15) {
+				/* clear CONTIG flag after this pte entry */
+				for (i = (llidx + 1); i < ((llidx + 16) & ~15); i++) {
+					ll[i] &= ~LX_BLKPAG_CONTIG;
+				}
 			}
 		}
 #endif

Reply via email to