table of contents
BITMAP_FIND_FREE_REG(9) | Basic Kernel Library Functions | BITMAP_FIND_FREE_REG(9) |
NAME¶
bitmap_find_free_region - find a contiguous aligned mem region
SYNOPSIS¶
int bitmap_find_free_region(unsigned long * bitmap, unsigned int bits, int order);
ARGUMENTS¶
unsigned long * bitmap
unsigned int bits
int order
DESCRIPTION¶
Find a region of free (zero) bits in a bitmap of bits bits and allocate them (set them to one). Only consider regions of length a power (order) of two, aligned to that power of two, which makes the search algorithm much faster.
Return the bit offset in bitmap of the allocated region, or -errno on failure.
COPYRIGHT¶
June 2017 | Kernel Hackers Manual 4.11 |