aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/atomic_ops.txt14
-rw-r--r--Documentation/memory-barriers.txt14
-rw-r--r--include/asm-alpha/bitops.h1
-rw-r--r--include/asm-arm/bitops.h1
-rw-r--r--include/asm-avr32/bitops.h1
-rw-r--r--include/asm-blackfin/bitops.h1
-rw-r--r--include/asm-cris/bitops.h1
-rw-r--r--include/asm-frv/bitops.h1
-rw-r--r--include/asm-generic/bitops.h1
-rw-r--r--include/asm-generic/bitops/lock.h45
-rw-r--r--include/asm-h8300/bitops.h1
-rw-r--r--include/asm-ia64/bitops.h2
-rw-r--r--include/asm-m32r/bitops.h1
-rw-r--r--include/asm-m68k/bitops.h1
-rw-r--r--include/asm-m68knommu/bitops.h1
-rw-r--r--include/asm-mips/bitops.h1
-rw-r--r--include/asm-parisc/bitops.h1
-rw-r--r--include/asm-powerpc/bitops.h1
-rw-r--r--include/asm-s390/bitops.h1
-rw-r--r--include/asm-sh/bitops.h1
-rw-r--r--include/asm-sh64/bitops.h1
-rw-r--r--include/asm-sparc/bitops.h1
-rw-r--r--include/asm-sparc64/bitops.h1
-rw-r--r--include/asm-v850/bitops.h1
-rw-r--r--include/asm-x86/bitops_32.h1
-rw-r--r--include/asm-x86/bitops_64.h1
-rw-r--r--include/asm-xtensa/bitops.h1
27 files changed, 96 insertions, 2 deletions
diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt
index d46306fea230..f20c10c2858f 100644
--- a/Documentation/atomic_ops.txt
+++ b/Documentation/atomic_ops.txt
@@ -418,6 +418,20 @@ brothers:
418 */ 418 */
419 smp_mb__after_clear_bit(); 419 smp_mb__after_clear_bit();
420 420
421There are two special bitops with lock barrier semantics (acquire/release,
422same as spinlocks). These operate in the same way as their non-_lock/unlock
423postfixed variants, except that they are to provide acquire/release semantics,
424respectively. This means they can be used for bit_spin_trylock and
425bit_spin_unlock type operations without specifying any more barriers.
426
427 int test_and_set_bit_lock(unsigned long nr, unsigned long *addr);
428 void clear_bit_unlock(unsigned long nr, unsigned long *addr);
429 void __clear_bit_unlock(unsigned long nr, unsigned long *addr);
430
431The __clear_bit_unlock version is non-atomic, however it still implements
432unlock barrier semantics. This can be useful if the lock itself is protecting
433the other bits in the word.
434
421Finally, there are non-atomic versions of the bitmask operations 435Finally, there are non-atomic versions of the bitmask operations
422provided. They are used in contexts where some other higher-level SMP 436provided. They are used in contexts where some other higher-level SMP
423locking scheme is being used to protect the bitmask, and thus less 437locking scheme is being used to protect the bitmask, and thus less
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 650657c54733..4e17beba2379 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -1479,7 +1479,8 @@ kernel.
1479 1479
1480Any atomic operation that modifies some state in memory and returns information 1480Any atomic operation that modifies some state in memory and returns information
1481about the state (old or new) implies an SMP-conditional general memory barrier 1481about the state (old or new) implies an SMP-conditional general memory barrier
1482(smp_mb()) on each side of the actual operation. These include: 1482(smp_mb()) on each side of the actual operation (with the exception of
1483explicit lock operations, described later). These include:
1483 1484
1484 xchg(); 1485 xchg();
1485 cmpxchg(); 1486 cmpxchg();
@@ -1536,10 +1537,19 @@ If they're used for constructing a lock of some description, then they probably
1536do need memory barriers as a lock primitive generally has to do things in a 1537do need memory barriers as a lock primitive generally has to do things in a
1537specific order. 1538specific order.
1538 1539
1539
1540Basically, each usage case has to be carefully considered as to whether memory 1540Basically, each usage case has to be carefully considered as to whether memory
1541barriers are needed or not. 1541barriers are needed or not.
1542 1542
1543The following operations are special locking primitives:
1544
1545 test_and_set_bit_lock();
1546 clear_bit_unlock();
1547 __clear_bit_unlock();
1548
1549These implement LOCK-class and UNLOCK-class operations. These should be used in
1550preference to other operations when implementing locking primitives, because
1551their implementations can be optimised on many architectures.
1552
1543[!] Note that special memory barrier primitives are available for these 1553[!] Note that special memory barrier primitives are available for these
1544situations because on some CPUs the atomic instructions used imply full memory 1554situations because on some CPUs the atomic instructions used imply full memory
1545barriers, and so barrier instructions are superfluous in conjunction with them, 1555barriers, and so barrier instructions are superfluous in conjunction with them,
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 9e71201000d5..ca667d121898 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -367,6 +367,7 @@ static inline unsigned int hweight8(unsigned int w)
367#else 367#else
368#include <asm-generic/bitops/hweight.h> 368#include <asm-generic/bitops/hweight.h>
369#endif 369#endif
370#include <asm-generic/bitops/lock.h>
370 371
371#endif /* __KERNEL__ */ 372#endif /* __KERNEL__ */
372 373
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
index b41831b6432f..52fe05895deb 100644
--- a/include/asm-arm/bitops.h
+++ b/include/asm-arm/bitops.h
@@ -286,6 +286,7 @@ static inline int constant_fls(int x)
286 286
287#include <asm-generic/bitops/sched.h> 287#include <asm-generic/bitops/sched.h>
288#include <asm-generic/bitops/hweight.h> 288#include <asm-generic/bitops/hweight.h>
289#include <asm-generic/bitops/lock.h>
289 290
290/* 291/*
291 * Ext2 is defined to use little-endian byte ordering. 292 * Ext2 is defined to use little-endian byte ordering.
diff --git a/include/asm-avr32/bitops.h b/include/asm-avr32/bitops.h
index 5299f8c8e11d..f3faddfd46a8 100644
--- a/include/asm-avr32/bitops.h
+++ b/include/asm-avr32/bitops.h
@@ -288,6 +288,7 @@ static inline int ffs(unsigned long word)
288#include <asm-generic/bitops/fls64.h> 288#include <asm-generic/bitops/fls64.h>
289#include <asm-generic/bitops/sched.h> 289#include <asm-generic/bitops/sched.h>
290#include <asm-generic/bitops/hweight.h> 290#include <asm-generic/bitops/hweight.h>
291#include <asm-generic/bitops/lock.h>
291 292
292#include <asm-generic/bitops/ext2-non-atomic.h> 293#include <asm-generic/bitops/ext2-non-atomic.h>
293#include <asm-generic/bitops/ext2-atomic.h> 294#include <asm-generic/bitops/ext2-atomic.h>
diff --git a/include/asm-blackfin/bitops.h b/include/asm-blackfin/bitops.h
index 27c2d0e48e1b..03ecedc1f2a7 100644
--- a/include/asm-blackfin/bitops.h
+++ b/include/asm-blackfin/bitops.h
@@ -199,6 +199,7 @@ static __inline__ int __test_bit(int nr, const void *addr)
199 199
200#include <asm-generic/bitops/find.h> 200#include <asm-generic/bitops/find.h>
201#include <asm-generic/bitops/hweight.h> 201#include <asm-generic/bitops/hweight.h>
202#include <asm-generic/bitops/lock.h>
202 203
203#include <asm-generic/bitops/ext2-atomic.h> 204#include <asm-generic/bitops/ext2-atomic.h>
204#include <asm-generic/bitops/ext2-non-atomic.h> 205#include <asm-generic/bitops/ext2-non-atomic.h>
diff --git a/include/asm-cris/bitops.h b/include/asm-cris/bitops.h
index a569065113d9..617151b9b72b 100644
--- a/include/asm-cris/bitops.h
+++ b/include/asm-cris/bitops.h
@@ -154,6 +154,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
154#include <asm-generic/bitops/fls64.h> 154#include <asm-generic/bitops/fls64.h>
155#include <asm-generic/bitops/hweight.h> 155#include <asm-generic/bitops/hweight.h>
156#include <asm-generic/bitops/find.h> 156#include <asm-generic/bitops/find.h>
157#include <asm-generic/bitops/lock.h>
157 158
158#include <asm-generic/bitops/ext2-non-atomic.h> 159#include <asm-generic/bitops/ext2-non-atomic.h>
159 160
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h
index f8560edf59ff..8dba74b1a254 100644
--- a/include/asm-frv/bitops.h
+++ b/include/asm-frv/bitops.h
@@ -302,6 +302,7 @@ int __ilog2_u64(u64 n)
302 302
303#include <asm-generic/bitops/sched.h> 303#include <asm-generic/bitops/sched.h>
304#include <asm-generic/bitops/hweight.h> 304#include <asm-generic/bitops/hweight.h>
305#include <asm-generic/bitops/lock.h>
305 306
306#include <asm-generic/bitops/ext2-non-atomic.h> 307#include <asm-generic/bitops/ext2-non-atomic.h>
307 308
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index 1f9d99193df8..e022a0f59e6b 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -22,6 +22,7 @@
22#include <asm-generic/bitops/sched.h> 22#include <asm-generic/bitops/sched.h>
23#include <asm-generic/bitops/ffs.h> 23#include <asm-generic/bitops/ffs.h>
24#include <asm-generic/bitops/hweight.h> 24#include <asm-generic/bitops/hweight.h>
25#include <asm-generic/bitops/lock.h>
25 26
26#include <asm-generic/bitops/ext2-non-atomic.h> 27#include <asm-generic/bitops/ext2-non-atomic.h>
27#include <asm-generic/bitops/ext2-atomic.h> 28#include <asm-generic/bitops/ext2-atomic.h>
diff --git a/include/asm-generic/bitops/lock.h b/include/asm-generic/bitops/lock.h
new file mode 100644
index 000000000000..308a9e22c802
--- /dev/null
+++ b/include/asm-generic/bitops/lock.h
@@ -0,0 +1,45 @@
1#ifndef _ASM_GENERIC_BITOPS_LOCK_H_
2#define _ASM_GENERIC_BITOPS_LOCK_H_
3
4/**
5 * test_and_set_bit_lock - Set a bit and return its old value, for lock
6 * @nr: Bit to set
7 * @addr: Address to count from
8 *
9 * This operation is atomic and provides acquire barrier semantics.
10 * It can be used to implement bit locks.
11 */
12#define test_and_set_bit_lock(nr, addr) test_and_set_bit(nr, addr)
13
14/**
15 * clear_bit_unlock - Clear a bit in memory, for unlock
16 * @nr: the bit to set
17 * @addr: the address to start counting from
18 *
19 * This operation is atomic and provides release barrier semantics.
20 */
21#define clear_bit_unlock(nr, addr) \
22do { \
23 smp_mb__before_clear_bit(); \
24 clear_bit(nr, addr); \
25} while (0)
26
27/**
28 * __clear_bit_unlock - Clear a bit in memory, for unlock
29 * @nr: the bit to set
30 * @addr: the address to start counting from
31 *
32 * This operation is like clear_bit_unlock, however it is not atomic.
33 * It does provide release barrier semantics so it can be used to unlock
34 * a bit lock, however it would only be used if no other CPU can modify
35 * any bits in the memory until the lock is released (a good example is
36 * if the bit lock itself protects access to the other bits in the word).
37 */
38#define __clear_bit_unlock(nr, addr) \
39do { \
40 smp_mb(); \
41 __clear_bit(nr, addr); \
42} while (0)
43
44#endif /* _ASM_GENERIC_BITOPS_LOCK_H_ */
45
diff --git a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h
index d76299c98b81..e64ad315656d 100644
--- a/include/asm-h8300/bitops.h
+++ b/include/asm-h8300/bitops.h
@@ -194,6 +194,7 @@ static __inline__ unsigned long __ffs(unsigned long word)
194#include <asm-generic/bitops/find.h> 194#include <asm-generic/bitops/find.h>
195#include <asm-generic/bitops/sched.h> 195#include <asm-generic/bitops/sched.h>
196#include <asm-generic/bitops/hweight.h> 196#include <asm-generic/bitops/hweight.h>
197#include <asm-generic/bitops/lock.h>
197#include <asm-generic/bitops/ext2-non-atomic.h> 198#include <asm-generic/bitops/ext2-non-atomic.h>
198#include <asm-generic/bitops/ext2-atomic.h> 199#include <asm-generic/bitops/ext2-atomic.h>
199#include <asm-generic/bitops/minix.h> 200#include <asm-generic/bitops/minix.h>
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h
index 6cc517e212a9..569dd62fe192 100644
--- a/include/asm-ia64/bitops.h
+++ b/include/asm-ia64/bitops.h
@@ -371,6 +371,8 @@ hweight64 (unsigned long x)
371#define hweight16(x) (unsigned int) hweight64((x) & 0xfffful) 371#define hweight16(x) (unsigned int) hweight64((x) & 0xfffful)
372#define hweight8(x) (unsigned int) hweight64((x) & 0xfful) 372#define hweight8(x) (unsigned int) hweight64((x) & 0xfful)
373 373
374#include <asm-generic/bitops/lock.h>
375
374#endif /* __KERNEL__ */ 376#endif /* __KERNEL__ */
375 377
376#include <asm-generic/bitops/find.h> 378#include <asm-generic/bitops/find.h>
diff --git a/include/asm-m32r/bitops.h b/include/asm-m32r/bitops.h
index 66ab672162cd..313a02c4a889 100644
--- a/include/asm-m32r/bitops.h
+++ b/include/asm-m32r/bitops.h
@@ -255,6 +255,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
255#include <asm-generic/bitops/find.h> 255#include <asm-generic/bitops/find.h>
256#include <asm-generic/bitops/ffs.h> 256#include <asm-generic/bitops/ffs.h>
257#include <asm-generic/bitops/hweight.h> 257#include <asm-generic/bitops/hweight.h>
258#include <asm-generic/bitops/lock.h>
258 259
259#endif /* __KERNEL__ */ 260#endif /* __KERNEL__ */
260 261
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index 1a61fdb56aaf..da151f70cdc6 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -314,6 +314,7 @@ static inline int fls(int x)
314#include <asm-generic/bitops/fls64.h> 314#include <asm-generic/bitops/fls64.h>
315#include <asm-generic/bitops/sched.h> 315#include <asm-generic/bitops/sched.h>
316#include <asm-generic/bitops/hweight.h> 316#include <asm-generic/bitops/hweight.h>
317#include <asm-generic/bitops/lock.h>
317 318
318/* Bitmap functions for the minix filesystem */ 319/* Bitmap functions for the minix filesystem */
319 320
diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h
index 7d6075d9b5cb..b8b2770d6870 100644
--- a/include/asm-m68knommu/bitops.h
+++ b/include/asm-m68knommu/bitops.h
@@ -160,6 +160,7 @@ static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
160 160
161#include <asm-generic/bitops/find.h> 161#include <asm-generic/bitops/find.h>
162#include <asm-generic/bitops/hweight.h> 162#include <asm-generic/bitops/hweight.h>
163#include <asm-generic/bitops/lock.h>
163 164
164static __inline__ int ext2_set_bit(int nr, volatile void * addr) 165static __inline__ int ext2_set_bit(int nr, volatile void * addr)
165{ 166{
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 899357a72ac4..0d3373f64920 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -556,6 +556,7 @@ static inline int ffs(int word)
556 556
557#include <asm-generic/bitops/sched.h> 557#include <asm-generic/bitops/sched.h>
558#include <asm-generic/bitops/hweight.h> 558#include <asm-generic/bitops/hweight.h>
559#include <asm-generic/bitops/lock.h>
559#include <asm-generic/bitops/ext2-non-atomic.h> 560#include <asm-generic/bitops/ext2-non-atomic.h>
560#include <asm-generic/bitops/ext2-atomic.h> 561#include <asm-generic/bitops/ext2-atomic.h>
561#include <asm-generic/bitops/minix.h> 562#include <asm-generic/bitops/minix.h>
diff --git a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h
index 015cb0d379bd..03ae287baf89 100644
--- a/include/asm-parisc/bitops.h
+++ b/include/asm-parisc/bitops.h
@@ -208,6 +208,7 @@ static __inline__ int fls(int x)
208 208
209#include <asm-generic/bitops/fls64.h> 209#include <asm-generic/bitops/fls64.h>
210#include <asm-generic/bitops/hweight.h> 210#include <asm-generic/bitops/hweight.h>
211#include <asm-generic/bitops/lock.h>
211#include <asm-generic/bitops/sched.h> 212#include <asm-generic/bitops/sched.h>
212 213
213#endif /* __KERNEL__ */ 214#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index 8144a2788db6..1d4c16613d2f 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -266,6 +266,7 @@ static __inline__ int fls(unsigned int x)
266#include <asm-generic/bitops/fls64.h> 266#include <asm-generic/bitops/fls64.h>
267 267
268#include <asm-generic/bitops/hweight.h> 268#include <asm-generic/bitops/hweight.h>
269#include <asm-generic/bitops/lock.h>
269 270
270#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0) 271#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
271unsigned long find_next_zero_bit(const unsigned long *addr, 272unsigned long find_next_zero_bit(const unsigned long *addr,
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index f79c9b792af1..d756b34d25f3 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -746,6 +746,7 @@ static inline int sched_find_first_bit(unsigned long *b)
746#include <asm-generic/bitops/fls64.h> 746#include <asm-generic/bitops/fls64.h>
747 747
748#include <asm-generic/bitops/hweight.h> 748#include <asm-generic/bitops/hweight.h>
749#include <asm-generic/bitops/lock.h>
749 750
750/* 751/*
751 * ATTENTION: intel byte ordering convention for ext2 and minix !! 752 * ATTENTION: intel byte ordering convention for ext2 and minix !!
diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h
index 1c16792cee1d..9d7021723a25 100644
--- a/include/asm-sh/bitops.h
+++ b/include/asm-sh/bitops.h
@@ -137,6 +137,7 @@ static inline unsigned long __ffs(unsigned long word)
137#include <asm-generic/bitops/find.h> 137#include <asm-generic/bitops/find.h>
138#include <asm-generic/bitops/ffs.h> 138#include <asm-generic/bitops/ffs.h>
139#include <asm-generic/bitops/hweight.h> 139#include <asm-generic/bitops/hweight.h>
140#include <asm-generic/bitops/lock.h>
140#include <asm-generic/bitops/sched.h> 141#include <asm-generic/bitops/sched.h>
141#include <asm-generic/bitops/ext2-non-atomic.h> 142#include <asm-generic/bitops/ext2-non-atomic.h>
142#include <asm-generic/bitops/ext2-atomic.h> 143#include <asm-generic/bitops/ext2-atomic.h>
diff --git a/include/asm-sh64/bitops.h b/include/asm-sh64/bitops.h
index f3bdcdb5d046..444d5ea92ce9 100644
--- a/include/asm-sh64/bitops.h
+++ b/include/asm-sh64/bitops.h
@@ -136,6 +136,7 @@ static __inline__ unsigned long ffz(unsigned long word)
136#include <asm-generic/bitops/__ffs.h> 136#include <asm-generic/bitops/__ffs.h>
137#include <asm-generic/bitops/find.h> 137#include <asm-generic/bitops/find.h>
138#include <asm-generic/bitops/hweight.h> 138#include <asm-generic/bitops/hweight.h>
139#include <asm-generic/bitops/lock.h>
139#include <asm-generic/bitops/sched.h> 140#include <asm-generic/bitops/sched.h>
140#include <asm-generic/bitops/ffs.h> 141#include <asm-generic/bitops/ffs.h>
141#include <asm-generic/bitops/ext2-non-atomic.h> 142#include <asm-generic/bitops/ext2-non-atomic.h>
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h
index 329e696e7751..00bd0a679d70 100644
--- a/include/asm-sparc/bitops.h
+++ b/include/asm-sparc/bitops.h
@@ -96,6 +96,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
96#include <asm-generic/bitops/fls.h> 96#include <asm-generic/bitops/fls.h>
97#include <asm-generic/bitops/fls64.h> 97#include <asm-generic/bitops/fls64.h>
98#include <asm-generic/bitops/hweight.h> 98#include <asm-generic/bitops/hweight.h>
99#include <asm-generic/bitops/lock.h>
99#include <asm-generic/bitops/find.h> 100#include <asm-generic/bitops/find.h>
100#include <asm-generic/bitops/ext2-non-atomic.h> 101#include <asm-generic/bitops/ext2-non-atomic.h>
101#include <asm-generic/bitops/ext2-atomic.h> 102#include <asm-generic/bitops/ext2-atomic.h>
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h
index 3d5e1af84723..dd4bfe993b61 100644
--- a/include/asm-sparc64/bitops.h
+++ b/include/asm-sparc64/bitops.h
@@ -81,6 +81,7 @@ static inline unsigned int hweight8(unsigned int w)
81#include <asm-generic/bitops/hweight.h> 81#include <asm-generic/bitops/hweight.h>
82 82
83#endif 83#endif
84#include <asm-generic/bitops/lock.h>
84#endif /* __KERNEL__ */ 85#endif /* __KERNEL__ */
85 86
86#include <asm-generic/bitops/find.h> 87#include <asm-generic/bitops/find.h>
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h
index 1fa99baf4e25..8eafdb1c08ba 100644
--- a/include/asm-v850/bitops.h
+++ b/include/asm-v850/bitops.h
@@ -145,6 +145,7 @@ static inline int __test_bit (int nr, const void *addr)
145#include <asm-generic/bitops/find.h> 145#include <asm-generic/bitops/find.h>
146#include <asm-generic/bitops/sched.h> 146#include <asm-generic/bitops/sched.h>
147#include <asm-generic/bitops/hweight.h> 147#include <asm-generic/bitops/hweight.h>
148#include <asm-generic/bitops/lock.h>
148 149
149#include <asm-generic/bitops/ext2-non-atomic.h> 150#include <asm-generic/bitops/ext2-non-atomic.h>
150#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) 151#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
diff --git a/include/asm-x86/bitops_32.h b/include/asm-x86/bitops_32.h
index a20fe9822f60..c96641f75022 100644
--- a/include/asm-x86/bitops_32.h
+++ b/include/asm-x86/bitops_32.h
@@ -402,6 +402,7 @@ static inline int fls(int x)
402} 402}
403 403
404#include <asm-generic/bitops/hweight.h> 404#include <asm-generic/bitops/hweight.h>
405#include <asm-generic/bitops/lock.h>
405 406
406#endif /* __KERNEL__ */ 407#endif /* __KERNEL__ */
407 408
diff --git a/include/asm-x86/bitops_64.h b/include/asm-x86/bitops_64.h
index 1d7d9b4bcacb..525edf2ce5c2 100644
--- a/include/asm-x86/bitops_64.h
+++ b/include/asm-x86/bitops_64.h
@@ -408,6 +408,7 @@ static __inline__ int fls(int x)
408#define ARCH_HAS_FAST_MULTIPLIER 1 408#define ARCH_HAS_FAST_MULTIPLIER 1
409 409
410#include <asm-generic/bitops/hweight.h> 410#include <asm-generic/bitops/hweight.h>
411#include <asm-generic/bitops/lock.h>
411 412
412#endif /* __KERNEL__ */ 413#endif /* __KERNEL__ */
413 414
diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h
index 1c1e0d933eea..78db04cf6e48 100644
--- a/include/asm-xtensa/bitops.h
+++ b/include/asm-xtensa/bitops.h
@@ -108,6 +108,7 @@ static inline int fls (unsigned int x)
108#endif 108#endif
109 109
110#include <asm-generic/bitops/hweight.h> 110#include <asm-generic/bitops/hweight.h>
111#include <asm-generic/bitops/lock.h>
111#include <asm-generic/bitops/sched.h> 112#include <asm-generic/bitops/sched.h>
112#include <asm-generic/bitops/minix.h> 113#include <asm-generic/bitops/minix.h>
113 114