[U-Boot] [PATCH] arm: add 8-byte alignment for ABI compliance before board_init_f

Albert ARIBAUD albert.aribaud at free.fr
Fri Nov 12 08:53:43 CET 2010


Le 12/11/2010 07:53, Heiko Schocher a écrit :
> suggested from Daniel Hobi<daniel.hobi at schmid-telecom.ch>
>
> Tested on following boards:
> arm1136: qong
> armv7: omap3_beagle
> arm926ejs: magnesium, tx25
>
> Signed-off-by: Heiko Schocher<hs at denx.de>
> cc: Daniel Hobi<daniel.hobi at schmid-telecom.ch>
> cc: Albert ARIBAUD<albert.aribaud at free.fr>

I'm a bit uneasy about having the symbol unaligned and the aligning done 
by the code (and in different places):

>   	ldr	sp, =(CONFIG_SYS_INIT_SP_ADDR)
> +	bic	sp, sp, #7 /* 8-byte alignment for ABI compliance */

> -	gd = (gd_t *) (CONFIG_SYS_INIT_SP_ADDR);
> +	gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR)&  ~0x07);
>

There is always a risk that overhauls of the code, or new uses elsewhere 
in the code, forget about the alignment constraint and use the symbol 
straight away, which could cause all sorts of hard to debug issues.

Could we not align the symbol value itself so that the code simply uses 
the symbol?

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list