dma_get_seg...ary_nr_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– dma_get_seg...ary_nr_pages(9) πŸ’–

okay so bestie, we're in the Kernel API Manual today and the star of the show is dma_get_seg...ary_nr_pages(9) (the full name got cut off in the header bc it's long, we'll get to it, don't worry 🫢). it's giving "small function, big responsibility" and honestly? iconic. let's get into it ✨


🌸 NAME 🌸

dma_get_seg_boundary_nr_pages β€” returns the segment boundary in "page" units, no cap πŸ’…


✨ SYNOPSIS ✨

unsigned long dma_get_seg_boundary_nr_pages (struct device *dev ,
       unsigned int page_shift );

literally just two args. we love a low-maintenance signature πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device you're querying the boundary for, iykyk 🌈
  • page_shift β€” the ilog of the IOMMU page size. yes, that's what it says, that's the vibe ⭐

πŸ’œ DESCRIPTION πŸ’œ

okay so what it actually does: it returns the segment boundary in IOMMU page units for the device you passed in. and heads up β€” those IOMMU page units may be different from the CPU page size, so don't go assuming they're the same, that's the whole plot twist πŸ”₯

if dev is NULL, a boundary of U32_MAX is assumed. and the docs are clear about why: this case is just for non-DMA API callers. so like, not your average DMA situation, bestie πŸ™ˆ

🧚 SEE ALSO 🧚

go read those next, they're all in the same friend group fr fr πŸ“


that's the whole page, periodt πŸ’€βœ¨ this little legend lives over in ./include/linux and the page is dated October 2026 β€” mwah, go query some boundaries responsibly, love u bye πŸŽ€πŸ’–πŸŒΈ

πŸ“¦ where this page comes from