gen_pool_dma_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 cap
  • dma β€” the dma-view physical address return value. Pass NULL if 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 πŸ‘‘:


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