[PATCH 072/111] PCIF: fixed build warnings

Daniel Hellstrom daniel at gaisler.com
Thu Feb 26 16:39:14 UTC 2015


---
 c/src/lib/libbsp/sparc/Makefile.am           |    1 +
 c/src/lib/libbsp/sparc/leon2/Makefile.am     |    1 +
 c/src/lib/libbsp/sparc/leon2/preinstall.am   |    4 ++++
 c/src/lib/libbsp/sparc/leon3/Makefile.am     |    1 +
 c/src/lib/libbsp/sparc/leon3/preinstall.am   |    4 ++++
 c/src/lib/libbsp/sparc/shared/include/pcif.h |   15 +++++++++++++++
 c/src/lib/libbsp/sparc/shared/pci/pcif.c     |   26 +++++++++++++-------------
 7 files changed, 39 insertions(+), 13 deletions(-)
 create mode 100644 c/src/lib/libbsp/sparc/shared/include/pcif.h

diff --git a/c/src/lib/libbsp/sparc/Makefile.am b/c/src/lib/libbsp/sparc/Makefile.am
index 265cbca..25eb099 100644
--- a/c/src/lib/libbsp/sparc/Makefile.am
+++ b/c/src/lib/libbsp/sparc/Makefile.am
@@ -41,6 +41,7 @@ EXTRA_DIST += shared/timer/tlib_ckinit.c
 # PCI bus
 EXTRA_DIST += shared/include/grpci.h
 EXTRA_DIST += shared/include/grpci2.h
+EXTRA_DIST += shared/include/pcif.h
 EXTRA_DIST += shared/pci/grpci.c
 EXTRA_DIST += shared/pci/grpci2.c
 EXTRA_DIST += shared/pci/pcif.c
diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
index 67805e4..927d539 100644
--- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
@@ -99,6 +99,7 @@ libbsp_a_SOURCES += ../../sparc/shared/timer/tlib.c
 # PCI
 include_HEADERS += ../../sparc/shared/include/grpci.h
 include_HEADERS += ../../sparc/shared/include/grpci2.h
+include_HEADERS += ../../sparc/shared/include/pcif.h
 libbsp_a_SOURCES += ../../sparc/shared/pci/grpci2.c
 libbsp_a_SOURCES += ../../sparc/shared/pci/grpci.c
 libbsp_a_SOURCES += ../../sparc/shared/pci/pcif.c
diff --git a/c/src/lib/libbsp/sparc/leon2/preinstall.am b/c/src/lib/libbsp/sparc/leon2/preinstall.am
index 3c751d6..5874ac7 100644
--- a/c/src/lib/libbsp/sparc/leon2/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon2/preinstall.am
@@ -125,6 +125,10 @@ $(PROJECT_INCLUDE)/grpci2.h: ../../sparc/shared/include/grpci2.h $(PROJECT_INCLU
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/grpci2.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/grpci2.h
 
+$(PROJECT_INCLUDE)/pcif.h: ../../sparc/shared/include/pcif.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/pcif.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/pcif.h
+
 $(PROJECT_INCLUDE)/gr_701.h: ../../sparc/shared/include/gr_701.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gr_701.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/gr_701.h
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index d445d8f..924c112 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -108,6 +108,7 @@ libbsp_a_SOURCES += \
 # PCI
 include_HEADERS += ../../sparc/shared/include/grpci.h
 include_HEADERS += ../../sparc/shared/include/grpci2.h
+include_HEADERS += ../../sparc/shared/include/pcif.h
 libbsp_a_SOURCES += ../../sparc/shared/pci/grpci.c
 libbsp_a_SOURCES += ../../sparc/shared/pci/grpci2.c
 libbsp_a_SOURCES +=  ../../sparc/shared/pci/pcif.c
diff --git a/c/src/lib/libbsp/sparc/leon3/preinstall.am b/c/src/lib/libbsp/sparc/leon3/preinstall.am
index 375e8e8..e506354 100644
--- a/c/src/lib/libbsp/sparc/leon3/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon3/preinstall.am
@@ -141,6 +141,10 @@ $(PROJECT_INCLUDE)/grpci2.h: ../../sparc/shared/include/grpci2.h $(PROJECT_INCLU
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/grpci2.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/grpci2.h
 
+$(PROJECT_INCLUDE)/pcif.h: ../../sparc/shared/include/pcif.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/pcif.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/pcif.h
+
 $(PROJECT_INCLUDE)/gr_701.h: ../../sparc/shared/include/gr_701.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gr_701.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/gr_701.h
diff --git a/c/src/lib/libbsp/sparc/shared/include/pcif.h b/c/src/lib/libbsp/sparc/shared/include/pcif.h
new file mode 100644
index 0000000..0221fcd
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/include/pcif.h
@@ -0,0 +1,15 @@
+#ifndef __PCIF_H__
+#define __PCIF_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Register the PCIF PCI host driver to the Driver Manager */
+extern void pcif_register_drv(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/c/src/lib/libbsp/sparc/shared/pci/pcif.c b/c/src/lib/libbsp/sparc/shared/pci/pcif.c
index bc435b5..8ace3df 100644
--- a/c/src/lib/libbsp/sparc/shared/pci/pcif.c
+++ b/c/src/lib/libbsp/sparc/shared/pci/pcif.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <libcpu/byteorder.h>
 #include <libcpu/access.h>
+#include <rtems/bspIo.h>
 #include <pci.h>
 #include <pci/cfg.h>
 
@@ -28,10 +29,8 @@
 #include <drvmgr/ambapp_bus.h>
 #include <ambapp.h>
 #include <drvmgr/pci_bus.h>
+#include <pcif.h>
 
-#include <pci.h>
-#include <rtems/bspIo.h>
-#include <string.h>
 
 /* Configuration options */
 #define SYSTEM_MAINMEM_START 0x40000000
@@ -153,7 +152,7 @@ void pcif_register_drv(void)
 	drvmgr_drv_register(&pcif_info.general);
 }
 
-int pcif_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val)
+static int pcif_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val)
 {
 	struct pcif_priv *priv = pcifpriv;
 	volatile uint32_t *pci_conf;
@@ -197,7 +196,8 @@ int pcif_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val)
 
 	return retval;
 }
