1 /* $Id: atomic.S,v 1.4 2001/11/18 00:12:56 davem Exp $
2 * atomic.S: These things are too big to do inline.
4 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
7 #include <linux/config.h>
10 /* On SMP we need to use memory barriers to ensure
11 * correct memory operation ordering, nop these out
15 #define ATOMIC_PRE_BARRIER membar #StoreLoad | #LoadLoad
16 #define ATOMIC_POST_BARRIER membar #StoreLoad | #StoreStore
18 #define ATOMIC_PRE_BARRIER nop
19 #define ATOMIC_POST_BARRIER nop
24 .globl atomic_impl_begin, atomic_impl_end
26 /* Two versions of the atomic routines, one that
27 * does not return a value and does not perform
28 * memory barriers, and a second which returns
29 * a value and does the barriers.
32 .type atomic_add,#function
33 atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
42 .size atomic_add, .-atomic_add
45 .type atomic_sub,#function
46 atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */
55 .size atomic_sub, .-atomic_sub
58 .type atomic_add_ret,#function
59 atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
70 .size atomic_add_ret, .-atomic_add_ret
73 .type atomic_sub_ret,#function
74 atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
85 .size atomic_sub_ret, .-atomic_sub_ret