On Fri, Aug 31, 2012 at 08:29:01AM +0930, Alan Modra wrote:
I wrote this code in the first instance using atomic_read_barrier
followed by atomic_increment.. The reason why I implemented the patch
as I did, is that the asm allows MUTEX_HINT_REL on lwarx. Otherwise
the asm is identical to atomic_read_barrier followed by
atomic_increment. Please look at the generated object code to verify
this is so (or to refute my claim and hopefully find why things are
going wrong). Is UP defined for your builds?
Sigh. I see the error. "=&r" (tmp) needs to be "=&b" (tmp), because
"addi 0,0,1" is really "li 0,1".