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-11 14:49:49 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2015-01-04 13:44:56 -0600
commit607c85465dc1115a0b86ff1168db8c5f670e40a7 (patch)
tree71df682f5e91d8faeb5c08c94d97e2aa344f8a02 /c/src/lib/libbsp/i386/pc386/console/printk_support.c
parentCorrect error return mismatches (diff)
downloadrtems-607c85465dc1115a0b86ff1168db8c5f670e40a7.tar.bz2
pc386: Add BSP_ENABLE_VGA BSP option
This allows the VGA and keyboard console to be completely disabled. It is useful on PCs without displays and prevents a very slow boot time on the Intel Edison.
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.c37
1 files changed, 22 insertions, 15 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 371c720743..b34e3e9f79 100644
--- a/c/src/lib/libbsp/i386/pc386/console/printk_support.c
+++ b/c/src/lib/libbsp/i386/pc386/console/printk_support.c
@@ -19,7 +19,9 @@
#include <rtems.h>
#include <rtems/bspIo.h>
-#include <rtems/keyboard.h>
+#if BSP_ENABLE_VGA
+ #include <rtems/keyboard.h>
+#endif
#include <bsp.h>
#include <libchip/serial.h>
#include <libchip/ns16550.h>
@@ -36,27 +38,32 @@ int BSP_inch(void);
void BSP_outch(char ch)
{
- if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
- _IBMPC_outch( ch );
- } else {
- console_tbl *cptr;
+ #if BSP_ENABLE_VGA
+ if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
+ _IBMPC_outch( ch );
+ return;
+ }
+ #endif
+ console_tbl *cptr;
- cptr = &Console_Configuration_Ports[BSPPrintkPort];
- cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
- }
+ cptr = &Console_Configuration_Ports[BSPPrintkPort];
+ cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
}
int BSP_inch(void)
{
int result;
- if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
- result = BSP_wait_polled_input();
- } else {
- do {
- result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
- } while (result == -1);
- }
+ #if BSP_ENABLE_VGA
+ if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
+ result = BSP_wait_polled_input();
+ } else
+ #endif
+ {
+ do {
+ result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
+ } while (result == -1);
+ }
return result;
}