1 /* bitops.S: Sparc64 atomic bit operations.
3 * Copyright (C) 2000, 2007 David S. Miller (davem@davemloft.net)
7 #include <asm/backoff.h>
11 /* On SMP we need to use memory barriers to ensure
12 * correct memory operation ordering, nop these out
17 #define BITOP_PRE_BARRIER membar #StoreLoad | #LoadLoad
18 #define BITOP_POST_BARRIER \
20 membar #StoreLoad | #StoreStore
25 #define BITOP_PRE_BARRIER
26 #define BITOP_POST_BARRIER
29 .globl test_and_set_bit
30 .type test_and_set_bit,#function
31 test_and_set_bit: /* %o0=nr, %o1=addr */
51 2: BACKOFF_SPIN(%o3, %o4, 1b)
52 .size test_and_set_bit, .-test_and_set_bit
54 .globl test_and_clear_bit
55 .type test_and_clear_bit,#function
56 test_and_clear_bit: /* %o0=nr, %o1=addr */
76 2: BACKOFF_SPIN(%o3, %o4, 1b)
77 .size test_and_clear_bit, .-test_and_clear_bit
79 .globl test_and_change_bit
80 .type test_and_change_bit,#function
81 test_and_change_bit: /* %o0=nr, %o1=addr */
101 2: BACKOFF_SPIN(%o3, %o4, 1b)
102 .size test_and_change_bit, .-test_and_change_bit
105 .type set_bit,#function
106 set_bit: /* %o0=nr, %o1=addr */
122 2: BACKOFF_SPIN(%o3, %o4, 1b)
123 .size set_bit, .-set_bit
126 .type clear_bit,#function
127 clear_bit: /* %o0=nr, %o1=addr */
143 2: BACKOFF_SPIN(%o3, %o4, 1b)
144 .size clear_bit, .-clear_bit
147 .type change_bit,#function
148 change_bit: /* %o0=nr, %o1=addr */
164 2: BACKOFF_SPIN(%o3, %o4, 1b)
165 .size change_bit, .-change_bit