My gcc cross compiler doesn't support Built-in functions for atomic memory access. How i can implement the following function, using inline assembly for Sparc V8 architecture:
long __sync_val_compare_and_swap (long *ptr, long oldval long newval)
{
....
}
Those builtin perform an atomic compare and swap. That is, if the current value of *ptr is oldval, then write newval into *ptr.