[U-Boot] SYS_MALLOC_SIMPLE versus SPL_SYS_MALLOC_SIMPLE?

Hans de Goede hdegoede at redhat.com
Mon Apr 18 10:54:27 CEST 2016


Hi,

On 16-04-16 10:58, Robert P. J. Day wrote:
>
>    (WARNING: many potentially dumb questions coming this weekend as i
> try to put together a u-boot tutorial for some upcoming presentations.
> please be patient ... )
>
>    i had a much longer question about the config option
> SYS_MALLOC_SIMPLE until i noticed that it doesn't seem to be defined
> in a Kconfig file:
>
>    $ grep -rw SYS_MALLOC_SIMPLE *
>    common/malloc_simple.c:#if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>    include/exports.h:#if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>    include/_exports.h:#if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>    include/malloc.h:#if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>    $
>
> that appears to be the extent of that symbol in the entire u-boot
> source tree, which is obviously different from:
>
>    $ grep -rw SPL_SYS_MALLOC_SIMPLE *
>    arch/arm/Kconfig:	select SPL_SYS_MALLOC_SIMPLE if SUPPORT_SPL
>    arch/arm/mach-rockchip/Kconfig:config SPL_SYS_MALLOC_SIMPLE
>    Kconfig:config SPL_SYS_MALLOC_SIMPLE
>    Kconfig:	depends on SPL_STACK_R && SPL_SYS_MALLOC_SIMPLE
>    $

There is some magic happening somewhere whereby SPL_FOO_BAR
Kconfig settings only get set when builind the SPL and they
actually get set as FOO_BAR, so the SPL_ prefix is special
and tells the u-boot build scripts to only define FOO_BAR
when building the SPL, this goes for all SPL_ prefixed
Kconfig settings. This all is IIRC.

Regards,

Hans


More information about the U-Boot mailing list