I am working on inline asm related staff. I couldn't
get proper answer for this question. So posting this
question here..... Expecting good response from you.
* Should we use "memory" clobber in *every* inline asm
which does atomic operation? (In MIPS, 'll'/'sc'
instructions are used to provide atomic operation)
As per my understanding, "memory" clobber will be
required for inline asm only if the corresponding
functions can be used to implement *lock* and *unlock*
primitives (or) memory modified by the inline asm
is *unknown*. Please correct me if I am wrong.
In the following URL, "memory" clobber has been
specified in the functions 'atomic_add_return' and
'atomic_sub_return'. But it is *not* specified in
the functions 'atomic_add' and 'atomic_sub'. WHY?
Does it mean that 'atomic_add'/'atomic_sub' (which
returns 'void') can't be used to implement *lock*
and *unlock* primitives?
Please clarify it. Thanks in advance!
Expecting your responses ...
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.