-int pcif_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val)
+
+static int pcif_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val)
 {
 	uint32_t v;
 	int retval;
@@ -211,7 +211,7 @@ int pcif_cfg_r16(pci_dev_t dev, int ofs, uint16_t *val)
 	return retval;
 }
 
-int pcif_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val)
+static int pcif_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val)
 {
 	uint32_t v;
 	int retval;
@@ -223,7 +223,7 @@ int pcif_cfg_r8(pci_dev_t dev, int ofs, uint8_t *val)
 	return retval;
 }
 
-int pcif_cfg_w32(pci_dev_t dev, int ofs, uint32_t val)
+static int pcif_cfg_w32(pci_dev_t dev, int ofs, uint32_t val)
 {
 	struct pcif_priv *priv = pcifpriv;
 	volatile uint32_t *pci_conf;
@@ -259,7 +259,7 @@ int pcif_cfg_w32(pci_dev_t dev, int ofs, uint32_t val)
 	return PCISTS_OK;
 }
 
-int pcif_cfg_w16(pci_dev_t dev, int ofs, uint16_t val)
+static int pcif_cfg_w16(pci_dev_t dev, int ofs, uint16_t val)
 {
 	uint32_t v;
 	int retval;
@@ -276,7 +276,7 @@ int pcif_cfg_w16(pci_dev_t dev, int ofs, uint16_t val)
 	return pcif_cfg_w32(dev, ofs & ~0x3, v);
 }
 
-int pcif_cfg_w8(pci_dev_t dev, int ofs, uint8_t val)
+static int pcif_cfg_w8(pci_dev_t dev, int ofs, uint8_t val)
 {
 	uint32_t v;
 	int retval;
@@ -300,7 +300,7 @@ int pcif_cfg_w8(pci_dev_t dev, int ofs, uint8_t val)
  * Returns the "system IRQ" for the PCI INTA#..INTD# pin in irq_pin. Returns
  * 0xff if not assigned.
  */
-uint8_t pcif_bus0_irq_map(pci_dev_t dev, int irq_pin)
+static uint8_t pcif_bus0_irq_map(pci_dev_t dev, int irq_pin)
 {
 	uint8_t sysIrqNr = 0; /* not assigned */
 	int irq_group;
@@ -315,7 +315,7 @@ uint8_t pcif_bus0_irq_map(pci_dev_t dev, int irq_pin)
 	return sysIrqNr;
 }
 
-int pcif_translate(uint32_t *address, int type, int dir)
+static int pcif_translate(uint32_t *address, int type, int dir)
 {
 	/* No address translation implmented at this point */
 	return 0;
@@ -350,7 +350,7 @@ struct pci_access_drv pcif_access_drv = {
 /* Initializes the PCIF core hardware
  *
  */
-int pcif_hw_init(struct pcif_priv *priv)
+static int pcif_hw_init(struct pcif_priv *priv)
 {
 	struct pcif_regs *regs;
 	uint32_t data, size;
@@ -412,7 +412,7 @@ int pcif_hw_init(struct pcif_priv *priv)
  *  -3            Error due to PCIF hardware initialization
  *  -4            Error registering driver to PCI layer
  */
-int pcif_init(struct pcif_priv *priv)
+static int pcif_init(struct pcif_priv *priv)
 {
 	struct ambapp_apb_info *apb;
 	struct ambapp_ahb_info *ahb;
-- 
1.7.0.4




More information about the devel mailing list