From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Fri, 12 Nov 2010 09:05:28 +0100 Subject: [U-Boot] [PATCH] arm: add 8-byte alignment for ABI compliance before board_init_f In-Reply-To: <4CDCF287.8010805@free.fr> References: <1289544835-24425-1-git-send-email-hs@denx.de> <4CDCF287.8010805@free.fr> Message-ID: <4CDCF548.2090405@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Albert, Albert ARIBAUD wrote: > Le 12/11/2010 07:53, Heiko Schocher a ?crit : >> suggested from Daniel Hobi >> >> Tested on following boards: >> arm1136: qong >> armv7: omap3_beagle >> arm926ejs: magnesium, tx25 >> >> Signed-off-by: Heiko Schocher >> cc: Daniel Hobi >> cc: Albert ARIBAUD > > I'm a bit uneasy about having the symbol unaligned and the aligning done > by the code (and in different places): ok. >> 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. Ok. > Could we not align the symbol value itself so that the code simply uses > the symbol? Hmm.. but users can forgot to align the symbol ... and I think, code should not change that often in this place ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany