Lines Matching full:bitmap

14 #include <linux/bitmap-str.h>
20 * longs. The bitmap interface and available operations are listed
21 * here, in bitmap.h
24 * lib/bitmap.c. Functions implementations that are architecture
28 * See lib/bitmap.c for more details.
32 * DOC: bitmap overview
34 * The available bitmap operations and their rough meaning in the
35 * case that the bitmap is a single unsigned long are thus:
56 * bitmap_weight_and(src1, src2, nbits) Hamming Weight of and'ed bitmap
69 * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf
70 * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf
71 * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf
72 * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf
73 * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region
74 * bitmap_release_region(bitmap, pos, order) Free specified bit region
75 * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region
84 * unsigned longs, that is, bits behind bitmap till the unsigned long
91 * DOC: bitmap bitops
114 * DOC: declare bitmap
121 * Allocation and deallocation of bitmap.
122 * Provided in lib/bitmap.c to avoid circular dependency.
128 void bitmap_free(const unsigned long *bitmap);
137 * lib/bitmap.c provides these functions:
169 unsigned int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits);
185 * @size: The bitmap size in bits
249 * Copy bitmap and clear tail bits in last word.
261 * machines the order of hi and lo parts of numbers match the bitmap structure.
268 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf,
270 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap,
273 #define bitmap_from_arr32(bitmap, buf, nbits) \ argument
274 bitmap_copy_clear_tail((unsigned long *) (bitmap), \
276 #define bitmap_to_arr32(buf, bitmap, nbits) \ argument
278 (const unsigned long *) (bitmap), (nbits))
286 void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
287 void bitmap_to_arr64(u64 *buf, const unsigned long *bitmap, unsigned int nbits);
289 #define bitmap_from_arr64(bitmap, buf, nbits) \ argument
290 bitmap_copy_clear_tail((unsigned long *)(bitmap), (const unsigned long *)(buf), (nbits))
291 #define bitmap_to_arr64(buf, bitmap, nbits) \ argument
292 bitmap_copy_clear_tail((unsigned long *)(buf), (const unsigned long *)(bitmap), (nbits))
358 * @src1: Pointer to bitmap 1
359 * @src2: Pointer to bitmap 2 will be or'ed with bitmap 1
360 * @src3: Pointer to bitmap 3. Compare to the result of *@src1 | *@src2
490 static inline void bitmap_next_set_region(unsigned long *bitmap, in bitmap_next_set_region() argument
494 *rs = find_next_bit(bitmap, end, *rs); in bitmap_next_set_region()
495 *re = find_next_zero_bit(bitmap, end, *rs + 1); in bitmap_next_set_region()
499 * bitmap_release_region - release allocated bitmap region
500 * @bitmap: array of unsigned longs corresponding to the bitmap
505 * the found region (by clearing it in the bitmap).
507 static inline void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order) in bitmap_release_region() argument
509 bitmap_clear(bitmap, pos, BIT(order)); in bitmap_release_region()
513 * bitmap_allocate_region - allocate bitmap region
514 * @bitmap: array of unsigned longs corresponding to the bitmap
518 * Allocate (set bits in) a specified region of a bitmap.
523 static inline int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order) in bitmap_allocate_region() argument
527 if (find_next_bit(bitmap, pos + len, pos) < pos + len) in bitmap_allocate_region()
529 bitmap_set(bitmap, pos, len); in bitmap_allocate_region()
535 * @bitmap: array of unsigned longs corresponding to the bitmap
536 * @bits: number of bits in the bitmap
539 * Find a region of free (zero) bits in a @bitmap of @bits bits and
544 * Returns: the bit offset in bitmap of the allocated region,
547 static inline int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order) in bitmap_find_free_region() argument
549 unsigned int pos, end; /* scans bitmap by regions of size order */ in bitmap_find_free_region()
552 if (!bitmap_allocate_region(bitmap, pos, order)) in bitmap_find_free_region()
559 * BITMAP_FROM_U64() - Represent u64 value in the format suitable for bitmap.
572 * prior to hi, and 32-bit BE orders hi word prior to lo. The bitmap on the
582 * hi and lo words, as is expected by bitmap.
593 * @mask: source bitmap
594 * @dst: destination bitmap
608 * @map: address to the bitmap memory region
625 * @map: address to the bitmap memory region
626 * @value: the 8-bit value; values wider than 8 bits may clobber bitmap