xref: /openbmc/linux/include/asm-generic/bitops.h (revision 9858c60c)
19858c60cSArnd Bergmann #ifndef __ASM_GENERIC_BITOPS_H
29858c60cSArnd Bergmann #define __ASM_GENERIC_BITOPS_H
31da177e4SLinus Torvalds 
41da177e4SLinus Torvalds /*
51da177e4SLinus Torvalds  * For the benefit of those who are trying to port Linux to another
61da177e4SLinus Torvalds  * architecture, here are some C-language equivalents.  You should
71da177e4SLinus Torvalds  * recode these in the native assembly language, if at all possible.
81da177e4SLinus Torvalds  *
91da177e4SLinus Torvalds  * C language equivalents written by Theodore Ts'o, 9/26/92
101da177e4SLinus Torvalds  */
111da177e4SLinus Torvalds 
129858c60cSArnd Bergmann #include <linux/irqflags.h>
139858c60cSArnd Bergmann #include <linux/compiler.h>
149858c60cSArnd Bergmann 
159858c60cSArnd Bergmann /*
169858c60cSArnd Bergmann  * clear_bit may not imply a memory barrier
179858c60cSArnd Bergmann  */
189858c60cSArnd Bergmann #ifndef smp_mb__before_clear_bit
199858c60cSArnd Bergmann #define smp_mb__before_clear_bit()	smp_mb()
209858c60cSArnd Bergmann #define smp_mb__after_clear_bit()	smp_mb()
219858c60cSArnd Bergmann #endif
229858c60cSArnd Bergmann 
23f51a05c1SAkinobu Mita #include <asm-generic/bitops/__ffs.h>
24f51a05c1SAkinobu Mita #include <asm-generic/bitops/ffz.h>
25f51a05c1SAkinobu Mita #include <asm-generic/bitops/fls.h>
269858c60cSArnd Bergmann #include <asm-generic/bitops/__fls.h>
27f51a05c1SAkinobu Mita #include <asm-generic/bitops/fls64.h>
28f51a05c1SAkinobu Mita #include <asm-generic/bitops/find.h>
291da177e4SLinus Torvalds 
300624517dSJiri Slaby #ifndef _LINUX_BITOPS_H
310624517dSJiri Slaby #error only <linux/bitops.h> can be included directly
320624517dSJiri Slaby #endif
330624517dSJiri Slaby 
34f51a05c1SAkinobu Mita #include <asm-generic/bitops/sched.h>
35f51a05c1SAkinobu Mita #include <asm-generic/bitops/ffs.h>
36f51a05c1SAkinobu Mita #include <asm-generic/bitops/hweight.h>
3726333576SNick Piggin #include <asm-generic/bitops/lock.h>
381da177e4SLinus Torvalds 
399858c60cSArnd Bergmann #include <asm-generic/bitops/atomic.h>
409858c60cSArnd Bergmann #include <asm-generic/bitops/non-atomic.h>
41f51a05c1SAkinobu Mita #include <asm-generic/bitops/ext2-non-atomic.h>
42f51a05c1SAkinobu Mita #include <asm-generic/bitops/ext2-atomic.h>
43f51a05c1SAkinobu Mita #include <asm-generic/bitops/minix.h>
441da177e4SLinus Torvalds 
459858c60cSArnd Bergmann #endif /* __ASM_GENERIC_BITOPS_H */
46