public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] struct NS16550 {...} __attribute__ ((packed)) at ns16550.h
@ 2005-04-22 14:57 Woojung.Huh at smsc.com
  2005-04-22 18:39 ` Wolfgang Denk
  0 siblings, 1 reply; 14+ messages in thread
From: Woojung.Huh at smsc.com @ 2005-04-22 14:57 UTC (permalink / raw)
  To: u-boot

Hi All,

I'm newbie to u-boot.

We are using u-boot for proprietary ARM board with NS16550 compatible serial controller.
It is configured as 4bytes access to serial controller, so set CFG_NS16550_REG_SIZE to 4.
But, because of "__attribute__ ((packed))" of struct NS16550, all register accesses to NS16550 are generated to byte
access (LDRB, STRB in ARM).

I think it should NOT have __attribute__ ((packed)) if NS16550 is configured as 4bytes access.
Am I missed something?

Thanks,
Woojung

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [U-Boot-Users] struct NS16550 {...} __attribute__ ((packed)) at ns16550.h
@ 2005-04-22 18:55 Woojung.Huh at smsc.com
  0 siblings, 0 replies; 14+ messages in thread
From: Woojung.Huh at smsc.com @ 2005-04-22 18:55 UTC (permalink / raw)
  To: u-boot

Wolfgang,

Thanks for your reply.
Maybe my configuration was wrong at that time when I compile sources.
Now it works as you described. (It was non-sense to me too.)
It means "__attribute__((packed))" doesn't affect 4byte access to serial controller.

Thanks,
Woojung



                                                                                                                                                  
                      Wolfgang Denk                                                                                                               
                      <wd@denx.de>             To:       Woojung Huh/SMSC at SMSC                                                                    
                      Sent by:                 cc:       U-Boot-Users at lists.sourceforge.net                                                       
                      wd at denx.de               Subject:  Re: [U-Boot-Users] struct NS16550 {...} __attribute__ ((packed)) at ns16550.h            
                                                                                                                                                  
                                                                                                                                                  
                      04/22/2005 02:39                                                                                                            
                      PM                                                                                                                          
                                                                                                                                                  
                                                                                                                                                  




In message <OF34DF8405.50E611E8-ON85256FEB.0051A68A-85256FEB.00522DF9@smsc.com> you wrote:
>
> We are using u-boot for proprietary ARM board with NS16550 compatible serial controller.
> It is configured as 4bytes access to serial controller, so set CFG_NS16550_REG_SIZE to 4.
> But, because of "__attribute__ ((packed))" of struct NS16550, all register accesses to NS16550 are generated to byte
> access (LDRB, STRB in ARM).

No, this staement makes no sense to me.

> I think it should NOT have __attribute__ ((packed)) if NS16550 is configured as 4bytes access.
> Am I missed something?

I think so.

"__attribute__ ((packed))" only affects the alignment of the  entries
in the structure. It has no influence on how to access these entries.
If  your  access is a 32 bit read or write access then it will not be
changed whether there is a "__attribute__  ((packed))"  in  place  or
not.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Every program has at least one bug and can be shortened by  at  least
one  instruction  --  from  which,  by induction, one can deduce that
every program can be reduced to one instruction which doesn't work.

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

end of thread, other threads:[~2005-04-26 14:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-22 14:57 [U-Boot-Users] struct NS16550 {...} __attribute__ ((packed)) at ns16550.h Woojung.Huh at smsc.com
2005-04-22 18:39 ` Wolfgang Denk
2005-04-25  7:44   ` Jean-Paul Saman
2005-04-25  8:20     ` Wolfgang Denk
2005-04-25 14:06       ` Arthur Shipkowski
2005-04-25 14:56         ` Wolfgang Denk
2005-04-25 15:18           ` Pantelis Antoniou
2005-04-25 19:43             ` Wolfgang Denk
2005-04-25 20:15               ` Arthur Shipkowski
2005-04-25 20:59                 ` Wolfgang Denk
2005-04-26  6:23               ` Pantelis Antoniou
2005-04-26  7:21                 ` Wolfgang Denk
2005-04-26 14:32                   ` Cory Tusar
  -- strict thread matches above, loose matches on Subject: below --
2005-04-22 18:55 Woojung.Huh at smsc.com

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