Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/imx7 If MEMSIZE isn't set, #error instead of...



details:   https://anonhg.NetBSD.org/src/rev/ba5a417151f1
branches:  trunk
changeset: 345495:ba5a417151f1
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon May 30 17:43:46 2016 +0000

description:
If MEMSIZE isn't set, #error instead of proceeding using uninitialized
stack garbage as the memory size. Please improve as needed; I don't know
anything about this hardware.

PR 51150 from David Binderman.

diffstat:

 sys/arch/evbarm/imx7/imx7_machdep.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 89aee15d6490 -r ba5a417151f1 sys/arch/evbarm/imx7/imx7_machdep.c
--- a/sys/arch/evbarm/imx7/imx7_machdep.c       Mon May 30 17:34:35 2016 +0000
+++ b/sys/arch/evbarm/imx7/imx7_machdep.c       Mon May 30 17:43:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imx7_machdep.c,v 1.2 2016/05/19 05:15:51 ryo Exp $     */
+/*     $NetBSD: imx7_machdep.c,v 1.3 2016/05/30 17:43:46 dholland Exp $        */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imx7_machdep.c,v 1.2 2016/05/19 05:15:51 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx7_machdep.c,v 1.3 2016/05/30 17:43:46 dholland Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_arm_debug.h"
@@ -211,6 +211,12 @@
 
 #ifdef MEMSIZE
        memsize = MEMSIZE * 1024 * 1024;
+#else
+/*
+ * Ugh... but this is better than proceeding using an uninitialized
+ * value in memsize, as the code did before I added this branch...
+ */
+#error "MEMSIZE not set"
 #endif
 
        bootconfig.dramblocks = 1;



Home | Main Index | Thread Index | Old Index