dma_unmap_sgtable(9)
π dma_unmap_sgtable(9) π
okay bestie, this is from the Kernel API Manual and it's giving very specific DMA cleanup energy. let's get into it β¨
πΈ NAME πΈ
dma_unmap_sgtable β unmaps the given buffer for DMA. that's the whole name vibe, no cap.
π SYNOPSIS π
void dma_unmap_sgtable (struct device *dev , struct sg_table *sgt , enum
dma_data_direction dir , unsigned long attrs );
π«Ά ARGUMENTS π«Ά
devβ the device you're doing the DMA operation for. main character device energy.sgtβ thesg_tableobject that describes the buffer. it's literally holding the buffer description together.dirβ the DMA direction. that's it, that's the vibe.attrsβ the optional DMA attributes for the unmap operation. optional, bestie, but still important.
π₯ DESCRIPTION π₯
so this function unmaps a buffer that's described by a scatterlist stored in the sg_table object you passed in. it does that unmap for the dir DMA operation, on the dev device. after this function runs, ownership of the buffer is transferred back to the CPU domain. periodt. π
π SEE ALSO π
peep the kernel file ./include/linux/dma-mapping.h, plus these besties:
dma_use_iova(9)dma_sync_sgtable_for_cpu(9)dma_sync_sgtable_for_device(9)dma_get_seg_boundary_nr_pages(9)
bye bestie π«Ά this page came from ./include/linux, dated October 2026, and it's dma_unmap_sgtable(9) from the Kernel API Manual. mwah πβ¨
π¦ 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