public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: need for packed attribute
@ 2006-01-12 12:27 Mikael Pettersson
  2006-01-12 13:47 ` Russell King
  2006-01-12 17:20 ` Pete Zaitcev
  0 siblings, 2 replies; 14+ messages in thread
From: Mikael Pettersson @ 2006-01-12 12:27 UTC (permalink / raw)
  To: rmk+lkml; +Cc: linux-kernel, linux-usb-devel, oliver

On Fri, 6 Jan 2006 18:38:46 +0000, Russell King wrote:
>> is there any architecture for which packed is required in structures like this:
>> 
>> /* All standard descriptors have these 2 fields at the beginning */
>> struct usb_descriptor_header {
>> 	__u8  bLength;
>> 	__u8  bDescriptorType;
>> };
>
>sizeof(struct usb_descriptor_header) will be 4 on ARM.

I found this surprising, but gcc-3.4.5 for ARM seems to agree with you.

As fas as I can tell, the AAPCS document (v2.03 7th Oct 2005) requires
that a simple "struct foo { unsigned char c; };" should have both size
and alignment equal to 1, but gcc makes them both 4. Do you have any
information about why gcc is doing this on ARM/Linux? Is there an accurate
ABI document for ARM/Linux somewhere?

/Mikael

^ permalink raw reply	[flat|nested] 14+ messages in thread
* need for packed attribute
@ 2006-01-06 18:15 Oliver Neukum
  2006-01-06 18:38 ` Russell King
  0 siblings, 1 reply; 14+ messages in thread
From: Oliver Neukum @ 2006-01-06 18:15 UTC (permalink / raw)
  To: linux-usb-devel, linux-kernel

Hi,

is there any architecture for which packed is required in structures like this:

/* All standard descriptors have these 2 fields at the beginning */
struct usb_descriptor_header {
	__u8  bLength;
	__u8  bDescriptorType;
};

	Regards
		Oliver

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

end of thread, other threads:[~2006-01-12 19:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-12 12:27 need for packed attribute Mikael Pettersson
2006-01-12 13:47 ` Russell King
2006-01-12 13:53   ` Russell King
2006-01-12 16:30   ` Mikael Pettersson
2006-01-12 16:46     ` Russell King
2006-01-12 17:22       ` [linux-usb-devel] " David Vrabel
2006-01-12 17:34         ` Russell King
2006-01-12 17:20 ` Pete Zaitcev
2006-01-12 17:26   ` Russell King
2006-01-12 17:36     ` Pete Zaitcev
2006-01-12 19:35   ` [linux-usb-devel] " David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2006-01-06 18:15 Oliver Neukum
2006-01-06 18:38 ` Russell King
2006-01-12 18:32   ` Benjamin LaHaise

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