[lkml]   [2011]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: ARM unaligned MMIO access with attribute((packed))
From: Russell King - ARM Linux <>
Date: Wed, 2 Feb 2011 21:45:22 +0000

> On Wed, Feb 02, 2011 at 01:38:31PM -0800, David Miller wrote:
>> From: Russell King - ARM Linux <>
>> Date: Wed, 2 Feb 2011 16:37:02 +0000
>> > 1. there's no way to tell GCC that the inline assembly is a load
>> > instruction and therefore it needs to schedule the following
>> > instructions appropriately.
>> Just add a dummy '"m" (pointer)' asm input argument to the inline asm
>> statement. Just make sure "typeof(pointer)" has a size matching the
>> size of the load your are performing.
> That involves this problematical cast from a packed struct pointer to
> an unsigned long pointer, which according to the C standard and GCC
> folk is undefined.

It's alignment may be undefined, but it's size definitely is well
defined and that's what matters here.

> Practice over the last 15 years on ARM has also shown that this is not
> necessary.

Sorry oh big super man, little ole' me is only a kernel newbie.

 \ /
  Last update: 2011-02-02 23:01    [W:0.067 / U:2.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site