Lines Matching full:bitmap

15 #include <linux/bitmap-str.h>
21 * longs. The bitmap interface and available operations are listed
22 * here, in bitmap.h
25 * lib/bitmap.c. Functions implementations that are architecture
29 * See lib/bitmap.c for more details.
33 * DOC: bitmap overview
35 * The available bitmap operations and their rough meaning in the
36 * case that the bitmap is a single unsigned long are thus:
57 * bitmap_weight_and(src1, src2, nbits) Hamming Weight of and'ed bitmap
58 * bitmap_weight_andnot(src1, src2, nbits) Hamming Weight of andnot'ed bitmap
73 * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf
74 * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf
75 * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf
76 * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf
77 * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region
78 * bitmap_release_region(bitmap, pos, order) Free specified bit region
79 * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region
92 * unsigned longs, that is, bits behind bitmap till the unsigned long
99 * DOC: bitmap bitops
122 * DOC: declare bitmap
129 * Allocation and deallocation of bitmap.
130 * Provided in lib/bitmap.c to avoid circular dependency.
136 void bitmap_free(const unsigned long *bitmap);
138 DEFINE_FREE(bitmap, unsigned long *, if (_T) bitmap_free(_T))
147 * lib/bitmap.c provides these functions:
179 unsigned int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits);
197 * @size: The bitmap size in bits
263 * Copy bitmap and clear tail bits in last word.
287 * machines the order of hi and lo parts of numbers match the bitmap structure.
294 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf,
296 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap,
299 #define bitmap_from_arr32(bitmap, buf, nbits) \ argument
300 bitmap_copy_clear_tail((unsigned long *) (bitmap), \
302 #define bitmap_to_arr32(buf, bitmap, nbits) \ argument
304 (const unsigned long *) (bitmap), (nbits))
312 void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits);
313 void bitmap_to_arr64(u64 *buf, const unsigned long *bitmap, unsigned int nbits);
315 #define bitmap_from_arr64(bitmap, buf, nbits) \ argument
316 bitmap_copy_clear_tail((unsigned long *)(bitmap), (const unsigned long *)(buf), (nbits))
317 #define bitmap_to_arr64(buf, bitmap, nbits) \ argument
318 bitmap_copy_clear_tail((unsigned long *)(buf), (const unsigned long *)(bitmap), (nbits))
388 * @src1: Pointer to bitmap 1
389 * @src2: Pointer to bitmap 2 will be or'ed with bitmap 1
390 * @src3: Pointer to bitmap 3. Compare to the result of *@src1 | *@src2
533 * bitmap_scatter - Scatter a bitmap according to the given mask
534 * @dst: scattered bitmap
535 * @src: gathered bitmap
536 * @mask: mask representing bits to assign to in the scattered bitmap
539 * Scatters bitmap with sequential bits according to the given @mask.
542 * If @src bitmap = 0x005a, with @mask = 0x1313, @dst will be 0x0302.
581 * bitmap_gather - Gather a bitmap according to given mask
582 * @dst: gathered bitmap
583 * @src: scattered bitmap
584 * @mask: mask representing bits to extract from in the scattered bitmap
587 * Gathers bitmap with sparse bits according to the given @mask.
590 * If @src bitmap = 0x0302, with @mask = 0x1313, @dst will be 0x001a.
611 * bitmap_scatter() for the bitmap scatter detailed operations.
636 void bitmap_next_set_region(unsigned long *bitmap, unsigned int *rs, in bitmap_next_set_region() argument
639 *rs = find_next_bit(bitmap, end, *rs); in bitmap_next_set_region()
640 *re = find_next_zero_bit(bitmap, end, *rs + 1); in bitmap_next_set_region()
644 * bitmap_release_region - release allocated bitmap region
645 * @bitmap: array of unsigned longs corresponding to the bitmap
650 * the found region (by clearing it in the bitmap).
653 void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order) in bitmap_release_region() argument
655 bitmap_clear(bitmap, pos, BIT(order)); in bitmap_release_region()
659 * bitmap_allocate_region - allocate bitmap region
660 * @bitmap: array of unsigned longs corresponding to the bitmap
664 * Allocate (set bits in) a specified region of a bitmap.
670 int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order) in bitmap_allocate_region() argument
674 if (find_next_bit(bitmap, pos + len, pos) < pos + len) in bitmap_allocate_region()
676 bitmap_set(bitmap, pos, len); in bitmap_allocate_region()
682 * @bitmap: array of unsigned longs corresponding to the bitmap
683 * @bits: number of bits in the bitmap
686 * Find a region of free (zero) bits in a @bitmap of @bits bits and
691 * Returns: the bit offset in bitmap of the allocated region,
695 int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order) in bitmap_find_free_region() argument
697 unsigned int pos, end; /* scans bitmap by regions of size order */ in bitmap_find_free_region()
700 if (!bitmap_allocate_region(bitmap, pos, order)) in bitmap_find_free_region()
707 * BITMAP_FROM_U64() - Represent u64 value in the format suitable for bitmap.
720 * prior to hi, and 32-bit BE orders hi word prior to lo. The bitmap on the
730 * hi and lo words, as is expected by bitmap.
741 * @mask: source bitmap
742 * @dst: destination bitmap
756 * @map: address to the bitmap memory region
785 * @map: address to the bitmap memory region
794 * __assign_bit(start + bit, bitmap, val & BIT(bit));