From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 11 Aug 2008 19:16:24 +0200 Subject: [U-Boot] __attribute__((__packed__)) switching to byte-access on ARM In-Reply-To: References: Message-ID: <20080811171624.GA9467@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 17:48 Mon 11 Aug , Guennadi Liakhovetski wrote: > Hi > > As I remarked in the opening email to the SMDK6400 patch-series, I've got > a strange problem, I cannot understand. > > Here're the c-code: > > typedef struct { > volatile u32 TCNTB; > volatile u32 TCMPB; > volatile u32 TCNTO; > } s3c64xx_timer; > > typedef struct { > volatile u32 TCFG0; > volatile u32 TCFG1; > volatile u32 TCON; > s3c64xx_timer ch[4]; > volatile u32 TCNTB4; > volatile u32 TCNTO4; > } s3c64xx_timers; IIRC in gcc 4 you're supposed to declare the struct as packet and not the typedef struct { volatile u32 TCNTB; volatile u32 TCMPB; volatile u32 TCNTO; } _s3c64xx_timer __attribute__ ((__packed__)); typedef struct _s3c64xx_timer s3c64xx_timer; struct { volatile u32 TCFG0; volatile u32 TCFG1; volatile u32 TCON; s3c64xx_timer ch[4]; volatile u32 TCNTB4; volatile u32 TCNTO4; } _s3c64xx_timers __attribute__ ((__packed__)); typedef struct _s3c64xx_timers s3c64xx_timers; Best Regards, J.