gen_pool_dma_zalloc_align(9)
β¨ gen_pool_dma_zalloc_align(9) β¨
okay bestie, welcome to the Kernel API Manual β yes, that's the manual name, we're in the kernel docs now, no cap π
πΈ NAME πΈ
gen_pool_dma_zalloc_align β allocate special zeroed memory from the pool for DMA usage with the given alignment π«Ά
π SYNOPSIS π
void * gen_pool_dma_zalloc_align (struct gen_pool *pool , size_t size ,
dma_addr_t *dma , int align );
literally the whole signature, copy it exactly, don't @ me β¨
π ARGUMENTS π
poolβ the pool you're allocating from, that's the vibe check you gotta pass π¦sizeβ number of bytes to allocate from the pool, yes the actual byte count, be precise bestie πdmaβ the DMA-view physical address return value π― useNULLif you don't need it, it's giving "optional and unbothered" πalignβ alignment in bytes for the starting address, so your memory starts on a cute lil boundary β
π₯ DESCRIPTION π₯
So what it does is: allocate the requested number of zeroed bytes from the specified pool, with the given alignment restriction π§β¨ like, it's a zalloc but with alignment, periodt.
β οΈ Heads up bestie: this can not be used in an NMI handler on architectures without an NMI-safe cmpxchg implementation. That's a real caveat, not a vibe, don't try it π
π RETURN π
returns the virtual address of the allocated zeroed memory, or NULL on failure π so like, always check, ngl π
π SEE ALSO π
kernel file ./lib/genalloc.c, and also this whole entire 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(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_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, mwah π this one's from the ./lib source, dated October 2026, and it's the gen_pool_dma_zalloc_align(9) entry for you β slay, go allocate something aligned β¨ππ¦
π¦ 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