[PATCH 074/111] APBUART_CONS: fix build warning

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


---
 c/src/lib/libbsp/sparc/Makefile.am                 |    1 +
 c/src/lib/libbsp/sparc/leon3/Makefile.am           |    1 +
 c/src/lib/libbsp/sparc/leon3/preinstall.am         |    4 ++++
 .../lib/libbsp/sparc/shared/include/apbuart_cons.h |   16 ++++++++++++++++
 c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c  |    9 +++++----
 5 files changed, 27 insertions(+), 4 deletions(-)
 create mode 100644 c/src/lib/libbsp/sparc/shared/include/apbuart_cons.h

diff --git a/c/src/lib/libbsp/sparc/Makefile.am b/c/src/lib/libbsp/sparc/Makefile.am
index ca93999..de125ca 100644
--- a/c/src/lib/libbsp/sparc/Makefile.am
+++ b/c/src/lib/libbsp/sparc/Makefile.am
@@ -77,6 +77,7 @@ EXTRA_DIST += shared/include/grspw_router.h
 EXTRA_DIST += shared/uart/cons.c
 EXTRA_DIST += shared/uart/apbuart_cons.c
 EXTRA_DIST += shared/include/cons.h
+EXTRA_DIST += shared/include/apbuart_cons.h
 EXTRA_DIST += shared/uart/apbuart.c
 EXTRA_DIST += shared/include/apbuart.h
 
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index a61549f..7acd9cb 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -84,6 +84,7 @@ libbsp_a_SOURCES += console/console.c
 libbsp_a_SOURCES += ../../sparc/shared/uart/cons.c
 libbsp_a_SOURCES += ../../sparc/shared/uart/apbuart_cons.c
 include_HEADERS += ../../sparc/shared/include/cons.h
+include_HEADERS += ../../sparc/shared/include/apbuart_cons.h
 # debugio
 libbsp_a_SOURCES += console/printk_support.c
 
diff --git a/c/src/lib/libbsp/sparc/leon3/preinstall.am b/c/src/lib/libbsp/sparc/leon3/preinstall.am
index 3d92b37..33a295b 100644
--- a/c/src/lib/libbsp/sparc/leon3/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon3/preinstall.am
@@ -117,6 +117,10 @@ $(PROJECT_INCLUDE)/cons.h: ../../sparc/shared/include/cons.h $(PROJECT_INCLUDE)/
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/cons.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/cons.h
 
+$(PROJECT_INCLUDE)/apbuart_cons.h: ../../sparc/shared/include/apbuart_cons.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/apbuart_cons.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/apbuart_cons.h
+
 $(PROJECT_INCLUDE)/genirq.h: ../../sparc/shared/include/genirq.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/genirq.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/genirq.h
diff --git a/c/src/lib/libbsp/sparc/shared/include/apbuart_cons.h b/c/src/lib/libbsp/sparc/shared/include/apbuart_cons.h
new file mode 100644
index 0000000..7aed0a4
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/include/apbuart_cons.h
@@ -0,0 +1,16 @@
+/*  APBUART Console driver interface
+ *
+ *  COPYRIGHT (c) 2015.
+ *  Cobham Gaisler.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef __APBUART_CONS_H__
+#define __APBUART_CONS_H__
+
+void apbuart_cons_register_drv (void);
+
+#endif
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
index e0fa64e..8bee2e9 100644
--- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
+++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
@@ -32,6 +32,7 @@
 #include <grlib.h>
 #include <cons.h>
 #include <rtems/termiostypes.h>
+#include <apbuart_cons.h>
 
 /*#define DEBUG 1  */
 
@@ -450,7 +451,7 @@ struct apbuart_baud {
 	unsigned int num;
 	unsigned int baud;
 };
-struct apbuart_baud apbuart_baud_table[] = {
+static struct apbuart_baud apbuart_baud_table[] = {
 	{B50, 50},
 	{B75, 75},
 	{B110, 110},
@@ -473,7 +474,7 @@ struct apbuart_baud apbuart_baud_table[] = {
 };
 #define BAUD_NUM (sizeof(apbuart_baud_table)/sizeof(struct apbuart_baud))
 
-int apbuart_baud_num2baud(unsigned int num)
+static int apbuart_baud_num2baud(unsigned int num)
 {
 	int i;
 
@@ -483,7 +484,7 @@ int apbuart_baud_num2baud(unsigned int num)
 	return -1;
 }
 
-struct apbuart_baud *apbuart_baud_find_closest(unsigned int baud)
+static struct apbuart_baud *apbuart_baud_find_closest(unsigned int baud)
 {
 	int i, diff;
 
@@ -511,7 +512,7 @@ int apbuart_get_baud(struct apbuart_priv *uart)
 	return core_clk_hz / ((scaler + 1) * 8);
 }
 
-struct apbuart_baud *apbuart_get_baud_closest(struct apbuart_priv *uart)
+static struct apbuart_baud *apbuart_get_baud_closest(struct apbuart_priv *uart)
 {
 	return apbuart_baud_find_closest(apbuart_get_baud(uart));
 }
-- 
1.7.0.4




More information about the devel mailing list