summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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