dma_contiguous_reserve_area(9)
π 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 use0for any β¨limitβ end address of the reserved memory. also optional β0means any π«Άres_cmaβ a pointer where the createdcmaregion 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
fixedistrueβ reserve the contiguous area at exactlybase. no negotiation, no wiggle room π - if
fixedisfalseβ reserve in range frombasetolimit. flexible queen β
π₯ SEE ALSO π₯
the kernel file ./kernel/dma/contiguous.c, plus the whole friend group of siblings:
dma_contiguous_get_area_by_idx(9)dma_contiguous_reserve(9)dma_alloc_from_contiguous(9)dma_release_from_contiguous(9)dma_alloc_contiguous(9)dma_free_contiguous(9)
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
- 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