gen_pool_dma_zalloc(9)
π gen_pool_dma_zalloc β from the Kernel API Manual π
okay bestie, so this one lives in the Kernel API Manual and honestly? it's a whole vibe. like, it's the girl who hands you pre-zeroed memory straight out of a pool, DMA-ready, no cap. let's get into it β¨
β¨ NAME β¨
gen_pool_dma_zalloc β allocate special zeroed memory from the pool for DMA usage π
literally that's the whole gig.
πΈ SYNOPSIS πΈ
void * gen_pool_dma_zalloc (struct gen_pool *pool , size_t size ,
dma_addr_t *dma );
look at her. three args, returns a void *. iconic signature, no notes π«Ά
π¦ ARGUMENTS π¦
poolβ the pool you're allocating from, bestie. your source of truth πsizeβ how many bytes you want from the pool. like, exactly this many, don't be weird about it β¨dmaβ the dma-view physical address, returned to you as a return value. passNULLif you literally don't need it β she won't be offended π
π§ DESCRIPTION π§
so here's the tea β: this bad girl allocates the requested number of zeroed bytes from the specified pool. zeroed! as in, already clean, already fresh out the box, you don't gotta memset anything. main character energy fr fr π
she uses the pool allocation function β with first-fit algorithm by default β so yep, she's out here finding the first chunk that fits. classic.
β οΈ real talk tho: this can not be used in NMI handler on architectures without NMI-safe cmpxchg implementation. like, that's not a suggestion, that's a hard no. don't do it, i'm begging ππ
β RETURN β
she gives you the virtual address of the allocated zeroed memory π
or NULL on failure π₯Ί (it happens, we don't judge)
π SEE ALSO π
the whole friend group is in the kernel file ./lib/genalloc.c β go say hi to all of them π«Άβ¨
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(9)gen_pool_dma_alloc_algo(9)gen_pool_dma_alloc_align(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)
and that's the whole page, bestie! π this cutie came out of ./lib in October 2026, and she's filed under gen_pool_dma_zalloc(9) β go forth and allocate responsibly, 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