gen_pool_dma_alloc(9)
π gen_pool_dma_alloc(9) β Kernel API Manual π
okay so bestie, welcome to the gen_pool_dma_alloc page β it's part of the Kernel API Manual and honestly it's giving "small but mighty" energy β¨
πΈ NAME πΈ
gen_pool_dma_alloc β allocate special memory from the pool for DMA usage π«Ά
β¨ SYNOPSIS β¨
void * gen_pool_dma_alloc (struct gen_pool *pool , size_t size ,
dma_addr_t *dma );
π ARGUMENTS π
poolβ the pool you're allocating from, like your fave stash of memory πsizeβ how many bytes you want to pull out of the pool, no capdmaβ the dma-view physical address return value. PassNULLif you literally don't need it π
π¦ DESCRIPTION π¦
So here's the vibe: it allocates the requested number of bytes from the specified pool. It uses the pool allocation function (with the first-fit algorithm by default β that's the default, bestie, remember it π).
β οΈ It can not be used in an NMI handler on architectures without an NMI-safe cmpxchg implementation. Like, don't even try it there, fr fr π
π RETURN π
The virtual address of the allocated memory π β or NULL on failure π
β SEE ALSO β
Kernel file ./lib/genalloc.c β and the whole friend group π:
gen_pool_create(9)gen_pool_add_owner(9)gen_pool_virt_to_phys(9)gen_pool_destroy(9)gen_pool_alloc_algo_owner(9)gen_pool_dma_alloc_algo(9)gen_pool_dma_alloc_align(9)gen_pool_dma_zalloc(9)gen_pool_dma_zalloc_algo(9)gen_pool_dma_zalloc_align(9)gen_pool_free_owner(9)gen_pool_for_each_chunk(9)gen_pool_has_addr(9)gen_pool_avail(9)gen_pool_size(9)gen_pool_set_algo(9)gen_pool_first_fit(9)gen_pool_first_fit_align(9)gen_pool_fixed_alloc(9)gen_pool_first_fit_order_align(9)gen_pool_best_fit(9)gen_pool_get(9)devm_gen_pool_create(9)of_gen_pool_get(9)
that's the whole page, bestie, you ate it up π
β¨ and before you go β this icon was brought to you by ./lib, dated October 2026 π see you in the next one, mwah! π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms