Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Arnd Bergmann | 9858c60 | 2009-05-13 22:56:32 +0000 | [diff] [blame] | 2 | #ifndef __ASM_GENERIC_BITOPS_H |
| 3 | #define __ASM_GENERIC_BITOPS_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
| 5 | /* |
| 6 | * For the benefit of those who are trying to port Linux to another |
Will Deacon | 5d0c9b0 | 2020-02-13 09:39:27 +0000 | [diff] [blame] | 7 | * architecture, here are some C-language equivalents. They should |
| 8 | * generate reasonable code, so take a look at what your compiler spits |
| 9 | * out before rolling your own buggy implementation in assembly language. |
Arnd Bergmann | 9858c60 | 2009-05-13 22:56:32 +0000 | [diff] [blame] | 10 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | * C language equivalents written by Theodore Ts'o, 9/26/92 |
| 12 | */ |
| 13 | |
Arnd Bergmann | 9858c60 | 2009-05-13 22:56:32 +0000 | [diff] [blame] | 14 | #include <linux/irqflags.h> |
| 15 | #include <linux/compiler.h> |
Peter Zijlstra | febdbfe | 2014-02-06 18:16:07 +0100 | [diff] [blame] | 16 | #include <asm/barrier.h> |
Arnd Bergmann | 9858c60 | 2009-05-13 22:56:32 +0000 | [diff] [blame] | 17 | |
Akinobu Mita | f51a05c | 2006-03-26 01:39:50 -0800 | [diff] [blame] | 18 | #include <asm-generic/bitops/__ffs.h> |
| 19 | #include <asm-generic/bitops/ffz.h> |
| 20 | #include <asm-generic/bitops/fls.h> |
Arnd Bergmann | 9858c60 | 2009-05-13 22:56:32 +0000 | [diff] [blame] | 21 | #include <asm-generic/bitops/__fls.h> |
Akinobu Mita | f51a05c | 2006-03-26 01:39:50 -0800 | [diff] [blame] | 22 | #include <asm-generic/bitops/fls64.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
Jiri Slaby | 0624517 | 2007-10-18 23:40:26 -0700 | [diff] [blame] | 24 | #ifndef _LINUX_BITOPS_H |
| 25 | #error only <linux/bitops.h> can be included directly |
| 26 | #endif |
| 27 | |
Akinobu Mita | f51a05c | 2006-03-26 01:39:50 -0800 | [diff] [blame] | 28 | #include <asm-generic/bitops/sched.h> |
| 29 | #include <asm-generic/bitops/ffs.h> |
| 30 | #include <asm-generic/bitops/hweight.h> |
Nick Piggin | 2633357 | 2007-10-18 03:06:39 -0700 | [diff] [blame] | 31 | #include <asm-generic/bitops/lock.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
Arnd Bergmann | 9858c60 | 2009-05-13 22:56:32 +0000 | [diff] [blame] | 33 | #include <asm-generic/bitops/atomic.h> |
| 34 | #include <asm-generic/bitops/non-atomic.h> |
Akinobu Mita | 861b5ae | 2011-03-23 16:42:02 -0700 | [diff] [blame] | 35 | #include <asm-generic/bitops/le.h> |
Akinobu Mita | f51a05c | 2006-03-26 01:39:50 -0800 | [diff] [blame] | 36 | #include <asm-generic/bitops/ext2-atomic.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Arnd Bergmann | 9858c60 | 2009-05-13 22:56:32 +0000 | [diff] [blame] | 38 | #endif /* __ASM_GENERIC_BITOPS_H */ |