pci_iomap_range(9)
πΈ NAME πΈ
Okay so this page is pci_iomap_range, and it lives in the Kernel API Manual. Its whole thing? Creating a virtual mapping cookie for a PCI BAR. Iconic behavior, honestly. π
β¨ SYNOPSIS β¨
void __iomem * pci_iomap_range (struct pci_dev *dev , int bar , unsigned long offset , unsigned long maxlen );
π ARGUMENTS π
devβ the PCI device that owns the BAR. Like, whose BAR is this? This one. π«Άbarβ the BAR number. Just the number, bestie.offsetβ map memory at the given offset in the BAR. So you're not starting at the very beginning unless you say so.maxlenβ max length of the memory to map. The limit, the cap, the "don't get carried away" number. β¨
π DESCRIPTION π
Using this function, you get a __iomem address to your device BAR. That's the prize. π
You can access it using ioread*() and iowrite*(). These functions hide the details if this is a MMIO or PIO address space, and they will just do what you expect from them in the correct way. No cap, they really do handle the vibe check for you. π₯
maxlen specifies the maximum length to map. If you want to get access to the complete BAR from offset to the end, pass 0 here. That's the little shortcut, iykyk. π
π¦ SEE ALSO π¦
Kernel file ./drivers/pci/iomap.c:
π That's the page, bestie. Cute little footer crumbs: source/version is./drivers/pci, datedOctober 2026, and it's all aboutpci_iomap_range(9). Slay. π
π¦ 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