[PATCH 1/8] Add console-polled.h and update all BSPs that should use it.

Joel Sherrill joel.sherrill at oarcorp.com
Thu Oct 9 18:39:52 UTC 2014


The file console-polled.h provides the prototypes for the three
required methods when implementing a single port polled console
driver. This paradigm is common on simulators and simple hardware.

+ Updated the BSPs Makefile.am to make console-polled.h available.
+ Regenerated the BSPs preinstall.sm.
+ Updated console support files to include <bsp/console-polled.h>.
+ Updated console support files to make printk() support method static.
---
 c/src/lib/libbsp/arm/gdbarmsim/Makefile.am         |  1 +
 .../lib/libbsp/arm/gdbarmsim/console/console-io.c  |  3 +-
 c/src/lib/libbsp/arm/gdbarmsim/preinstall.am       |  4 ++
 c/src/lib/libbsp/avr/avrtest/Makefile.am           |  1 +
 c/src/lib/libbsp/avr/avrtest/console/console-io.c  |  9 +++--
 c/src/lib/libbsp/avr/avrtest/preinstall.am         |  4 ++
 c/src/lib/libbsp/h8300/h8sim/Makefile.am           |  1 +
 c/src/lib/libbsp/h8300/h8sim/console/console-io.c  |  5 ++-
 c/src/lib/libbsp/h8300/h8sim/preinstall.am         |  4 ++
 c/src/lib/libbsp/m32c/m32cbsp/Makefile.am          |  1 +
 c/src/lib/libbsp/m32c/m32cbsp/console/console-io.c |  9 +++--
 c/src/lib/libbsp/m32c/m32cbsp/preinstall.am        |  4 ++
 c/src/lib/libbsp/m32r/m32rsim/Makefile.am          |  1 +
 c/src/lib/libbsp/m32r/m32rsim/console/console-io.c |  3 +-
 c/src/lib/libbsp/m32r/m32rsim/preinstall.am        |  4 ++
 c/src/lib/libbsp/m68k/csb360/Makefile.am           |  1 +
 c/src/lib/libbsp/m68k/csb360/console/console-io.c  |  7 +++-
 c/src/lib/libbsp/m68k/csb360/preinstall.am         |  4 ++
 c/src/lib/libbsp/mips/csb350/Makefile.am           |  1 +
 c/src/lib/libbsp/mips/csb350/console/console-io.c  |  9 +++--
 c/src/lib/libbsp/mips/csb350/preinstall.am         |  4 ++
 c/src/lib/libbsp/mips/jmr3904/Makefile.am          |  1 +
 c/src/lib/libbsp/mips/jmr3904/console/console-io.c |  7 +++-
 c/src/lib/libbsp/mips/jmr3904/preinstall.am        |  4 ++
 c/src/lib/libbsp/moxie/moxiesim/Makefile.am        |  1 +
 .../lib/libbsp/moxie/moxiesim/console/console-io.c |  7 +++-
 c/src/lib/libbsp/moxie/moxiesim/preinstall.am      |  4 ++
 c/src/lib/libbsp/nios2/nios2_iss/Makefile.am       |  1 +
 c/src/lib/libbsp/nios2/nios2_iss/console/console.c |  8 ++--
 c/src/lib/libbsp/nios2/nios2_iss/preinstall.am     |  4 ++
 c/src/lib/libbsp/powerpc/psim/Makefile.am          |  1 +
 c/src/lib/libbsp/powerpc/psim/console/console-io.c |  3 +-
 c/src/lib/libbsp/powerpc/psim/preinstall.am        |  4 ++
 c/src/lib/libbsp/powerpc/qemuppc/Makefile.am       |  1 +
 .../libbsp/powerpc/qemuppc/console/console-io.c    |  9 +++--
 c/src/lib/libbsp/powerpc/qemuppc/preinstall.am     |  4 ++
 c/src/lib/libbsp/sh/shsim/Makefile.am              |  1 +
 c/src/lib/libbsp/sh/shsim/console/console-io.c     |  7 ++--
 c/src/lib/libbsp/sh/shsim/preinstall.am            |  4 ++
 c/src/lib/libbsp/shared/console-polled.c           | 13 ++++---
 c/src/lib/libbsp/shared/include/console-polled.h   | 43 ++++++++++++++++++++++
 c/src/lib/libbsp/v850/gdbv850sim/Makefile.am       |  1 +
 .../libbsp/v850/gdbv850sim/console/console-io.c    |  3 +-
 c/src/lib/libbsp/v850/gdbv850sim/preinstall.am     |  4 ++
 44 files changed, 179 insertions(+), 36 deletions(-)
 create mode 100644 c/src/lib/libbsp/shared/include/console-polled.h

