Thread (1 message) 1 message, 1 author, 2011-02-02

ARM unaligned MMIO access with attribute((packed))

From: davem@davemloft.net (David Miller)
Date: 2011-02-02 23:23:16
Also in: lkml

From: M?ns Rullg?rd <redacted>
Date: Wed, 02 Feb 2011 23:08:01 +0000
David Miller [off-list ref] writes:
quoted
From: Russell King - ARM Linux <redacted>
Date: Wed, 2 Feb 2011 16:37:02 +0000
quoted
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 should be "m"(*pointer).
Right, thanks for the correction.
quoted
But you really need that memory clobber there whether you like it or
not, see above.
I don't know of any device where the side-effects are not explicitly
indicated by other means in the code triggering them, so it probably
is safe without the clobber as Russel says.
You're probably right.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help