diff options
Diffstat (limited to 'lib9/lock-Solaris-sparc.s')
| -rw-r--r-- | lib9/lock-Solaris-sparc.s | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib9/lock-Solaris-sparc.s b/lib9/lock-Solaris-sparc.s new file mode 100644 index 00000000..d0f9399f --- /dev/null +++ b/lib9/lock-Solaris-sparc.s @@ -0,0 +1,20 @@ + + .section ".text", #alloc, #execinstr + .align 8 + .skip 16 + .global canlock + .type canlock,2 + +canlock: + or %g0,1,%o1 + swap [%o0],%o1 ! o0 points to lock; key is first word + cmp %o1,1 + bne .gotit + nop + retl ! key was 1 + or %g0,0,%o0 +.gotit: + retl ! key was not 1 + or %g0,1,%o0 + + .size canlock,(.-canlock) |
