summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/console/printk_support.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-12-14 16:45:08 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2015-01-04 13:44:56 -0600
commit0a36af04bb81afb0e006582cc0751bd4854714b3 (patch)
treee53230dd823b8174170dd7c6c05542bbff025749 /c/src/lib/libbsp/i386/pc386/console/printk_support.c
parentpc386: Add BSP_ENABLE_IDE BSP option (diff)
downloadrtems-0a36af04bb81afb0e006582cc0751bd4854714b3.tar.bz2
pc386: Add BSP_ENABLE_COM1_COM4 BSP option
This allows the support for the legacy COM1-COM4 serial ports to be completely disabled. It is needed to prevent hangs on some hardware. In particular, the Intel Edison where it is not present.
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/console/printk_support.c')
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/printk_support.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/console/printk_support.c b/c/src/lib/libbsp/i386/pc386/console/printk_support.c
index b34e3e9f79..c6b0fe5c00 100644
--- a/c/src/lib/libbsp/i386/pc386/console/printk_support.c
+++ b/c/src/lib/libbsp/i386/pc386/console/printk_support.c
@@ -29,9 +29,9 @@
rtems_device_minor_number BSPPrintkPort = 0;
-int ns16550_inbyte_nonblocking_polled(
- int minor
-);
+#if BSP_ENABLE_COM1_COM4
+int ns16550_inbyte_nonblocking_polled( int minor );
+#endif
void BSP_outch(char ch);
int BSP_inch(void);
@@ -52,18 +52,20 @@ void BSP_outch(char ch)
int BSP_inch(void)
{
- int result;
+ int result = -1;
#if BSP_ENABLE_VGA
if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
result = BSP_wait_polled_input();
} else
#endif
+ #if BSP_ENABLE_COM1_COM4
{
do {
result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
} while (result == -1);
}
+ #endif
return result;
}