From 92b5296a7ba1d6368ea425d71bcbf804b0ec97c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 1 Mar 2019 08:08:28 +0200 Subject: device/pci_ops: Avoid name collisions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Having different signatures for the PCI config accessors prevents them from having the same name in different stages. For now, work around this using __SIMPLE_DEVICE__. Change-Id: I20f56cfe3ac7dc4421e62a99ca91f39a857c0ccf Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/31677 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Felix Held --- src/arch/x86/include/arch/pci_io_cfg.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/include/arch/pci_io_cfg.h b/src/arch/x86/include/arch/pci_io_cfg.h index d02e6404d2..3e2129fa1a 100644 --- a/src/arch/x86/include/arch/pci_io_cfg.h +++ b/src/arch/x86/include/arch/pci_io_cfg.h @@ -78,43 +78,48 @@ void pci_io_write_config32(pci_devfn_t dev, unsigned int where, uint32_t value) } #if !IS_ENABLED(CONFIG_MMCONF_SUPPORT) -#ifdef __SIMPLE_DEVICE__ + +/* Avoid name collisions as different stages have different signature + * for these functions. The _s_ stands for simple, fundamental IO or + * MMIO variant. + */ + static __always_inline -uint8_t pci_read_config8(pci_devfn_t dev, unsigned int where) +uint8_t pci_s_read_config8(pci_devfn_t dev, unsigned int where) { return pci_io_read_config8(dev, where); } static __always_inline -uint16_t pci_read_config16(pci_devfn_t dev, unsigned int where) +uint16_t pci_s_read_config16(pci_devfn_t dev, unsigned int where) { return pci_io_read_config16(dev, where); } static __always_inline -uint32_t pci_read_config32(pci_devfn_t dev, unsigned int where) +uint32_t pci_s_read_config32(pci_devfn_t dev, unsigned int where) { return pci_io_read_config32(dev, where); } static __always_inline -void pci_write_config8(pci_devfn_t dev, unsigned int where, uint8_t value) +void pci_s_write_config8(pci_devfn_t dev, unsigned int where, uint8_t value) { pci_io_write_config8(dev, where, value); } static __always_inline -void pci_write_config16(pci_devfn_t dev, unsigned int where, uint16_t value) +void pci_s_write_config16(pci_devfn_t dev, unsigned int where, uint16_t value) { pci_io_write_config16(dev, where, value); } static __always_inline -void pci_write_config32(pci_devfn_t dev, unsigned int where, uint32_t value) +void pci_s_write_config32(pci_devfn_t dev, unsigned int where, uint32_t value) { pci_io_write_config32(dev, where, value); } -#endif /* __SIMPLE_DEVICE__ */ + #endif #endif /* _PCI_IO_CFG_H */ -- cgit v1.2.3