Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/beagle Actually, only copy the uboot args if...



details:   https://anonhg.NetBSD.org/src/rev/db5d0af4e878
branches:  trunk
changeset: 788956:db5d0af4e878
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Jul 30 22:23:45 2013 +0000

description:
Actually, only copy the uboot args if they are within the amount of ram we
mapped.  If they aren't we'd fault trying to access them.  It's too early
to grab a VA to map them so we just punt for now. XXX

diffstat:

 sys/arch/evbarm/beagle/beagle_machdep.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 3e5cd3180409 -r db5d0af4e878 sys/arch/evbarm/beagle/beagle_machdep.c
--- a/sys/arch/evbarm/beagle/beagle_machdep.c   Tue Jul 30 20:51:38 2013 +0000
+++ b/sys/arch/evbarm/beagle/beagle_machdep.c   Tue Jul 30 22:23:45 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: beagle_machdep.c,v 1.53 2013/07/30 20:45:44 matt Exp $ */
+/*     $NetBSD: beagle_machdep.c,v 1.54 2013/07/30 22:23:45 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.53 2013/07/30 20:45:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.54 2013/07/30 22:23:45 matt Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -562,10 +562,12 @@
        arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, devmap,
            mapallmem_p);
 
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
        /* "bootargs" env variable is passed as 4th argument to kernel */
-       if ((uboot_args[3] & 0xe0000000) == 0x80000000) {
+       if (uboot_args[3] - 0x80000000 < ram_size) {
                strlcpy(bootargs, (char *)uboot_args[3], sizeof(bootargs));
        }
+#endif
        boot_args = bootargs;
        parse_mi_bootargs(boot_args);
 



Home | Main Index | Thread Index | Old Index