linux guarantees ll/sc are always available. on mips1, they will be
emulated by the kernel. thus they are part of the linux mips1 abi and
safe to use.
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%2)\n"
" bne %0, %3, 1f\n"
int old, dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%2)\n"
" addu %1, %3, $0\n"
int old, dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%2)\n"
" addu %1, %0, %3\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" addu %0, %0, 1\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" subu %0, %0, 1\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" addu %0, %2, $0\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" and %0, %0, %2\n"
int dummy;
__asm__ __volatile__(
".set push\n"
+ ".set mips2\n"
".set noreorder\n"
"1: ll %0, 0(%1)\n"
" or %0, %0, %2\n"