Linux Audio

Check our new training course

Loading...
v3.15
 
 1#ifndef _ASM_GENERIC_BITOPS_FIND_H_
 2#define _ASM_GENERIC_BITOPS_FIND_H_
 3
 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
10 *
11 * Returns the bit number for the next set bit
12 * If no bits are set, returns @size.
13 */
14extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
15		size, unsigned long offset);
16#endif
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18#ifndef find_next_zero_bit
19/**
20 * find_next_zero_bit - find the next cleared bit in a memory region
21 * @addr: The address to base the search on
22 * @offset: The bitnumber to start searching at
23 * @size: The bitmap size in bits
24 *
25 * Returns the bit number of the next zero bit
26 * If no bits are zero, returns @size.
27 */
28extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
29		long size, unsigned long offset);
30#endif
31
32#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
33
34/**
35 * find_first_bit - find the first set bit in a memory region
36 * @addr: The address to start the search at
37 * @size: The maximum number of bits to search
38 *
39 * Returns the bit number of the first set bit.
40 * If no bits are set, returns @size.
41 */
42extern unsigned long find_first_bit(const unsigned long *addr,
43				    unsigned long size);
44
45/**
46 * find_first_zero_bit - find the first cleared bit in a memory region
47 * @addr: The address to start the search at
48 * @size: The maximum number of bits to search
49 *
50 * Returns the bit number of the first cleared bit.
51 * If no bits are zero, returns @size.
52 */
53extern unsigned long find_first_zero_bit(const unsigned long *addr,
54					 unsigned long size);
55#else /* CONFIG_GENERIC_FIND_FIRST_BIT */
56
 
57#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
 
 
58#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
 
59
60#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
61
62#endif /*_ASM_GENERIC_BITOPS_FIND_H_ */
v4.17
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _ASM_GENERIC_BITOPS_FIND_H_
 3#define _ASM_GENERIC_BITOPS_FIND_H_
 4
 5#ifndef find_next_bit
 6/**
 7 * find_next_bit - find the next set bit in a memory region
 8 * @addr: The address to base the search on
 9 * @offset: The bitnumber to start searching at
10 * @size: The bitmap size in bits
11 *
12 * Returns the bit number for the next set bit
13 * If no bits are set, returns @size.
14 */
15extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
16		size, unsigned long offset);
17#endif
18
19#ifndef find_next_and_bit
20/**
21 * find_next_and_bit - find the next set bit in both memory regions
22 * @addr1: The first address to base the search on
23 * @addr2: The second address to base the search on
24 * @offset: The bitnumber to start searching at
25 * @size: The bitmap size in bits
26 *
27 * Returns the bit number for the next set bit
28 * If no bits are set, returns @size.
29 */
30extern unsigned long find_next_and_bit(const unsigned long *addr1,
31		const unsigned long *addr2, unsigned long size,
32		unsigned long offset);
33#endif
34
35#ifndef find_next_zero_bit
36/**
37 * find_next_zero_bit - find the next cleared bit in a memory region
38 * @addr: The address to base the search on
39 * @offset: The bitnumber to start searching at
40 * @size: The bitmap size in bits
41 *
42 * Returns the bit number of the next zero bit
43 * If no bits are zero, returns @size.
44 */
45extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
46		long size, unsigned long offset);
47#endif
48
49#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
50
51/**
52 * find_first_bit - find the first set bit in a memory region
53 * @addr: The address to start the search at
54 * @size: The maximum number of bits to search
55 *
56 * Returns the bit number of the first set bit.
57 * If no bits are set, returns @size.
58 */
59extern unsigned long find_first_bit(const unsigned long *addr,
60				    unsigned long size);
61
62/**
63 * find_first_zero_bit - find the first cleared bit in a memory region
64 * @addr: The address to start the search at
65 * @size: The maximum number of bits to search
66 *
67 * Returns the bit number of the first cleared bit.
68 * If no bits are zero, returns @size.
69 */
70extern unsigned long find_first_zero_bit(const unsigned long *addr,
71					 unsigned long size);
72#else /* CONFIG_GENERIC_FIND_FIRST_BIT */
73
74#ifndef find_first_bit
75#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
76#endif
77#ifndef find_first_zero_bit
78#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
79#endif
80
81#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
82
83#endif /*_ASM_GENERIC_BITOPS_FIND_H_ */