diff --git a/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am b/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
index 9afe11e..f13ad7d 100644
--- a/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
+++ b/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
@@ -16,6 +16,7 @@ include_bsp_HEADERS += ../../shared/include/irq-info.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 noinst_PROGRAMS =
 
diff --git a/c/src/lib/libbsp/arm/gdbarmsim/console/console-io.c b/c/src/lib/libbsp/arm/gdbarmsim/console/console-io.c
index d5ac5e8..8bea74d 100644
--- a/c/src/lib/libbsp/arm/gdbarmsim/console/console-io.c
+++ b/c/src/lib/libbsp/arm/gdbarmsim/console/console-io.c
@@ -8,6 +8,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -51,7 +52,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void MyBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void MyBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = MyBSP_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/arm/gdbarmsim/preinstall.am b/c/src/lib/libbsp/arm/gdbarmsim/preinstall.am
index de1cec0..927e8fb 100644
--- a/c/src/lib/libbsp/arm/gdbarmsim/preinstall.am
+++ b/c/src/lib/libbsp/arm/gdbarmsim/preinstall.am
@@ -73,6 +73,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/avr/avrtest/Makefile.am b/c/src/lib/libbsp/avr/avrtest/Makefile.am
index 51f3fd4..e3e84bd 100644
--- a/c/src/lib/libbsp/avr/avrtest/Makefile.am
+++ b/c/src/lib/libbsp/avr/avrtest/Makefile.am
@@ -12,6 +12,7 @@ include_HEADERS += ../../shared/include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 noinst_PROGRAMS =
 
