diff options
Diffstat (limited to 'arch/sparc/lib/atomic_64.S')
-rw-r--r-- | arch/sparc/lib/atomic_64.S | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/sparc/lib/atomic_64.S b/arch/sparc/lib/atomic_64.S index 4d502da3de78..85c233d0a340 100644 --- a/arch/sparc/lib/atomic_64.S +++ b/arch/sparc/lib/atomic_64.S | |||
@@ -1,6 +1,6 @@ | |||
1 | /* atomic.S: These things are too big to do inline. | 1 | /* atomic.S: These things are too big to do inline. |
2 | * | 2 | * |
3 | * Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net) | 3 | * Copyright (C) 1999, 2007 2012 David S. Miller (davem@davemloft.net) |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <linux/linkage.h> | 6 | #include <linux/linkage.h> |
@@ -117,3 +117,17 @@ ENTRY(atomic64_sub_ret) /* %o0 = decrement, %o1 = atomic_ptr */ | |||
117 | sub %g1, %o0, %o0 | 117 | sub %g1, %o0, %o0 |
118 | 2: BACKOFF_SPIN(%o2, %o3, 1b) | 118 | 2: BACKOFF_SPIN(%o2, %o3, 1b) |
119 | ENDPROC(atomic64_sub_ret) | 119 | ENDPROC(atomic64_sub_ret) |
120 | |||
121 | ENTRY(atomic64_dec_if_positive) /* %o0 = atomic_ptr */ | ||
122 | BACKOFF_SETUP(%o2) | ||
123 | 1: ldx [%o0], %g1 | ||
124 | brlez,pn %g1, 3f | ||
125 | sub %g1, 1, %g7 | ||
126 | casx [%o0], %g1, %g7 | ||
127 | cmp %g1, %g7 | ||
128 | bne,pn %xcc, BACKOFF_LABEL(2f, 1b) | ||
129 | nop | ||
130 | 3: retl | ||
131 | sub %g1, 1, %o0 | ||
132 | 2: BACKOFF_SPIN(%o2, %o3, 1b) | ||
133 | ENDPROC(atomic64_dec_if_positive) | ||