Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/oea Fix loop bug (Phileas Fogg)



details:   https://anonhg.NetBSD.org/src/rev/926b32eac468
branches:  trunk
changeset: 785732:926b32eac468
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 28 00:22:21 2013 +0000

description:
Fix loop bug (Phileas Fogg)

diffstat:

 sys/arch/powerpc/oea/pmap.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 3e02f30698ee -r 926b32eac468 sys/arch/powerpc/oea/pmap.c
--- a/sys/arch/powerpc/oea/pmap.c       Thu Mar 28 00:20:02 2013 +0000
+++ b/sys/arch/powerpc/oea/pmap.c       Thu Mar 28 00:22:21 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.87 2012/10/20 14:42:15 kiyohara Exp $       */
+/*     $NetBSD: pmap.c,v 1.88 2013/03/28 00:22:21 christos Exp $       */
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.87 2012/10/20 14:42:15 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.88 2013/03/28 00:22:21 christos Exp $");
 
 #define        PMAP_NOOPNAMES
 
@@ -3090,7 +3090,7 @@
 int
 pmap_setup_segment0_map(int use_large_pages, ...)
 {
-    vaddr_t va;
+    vaddr_t va, va_end;
 
     register_t pte_lo = 0x0;
     int ptegidx = 0, i = 0;
@@ -3123,7 +3123,7 @@
         pa = va_arg(ap, paddr_t);
         size = va_arg(ap, size_t);
 
-        for (; va < (va + size); va += 0x1000, pa += 0x1000) {
+        for (va_end = va + size; va < va_end; va += 0x1000, pa += 0x1000) {
 #if 0
            printf("%s: Inserting: va: %#" _PRIxva ", pa: %#" _PRIxpa "\n", __func__,  va, pa);
 #endif



Home | Main Index | Thread Index | Old Index