summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-09-27 12:01:15 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-09-29 03:39:06 +0000
commit9d5af5b0c2dd2c9455f8094f10e649b92094c4a3 (patch)
tree7dcda547891a58f7e4a65473fd3d72395285c6d5 /src
parent91f2f03759a0b558be52a98037beeeb2812c93ed (diff)
downloadcoreboot-9d5af5b0c2dd2c9455f8094f10e649b92094c4a3.tar.xz
device/pci_ops: Add ENV_PCI_SIMPLE_DEVICE
Source files including this may have locally defined __SIMPLE_DEVICE__ so this cannot be placed in <rules.h>. Change-Id: If700dd10fd5e082568cd6866bfd802fc2e021806 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35652 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/include/device/pci_ops.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h
index 5371e07419..9d64f037f6 100644
--- a/src/include/device/pci_ops.h
+++ b/src/include/device/pci_ops.h
@@ -39,7 +39,13 @@ static __always_inline pci_devfn_t pcidev_assert(const struct device *dev)
}
#endif
-#ifdef __SIMPLE_DEVICE__
+#if defined(__SIMPLE_DEVICE__)
+#define ENV_PCI_SIMPLE_DEVICE 1
+#else
+#define ENV_PCI_SIMPLE_DEVICE 0
+#endif
+
+#if ENV_PCI_SIMPLE_DEVICE
/* Avoid name collisions as different stages have different signature
* for these functions. The _s_ stands for simple, fundamental IO or
@@ -91,7 +97,7 @@ void pci_write_config32(const struct device *dev, u16 reg, u32 val)
#endif
-#ifdef __SIMPLE_DEVICE__
+#if ENV_PCI_SIMPLE_DEVICE
static __always_inline
void pci_or_config8(pci_devfn_t dev, u16 reg, u8 ormask)
#else
@@ -103,7 +109,7 @@ void pci_or_config8(const struct device *dev, u16 reg, u8 ormask)
pci_write_config8(dev, reg, value | ormask);
}
-#ifdef __SIMPLE_DEVICE__
+#if ENV_PCI_SIMPLE_DEVICE
static __always_inline
void pci_or_config16(pci_devfn_t dev, u16 reg, u16 ormask)
#else
@@ -115,7 +121,7 @@ void pci_or_config16(const struct device *dev, u16 reg, u16 ormask)
pci_write_config16(dev, reg, value | ormask);
}
-#ifdef __SIMPLE_DEVICE__
+#if ENV_PCI_SIMPLE_DEVICE
static __always_inline
void pci_or_config32(pci_devfn_t dev, u16 reg, u32 ormask)
#else
@@ -127,7 +133,7 @@ void pci_or_config32(const struct device *dev, u16 reg, u32 ormask)
pci_write_config32(dev, reg, value | ormask);
}
-#ifdef __SIMPLE_DEVICE__
+#if ENV_PCI_SIMPLE_DEVICE
static __always_inline
void pci_update_config8(pci_devfn_t dev, u16 reg, u8 mask, u8 or)
#else
@@ -143,7 +149,7 @@ void pci_update_config8(const struct device *dev, u16 reg, u8 mask, u8 or)
pci_write_config8(dev, reg, reg8);
}
-#ifdef __SIMPLE_DEVICE__
+#if ENV_PCI_SIMPLE_DEVICE
static __always_inline
void pci_update_config16(pci_devfn_t dev, u16 reg, u16 mask, u16 or)
#else
@@ -159,7 +165,7 @@ void pci_update_config16(const struct device *dev, u16 reg, u16 mask, u16 or)
pci_write_config16(dev, reg, reg16);
}
-#ifdef __SIMPLE_DEVICE__
+#if ENV_PCI_SIMPLE_DEVICE
static __always_inline
void pci_update_config32(pci_devfn_t dev, u16 reg, u32 mask, u32 or)
#else