函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:lib\genalloc.c Create Date:2022-07-27 07:54:16
首页 Copyright©Brick

711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
/**
 * gen_pool_first_fit_order_align - find the first available region
 * of memory matching the size requirement. The region will be aligned
 * to the order of the size specified.
 * @map: The address to base the search on
 * @size: The bitmap size in bits
 * @start: The bitnumber to start searching at
 * @nr: The number of zeroed bits we're looking for
 * @data: additional data - unused
 * @pool: pool to find the fit region memory from
 */
unsigned long gen_pool_first_fit_order_align(unsigned long *map,
        unsigned long size, unsigned long start,
        unsigned int nr, void *data, struct gen_pool *pool,
        unsigned long start_addr)
{
    unsigned long align_mask = roundup_pow_of_two(nr) - 1;
 
    return bitmap_find_next_zero_area(map, size, start, nr, align_mask);
}