aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/sync_bitops.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2008-03-14 03:56:32 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:13 -0400
commitf7d909d5475bb27d261389a3902860e086b0d4c9 (patch)
treebde83b375fd4df1ec41e0665ea6fc705e6bc5b48 /include/asm-x86/sync_bitops.h
parentacb5b8a2dd0f901463d075382ea548935e679f4e (diff)
x86: simplify sync_test_bit()
There really is no need for a redundant implementation here, just keep the alternative name for allowing consumers to use consistent naming. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/sync_bitops.h')
-rw-r--r--include/asm-x86/sync_bitops.h21
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
126static __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
132static 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