From 7a03ac296299fea1759432ba4a283bc608d4d449 Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Fri, 6 Feb 2015 09:59:13 +0100 Subject: APBUART_CONS: fix build warning --- 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 ++++ c/src/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 (limited to 'c/src') diff --git a/c/src/lib/libbsp/sparc/Makefile.am b/c/src/lib/libbsp/sparc/Makefile.am index ca93999038..de125caea1 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 a61549f2ff..7acd9cb460 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 3d92b373d4..33a295b5ea 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 0000000000..7aed0a4576 --- /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 e0fa64e178..8bee2e9f21 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 #include #include +#include /*#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)); } -- cgit v1.2.3