U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] __attribute__((__packed__)) switching to byte-access	on ARM
Date: Mon, 11 Aug 2008 19:16:24 +0200	[thread overview]
Message-ID: <20080811171624.GA9467@game.jcrosoft.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0808111737330.30591@axis700.grange>

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.

  parent reply	other threads:[~2008-08-11 17:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 15:48 [U-Boot] __attribute__((__packed__)) switching to byte-access on ARM Guennadi Liakhovetski
2008-08-11 16:06 ` Wolfgang Denk
2008-08-11 16:23   ` Guennadi Liakhovetski
2008-08-11 16:50     ` Kenneth Johansson
2008-08-11 17:00       ` Guennadi Liakhovetski
2008-08-11 17:21         ` Kenneth Johansson
2008-08-11 18:14           ` Guennadi Liakhovetski
2008-08-11 17:16 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2008-08-11 17:44   ` Guennadi Liakhovetski
2008-08-11 19:41     ` Guennadi Liakhovetski
2008-08-11 19:01 ` Scott Wood
2008-08-11 19:20   ` Guennadi Liakhovetski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080811171624.GA9467@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox