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