public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] packed attribute problem
@ 2010-10-04  9:38 Vipin Kumar
  2010-10-04 10:17 ` Wolfgang Denk
  0 siblings, 1 reply; 27+ messages in thread
From: Vipin Kumar @ 2010-10-04  9:38 UTC (permalink / raw)
  To: u-boot

Hi All,

I encountered a problem something like

struct xyz {
	int	x;
	int	y;
	int	z[CONST];
} __attribute__ ((packed));

struct xyz *abc;
u32 * status_reg = (u32 *)&abc->z[0];

writel(status, status_reg);

This writel results in writing byte by byte on the address pointed to by status_reg.
This problem is visible with both gcc version 4.4.1 as well as 4.5.0

Incidently, the same code works well with 4.2.4

The problem is visible in the usb host driver which uses the packed structures for 
accessing  device registers.

Regards
Vipin

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2010-10-11 13:22 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-04  9:38 [U-Boot] packed attribute problem Vipin Kumar
2010-10-04 10:17 ` Wolfgang Denk
2010-10-04 10:30   ` Vipin Kumar
2010-10-04 10:44     ` Wolfgang Denk
2010-10-04 10:56       ` Reinhard Meyer
2010-10-04 11:01         ` Vipin Kumar
2010-10-04 11:46           ` Reinhard Meyer
2010-10-04 12:29             ` Wolfgang Denk
2010-10-04 12:43               ` Reinhard Meyer
2010-10-04 12:50                 ` Balau
2010-10-04 12:58                   ` Wolfgang Denk
2010-10-04 13:02                     ` [U-Boot] DDR SPD table sywang
2010-10-04 15:56                       ` Mike Frysinger
2010-10-04 12:56                 ` [U-Boot] packed attribute problem Wolfgang Denk
2010-10-05  3:45                 ` Vipin Kumar
2010-10-05 11:43                 ` Detlev Zundel
2010-10-05 18:03                   ` Scott Wood
2010-10-07  9:59                     ` Detlev Zundel
2010-10-07 16:46                       ` Scott Wood
2010-10-07 17:57                         ` Wolfgang Denk
2010-10-07 18:52                           ` Scott Wood
2010-10-07 19:31                             ` Wolfgang Denk
2010-10-07 20:15                               ` Scott Wood
2010-10-11 11:32                                 ` Detlev Zundel
2010-10-11 13:22                                   ` Balau
2010-10-04 10:57       ` Vipin Kumar
2010-10-04 12:04         ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox