[U-Boot] [PATCH 7/8] armv7: adapt omap3 to the new cache maintenance framework

Wolfgang Denk wd at denx.de
Tue Jan 18 10:23:22 CET 2011


Dear Aneesh V,

In message <4D3525CD.8090001 at ti.com> you wrote:
> 
> >>>> +struct __attribute__ ((__packed__)) emu_hal_params {
> >>>> +	u32 num_params;
> >>>> +	u32 param1;
> >>>> +};
> >>>
> >>> Why exactly do we need the "__attribute__ ((__packed__))" here?
> >>
> >> Because a pointer to it has to be passed to ROM code and ROM code
> >> wouldn't expect any padding.
> >
> > But padding would only be needed if there were any alignment
> > requirements requiring it. There are none here.
> 
> Yes. But, is that guaranteed?  I didn't want to make it compiler

Well, there has never been a guarantee agains broken tools doing
stupid or plain wrong things.

> dependent. Isn't it safer to use '__attribute__ ((__packed__))'

'__attribute__ ((__packed__))' has (especially on ARM) certain
side-effects that are neither needed nor wanted here, I think.

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
Knowledge, sir, should be free to all!
	-- Harry Mudd, "I, Mudd", stardate 4513.3


More information about the U-Boot mailing list