Blackfin: respect/check CONFIG_SYS_GBL_DATA_SIZE
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 <vapier@gentoo.org>
This commit is contained in:
parent
01815c2d06
commit
78a0ba7dc2
1 changed files with 5 additions and 1 deletions
|
@ -279,9 +279,13 @@ void board_init_f(ulong bootflag)
|
||||||
dcache_enable();
|
dcache_enable();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (CONFIG_SYS_GBL_DATA_SIZE < sizeof(*gd))
|
||||||
|
hang();
|
||||||
|
#endif
|
||||||
serial_early_puts("Init global data\n");
|
serial_early_puts("Init global data\n");
|
||||||
gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
|
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 */
|
/* Board data initialization */
|
||||||
addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t));
|
addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t));
|
||||||
|
|
Loading…
Reference in a new issue