diff options
-rw-r--r-- | include/asm-x86/sync_bitops.h | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/include/asm-x86/sync_bitops.h b/include/asm-x86/sync_bitops.h index 6b775c905666..bc249f40e0ee 100644 --- a/include/asm-x86/sync_bitops.h +++ b/include/asm-x86/sync_bitops.h | |||
@@ -123,26 +123,7 @@ static inline int sync_test_and_change_bit(int nr, volatile unsigned long* addr) | |||
123 | return oldbit; | 123 | return oldbit; |
124 | } | 124 | } |
125 | 125 | ||
126 | static __always_inline int sync_constant_test_bit(int nr, const volatile unsigned long *addr) | 126 | #define sync_test_bit test_bit |
127 | { | ||
128 | return ((1UL << (nr & 31)) & | ||
129 | (((const volatile unsigned int *)addr)[nr >> 5])) != 0; | ||
130 | } | ||
131 | |||
132 | static inline int sync_var_test_bit(int nr, const volatile unsigned long * addr) | ||
133 | { | ||
134 | int oldbit; | ||
135 | |||
136 | __asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0" | ||
137 | :"=r" (oldbit) | ||
138 | :"m" (ADDR),"Ir" (nr)); | ||
139 | return oldbit; | ||
140 | } | ||
141 | |||
142 | #define sync_test_bit(nr,addr) \ | ||
143 | (__builtin_constant_p(nr) ? \ | ||
144 | sync_constant_test_bit((nr),(addr)) : \ | ||
145 | sync_var_test_bit((nr),(addr))) | ||
146 | 127 | ||
147 | #undef ADDR | 128 | #undef ADDR |
148 | 129 | ||