dma_contiguous_reserve_area(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– dma_contiguous_reserve_area(9) πŸ’–

okay bestie, so this one's from the Kernel API Manual β€” literally the dma_contiguous_reserve_area(9) page itself, no cap. it's giving "arch code only, normies keep out" energy and i'm obsessed πŸŽ€


✨ NAME ✨

dma_contiguous_reserve_area β€” reserve a custom contiguous area 🧚


🌸 SYNOPSIS 🌸

int dma_contiguous_reserve_area (phys_addr_t size , phys_addr_t base ,
       phys_addr_t limit , struct cma **res_cma , bool fixed );

like, that's the whole signature, copy it exactly please πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • size β€” size of the reserved area, in bytes. that's it, that's the vibe πŸ’œ
  • base β€” base address of the reserved area. it's optional, so if you don't care, just use 0 for any ✨
  • limit β€” end address of the reserved memory. also optional β€” 0 means any 🫢
  • res_cma β€” a pointer where the created cma region gets stored πŸ‘‘
  • fixed β€” a lil hint about where to place the reserved area πŸ™ˆ

πŸ’€ DESCRIPTION πŸ’€

so this function reserves memory from the early allocator. main character behavior tbh.

it should be called by arch specific code β€” and listen, the timing matters fr fr: only once the early allocator (memblock or bootmem) has been activated and all other subsystems have already allocated/reserved memory. not before. do not come for it early 😭

what it does is let you create custom reserved areas for specific devices β€” bespoke, hand-picked, curated reserved area. it's giving couture 🌈

and here's the vibe check on fixed:

  • if fixed is true β†’ reserve the contiguous area at exactly base. no negotiation, no wiggle room πŸ’…
  • if fixed is false β†’ reserve in range from base to limit. flexible queen ⭐

πŸ”₯ SEE ALSO πŸ”₯

the kernel file ./kernel/dma/contiguous.c, plus the whole friend group of siblings:

go read them, iykyk πŸ“šπŸ’–


and that's the page bestie!! πŸŽ€ this one's from ./kernel/dma, dated October 2026 β€” that's the source and the date, mwah, love that for us πŸ’‹βœ¨πŸ¦‹

πŸ“¦ where this page comes from