From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Wed, 11 Nov 2015 09:52:31 +0100 Subject: [U-Boot] [PATCH v2] Fix board init code to use a valid C runtime environment In-Reply-To: <1447180247-29704-1-git-send-email-albert.u.boot@aribaud.net> References: <1447180247-29704-1-git-send-email-albert.u.boot@aribaud.net> Message-ID: <20151111095231.30257650@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 10 Nov 2015 19:30:47 +0100, Albert ARIBAUD 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.