static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) { struct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus); if (cfg && cfg->virt) return cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12)); return NULL; }
/* * Functions for accessing PCI configuration space with MMCONFIG accesses */ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn) { struct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus); if (cfg) return cfg->address; return 0; }
void __iomem * pci_mcfg_dev_base(struct pci_bus *bus, unsigned int devfn, int offset) { struct pci_mmcfg_region *cfg; cfg = pci_mmconfig_lookup(pci_domain_nr(bus), bus->number); if (cfg && cfg->virt) return cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus->number) | (devfn << 12)) + offset; return NULL; }