summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/shared
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-10-08 16:04:56 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-10-10 10:17:09 -0500
commit62791499ebf0a6161e1541eb7587c57d88407f8b (patch)
treefaaa9f51fdd6d13727c237ddc44e87a9cdd60df4 /c/src/lib/libbsp/shared
parentMove Mongoose-V specific devices into BSP. (diff)
downloadrtems-62791499ebf0a6161e1541eb7587c57d88407f8b.tar.bz2
Add console-polled.h and update all BSPs that should use it.
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.
Diffstat (limited to 'c/src/lib/libbsp/shared')
-rw-r--r--c/src/lib/libbsp/shared/console-polled.c13
-rw-r--r--c/src/lib/libbsp/shared/include/console-polled.h43
2 files changed, 51 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/shared/console-polled.c b/c/src/lib/libbsp/shared/console-polled.c
index 6ae758711b..22a654f82f 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 0000000000..09a99c30cb
--- /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