diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-10-27 20:50:57 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-10-27 20:50:57 +0000 |
commit | 45544f0d016c4246d9556911afabf106fe6bd7f7 (patch) | |
tree | 21a47b5aa839ea552e16270fe310211d50e135f7 /c/src/lib/libbsp/i386/pc386/console | |
parent | Modified to properly descend into the dummy directory. (diff) | |
download | rtems-45544f0d016c4246d9556911afabf106fe6bd7f7.tar.bz2 |
Patch from Aleksey (Quality Quorum <qqi@world.std.com>) to
increase ease of application configuration of the pc386 BSP. This
patch allows switching the printk console to a serial port and
overriding bsp_start by making it a weak alias.
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/console')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/console.c | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/console/console.c b/c/src/lib/libbsp/i386/pc386/console/console.c index 3fa6c2217d..a23f46f3cf 100644 --- a/c/src/lib/libbsp/i386/pc386/console/console.c +++ b/c/src/lib/libbsp/i386/pc386/console/console.c @@ -49,16 +49,17 @@ void __assert (const char *file, int line, const char *msg); * BSP_CONSOLE_PORT_CONSOLE * BSP_UART_COM1 * BSP_UART_COM2 - */ - -/* - * Possible value for console input/output : - * BSP_CONSOLE_PORT_CONSOLE - * BSP_UART_COM1 - * BSP_UART_COM2 + * + * Note: + * 1. Currently BSPPrintkPort, cannot be assigned to COM2, + * it will be fixed soon. + * + * 2. If both BSPConsolePort and BSPPrintkport are assigned + * to same serial device it does not work that great */ int BSPConsolePort = BSP_CONSOLE_PORT_CONSOLE; +int BSPPrintkPort = BSP_CONSOLE_PORT_CONSOLE; /* int BSPConsolePort = BSP_UART_COM2; */ int BSPBaseBaud = 115200; @@ -231,17 +232,26 @@ console_initialize(rtems_device_major_number major, { printk("Initialized console on port COM2 9600-8-N-1\n\n"); } -#define PRINTK_ON_SERIAL -#ifdef PRINTK_ON_SERIAL - /* - * You can remove the follwoing tree lines if you want to have printk - * using the video console for output while printf use serial line. - * This may be convenient to debug the serial line driver itself... - */ - /* printk("Warning : This will be the last message displayed on console\n");*/ - BSP_output_char = (BSP_output_char_function_type) BSP_output_char_via_serial; - BSP_poll_char = (BSP_polling_getchar_function_type) BSP_poll_char_via_serial; -#endif + + if(BSPPrintkPort == BSP_UART_COM1) + { + printk("Warning : This will be the last message on console\n"); + + /* + * FIXME: cast below defeats the very idea of having + * function pointer types defined + */ + BSP_output_char = (BSP_output_char_function_type) + BSP_output_char_via_serial; + BSP_poll_char = (BSP_polling_getchar_function_type) + BSP_poll_char_via_serial; + } + else if(BSPPrintkPort != BSP_CONSOLE_PORT_CONSOLE) + { + printk("illegal assignement of projtk channel"); + rtems_fatal_error_occurred (status); + } + } return RTEMS_SUCCESSFUL; } /* console_initialize */ |