gen_pool_dma_zalloc_align(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 🎯 use NULL if 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:


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