diff --git a/c/src/lib/libbsp/avr/avrtest/console/console-io.c b/c/src/lib/libbsp/avr/avrtest/console/console-io.c
index b7b2548..f02ad5d 100644
--- a/c/src/lib/libbsp/avr/avrtest/console/console-io.c
+++ b/c/src/lib/libbsp/avr/avrtest/console/console-io.c
@@ -1,7 +1,9 @@
 /*
  *  This file contains the hardware specific portions of the TTY driver
- *  for the serial ports on the erc32.
- *
+ *  for the serial ports on the avr.
+ */
+
+/*
  *  COPYRIGHT (c) 1989-2008.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -11,6 +13,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -59,7 +62,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void AVRsimBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void AVRsimBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = AVRsimBSP_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/avr/avrtest/preinstall.am b/c/src/lib/libbsp/avr/avrtest/preinstall.am
index 347e43d..f3d7d23 100644
--- a/c/src/lib/libbsp/avr/avrtest/preinstall.am
+++ b/c/src/lib/libbsp/avr/avrtest/preinstall.am
@@ -53,6 +53,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/h8300/h8sim/Makefile.am b/c/src/lib/libbsp/h8300/h8sim/Makefile.am
index 147b93d..19f473a 100644
--- a/c/src/lib/libbsp/h8300/h8sim/Makefile.am
+++ b/c/src/lib/libbsp/h8300/h8sim/Makefile.am
@@ -11,6 +11,7 @@ include_HEADERS += ../../shared/include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 
 nodist_include_HEADERS += ../../shared/include/coverhd.h
diff --git a/c/src/lib/libbsp/h8300/h8sim/console/console-io.c b/c/src/lib/libbsp/h8300/h8sim/console/console-io.c
index 03e2140..195ac5c 100644
--- a/c/src/lib/libbsp/h8300/h8sim/console/console-io.c
+++ b/c/src/lib/libbsp/h8300/h8sim/console/console-io.c
@@ -1,6 +1,6 @@
 /*
  *  This file contains the hardware specific portions of the TTY driver
- *  for the serial ports on the erc32.
+ *  for the serial ports on the h8300 simulator in gdb.
  */
 
 /*
@@ -13,6 +13,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -58,7 +59,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void H8simBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void H8simBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = H8simBSP_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/h8300/h8sim/preinstall.am b/c/src/lib/libbsp/h8300/h8sim/preinstall.am
index 347e43d..f3d7d23 100644
--- a/c/src/lib/libbsp/h8300/h8sim/preinstall.am
+++ b/c/src/lib/libbsp/h8300/h8sim/preinstall.am
@@ -53,6 +53,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am b/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
index 1378979..c0d7238 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
+++ b/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
@@ -12,6 +12,7 @@ include_HEADERS += ../../shared/include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 noinst_PROGRAMS =
 
diff --git a/c/src/lib/libbsp/m32c/m32cbsp/console/console-io.c b/c/src/lib/libbsp/m32c/m32cbsp/console/console-io.c
index f98977a..745493c 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/console/console-io.c
+++ b/c/src/lib/libbsp/m32c/m32cbsp/console/console-io.c
@@ -1,7 +1,9 @@
 /*
  *  This file contains the hardware specific portions of the TTY driver
- *  for the serial ports on the erc32.
- *
+ *  for the serial ports on the m32c simulator in gdb.
+ */
+
+/*
  *  COPYRIGHT (c) 1989-2008.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -11,6 +13,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -56,7 +59,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void M32CsimBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void M32CsimBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type       BSP_output_char = M32CsimBSP_output_char;
 BSP_polling_getchar_function_type   BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/m32c/m32cbsp/preinstall.am b/c/src/lib/libbsp/m32c/m32cbsp/preinstall.am
index 347e43d..f3d7d23 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/preinstall.am
+++ b/c/src/lib/libbsp/m32c/m32cbsp/preinstall.am
@@ -53,6 +53,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/m32r/m32rsim/Makefile.am b/c/src/lib/libbsp/m32r/m32rsim/Makefile.am
index 7fca9f5..ec3dcda 100644
--- a/c/src/lib/libbsp/m32r/m32rsim/Makefile.am
+++ b/c/src/lib/libbsp/m32r/m32rsim/Makefile.am
@@ -12,6 +12,7 @@ include_HEADERS += include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 noinst_PROGRAMS =
 
diff --git a/c/src/lib/libbsp/m32r/m32rsim/console/console-io.c b/c/src/lib/libbsp/m32r/m32rsim/console/console-io.c
index e9dbd46..4c8c945 100644
--- a/c/src/lib/libbsp/m32r/m32rsim/console/console-io.c
+++ b/c/src/lib/libbsp/m32r/m32rsim/console/console-io.c
@@ -8,6 +8,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -53,7 +54,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void console_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void console_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = console_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/m32r/m32rsim/preinstall.am b/c/src/lib/libbsp/m32r/m32rsim/preinstall.am
index 5092254..586785b 100644
--- a/c/src/lib/libbsp/m32r/m32rsim/preinstall.am
+++ b/c/src/lib/libbsp/m32r/m32rsim/preinstall.am
@@ -53,6 +53,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/m68k/csb360/Makefile.am b/c/src/lib/libbsp/m68k/csb360/Makefile.am
index 63cd6a2..f152e01 100644
--- a/c/src/lib/libbsp/m68k/csb360/Makefile.am
+++ b/c/src/lib/libbsp/m68k/csb360/Makefile.am
@@ -11,6 +11,7 @@ include_HEADERS += include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 
 include_HEADERS += include/coverhd.h
diff --git a/c/src/lib/libbsp/m68k/csb360/console/console-io.c b/c/src/lib/libbsp/m68k/csb360/console/console-io.c
index 47dcbbb..9b0aeac 100644
--- a/c/src/lib/libbsp/m68k/csb360/console/console-io.c
+++ b/c/src/lib/libbsp/m68k/csb360/console/console-io.c
@@ -1,7 +1,9 @@
 /*
  *  This file contains the hardware specific portions of the TTY driver
  *  for the serial ports on the mcf5272
- *
+ */
+
+/*
  *  COPYRIGHT (c) 1989-2000.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -11,6 +13,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <mcf5272/mcf5272.h>
 
@@ -87,7 +90,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void mcf5272_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void mcf5272_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = mcf5272_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/m68k/csb360/preinstall.am b/c/src/lib/libbsp/m68k/csb360/preinstall.am
index 647b809..2fda2d8 100644
--- a/c/src/lib/libbsp/m68k/csb360/preinstall.am
+++ b/c/src/lib/libbsp/m68k/csb360/preinstall.am
@@ -53,6 +53,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/mips/csb350/Makefile.am b/c/src/lib/libbsp/mips/csb350/Makefile.am
index ac31d16..edca0cc 100644
--- a/c/src/lib/libbsp/mips/csb350/Makefile.am
+++ b/c/src/lib/libbsp/mips/csb350/Makefile.am
@@ -16,6 +16,7 @@ include_bsp_HEADERS += include/irq.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 nodist_include_HEADERS += ../../shared/include/coverhd.h
 
diff --git a/c/src/lib/libbsp/mips/csb350/console/console-io.c b/c/src/lib/libbsp/mips/csb350/console/console-io.c
index b3450c3..aa991ad 100644
--- a/c/src/lib/libbsp/mips/csb350/console/console-io.c
+++ b/c/src/lib/libbsp/mips/csb350/console/console-io.c
@@ -1,9 +1,9 @@
 /*
  *  This file contains the hardware specific portions of the TTY driver
  *  for the serial ports on the csb350.
- *
- *  Logic based on the jmr3904-io.c file in newlib 1.8.2
- *
+ */
+
+/*
  *  COPYRIGHT (c) 1989-2000.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -13,6 +13,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <libcpu/au1x00.h>
 
@@ -80,7 +81,7 @@ void csb250_output_char(char c)
     }
 }
 
-int csb250_get_char(void)
+static int csb250_get_char(void)
 {
   return console_inbyte_nonblocking(0);
 }
diff --git a/c/src/lib/libbsp/mips/csb350/preinstall.am b/c/src/lib/libbsp/mips/csb350/preinstall.am
index d05c802..74b8750 100644
--- a/c/src/lib/libbsp/mips/csb350/preinstall.am
+++ b/c/src/lib/libbsp/mips/csb350/preinstall.am
@@ -69,6 +69,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/mips/jmr3904/Makefile.am b/c/src/lib/libbsp/mips/jmr3904/Makefile.am
index dfb5db1..311438b 100644
--- a/c/src/lib/libbsp/mips/jmr3904/Makefile.am
+++ b/c/src/lib/libbsp/mips/jmr3904/Makefile.am
@@ -16,6 +16,7 @@ include_bsp_HEADERS += include/irq.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 
 nodist_include_HEADERS += ../../shared/include/coverhd.h
diff --git a/c/src/lib/libbsp/mips/jmr3904/console/console-io.c b/c/src/lib/libbsp/mips/jmr3904/console/console-io.c
index 806e2b7..a7f3204 100644
--- a/c/src/lib/libbsp/mips/jmr3904/console/console-io.c
+++ b/c/src/lib/libbsp/mips/jmr3904/console/console-io.c
@@ -3,7 +3,9 @@
  *  for the serial ports on the jmr3904.
  *
  *  Logic based on the jmr3904-io.c file in newlib 1.8.2
- *
+ */
+
+/*
  *  COPYRIGHT (c) 1989-2000.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -13,6 +15,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -114,7 +117,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void JMR3904_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void JMR3904_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = JMR3904_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/mips/jmr3904/preinstall.am b/c/src/lib/libbsp/mips/jmr3904/preinstall.am
index d05c802..74b8750 100644
--- a/c/src/lib/libbsp/mips/jmr3904/preinstall.am
+++ b/c/src/lib/libbsp/mips/jmr3904/preinstall.am
@@ -69,6 +69,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/moxie/moxiesim/Makefile.am b/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
index 8b06280..134ae78 100644
--- a/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
+++ b/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
@@ -15,6 +15,7 @@ include_HEADERS += ../../shared/include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 
 nodist_include_HEADERS += ../../shared/include/coverhd.h
diff --git a/c/src/lib/libbsp/moxie/moxiesim/console/console-io.c b/c/src/lib/libbsp/moxie/moxiesim/console/console-io.c
index b41b59f..de058eb 100644
--- a/c/src/lib/libbsp/moxie/moxiesim/console/console-io.c
+++ b/c/src/lib/libbsp/moxie/moxiesim/console/console-io.c
@@ -1,7 +1,9 @@
 /*
  *  This file contains the hardware specific portions of the TTY driver
  *  for the Moxie GDB simulator.
- *
+ */
+
+/*
  *  COPYRIGHT (c) 2011.
  *  Anthony Green.
  *
@@ -15,6 +17,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -60,7 +63,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void moxiesim_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void moxiesim_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = moxiesim_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/moxie/moxiesim/preinstall.am b/c/src/lib/libbsp/moxie/moxiesim/preinstall.am
index 347e43d..f3d7d23 100644
--- a/c/src/lib/libbsp/moxie/moxiesim/preinstall.am
+++ b/c/src/lib/libbsp/moxie/moxiesim/preinstall.am
@@ -53,6 +53,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am b/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
index 6f6b939..3022c14 100644
--- a/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
+++ b/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
@@ -11,6 +11,7 @@ include_HEADERS += ../../shared/include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 
 include_HEADERS += ../../shared/include/coverhd.h
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/console/console.c b/c/src/lib/libbsp/nios2/nios2_iss/console/console.c
index fc3223e..7e50874 100644
--- a/c/src/lib/libbsp/nios2/nios2_iss/console/console.c
+++ b/c/src/lib/libbsp/nios2/nios2_iss/console/console.c
@@ -1,7 +1,8 @@
 /*
  *  This file implements simple console IO via JTAG UART.
- *
- *  Based on no_cpu/console.c
+ */
+
+/*
  *  COPYRIGHT (c) 1989-1999.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -16,6 +17,7 @@
 #define NO_BSP_INIT
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 
 /* #define JTAG_UART_REGS ((altera_avalon_jtag_uart_regs*)NIOS2_IO_BASE(JTAG_UART_BASE)) */
