Lines Matching defs:bit

128 	int bit;
130 for (bit = 0; size >= BITS_PER_LONG;
131 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) {
134 return (bit + __ffsl(*addr));
139 bit += __ffsl(mask);
141 bit += size;
143 return (bit);
150 int bit;
152 for (bit = 0; size >= BITS_PER_LONG;
153 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) {
156 return (bit + __ffsl(~(*addr)));
161 bit += __ffsl(mask);
163 bit += size;
165 return (bit);
173 int bit;
178 bit = BITS_PER_LONG * pos;
183 return (bit + __flsl(mask));
187 bit -= BITS_PER_LONG;
189 return (bit + __flsl(*addr));
199 int bit;
206 bit = BITS_PER_LONG * pos;
211 return (bit + __ffsl(mask));
212 if (size - bit <= BITS_PER_LONG)
214 bit += BITS_PER_LONG;
217 for (size -= bit; size >= BITS_PER_LONG;
218 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) {
221 return (bit + __ffsl(*addr));
226 bit += __ffsl(mask);
228 bit += size;
230 return (bit);
239 int bit;
246 bit = BITS_PER_LONG * pos;
251 return (bit + __ffsl(mask));
252 if (size - bit <= BITS_PER_LONG)
254 bit += BITS_PER_LONG;
257 for (size -= bit; size >= BITS_PER_LONG;
258 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) {
261 return (bit + __ffsl(~(*addr)));
266 bit += __ffsl(mask);
268 bit += size;
270 return (bit);
292 test_and_clear_bit(long bit, volatile unsigned long *var)
296 var += BIT_WORD(bit);
297 bit %= BITS_PER_LONG;
298 bit = (1UL << bit);
301 while (!atomic_fcmpset_long(var, &val, val & ~bit))
303 return !!(val & bit);
307 __test_and_clear_bit(long bit, volatile unsigned long *var)
311 var += BIT_WORD(bit);
312 bit %= BITS_PER_LONG;
313 bit = (1UL << bit);
316 *var &= ~bit;
318 return !!(val & bit);
322 test_and_set_bit(long bit, volatile unsigned long *var)
326 var += BIT_WORD(bit);
327 bit %= BITS_PER_LONG;
328 bit = (1UL << bit);
331 while (!atomic_fcmpset_long(var, &val, val | bit))
333 return !!(val & bit);
337 __test_and_set_bit(long bit, volatile unsigned long *var)
341 var += BIT_WORD(bit);
342 bit %= BITS_PER_LONG;
343 bit = (1UL << bit);
346 *var |= bit;
348 return !!(val & bit);
402 #define for_each_set_bit(bit, addr, size) \
403 for ((bit) = find_first_bit((addr), (size)); \
404 (bit) < (size); \
405 (bit) = find_next_bit((addr), (size), (bit) + 1))
407 #define for_each_clear_bit(bit, addr, size) \
408 for ((bit) = find_first_zero_bit((addr), (size)); \
409 (bit) < (size); \
410 (bit) = find_next_zero_bit((addr), (size), (bit) + 1))