[PATCH 075/111] GPTIMER: fix build warnings

Daniel Hellstrom daniel at gaisler.com
Thu Feb 26 16:39:17 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/gptimer.h |   30 +++++++++++++++++++++++
 c/src/lib/libbsp/sparc/shared/timer/gptimer.c   |    9 ++++--
 7 files changed, 47 insertions(+), 3 deletions(-)
 create mode 100644 c/src/lib/libbsp/sparc/shared/include/gptimer.h

diff --git a/c/src/lib/libbsp/sparc/Makefile.am b/c/src/lib/libbsp/sparc/Makefile.am
index de125ca..e17f03a 100644
--- a/c/src/lib/libbsp/sparc/Makefile.am
+++ b/c/src/lib/libbsp/sparc/Makefile.am
@@ -33,6 +33,7 @@ EXTRA_DIST += shared/amba/ambapp_old.c
 EXTRA_DIST += shared/amba/ambapp_show.c
 
 # Clock Driver and Timer Library
+EXTRA_DIST += shared/include/gptimer.h
 EXTRA_DIST += shared/include/tlib.h
 EXTRA_DIST += shared/timer/gptimer.c
 EXTRA_DIST += shared/timer/tlib.c
diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
index 1624ea5..7f1a19f 100644
--- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
@@ -92,6 +92,7 @@ libbsp_a_SOURCES += ../../sparc/shared/amba/ambapp_show.c
 libbsp_a_SOURCES += ../../sparc/shared/amba/ahbstat.c
 
 # Clock Driver and Timer Library
+include_HEADERS += ../../sparc/shared/include/gptimer.h
 include_HEADERS += ../../sparc/shared/include/tlib.h
 libbsp_a_SOURCES += ../../sparc/shared/timer/gptimer.c
 libbsp_a_SOURCES += ../../sparc/shared/timer/tlib.c
diff --git a/c/src/lib/libbsp/sparc/leon2/preinstall.am b/c/src/lib/libbsp/sparc/leon2/preinstall.am
index ada9a3b..8ea53e0 100644
--- a/c/src/lib/libbsp/sparc/leon2/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon2/preinstall.am
@@ -113,6 +113,10 @@ $(PROJECT_INCLUDE)/ahbstat.h: ../../sparc/shared/include/ahbstat.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ahbstat.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/ahbstat.h
 
+$(PROJECT_INCLUDE)/gptimer.h: ../../sparc/shared/include/gptimer.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gptimer.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/gptimer.h
+
 $(PROJECT_INCLUDE)/tlib.h: ../../sparc/shared/include/tlib.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tlib.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/tlib.h
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index 7acd9cb..de6a4f8 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -70,6 +70,7 @@ libbsp_a_SOURCES += ../../sparc/shared/amba/ambapp_show.c
 libbsp_a_SOURCES += ../../sparc/shared/amba/ahbstat.c
 
 # Clock Driver and Timer Library
+include_HEADERS += ../../sparc/shared/include/gptimer.h
 include_HEADERS += ../../sparc/shared/include/tlib.h
 libbsp_a_SOURCES += ../../sparc/shared/timer/gptimer.c
 libbsp_a_SOURCES += ../../sparc/shared/timer/tlib.c
diff --git a/c/src/lib/libbsp/sparc/leon3/preinstall.am b/c/src/lib/libbsp/sparc/leon3/preinstall.am
index 33a295b..441102f 100644
--- a/c/src/lib/libbsp/sparc/leon3/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon3/preinstall.am
@@ -109,6 +109,10 @@ $(PROJECT_INCLUDE)/ahbstat.h: ../../sparc/shared/include/ahbstat.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ahbstat.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/ahbstat.h
 
+$(PROJECT_INCLUDE)/gptimer.h: ../../sparc/shared/include/gptimer.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/gptimer.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/gptimer.h
+
 $(PROJECT_INCLUDE)/tlib.h: ../../sparc/shared/include/tlib.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tlib.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/tlib.h
diff --git a/c/src/lib/libbsp/sparc/shared/include/gptimer.h b/c/src/lib/libbsp/sparc/shared/include/gptimer.h
new file mode 100644
index 0000000..0adea8a
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/include/gptimer.h
@@ -0,0 +1,30 @@
+/*  GPTIMER and GRTIMER timer driver
+ *
+ *  COPYRIGHT (c) 2015.
+ *  Cobham Gaisler.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ */
+
+#ifndef __GPTIMER_H__
+#define __GPTIMER_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The GPTIMER_INFO_AVAIL define set from the BSP bsp.h configures if the 
+ * Driver manager info interface is built.
+ */
+
+/* Register GPTIMER and GRTIMER driver to Driver Manager */
+void gptimer_register_drv (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/c/src/lib/libbsp/sparc/shared/timer/gptimer.c b/c/src/lib/libbsp/sparc/shared/timer/gptimer.c
index b879483..b8c08e5 100644
--- a/c/src/lib/libbsp/sparc/shared/timer/gptimer.c
+++ b/c/src/lib/libbsp/sparc/shared/timer/gptimer.c
@@ -37,6 +37,7 @@
 #include <drvmgr/drvmgr.h>
 #include <drvmgr/ambapp_bus.h>
 #include <grlib.h>
+#include <gptimer.h>
 #include "tlib.h"
 
 #if defined(LEON3) && defined(RTEMS_DRVMGR_STARTUP)
@@ -379,7 +380,7 @@ static inline struct gptimer_priv *priv_from_timer(struct gptimer_timer *t)
 		t->index * sizeof(struct gptimer_timer));
 }
 
-int gptimer_tlib_int_pend(struct tlib_dev *hand, int ack)
+static int gptimer_tlib_int_pend(struct tlib_dev *hand, int ack)
 {
 	struct gptimer_timer *timer = (struct gptimer_timer *)hand;
 	unsigned int ctrl = timer->tregs->ctrl;
@@ -415,7 +416,7 @@ void gptimer_isr(void *data)
 	}
 }
 
-void gptimer_tlib_reset(struct tlib_dev *hand)
+static void gptimer_tlib_reset(struct tlib_dev *hand)
 {
 	struct gptimer_timer *timer = (struct gptimer_timer *)hand;
 
@@ -508,7 +509,9 @@ static void gptimer_tlib_restart(struct tlib_dev *hand)
 	timer->tregs->ctrl |= GPTIMER_CTRL_LD | GPTIMER_CTRL_EN;
 }
 
-static void gptimer_tlib_get_counter(struct tlib_dev *hand, unsigned int *counter)
+static void gptimer_tlib_get_counter(
+	struct tlib_dev *hand,
+	unsigned int *counter)
 {
 	struct gptimer_timer *timer = (struct gptimer_timer *)hand;
 
-- 
1.7.0.4




More information about the devel mailing list