From: Mike Frysinger Date: Fri, 23 Jan 2009 13:00:16 -0500 Subject: [U-Boot] [PATCH 15/40] Blackfin: respect/check CONFIG_SYS_GBL_DATA_SIZE In-Reply-To: <1232733641-29276-1-git-send-email-vapier@gentoo.org> References: <1232733641-29276-1-git-send-email-vapier@gentoo.org> Message-ID: <1232733641-29276-16-git-send-email-vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de When setting up the global data, rather than relying on sizeof(), use the common CONFIG_SYS_GBL_DATA_SIZE define. Signed-off-by: Mike Frysinger --- lib_blackfin/board.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c index 9d7a0f6..2feb64b 100644 --- a/lib_blackfin/board.c +++ b/lib_blackfin/board.c @@ -278,9 +278,13 @@ void board_init_f(ulong bootflag) dcache_enable(); #endif +#ifdef DEBUG + if (CONFIG_SYS_GBL_DATA_SIZE < sizeof(*gd)) + hang(); +#endif serial_early_puts("Init global data\n"); gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR); - memset((void *)gd, 0, sizeof(gd_t)); + memset((void *)gd, 0, CONFIG_SYS_GBL_DATA_SIZE); /* Board data initialization */ addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t)); -- 1.6.1