1PCI_IOMAP(9) Public Functions Provided PCI_IOMAP(9)
2
3
4
6 pci_iomap - create a virtual mapping cookie for a PCI BAR
7
9 void __iomem * pci_iomap(struct pci_dev * dev, int bar,
10 unsigned long maxlen);
11
13 dev
14 PCI device that owns the BAR
15
16 bar
17 BAR number
18
19 maxlen
20 length of the memory to map
21
23 Using this function you will get a __iomem address to your device BAR.
24 You can access it using ioread*() and iowrite*(). These functions hide
25 the details if this is a MMIO or PIO address space and will just do
26 what you expect from them in the correct way.
27
28 maxlen specifies the maximum length to map. If you want to get access
29 to the complete BAR without checking for its length first, pass 0 here.
30
32 Matthew Wilcox <matthew@wil.cx>
33 Author.
34
35 Alan Cox <alan@lxorguk.ukuu.org.uk>
36 Author.
37
39Kernel Hackers Manual 3.10 June 2019 PCI_IOMAP(9)