diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2015-11-25 17:56:32 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-01-13 21:05:17 -0500 |
commit | ecc306639e83c9019a5093b77a48685ea40eedc2 (patch) | |
tree | 7785c9d7358ccd22ddabe52489aae8a8c7035ffe /arch/x86 | |
parent | 20d08f59fa7cdde0da1eb7aca7915c91dbdeaf51 (diff) | |
download | talos-obmc-uboot-ecc306639e83c9019a5093b77a48685ea40eedc2.tar.gz talos-obmc-uboot-ecc306639e83c9019a5093b77a48685ea40eedc2.zip |
Fix board init code to respect the C runtime environment
board_init_f_mem() alters the C runtime environment's
stack it is actually already using. This is not a valid
behaviour within a C runtime environment.
Split board_init_f_mem into C functions which do not alter
their own stack and always behave properly with respect to
their C runtime environment.
Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
Acked-by: Thomas Chou <thomas@wytron.com.tw>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/cpu/start.S | 3 | ||||
-rw-r--r-- | arch/x86/lib/fsp/fsp_common.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S index 5b4ee79d88..485868ff57 100644 --- a/arch/x86/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -123,8 +123,9 @@ car_init_ret: #endif /* Set up global data */ mov %esp, %eax - call board_init_f_mem + call board_init_f_alloc_reserve mov %eax, %esp + call board_init_f_init_reserve #ifdef CONFIG_DEBUG_UART call debug_uart_init diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c index 5276ce6ab1..8479af1d7e 100644 --- a/arch/x86/lib/fsp/fsp_common.c +++ b/arch/x86/lib/fsp/fsp_common.c @@ -90,8 +90,8 @@ int x86_fsp_init(void) /* * The second time we enter here, adjust the size of malloc() * pool before relocation. Given gd->malloc_base was adjusted - * after the call to board_init_f_mem() in arch/x86/cpu/start.S, - * we should fix up gd->malloc_limit here. + * after the call to board_init_f_init_reserve() in arch/x86/ + * cpu/start.S, we should fix up gd->malloc_limit here. */ gd->malloc_limit += CONFIG_FSP_SYS_MALLOC_F_LEN; } |