I need atomic operation code equivalent to following:
__asm__ __volatile__ (
" lock;\n"
" addl %1, %0; \n"
" movl %0, %%eax"
: "=m"(a), "=a" (c)
: "ir"(b)
);
(Adding two variables a and b and output stored in both a and c on Linux)
Equivalent to above is needed on Solaris(Sparc architecture). Is there anyone to help me out?