[U-Boot] [PATCH 04/10] board_init_f_mem(): Don't create an unused early malloc() area

Masahiro Yamada yamada.masahiro at socionext.com
Mon Apr 20 14:12:41 CEST 2015


2015-04-16 10:14 GMT+09:00 Simon Glass <sjg at chromium.org>:
> Change the #ifdef so that the early malloc() area is not set up in SPL if
> CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually
> be used, and just chews up stack space.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  common/init/global_data.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/common/init/global_data.c b/common/init/global_data.c
> index d2d7baa..dd91e98 100644
> --- a/common/init/global_data.c
> +++ b/common/init/global_data.c
> @@ -31,7 +31,8 @@ ulong board_init_f_mem(ulong top)
>                 *ptr++ = 0;
>  #endif
>
> -#ifdef CONFIG_SYS_MALLOC_F_LEN
> +#if defined(CONFIG_SYS_MALLOC_F_LEN) && \
> +       (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYS_SPL_MALLOC_START))
>         top -= CONFIG_SYS_MALLOC_F_LEN;
>         gd->malloc_base = top;
>  #endif


This is a critical one to fix the bug on Zynq.

Tested-by: Masahiro Yamada <yamada.masahiro at socionext.com>


BTW, we should do something with defined(CONFIG_SYS_MALLOC_F_LEN) later.
Note CONFIG_SYS_MALLOC_F_LEN is a hex type config.



-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list