1 /* atomic.S: These things are too big to do inline.
3 * Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net)
7 #include <asm/backoff.h>
11 /* Two versions of the atomic routines, one that
12 * does not return a value and does not perform
13 * memory barriers, and a second which returns
14 * a value and does the barriers.
17 .type atomic_add,#function
18 atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
28 2: BACKOFF_SPIN(%o2, %o3, 1b)
29 .size atomic_add, .-atomic_add
32 .type atomic_sub,#function
33 atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */
43 2: BACKOFF_SPIN(%o2, %o3, 1b)
44 .size atomic_sub, .-atomic_sub
47 .type atomic_add_ret,#function
48 atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
59 2: BACKOFF_SPIN(%o2, %o3, 1b)
60 .size atomic_add_ret, .-atomic_add_ret
63 .type atomic_sub_ret,#function
64 atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
75 2: BACKOFF_SPIN(%o2, %o3, 1b)
76 .size atomic_sub_ret, .-atomic_sub_ret
79 .type atomic64_add,#function
80 atomic64_add: /* %o0 = increment, %o1 = atomic_ptr */
90 2: BACKOFF_SPIN(%o2, %o3, 1b)
91 .size atomic64_add, .-atomic64_add
94 .type atomic64_sub,#function
95 atomic64_sub: /* %o0 = decrement, %o1 = atomic_ptr */
105 2: BACKOFF_SPIN(%o2, %o3, 1b)
106 .size atomic64_sub, .-atomic64_sub
108 .globl atomic64_add_ret
109 .type atomic64_add_ret,#function
110 atomic64_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
121 2: BACKOFF_SPIN(%o2, %o3, 1b)
122 .size atomic64_add_ret, .-atomic64_add_ret
124 .globl atomic64_sub_ret
125 .type atomic64_sub_ret,#function
126 atomic64_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
137 2: BACKOFF_SPIN(%o2, %o3, 1b)
138 .size atomic64_sub_ret, .-atomic64_sub_ret