2 * R4000 user-level atomic operations
5 #define LL(base, rt) WORD $((060<<26)|((base)<<21)|((rt)<<16))
6 #define SC(base, rt) WORD $((070<<26)|((base)<<21)|((rt)<<16))
7 #define NOOP WORD $0x27
9 TEXT ainc(SB), 1, $-4 /* long ainc(long *); */
10 TEXT _xinc(SB), 1, $-4 /* void _xinc(long *); */
11 MOVW R1, R2 /* address of counter */
16 MOVW R3, R1 /* return new value */
22 TEXT adec(SB), 1, $-4 /* long adec(long*); */
23 TEXT _xdec(SB), 1, $-4 /* long _xdec(long *); */
24 MOVW R1, R2 /* address of counter */
29 MOVW R3, R1 /* return new value */
36 * int cas(uint* p, int ov, int nv);
42 LL(1, 4) /* R4 = *R1 */
45 SC(1, 3) /* *R1 = R3 */
47 BEQ R3, spincas /* R3 == 0 means store failed */