[U-Boot] packed attribute problem
Wolfgang Denk
wd at denx.de
Mon Oct 4 14:04:58 CEST 2010
Dear Vipin Kumar,
In message <4CA9B316.3050802 at st.com> you wrote:
>
> >>> Hm... Why do these structs have any "__attribute__ ((packed))" at all?
> >>
> >> Even I could not understand that very well
> >
> > Eventually alignment of these structs cannot be guaranteed?
>
> In my opinion it can be guaranteed.
> btw, I am talking about ehci_hcor structure in include/usb/host/ehci.h
> The only reason I am confused is that a lot many platforms would have faced a
> similar problem (or is it only me).
>
> Please confirm if I should remove the packed attribute and send a patch
This is mostly a decision Remy has to make (on cc:)
> This also raises one doubt. Since u-boot code now contains structures to access
> device registers, using packed attribute with these structures can be lethal
On ARM, indeed. Such structures must not use any packed attributes.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
About the use of language: it is impossible to sharpen a pencil with
a blunt ax. It is equally vain to try to do it with ten blunt axes
instead. -- Edsger Dijkstra
More information about the U-Boot
mailing list