[U-Boot] [PATCH] ARM926: Add mb to the cache invalidate/flush

Scott Wood scottwood at freescale.com
Thu Oct 11 23:09:28 CEST 2012


On 10/11/2012 03:01:32 PM, Albert ARIBAUD wrote:
> Hi Mark,
> 
> Thanks for your example.
> 
> > My understanding of gcc is that global memory accesses are meant to
> > stay on the correct side of an asm with a "memory" clobber.  The gcc
> > manual states that if you use a memory clobber, the asm should also
> > be volatile.
> 
> Not exactly. It states that you need to add volatile if you cannot  
> tell
> where in memory your instruction will write; if you can tell (by
> specifying "m" as an output of the asm) then volatile is not
> needed -- simply because the compiler can tell where in memory the
> write will happen, and will thus not eliminate the asm statement as
> long as the destination memory is not optimized out.

You're confusing the part about adding volatile to the asm statement to  
keep it from being completely removed, from anything to do with  
ordering or clobbers.

-Scott


More information about the U-Boot mailing list