[lkml]   [2011]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/4] msm: scm: Mark inline asm as volatile
Hi David,

On Sun, 2011-02-27 at 17:38 +0000, David Brown wrote:
> Per the gcc manual:
> If your assembler instructions access memory in an unpredictable
> fashion, add `memory' to the list of clobbered registers. This will
> cause GCC to not keep memory values cached in registers across the
> assembler instruction and not optimize stores or loads to that
> memory. You will also want to add the `volatile' keyword if the
> memory affected is not listed in the inputs or outputs of the `asm',
> as the `memory' clobber does not count as a side-effect of the `asm'.
> If you know how large the accessed memory is, you can add it as input
> or output but if this is not known, you should add `memory'. As an
> example, if you access ten bytes of a string, you can use a memory
> input like:
Right, so if you neglected to check the output from the smc block then
it would be a candidate for removal even with a memory clobber. Now I
see why you want a volatile in there!

For what it's worth:

Acked-by: Will Deacon <>


 \ /
  Last update: 2011-03-01 11:33    [W:0.084 / U:1.052 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site