|
21 | 21 | * See lib/bitmap.c for more details. |
22 | 22 | */ |
23 | 23 |
|
24 | | -/* |
| 24 | +/** |
| 25 | + * DOC: bitmap overview |
| 26 | + * |
25 | 27 | * The available bitmap operations and their rough meaning in the |
26 | 28 | * case that the bitmap is a single unsigned long are thus: |
27 | 29 | * |
28 | 30 | * Note that nbits should be always a compile time evaluable constant. |
29 | 31 | * Otherwise many inlines will generate horrible code. |
30 | 32 | * |
31 | | - * bitmap_zero(dst, nbits) *dst = 0UL |
32 | | - * bitmap_fill(dst, nbits) *dst = ~0UL |
33 | | - * bitmap_copy(dst, src, nbits) *dst = *src |
34 | | - * bitmap_and(dst, src1, src2, nbits) *dst = *src1 & *src2 |
35 | | - * bitmap_or(dst, src1, src2, nbits) *dst = *src1 | *src2 |
36 | | - * bitmap_xor(dst, src1, src2, nbits) *dst = *src1 ^ *src2 |
37 | | - * bitmap_andnot(dst, src1, src2, nbits) *dst = *src1 & ~(*src2) |
38 | | - * bitmap_complement(dst, src, nbits) *dst = ~(*src) |
39 | | - * bitmap_equal(src1, src2, nbits) Are *src1 and *src2 equal? |
40 | | - * bitmap_intersects(src1, src2, nbits) Do *src1 and *src2 overlap? |
41 | | - * bitmap_subset(src1, src2, nbits) Is *src1 a subset of *src2? |
42 | | - * bitmap_empty(src, nbits) Are all bits zero in *src? |
43 | | - * bitmap_full(src, nbits) Are all bits set in *src? |
44 | | - * bitmap_weight(src, nbits) Hamming Weight: number set bits |
45 | | - * bitmap_set(dst, pos, nbits) Set specified bit area |
46 | | - * bitmap_clear(dst, pos, nbits) Clear specified bit area |
47 | | - * bitmap_find_next_zero_area(buf, len, pos, n, mask) Find bit free area |
48 | | - * bitmap_find_next_zero_area_off(buf, len, pos, n, mask) as above |
49 | | - * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n |
50 | | - * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n |
51 | | - * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) |
52 | | - * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit) |
53 | | - * bitmap_onto(dst, orig, relmap, nbits) *dst = orig relative to relmap |
54 | | - * bitmap_fold(dst, orig, sz, nbits) dst bits = orig bits mod sz |
55 | | - * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf |
56 | | - * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf |
57 | | - * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf |
58 | | - * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf |
59 | | - * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region |
60 | | - * bitmap_release_region(bitmap, pos, order) Free specified bit region |
61 | | - * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region |
62 | | - * bitmap_from_u32array(dst, nbits, buf, nwords) *dst = *buf (nwords 32b words) |
63 | | - * bitmap_to_u32array(buf, nwords, src, nbits) *buf = *dst (nwords 32b words) |
| 33 | + * :: |
| 34 | + * |
| 35 | + * bitmap_zero(dst, nbits) *dst = 0UL |
| 36 | + * bitmap_fill(dst, nbits) *dst = ~0UL |
| 37 | + * bitmap_copy(dst, src, nbits) *dst = *src |
| 38 | + * bitmap_and(dst, src1, src2, nbits) *dst = *src1 & *src2 |
| 39 | + * bitmap_or(dst, src1, src2, nbits) *dst = *src1 | *src2 |
| 40 | + * bitmap_xor(dst, src1, src2, nbits) *dst = *src1 ^ *src2 |
| 41 | + * bitmap_andnot(dst, src1, src2, nbits) *dst = *src1 & ~(*src2) |
| 42 | + * bitmap_complement(dst, src, nbits) *dst = ~(*src) |
| 43 | + * bitmap_equal(src1, src2, nbits) Are *src1 and *src2 equal? |
| 44 | + * bitmap_intersects(src1, src2, nbits) Do *src1 and *src2 overlap? |
| 45 | + * bitmap_subset(src1, src2, nbits) Is *src1 a subset of *src2? |
| 46 | + * bitmap_empty(src, nbits) Are all bits zero in *src? |
| 47 | + * bitmap_full(src, nbits) Are all bits set in *src? |
| 48 | + * bitmap_weight(src, nbits) Hamming Weight: number set bits |
| 49 | + * bitmap_set(dst, pos, nbits) Set specified bit area |
| 50 | + * bitmap_clear(dst, pos, nbits) Clear specified bit area |
| 51 | + * bitmap_find_next_zero_area(buf, len, pos, n, mask) Find bit free area |
| 52 | + * bitmap_find_next_zero_area_off(buf, len, pos, n, mask) as above |
| 53 | + * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n |
| 54 | + * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n |
| 55 | + * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) |
| 56 | + * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit) |
| 57 | + * bitmap_onto(dst, orig, relmap, nbits) *dst = orig relative to relmap |
| 58 | + * bitmap_fold(dst, orig, sz, nbits) dst bits = orig bits mod sz |
| 59 | + * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf |
| 60 | + * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf |
| 61 | + * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf |
| 62 | + * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf |
| 63 | + * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region |
| 64 | + * bitmap_release_region(bitmap, pos, order) Free specified bit region |
| 65 | + * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region |
| 66 | + * bitmap_from_u32array(dst, nbits, buf, nwords) *dst = *buf (nwords 32b words) |
| 67 | + * bitmap_to_u32array(buf, nwords, src, nbits) *buf = *dst (nwords 32b words) |
| 68 | + * |
64 | 69 | */ |
65 | 70 |
|
66 | | -/* |
67 | | - * Also the following operations in asm/bitops.h apply to bitmaps. |
| 71 | +/** |
| 72 | + * DOC: bitmap bitops |
| 73 | + * |
| 74 | + * Also the following operations in asm/bitops.h apply to bitmaps.:: |
| 75 | + * |
| 76 | + * set_bit(bit, addr) *addr |= bit |
| 77 | + * clear_bit(bit, addr) *addr &= ~bit |
| 78 | + * change_bit(bit, addr) *addr ^= bit |
| 79 | + * test_bit(bit, addr) Is bit set in *addr? |
| 80 | + * test_and_set_bit(bit, addr) Set bit and return old value |
| 81 | + * test_and_clear_bit(bit, addr) Clear bit and return old value |
| 82 | + * test_and_change_bit(bit, addr) Change bit and return old value |
| 83 | + * find_first_zero_bit(addr, nbits) Position first zero bit in *addr |
| 84 | + * find_first_bit(addr, nbits) Position first set bit in *addr |
| 85 | + * find_next_zero_bit(addr, nbits, bit) Position next zero bit in *addr >= bit |
| 86 | + * find_next_bit(addr, nbits, bit) Position next set bit in *addr >= bit |
68 | 87 | * |
69 | | - * set_bit(bit, addr) *addr |= bit |
70 | | - * clear_bit(bit, addr) *addr &= ~bit |
71 | | - * change_bit(bit, addr) *addr ^= bit |
72 | | - * test_bit(bit, addr) Is bit set in *addr? |
73 | | - * test_and_set_bit(bit, addr) Set bit and return old value |
74 | | - * test_and_clear_bit(bit, addr) Clear bit and return old value |
75 | | - * test_and_change_bit(bit, addr) Change bit and return old value |
76 | | - * find_first_zero_bit(addr, nbits) Position first zero bit in *addr |
77 | | - * find_first_bit(addr, nbits) Position first set bit in *addr |
78 | | - * find_next_zero_bit(addr, nbits, bit) Position next zero bit in *addr >= bit |
79 | | - * find_next_bit(addr, nbits, bit) Position next set bit in *addr >= bit |
80 | 88 | */ |
81 | 89 |
|
82 | | -/* |
| 90 | +/** |
| 91 | + * DOC: declare bitmap |
83 | 92 | * The DECLARE_BITMAP(name,bits) macro, in linux/types.h, can be used |
84 | 93 | * to declare an array named 'name' of just enough unsigned longs to |
85 | 94 | * contain all bit positions from 0 to 'bits' - 1. |
|
0 commit comments