| 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 |  | 
| Akinobu Mita | d852a6a | 2010-09-29 18:08:51 +0900 | [diff] [blame] | 4 | /** | 
|  | 5 | * find_next_bit - find the next set bit in a memory region | 
|  | 6 | * @addr: The address to base the search on | 
|  | 7 | * @offset: The bitnumber to start searching at | 
|  | 8 | * @size: The bitmap size in bits | 
|  | 9 | */ | 
| Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 10 | extern unsigned long find_next_bit(const unsigned long *addr, unsigned long | 
|  | 11 | size, unsigned long offset); | 
|  | 12 |  | 
| Akinobu Mita | d852a6a | 2010-09-29 18:08:51 +0900 | [diff] [blame] | 13 | /** | 
|  | 14 | * find_next_zero_bit - find the next cleared bit in a memory region | 
|  | 15 | * @addr: The address to base the search on | 
|  | 16 | * @offset: The bitnumber to start searching at | 
|  | 17 | * @size: The bitmap size in bits | 
|  | 18 | */ | 
| Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 19 | extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned | 
|  | 20 | long size, unsigned long offset); | 
| Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 21 |  | 
| Akinobu Mita | 708ff2a | 2010-09-29 18:08:50 +0900 | [diff] [blame] | 22 | #ifdef CONFIG_GENERIC_FIND_FIRST_BIT | 
|  | 23 |  | 
|  | 24 | /** | 
|  | 25 | * find_first_bit - find the first set 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 set bit. | 
|  | 30 | */ | 
|  | 31 | extern unsigned long find_first_bit(const unsigned long *addr, | 
|  | 32 | unsigned long size); | 
|  | 33 |  | 
|  | 34 | /** | 
|  | 35 | * find_first_zero_bit - find the first cleared bit in a memory region | 
|  | 36 | * @addr: The address to start the search at | 
|  | 37 | * @size: The maximum size to search | 
|  | 38 | * | 
|  | 39 | * Returns the bit number of the first cleared bit. | 
|  | 40 | */ | 
|  | 41 | extern unsigned long find_first_zero_bit(const unsigned long *addr, | 
|  | 42 | unsigned long size); | 
|  | 43 | #else /* CONFIG_GENERIC_FIND_FIRST_BIT */ | 
|  | 44 |  | 
| Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 45 | #define find_first_bit(addr, size) find_next_bit((addr), (size), 0) | 
|  | 46 | #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0) | 
|  | 47 |  | 
| Akinobu Mita | 708ff2a | 2010-09-29 18:08:50 +0900 | [diff] [blame] | 48 | #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ | 
|  | 49 |  | 
| Akinobu Mita | c7f612c | 2006-03-26 01:39:11 -0800 | [diff] [blame] | 50 | #endif /*_ASM_GENERIC_BITOPS_FIND_H_ */ |