[U-Boot] [PATCH v2] Fix board init code to use a valid C runtime environment

Albert ARIBAUD albert.u.boot at aribaud.net
Wed Nov 11 09:52:31 CET 2015


On Tue, 10 Nov 2015 19:30:47 +0100, Albert ARIBAUD
<albert.u.boot at aribaud.net> wrote:
> board_init_f_mem() alters the C runtime environment's
> stack it ls actually already using. This is not a valid
> C runtime environment.
> 
> Split board_init_f_mem into C functions which do not
> alter their own stack and therefore run in a valid C
> runtime environment.

Additional note: tested with current u-boot/master (commit cad04990) on
an OpenRD-Client board (which builds Thumb-1 code) using gcc 5.2.1 (which
saves and restores r9 in just about any C function, causing
arch_setup_gd to fail setting GD):

- without this patch, the board fails to boot with an undefined
  instruction exception.

- with this patch, the board boots and functions normally (at least
  dhcp, tftp, go are working as expected).

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list