pcim_iomap(9)
π pcim_iomap(9) β like, the managed iomap one
okay bestie, welcome to the Kernel API Manual entry for pcim_iomap, aka the function that maps a PCI BAR for you and then quietly cleans up after itself like the responsible main character it is π
β¨ NAME β¨
pcim_iomap β the managed version of pcim_iomap(), no cap π
π¦ SYNOPSIS π¦
void __iomem * pcim_iomap (struct pci_dev *pdev , int bar , unsigned
long maxlen );
πΈ ARGUMENTS πΈ
pdevβ the PCI device you're iomapping for, your little guy π«Άbarβ which BAR you wanna iomap, pick one bestiemaxlenβ the maximum length of the iomap, aka how much you're asking for
β RETURN β
you get a __iomem pointer on success, and NULL on failure. that's it, that's the deal β¨
π DESCRIPTION π
so this is the managed pci_iomap. the map gets automatically unmapped on driver detach β the kernel handles the cleanup for you, obsessed π
but like, if you really want to unmap it manually? you can, but only with pcim_iounmap. literally only that one, iykyk π
also this SHOULD only be used once per BAR. once. per BAR. don't be weird about it π
π NOTE π
okay this is important so listen up π₯ contrary to all the other pcim_* functions, this one does NOT return an IOMEM_ERR_PTR on failure β it returns a simple NULL instead. and why? for backwards compatibility, bestie. that's the whole reason. periodt π
π SEE ALSO π
kernel file ./drivers/pci/devres.c plus all these iconic neighbors:
devm_pci_remap_iospace(9), devm_pci_remap_cfgspace(9), devm_pci_remap_cfg_resource(9), pcim_set_mwi(9), pcim_intx(9), pcim_enable_device(9), pcim_pin_device(9), pcim_iomap_table(9), pcim_iounmap(9), pcim_iomap_region(9), pcim_iounmap_region(9), pcim_iomap_regions(9), pcim_request_region(9), pcim_release_region(9), pcim_release_all_regions(9), pcim_request_all_regions(9), pcim_iomap_range(9) π¦
and that's the whole page, bestie! this one lives in ./drivers/pci and it's dated October 2026 β go forth and map responsibly, 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