aboutsummaryrefslogtreecommitdiff
path: root/src/include/device/pci_ops.h
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-03-01 08:08:28 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-03-03 13:43:59 +0000
commit92b5296a7ba1d6368ea425d71bcbf804b0ec97c7 (patch)
tree4fe55a9a0ab6e842676820d6685ed92091ef5c52 /src/include/device/pci_ops.h
parent268744306a512de20839fa566f847d33cfec03bc (diff)
device/pci_ops: Avoid name collisions
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 <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/31677 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/include/device/pci_ops.h')
-rw-r--r--src/include/device/pci_ops.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h
index 1cf5b77bf7..6bcb3e95b1 100644
--- a/src/include/device/pci_ops.h
+++ b/src/include/device/pci_ops.h
@@ -5,7 +5,19 @@
#include <device/device.h>
#include <arch/pci_ops.h>
-#ifndef __SIMPLE_DEVICE__
+#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.
+ */
+#define pci_read_config8 pci_s_read_config8
+#define pci_read_config16 pci_s_read_config16
+#define pci_read_config32 pci_s_read_config32
+#define pci_write_config8 pci_s_write_config8
+#define pci_write_config16 pci_s_write_config16
+#define pci_write_config32 pci_s_write_config32
+#else
u8 pci_read_config8(struct device *dev, unsigned int where);
u16 pci_read_config16(struct device *dev, unsigned int where);
u32 pci_read_config32(struct device *dev, unsigned int where);