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 that start.S and machdep.c don'...



details:   https://anonhg.NetBSD.org/src/rev/7abffc246e05
branches:  trunk
changeset: 782165:7abffc246e05
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Oct 19 12:36:24 2012 +0000

description:
Make sure that start.S and machdep.c don't disagree wrt L1 page table
location during bootstrap.

diffstat:

 sys/arch/arm/arm32/arm32_kvminit.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r 984af55cbff6 -r 7abffc246e05 sys/arch/arm/arm32/arm32_kvminit.c
--- a/sys/arch/arm/arm32/arm32_kvminit.c        Fri Oct 19 12:33:27 2012 +0000
+++ b/sys/arch/arm/arm32/arm32_kvminit.c        Fri Oct 19 12:36:24 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_kvminit.c,v 1.11 2012/10/19 09:56:32 skrll Exp $ */
+/*     $NetBSD: arm32_kvminit.c,v 1.12 2012/10/19 12:36:24 skrll Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.11 2012/10/19 09:56:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.12 2012/10/19 12:36:24 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -324,6 +324,12 @@
                }
        }
 
+       /*
+        * As we allocate the memory, make sure that we don't walk over
+        * our current first level translation table.
+        */
+       KASSERT((armreg_ttbr_read() & ~(L1_TABLE_SIZE - 1)) != free_pv->pv_pa);
+
        pv->pv_pa = free_pv->pv_pa;
        pv->pv_va = free_pv->pv_va;
        pv->pv_size = nbytes;
@@ -428,11 +434,6 @@
                SLIST_INSERT_HEAD(&bmi->bmi_freechunks, &chunks[i], pv_list);
        }
 
-       /*
-        * As we allocate the memory, make sure that we don't walk over
-        * our temporary first level translation table.
-        */
-
        kernel_l1pt.pv_pa = 0;
        kernel_l1pt.pv_va = 0;
 



Home | Main Index | Thread Index | Old Index