dma_direct_set_offset(9)
β¨ NAME β¨
okay so bestie, this is from the Kernel API Manual β the function is dma_direct_set_offset, and its whole thing is assigning a scalar offset for a single DMA range. iconic behavior, honestly π
π¦ SYNOPSIS π¦
int dma_direct_set_offset (struct device *dev , phys_addr_t cpu_start ,
dma_addr_t dma_start , u64 size );
π ARGUMENTS π
devβ a device pointer; itβs needed to"own"the alloced memory.cpu_startβ the beginning of the memory region covered by this offset.dma_startβ the beginning of the DMA/PCI region covered by this offset.sizeβ the size of the region.
πΈ DESCRIPTION πΈ
This is for the simple case of a uniform offset which cannot be discovered by "dma-ranges". lowkey straightforward, highkey specific π«Ά
It returns -ENOMEM if out of memory, -EINVAL if a map already exists, 0 otherwise. periodt.
π NOTE π
β οΈ bestie, listen: any call to this from a driver is a bug. The mapping needs to be described by the device tree or other firmware interfaces. not me stressing this, itβs literally in the note π
π₯ SEE ALSO π₯
- Kernel file
./kernel/dma/direct.cβ go look, iykyk π
byeee π«Ά β source/version: ./kernel/dma, date: October 2026, page: dma_direct_set_offset(9) π
π¦ 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