summaryrefslogtreecommitdiff
path: root/src/include/device/pci_ops.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/device/pci_ops.h')
-rw-r--r--src/include/device/pci_ops.h46
1 files changed, 36 insertions, 10 deletions
diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h
index 5e60e8de2d..54284f590a 100644
--- a/src/include/device/pci_ops.h
+++ b/src/include/device/pci_ops.h
@@ -15,33 +15,49 @@ void pci_write_config32(struct device *dev, unsigned int where, u32 val);
#endif
-/*
- * Use device_t here as the functions are to be used with either
- * __SIMPLE_DEVICE__ defined or undefined.
- */
+#ifdef __SIMPLE_DEVICE__
static __always_inline
-void pci_or_config8(device_t dev, unsigned int where, u8 ormask)
+void pci_or_config8(pci_devfn_t dev, unsigned int where, u8 ormask)
+#else
+static __always_inline
+void pci_or_config8(struct device *dev, unsigned int where, u8 ormask)
+#endif
{
u8 value = pci_read_config8(dev, where);
pci_write_config8(dev, where, value | ormask);
}
+#ifdef __SIMPLE_DEVICE__
+static __always_inline
+void pci_or_config16(pci_devfn_t dev, unsigned int where, u16 ormask)
+#else
static __always_inline
-void pci_or_config16(device_t dev, unsigned int where, u16 ormask)
+void pci_or_config16(struct device *dev, unsigned int where, u16 ormask)
+#endif
{
u16 value = pci_read_config16(dev, where);
pci_write_config16(dev, where, value | ormask);
}
+#ifdef __SIMPLE_DEVICE__
+static __always_inline
+void pci_or_config32(pci_devfn_t dev, unsigned int where, u32 ormask)
+#else
static __always_inline
-void pci_or_config32(device_t dev, unsigned int where, u32 ormask)
+void pci_or_config32(struct device *dev, unsigned int where, u32 ormask)
+#endif
{
u32 value = pci_read_config32(dev, where);
pci_write_config32(dev, where, value | ormask);
}
+#ifdef __SIMPLE_DEVICE__
static __always_inline
-void pci_update_config8(device_t dev, int reg, u8 mask, u8 or)
+void pci_update_config8(pci_devfn_t dev, int reg, u8 mask, u8 or)
+#else
+static __always_inline
+void pci_update_config8(struct device *dev, int reg, u8 mask, u8 or)
+#endif
{
u8 reg8;
@@ -51,8 +67,13 @@ void pci_update_config8(device_t dev, int reg, u8 mask, u8 or)
pci_write_config8(dev, reg, reg8);
}
+#ifdef __SIMPLE_DEVICE__
+static __always_inline
+void pci_update_config16(pci_devfn_t dev, int reg, u16 mask, u16 or)
+#else
static __always_inline
-void pci_update_config16(device_t dev, int reg, u16 mask, u16 or)
+void pci_update_config16(struct device *dev, int reg, u16 mask, u16 or)
+#endif
{
u16 reg16;
@@ -62,8 +83,13 @@ void pci_update_config16(device_t dev, int reg, u16 mask, u16 or)
pci_write_config16(dev, reg, reg16);
}
+#ifdef __SIMPLE_DEVICE__
+static __always_inline
+void pci_update_config32(pci_devfn_t dev, int reg, u32 mask, u32 or)
+#else
static __always_inline
-void pci_update_config32(device_t dev, int reg, u32 mask, u32 or)
+void pci_update_config32(struct device *dev, int reg, u32 mask, u32 or)
+#endif
{
u32 reg32;