[U-Boot] __attribute__((__packed__)) switching to byte-access on ARM
Guennadi Liakhovetski
lg at denx.de
Mon Aug 11 18:23:48 CEST 2008
On Mon, 11 Aug 2008, Wolfgang Denk wrote:
> Dear Guennadi Liakhovetski,
>
> In message <Pine.LNX.4.64.0808111737330.30591 at axis700.grange> you wrote:
> >
> > As I remarked in the opening email to the SMDK6400 patch-series, I've got
> > a strange problem, I cannot understand.
>
> What exactly is your problem?
Right, sorry, the problem is simple: it doesn't work with the byte access.
> > which converts all accesses to the structure to 8-bit... Ideas? Toolchain
> > eldk-4.1. U-Boot from nand/testing git with the patches I just sent to the
> > list, configured for smdk6400_config.
>
> Note that you did not exactly ask a question, you just describe your
> observations so we have to guess what might be puzzeling you. I think
> that some people with more ARM experience than me will simply not
> understand what you are asking about, because they are used to GCC
> turning perfectly valid looking 32 bit accesses into a sequence of
> four 8 bit accesses.
>
> They consider this "normal".
I cannot think of any such examples... I know access-types can be changed
on the hardware, say, on a 16-bit bus a 32-bit access can be split into
two 16-bit accesses, but I currently cannot think of any examples of the
compiler doing such things. But, I think, I can imagine _why_ the compiler
might decide to do that - it cannot guarantee, that the structure is
32-bit aligned, so, it is opting for the "safe" variant... So, the
question is: is the compiler right and the c-code was wrong, or the other
way round?
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
More information about the U-Boot
mailing list