Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 1 | #ifndef _ASM_GENERIC_BITOPS_FIND_H_ |
| 2 | #define _ASM_GENERIC_BITOPS_FIND_H_ |
| 3 | |
Alexander van Heukelum | 64970b6 | 2008-03-11 16:17:19 +0100 | [diff] [blame] | 4 | #ifndef CONFIG_GENERIC_FIND_NEXT_BIT |
Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 5 | extern unsigned long find_next_bit(const unsigned long *addr, unsigned long |
| 6 | size, unsigned long offset); |
| 7 | |
| 8 | extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned |
| 9 | long size, unsigned long offset); |
Alexander van Heukelum | 64970b6 | 2008-03-11 16:17:19 +0100 | [diff] [blame] | 10 | #endif |
Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 11 | |
Akinobu Mita | 708ff2a | 2010-09-29 18:08:50 +0900 | [diff] [blame^] | 12 | #ifdef CONFIG_GENERIC_FIND_FIRST_BIT |
| 13 | |
| 14 | /** |
| 15 | * find_first_bit - find the first set bit in a memory region |
| 16 | * @addr: The address to start the search at |
| 17 | * @size: The maximum size to search |
| 18 | * |
| 19 | * Returns the bit number of the first set bit. |
| 20 | */ |
| 21 | extern unsigned long find_first_bit(const unsigned long *addr, |
| 22 | unsigned long size); |
| 23 | |
| 24 | /** |
| 25 | * find_first_zero_bit - find the first cleared bit in a memory region |
| 26 | * @addr: The address to start the search at |
| 27 | * @size: The maximum size to search |
| 28 | * |
| 29 | * Returns the bit number of the first cleared bit. |
| 30 | */ |
| 31 | extern unsigned long find_first_zero_bit(const unsigned long *addr, |
| 32 | unsigned long size); |
| 33 | #else /* CONFIG_GENERIC_FIND_FIRST_BIT */ |
| 34 | |
Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 35 | #define find_first_bit(addr, size) find_next_bit((addr), (size), 0) |
| 36 | #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0) |
| 37 | |
Akinobu Mita | 708ff2a | 2010-09-29 18:08:50 +0900 | [diff] [blame^] | 38 | #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ |
| 39 | |
Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 40 | #endif /*_ASM_GENERIC_BITOPS_FIND_H_ */ |