diff options
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/console')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/conscfg.c | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/console_control.c | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/printk_support.c | 37 |
3 files changed, 35 insertions, 15 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/console/conscfg.c b/c/src/lib/libbsp/i386/pc386/console/conscfg.c index f0295ef29e..72ccfe3709 100644 --- a/c/src/lib/libbsp/i386/pc386/console/conscfg.c +++ b/c/src/lib/libbsp/i386/pc386/console/conscfg.c @@ -18,12 +18,17 @@ #include <bsp.h> #include <libchip/serial.h> #include <libchip/ns16550.h> +#if BSP_ENABLE_VGA #include "vgacons.h" +#endif #include <bsp/irq.h> #include <rtems/pci.h> #include <bsp/rtd316.h> +#if BSP_ENABLE_VGA #define VGA_CONSOLE_FUNCTIONS &vgacons_fns +#endif + #if 0 #define COM_CONSOLE_FUNCTIONS &ns16550_fns_polled #else @@ -54,6 +59,7 @@ static void com_set_register(uint32_t addr, uint8_t i, uint8_t val) } console_tbl Console_Configuration_Ports[] = { +#if BSP_ENABLE_VGA { "/dev/vgacons", /* sDeviceName */ VGA_CONSOLE, /* deviceType */ @@ -73,6 +79,7 @@ console_tbl Console_Configuration_Ports[] = { 0X0, /* ulClock */ 0x0 /* ulIntVector -- base for port */ }, +#endif { "/dev/com1", /* sDeviceName */ SERIAL_NS16550, /* deviceType */ diff --git a/c/src/lib/libbsp/i386/pc386/console/console_control.c b/c/src/lib/libbsp/i386/pc386/console/console_control.c index 4bdae45809..e0201de570 100644 --- a/c/src/lib/libbsp/i386/pc386/console/console_control.c +++ b/c/src/lib/libbsp/i386/pc386/console/console_control.c @@ -26,7 +26,9 @@ #include <rtems/termiostypes.h> #include <libchip/serial.h> #include <rtems/mouse_parser.h> +#if BSP_ENABLE_VGA #include "keyboard.h" +#endif #include "../../../shared/console_private.h" /* @@ -40,6 +42,7 @@ rtems_device_driver console_control( void * arg ) { +#if BSP_ENABLE_VGA rtems_libio_ioctl_args_t *args = arg; switch (args->command) { @@ -60,4 +63,7 @@ rtems_device_driver console_control( args->ioctl_return = 0; return RTEMS_SUCCESSFUL; +#else + return rtems_termios_ioctl (arg); +#endif } 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; } |