| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a2812e1 commit 19de85e
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | #ifndef _ASM_GENERIC_BITOPS_FIND_H_ | |
| 2 | 2 | #define _ASM_GENERIC_BITOPS_FIND_H_ | |
| 3 | 3 | ||
| 4 | + #ifndef find_next_bit | ||
| 4 | 5 | /** | |
| 5 | 6 | * find_next_bit - find the next set bit in a memory region | |
| 6 | 7 | * @addr: The address to base the search on | |
@@ -9,7 +10,9 @@ | |||
| 9 | 10 | */ | |
| 10 | 11 | extern unsigned long find_next_bit(const unsigned long *addr, unsigned long | |
| 11 | 12 | size, unsigned long offset); | |
| 13 | + #endif | ||
| 12 | 14 | ||
| 15 | + #ifndef find_next_zero_bit | ||
| 13 | 16 | /** | |
| 14 | 17 | * find_next_zero_bit - find the next cleared bit in a memory region | |
| 15 | 18 | * @addr: The address to base the search on | |
@@ -18,6 +21,7 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long | |||
| 18 | 21 | */ | |
| 19 | 22 | extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned | |
| 20 | 23 | long size, unsigned long offset); | |
| 24 | + #endif | ||
| 21 | 25 | ||
| 22 | 26 | #ifdef CONFIG_GENERIC_FIND_FIRST_BIT | |
| 23 | 27 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,13 +30,20 @@ static inline unsigned long find_first_zero_bit_le(const void *addr, | |||
| 30 | 30 | ||
| 31 | 31 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) | |
| 32 | 32 | ||
| 33 | + #ifndef find_next_zero_bit_le | ||
| 33 | 34 | extern unsigned long find_next_zero_bit_le(const void *addr, | |
| 34 | 35 | unsigned long size, unsigned long offset); | |
| 36 | + #endif | ||
| 37 | + | ||
| 38 | + #ifndef find_next_bit_le | ||
| 35 | 39 | extern unsigned long find_next_bit_le(const void *addr, | |
| 36 | 40 | unsigned long size, unsigned long offset); | |
| 41 | + #endif | ||
| 37 | 42 | ||
| 43 | + #ifndef find_first_zero_bit_le | ||
| 38 | 44 | #define find_first_zero_bit_le(addr, size) \ | |
| 39 | 45 | find_next_zero_bit_le((addr), (size), 0) | |
| 46 | + #endif | ||
| 40 | 47 | ||
| 41 | 48 | #else | |
| 42 | 49 | #error "Please fix <asm/byteorder.h>" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,6 +149,7 @@ static inline unsigned long __ffs64(u64 word) | |||
| 149 | 149 | #ifdef __KERNEL__ | |
| 150 | 150 | ||
| 151 | 151 | #ifdef CONFIG_GENERIC_FIND_LAST_BIT | |
| 152 | + #ifndef find_last_bit | ||
| 152 | 153 | /** | |
| 153 | 154 | * find_last_bit - find the last set bit in a memory region | |
| 154 | 155 | * @addr: The address to start the search at | |
@@ -158,6 +159,7 @@ static inline unsigned long __ffs64(u64 word) | |||
| 158 | 159 | */ | |
| 159 | 160 | extern unsigned long find_last_bit(const unsigned long *addr, | |
| 160 | 161 | unsigned long size); | |
| 162 | + #endif | ||
| 161 | 163 | #endif /* CONFIG_GENERIC_FIND_LAST_BIT */ | |
| 162 | 164 | ||
| 163 | 165 | #endif /* __KERNEL__ */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,8 @@ | |||
| 15 | 15 | #include <asm/types.h> | |
| 16 | 16 | #include <asm/byteorder.h> | |
| 17 | 17 | ||
| 18 | + #ifndef find_last_bit | ||
| 19 | + | ||
| 18 | 20 | unsigned long find_last_bit(const unsigned long *addr, unsigned long size) | |
| 19 | 21 | { | |
| 20 | 22 | unsigned long words; | |
@@ -43,3 +45,5 @@ unsigned long find_last_bit(const unsigned long *addr, unsigned long size) | |||
| 43 | 45 | return size; | |
| 44 | 46 | } | |
| 45 | 47 | EXPORT_SYMBOL(find_last_bit); | |
| 48 | + | ||
| 49 | + #endif | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,7 @@ | |||
| 17 | 17 | #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) | |
| 18 | 18 | ||
| 19 | 19 | #ifdef CONFIG_GENERIC_FIND_NEXT_BIT | |
| 20 | + #ifndef find_next_bit | ||
| 20 | 21 | /* | |
| 21 | 22 | * Find the next set bit in a memory region. | |
| 22 | 23 | */ | |
@@ -59,7 +60,9 @@ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, | |||
| 59 | 60 | return result + __ffs(tmp); | |
| 60 | 61 | } | |
| 61 | 62 | EXPORT_SYMBOL(find_next_bit); | |
| 63 | + #endif | ||
| 62 | 64 | ||
| 65 | + #ifndef find_next_zero_bit | ||
| 63 | 66 | /* | |
| 64 | 67 | * This implementation of find_{first,next}_zero_bit was stolen from | |
| 65 | 68 | * Linus' asm-alpha/bitops.h. | |
@@ -103,9 +106,11 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, | |||
| 103 | 106 | return result + ffz(tmp); | |
| 104 | 107 | } | |
| 105 | 108 | EXPORT_SYMBOL(find_next_zero_bit); | |
| 109 | + #endif | ||
| 106 | 110 | #endif /* CONFIG_GENERIC_FIND_NEXT_BIT */ | |
| 107 | 111 | ||
| 108 | 112 | #ifdef CONFIG_GENERIC_FIND_FIRST_BIT | |
| 113 | + #ifndef find_first_bit | ||
| 109 | 114 | /* | |
| 110 | 115 | * Find the first set bit in a memory region. | |
| 111 | 116 | */ | |
@@ -131,7 +136,9 @@ unsigned long find_first_bit(const unsigned long *addr, unsigned long size) | |||
| 131 | 136 | return result + __ffs(tmp); | |
| 132 | 137 | } | |
| 133 | 138 | EXPORT_SYMBOL(find_first_bit); | |
| 139 | + #endif | ||
| 134 | 140 | ||
| 141 | + #ifndef find_first_zero_bit | ||
| 135 | 142 | /* | |
| 136 | 143 | * Find the first cleared bit in a memory region. | |
| 137 | 144 | */ | |
@@ -157,6 +164,7 @@ unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) | |||
| 157 | 164 | return result + ffz(tmp); | |
| 158 | 165 | } | |
| 159 | 166 | EXPORT_SYMBOL(find_first_zero_bit); | |
| 167 | + #endif | ||
| 160 | 168 | #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ | |
| 161 | 169 | ||
| 162 | 170 | #ifdef __BIG_ENDIAN | |
@@ -186,6 +194,7 @@ static inline unsigned long ext2_swab(const unsigned long y) | |||
| 186 | 194 | #endif | |
| 187 | 195 | } | |
| 188 | 196 | ||
| 197 | + #ifndef find_next_zero_bit_le | ||
| 189 | 198 | unsigned long find_next_zero_bit_le(const void *addr, unsigned | |
| 190 | 199 | long size, unsigned long offset) | |
| 191 | 200 | { | |
@@ -229,7 +238,9 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned | |||
| 229 | 238 | return result + ffz(ext2_swab(tmp)); | |
| 230 | 239 | } | |
| 231 | 240 | EXPORT_SYMBOL(find_next_zero_bit_le); | |
| 241 | + #endif | ||
| 232 | 242 | ||
| 243 | + #ifndef find_next_bit_le | ||
| 233 | 244 | unsigned long find_next_bit_le(const void *addr, unsigned | |
| 234 | 245 | long size, unsigned long offset) | |
| 235 | 246 | { | |
@@ -274,6 +285,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned | |||
| 274 | 285 | return result + __ffs(ext2_swab(tmp)); | |
| 275 | 286 | } | |
| 276 | 287 | EXPORT_SYMBOL(find_next_bit_le); | |
| 288 | + #endif | ||
| 277 | 289 | ||
| 278 | 290 | #endif /* CONFIG_GENERIC_FIND_BIT_LE */ | |
| 279 | 291 | #endif /* __BIG_ENDIAN */ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments