Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 Make sure nptes is a multiple of PAGE_SIZ...



details:   https://anonhg.NetBSD.org/src/rev/cc39111cb3e6
branches:  trunk
changeset: 808278:cc39111cb3e6
user:      matt <matt%NetBSD.org@localhost>
date:      Mon May 11 22:28:22 2015 +0000

description:
Make sure nptes is a multiple of PAGE_SIZE / L2_S_SIZE.

diffstat:

 sys/arch/arm/arm32/pmap.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 5048702e0412 -r cc39111cb3e6 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Mon May 11 21:46:50 2015 +0000
+++ b/sys/arch/arm/arm32/pmap.c Mon May 11 22:28:22 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.320 2015/04/13 16:19:42 matt Exp $  */
+/*     $NetBSD: pmap.c,v 1.321 2015/05/11 22:28:22 matt Exp $  */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -216,7 +216,7 @@
 
 #include <arm/locore.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.320 2015/04/13 16:19:42 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.321 2015/05/11 22:28:22 matt Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -6167,9 +6167,11 @@
         */
        virtual_avail = (virtual_avail + arm_cache_prefer_mask) & ~arm_cache_prefer_mask;
        nptes = (arm_cache_prefer_mask >> L2_S_SHIFT) + 1;
+       nptes = roundup(nptes, PAGE_SIZE / L2_S_SIZE);
        if (arm_pcache.icache_type != CACHE_TYPE_PIPT
            && arm_pcache.icache_way_size > nptes * L2_S_SIZE) {
                nptes = arm_pcache.icache_way_size >> L2_S_SHIFT;
+               nptes = roundup(nptes, PAGE_SIZE / L2_S_SIZE);
        }
 #else
        nptes = PAGE_SIZE / L2_S_SIZE;



Home | Main Index | Thread Index | Old Index