Linux 3.9-rc4
[linux-2.6/cjktty.git] / include / asm-generic / bitops / find.h
blob71c778033f575e53b106c0fa649202d0a6a5ee3a
1 #ifndef _ASM_GENERIC_BITOPS_FIND_H_
2 #define _ASM_GENERIC_BITOPS_FIND_H_
4 #ifndef find_next_bit
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
11 extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
12 size, unsigned long offset);
13 #endif
15 #ifndef find_next_zero_bit
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
22 extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
23 long size, unsigned long offset);
24 #endif
26 #ifdef CONFIG_GENERIC_FIND_FIRST_BIT
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
33 * Returns the bit number of the first set bit.
35 extern unsigned long find_first_bit(const unsigned long *addr,
36 unsigned long size);
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
43 * Returns the bit number of the first cleared bit.
45 extern unsigned long find_first_zero_bit(const unsigned long *addr,
46 unsigned long size);
47 #else /* CONFIG_GENERIC_FIND_FIRST_BIT */
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)
52 #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
54 #endif /*_ASM_GENERIC_BITOPS_FIND_H_ */