1 / See the file LICENSE for redistribution information.
3 / Copyright (c) 1997-2009 Oracle. All rights reserved.
7 / int uts_lock ( int *p, int i );
8 / Update the lock word pointed to by p with the
9 / value i, using compare-and-swap.
10 / Returns 0 if update was successful.
11 / Returns 1 if update failed.
17 l r2,64+0(sp) / R2 -> word to update
18 slr r0, r0 / R0 = current lock value must be 0
19 l r1,64+4(sp) / R1 = new lock value
20 cs r0,r1,0(r2) / Try the update ...
21 be x / ... Success. Return 0
22 la r0,1 / ... Failure. Return 1
24 l r2,8(sp) / Restore R2
25 b 2(,r14) / Return to caller