lib: add gen_pool_alloc_aligned()
This commit adds a gen_pool_alloc_aligned() function to the generic allocator API. It allows specifying alignment for the allocated block. This feature uses the bitmap_find_next_zero_area_off() function. It also fixes possible issue with bitmap's last element being not fully allocated (ie. space allocated for chunk->bits is not a multiple of sizeof(long)). It also makes some other smaller changes: - moves structure definitions out of the header file, - adds __must_check to functions returning value, - makes gen_pool_add() return -ENOMEM rater than -1 on error, - changes list_for_each to list_for_each_entry, and - makes use of bitmap_clear(). Change-Id: Ib59f54d51ffe4c4fb747defc97a6581c46565890 Signed-off-by:Michal Nazarewicz <mina86@mina86.com> Signed-off-by:
Larry Bassel <lbassel@codeaurora.org>
Loading
Please register or sign in to comment