@@ -113,7 +115,7 @@ void console_outbyte_polled(
 #include <rtems/bspIo.h>
 
 
-void ISS_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void ISS_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = ISS_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/preinstall.am b/c/src/lib/libbsp/nios2/nios2_iss/preinstall.am
index eaeeefe..b01172e 100644
--- a/c/src/lib/libbsp/nios2/nios2_iss/preinstall.am
+++ b/c/src/lib/libbsp/nios2/nios2_iss/preinstall.am
@@ -53,6 +53,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/powerpc/psim/Makefile.am b/c/src/lib/libbsp/powerpc/psim/Makefile.am
index 26c1940..40f0d19 100644
--- a/c/src/lib/libbsp/powerpc/psim/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/psim/Makefile.am
@@ -14,6 +14,7 @@ include_bsp_HEADERS = ../shared/include/linker-symbols.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 
 include_HEADERS += include/coverhd.h
diff --git a/c/src/lib/libbsp/powerpc/psim/console/console-io.c b/c/src/lib/libbsp/powerpc/psim/console/console-io.c
index 9e3d441..512b90d 100644
--- a/c/src/lib/libbsp/powerpc/psim/console/console-io.c
+++ b/c/src/lib/libbsp/powerpc/psim/console/console-io.c
@@ -13,6 +13,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -71,7 +72,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void PSIM_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void PSIM_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = PSIM_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/powerpc/psim/preinstall.am b/c/src/lib/libbsp/powerpc/psim/preinstall.am
index 9a133c4..d5043a9 100644
--- a/c/src/lib/libbsp/powerpc/psim/preinstall.am
+++ b/c/src/lib/libbsp/powerpc/psim/preinstall.am
@@ -61,6 +61,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am b/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
index 0dce1cd..ad3a2ec 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
@@ -12,6 +12,7 @@ include_HEADERS += ../../shared/include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 noinst_PROGRAMS =
 
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/console/console-io.c b/c/src/lib/libbsp/powerpc/qemuppc/console/console-io.c
index 2f1f7bb..738bd27 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/console/console-io.c
+++ b/c/src/lib/libbsp/powerpc/qemuppc/console/console-io.c
@@ -1,7 +1,9 @@
 /*
  *  This file contains the hardware specific portions of the TTY driver
- *  for the serial ports on the erc32.
- *
+ *  for the serial ports on the qemuppc.
+ */
+
+/*
  *  COPYRIGHT (c) 1989-2008.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -11,6 +13,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -68,7 +71,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void simBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void simBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = simBSP_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/preinstall.am b/c/src/lib/libbsp/powerpc/qemuppc/preinstall.am
index e5e2ab2..a698dd8 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/preinstall.am
+++ b/c/src/lib/libbsp/powerpc/qemuppc/preinstall.am
@@ -53,6 +53,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/sh/shsim/Makefile.am b/c/src/lib/libbsp/sh/shsim/Makefile.am
index eb0d479..637bf68 100644
--- a/c/src/lib/libbsp/sh/shsim/Makefile.am
+++ b/c/src/lib/libbsp/sh/shsim/Makefile.am
@@ -12,6 +12,7 @@ include_HEADERS += ../../shared/include/tm27.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 
 nodist_include_HEADERS += ../../shared/include/coverhd.h
diff --git a/c/src/lib/libbsp/sh/shsim/console/console-io.c b/c/src/lib/libbsp/sh/shsim/console/console-io.c
index b327192..7f5794e 100644
--- a/c/src/lib/libbsp/sh/shsim/console/console-io.c
+++ b/c/src/lib/libbsp/sh/shsim/console/console-io.c
@@ -1,9 +1,9 @@
 /*
  *  This file contains the hardware specific portions of the TTY driver
  *  for the simulators stdin/out.
- *
- *  Logic based on newlib-1.8.2/newlib/libc/sys/sh/syscalls.c
- *
+ */
+
+/*
  *  COPYRIGHT (c) 1989-2011.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -13,6 +13,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <stdlib.h>
 #include <assert.h>
diff --git a/c/src/lib/libbsp/sh/shsim/preinstall.am b/c/src/lib/libbsp/sh/shsim/preinstall.am
index fa84c38..7ada971 100644
--- a/c/src/lib/libbsp/sh/shsim/preinstall.am
+++ b/c/src/lib/libbsp/sh/shsim/preinstall.am
@@ -57,6 +57,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
diff --git a/c/src/lib/libbsp/shared/console-polled.c b/c/src/lib/libbsp/shared/console-polled.c
index 6ae7587..22a654f 100644
--- a/c/src/lib/libbsp/shared/console-polled.c
+++ b/c/src/lib/libbsp/shared/console-polled.c
@@ -2,7 +2,9 @@
  *  This file contains the hardware independent portion of a polled
  *  console device driver.  If a BSP chooses to use this, then it
  *  only has to provide a few board dependent routines.
- *
+ */
+
+/*
  *  COPYRIGHT (c) 1989-1997.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -16,10 +18,11 @@
 #include <stdlib.h>
 #include <assert.h>
 
-/* external prototypes for monitor interface routines */
-void console_outbyte_polled(int  port, char ch);
-int console_inbyte_nonblocking(int port);
-void console_initialize_hardware(void);
+#include <bsp/console-polled.h>
+
+/*
+ *  Prototypes
+ */
 ssize_t console_write_support(int, const char *, size_t);
 
 /*
diff --git a/c/src/lib/libbsp/shared/include/console-polled.h b/c/src/lib/libbsp/shared/include/console-polled.h
new file mode 100644
index 0000000..1955c23
--- /dev/null
+++ b/c/src/lib/libbsp/shared/include/console-polled.h
@@ -0,0 +1,43 @@
+/**
+ * @file
+ *
+ * @ingroup Console
+ *
+ * This file defines the interfaces between the single port
+ * polled console framework and the BSP. 
+ */
+
+/*
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef __BSP_CONSOLE_POLLED_h
+#define __BSP_CONSOLE_POLLED_h
+
+/**
+ * This method polls the specified character @a ch to the specified
+ * console @a port.
+ *
+ * @param[in] port is the output port
+ * @param[in] ch is the character to print
+ */
+void console_outbyte_polled(int port, char ch);
+
+/**
+ * This method polls the specified @a port for an input character.
+ * console @a port.
+ *
+ * @param[in] port is the input port
+ *
+ * @return This method returns the character read of -1 if there is no data.
+ */
+int console_inbyte_nonblocking(int port);
+
+/**
+ * This method is invoked to initialize the console hardware device(s).
+ */
+void console_initialize_hardware(void);
+
+#endif
diff --git a/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am b/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
index 8e648c8..5b61b45 100644
--- a/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
+++ b/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
@@ -16,6 +16,7 @@ include_bsp_HEADERS = include/syscall.h
 
 nodist_include_HEADERS = include/bspopts.h
 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
+nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
 DISTCLEANFILES = include/bspopts.h
 noinst_PROGRAMS =
 
diff --git a/c/src/lib/libbsp/v850/gdbv850sim/console/console-io.c b/c/src/lib/libbsp/v850/gdbv850sim/console/console-io.c
index c178197..c1f51a3 100644
--- a/c/src/lib/libbsp/v850/gdbv850sim/console/console-io.c
+++ b/c/src/lib/libbsp/v850/gdbv850sim/console/console-io.c
@@ -8,6 +8,7 @@
  */
 
 #include <bsp.h>
+#include <bsp/console-polled.h>
 #include <rtems/libio.h>
 #include <bsp/syscall.h>
 
@@ -55,7 +56,7 @@ int console_inbyte_nonblocking(
 
 #include <rtems/bspIo.h>
 
-void console_output_char(char c) { console_outbyte_polled( 0, c ); }
+static void console_output_char(char c) { console_outbyte_polled( 0, c ); }
 
 BSP_output_char_function_type           BSP_output_char = console_output_char;
 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/v850/gdbv850sim/preinstall.am b/c/src/lib/libbsp/v850/gdbv850sim/preinstall.am
index 38d42ac..dab51fb 100644
--- a/c/src/lib/libbsp/v850/gdbv850sim/preinstall.am
+++ b/c/src/lib/libbsp/v850/gdbv850sim/preinstall.am
@@ -57,6 +57,10 @@ $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INC
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
 
+$(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
+
 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
-- 
1.9.3



More information about the devel mailing list