for_each_sg_dma_page(9)
π
for_each_sg_dma_page(9) β the Kernel API Manual page, bestie edition π
πΈ NAME πΈ
for_each_sg_dma_page β okay so this icon literally iterates over the pages of the sg list you give it. That's the assignment. π
β¨ SYNOPSIS β¨
for_each_sg_dma_page (sglist , dma_iter , dma_nents , pgoffset );
π ARGUMENTS π
sglistβ the sglist to iterate over, bestie. That's the whole vibe.dma_iterβ the DMA page iterator that holds the current page. It's giving current-page main character energy β¨dma_nentsβ the maximum number of sg entries to iterate over; this is literally the value returned fromdma_map_sg. No cap. π₯pgoffsetβ the starting page offset, measured in pages. Yep, pages. π«Ά
π DESCRIPTION π
Callers may use sg_page_iter_dma_address to get each page's DMA address. In each loop it operates on PAGE_SIZE unit. Like, every loop is operating on that PAGE_SIZE unit. Periodt. π
π¦ SEE ALSO π¦
- Kernel file:
./include/linux/scatterlist.h - The whole squad:
sg_next(9),sg_assign_page(9),sg_set_page(9),sg_set_folio(9),sg_set_buf(9),sg_chain(9),sg_mark_end(9),sg_unmark_end(9),sg_dma_is_bus_address(9),sg_dma_mark_bus_address(9),sg_dma_unmark_bus_address(9),sg_dma_is_swiotlb(9),sg_dma_mark_swiotlb(9),sg_phys(9),sg_virt(9),sg_init_marker(9),sg_alloc_table_from_pages(9),sg_page_iter_page(9),sg_page_iter_dma_address(9),for_each_sg_page(9),for_each_sgtable_page(9),for_each_sgtable_dma_page(9)
xoxo, your local Unix bestie π β source/version: ./include/linux Β· date: October 2026 Β· page: for_each_sg_dma_page(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