pcim_iomap_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pcim_iomap_range(9) πŸ’…

okay so bestie, this is a page straight out of the Kernel API Manual β€” yes, the actual kernel manual, and yes, we're gonna make it make sense 🫢


✨ NAME ✨

pcim_iomap_range β€” creates a ranged __iomap mapping, like, inside a PCI BAR. that's the whole vibe πŸ’–


🌸 SYNOPSIS 🌸

void __iomem * pcim_iomap_range (struct pci_dev *pdev , int bar ,
unsigned long offset , unsigned long len );

πŸŽ€ ARGUMENTS πŸŽ€

  • pdev β€” the PCI device you're mapping IO resources for. the main character, basically πŸ‘‘
  • bar β€” the index of the BAR. just the number index, nothing deeper, don't overthink it πŸ’…
  • offset β€” how far from the begin of the BAR you're starting. your little starting point ✨
  • len β€” length in bytes for the mapping. how much you're taking, in bytes, no cap πŸ“

πŸ¦‹ RETURN πŸ¦‹

a __iomem pointer on success πŸ’– β€” and on failure you get an IOMEM_ERR_PTR 😭 (so like, check that bad boy, fr fr).


🌈 DESCRIPTION 🌈

so it creates a new IO-Mapping within the specified bar, ranging from offset to offset + len. cute, tidy, exactly what it says 🎯

and here's the slay part: the mapping will automatically get unmapped on driver detach ✨ like it handles its own cleanup, icon behaviour honestly.

but lowkey listen β€” if you desired, you can release manually, and only with pcim_iounmap. that's the one. don't get creative πŸ™ˆ

⭐ SEE ALSO ⭐

like, the whole friend group, iykyk πŸ’œ


and that's the page!! brought to you by ./drivers/pci, dated October 2026 πŸŒΈπŸ¦‹ β€” mwah, go map responsibly, bestie πŸ’…βœ¨

πŸ“¦ where this page comes from