[coreboot-gerrit] Change in coreboot[master]: pci: Move inline function to device/pci.h

Patrick Rudolph (Code Review) gerrit at coreboot.org
Wed Apr 18 10:36:40 CEST 2018


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/25720


Change subject: pci: Move inline function to device/pci.h
......................................................................

pci: Move inline function to device/pci.h

Move inline function where they belong to.
Fixes compilation on non x86.

Change-Id: Ia05391c43b8d501bd68df5654bcfb587f8786f71
Signed-off-by: Patrick Rudolph <patrick.rudolph at 9elements.com>
---
M src/arch/x86/include/arch/io.h
M src/include/device/pci.h
2 files changed, 54 insertions(+), 59 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/25720/1

diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h
index d35e964..37b2e95 100644
--- a/src/arch/x86/include/arch/io.h
+++ b/src/arch/x86/include/arch/io.h
@@ -427,63 +427,4 @@
 }
 
 #endif /* __SIMPLE_DEVICE__ */
-
-#ifndef __SIMPLE_DEVICE__
-#include <device/pci_ops.h>
-#endif
-
-static inline __attribute__((always_inline))
-void pci_or_config8(device_t dev, unsigned int where, u8 ormask)
-{
-	u8 value = pci_read_config8(dev, where);
-	pci_write_config8(dev, where, value | ormask);
-}
-
-static inline __attribute__((always_inline))
-void pci_or_config16(device_t dev, unsigned int where, u16 ormask)
-{
-	u16 value = pci_read_config16(dev, where);
-	pci_write_config16(dev, where, value | ormask);
-}
-
-static inline __attribute__((always_inline))
-void pci_or_config32(device_t dev, unsigned int where, u32 ormask)
-{
-	u32 value = pci_read_config32(dev, where);
-	pci_write_config32(dev, where, value | ormask);
-}
-
-static inline __attribute__((always_inline))
-void pci_update_config8(device_t dev, int reg, u8 mask, u8 or)
-{
-	u8 reg8;
-
-	reg8 = pci_read_config8(dev, reg);
-	reg8 &= mask;
-	reg8 |= or;
-	pci_write_config8(dev, reg, reg8);
-}
-
-static inline __attribute__((always_inline))
-void pci_update_config16(device_t dev, int reg, u16 mask, u16 or)
-{
-	u16 reg16;
-
-	reg16 = pci_read_config16(dev, reg);
-	reg16 &= mask;
-	reg16 |= or;
-	pci_write_config16(dev, reg, reg16);
-}
-
-static inline __attribute__((always_inline))
-void pci_update_config32(device_t dev, int reg, u32 mask, u32 or)
-{
-	u32 reg32;
-
-	reg32 = pci_read_config32(dev, reg);
-	reg32 &= mask;
-	reg32 |= or;
-	pci_write_config32(dev, reg, reg32);
-}
-
 #endif
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index 5eb6a4a..284ad69 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -136,6 +136,60 @@
 }
 #endif
 
+static inline __attribute__((always_inline))
+void pci_or_config8(device_t dev, unsigned int where, u8 ormask)
+{
+	u8 value = pci_read_config8(dev, where);
+	pci_write_config8(dev, where, value | ormask);
+}
+
+static inline __attribute__((always_inline))
+void pci_or_config16(device_t dev, unsigned int where, u16 ormask)
+{
+	u16 value = pci_read_config16(dev, where);
+	pci_write_config16(dev, where, value | ormask);
+}
+
+static inline __attribute__((always_inline))
+void pci_or_config32(device_t dev, unsigned int where, u32 ormask)
+{
+	u32 value = pci_read_config32(dev, where);
+	pci_write_config32(dev, where, value | ormask);
+}
+
+static inline __attribute__((always_inline))
+void pci_update_config8(device_t dev, int reg, u8 mask, u8 or)
+{
+	u8 reg8;
+
+	reg8 = pci_read_config8(dev, reg);
+	reg8 &= mask;
+	reg8 |= or;
+	pci_write_config8(dev, reg, reg8);
+}
+
+static inline __attribute__((always_inline))
+void pci_update_config16(device_t dev, int reg, u16 mask, u16 or)
+{
+	u16 reg16;
+
+	reg16 = pci_read_config16(dev, reg);
+	reg16 &= mask;
+	reg16 |= or;
+	pci_write_config16(dev, reg, reg16);
+}
+
+static inline __attribute__((always_inline))
+void pci_update_config32(device_t dev, int reg, u32 mask, u32 or)
+{
+	u32 reg32;
+
+	reg32 = pci_read_config32(dev, reg);
+	reg32 &= mask;
+	reg32 |= or;
+	pci_write_config32(dev, reg, reg32);
+}
+
 #endif /* CONFIG_PCI */
 
 #endif /* PCI_H */

-- 
To view, visit https://review.coreboot.org/25720
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia05391c43b8d501bd68df5654bcfb587f8786f71
Gerrit-Change-Number: 25720
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph at 9elements.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180418/6f971830/attachment-0001.html>


More information about the coreboot-gerrit mailing list