1BITMAP_BITREMAP(9)      Basic Kernel Library Functions      BITMAP_BITREMAP(9)
2
3
4

NAME

6       bitmap_bitremap - Apply map defined by a pair of bitmaps to a single
7       bit
8

SYNOPSIS

10       int bitmap_bitremap(int oldbit, const unsigned long * old,
11                           const unsigned long * new, int bits);
12

ARGUMENTS

14       oldbit
15           bit position to be mapped
16
17       old
18           defines domain of map
19
20       new
21           defines range of map
22
23       bits
24           number of bits in each of these bitmaps
25

DESCRIPTION

27       Let old and new define a mapping of bit positions, such that whatever
28       position is held by the n-th set bit in old is mapped to the n-th set
29       bit in new. In the more general case, allowing for the possibility that
30       the weight 'w' of new is less than the weight of old, map the position
31       of the n-th set bit in old to the position of the m-th set bit in new,
32       where m == n % w.
33
34       The positions of unset bits in old are mapped to themselves (the
35       identify map).
36
37       Apply the above specified mapping to bit position oldbit, returning the
38       new bit position.
39
40       For example, lets say that old has bits 4 through 7 set, and new has
41       bits 12 through 15 set. This defines the mapping of bit position 4 to
42       12, 5 to 13, 6 to 14 and 7 to 15, and of all other bit positions
43       unchanged. So if say oldbit is 5, then this routine returns 13.
44
46Kernel Hackers Manual 3.10         June 2019                BITMAP_BITREMAP(9)
Impressum