Ignore:
Timestamp:
10/27/99 20:50:57 (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
c8b35b1b
Parents:
e4487b6
Message:

Patch from Aleksey (Quality Quorum <qqi@…>) 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/console/console.c

    re4487b6 r45544f0  
    5050 *      BSP_UART_COM1
    5151 *      BSP_UART_COM2
     52 *
     53 * Note:
     54 *   1. Currently BSPPrintkPort, cannot be assigned to COM2,
     55 *      it will be fixed soon.
     56 *
     57 *   2. If both BSPConsolePort and BSPPrintkport are assigned
     58 *      to same serial device it does not work that great
    5259 */
    5360
    54 /*
    55  * Possible value for console input/output :
    56  *      BSP_CONSOLE_PORT_CONSOLE
    57  *      BSP_UART_COM1
    58  *      BSP_UART_COM2
    59  */
    60 
    6161int BSPConsolePort = BSP_CONSOLE_PORT_CONSOLE;
     62int BSPPrintkPort  = BSP_CONSOLE_PORT_CONSOLE;
    6263
    6364/* int BSPConsolePort = BSP_UART_COM2;  */
     
    232233          printk("Initialized console on port COM2 9600-8-N-1\n\n");
    233234        }
    234 #define  PRINTK_ON_SERIAL
    235 #ifdef PRINTK_ON_SERIAL
    236       /*
    237        * You can remove the follwoing tree lines if you want to have printk
    238        * using the video console for output while printf use serial line.
    239        * This may be convenient to debug the serial line driver itself...
    240        */
    241       /*      printk("Warning : This will be the last message displayed on console\n");*/
    242       BSP_output_char = (BSP_output_char_function_type) BSP_output_char_via_serial;
    243       BSP_poll_char   = (BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
    244 #endif 
     235
     236      if(BSPPrintkPort == BSP_UART_COM1)
     237        {
     238          printk("Warning : This will be the last message on console\n");
     239
     240          /*
     241           * FIXME: cast below defeats the very idea of having
     242           * function pointer types defined
     243           */
     244          BSP_output_char = (BSP_output_char_function_type)
     245                              BSP_output_char_via_serial;
     246          BSP_poll_char   = (BSP_polling_getchar_function_type)
     247                              BSP_poll_char_via_serial;
     248        }
     249      else if(BSPPrintkPort != BSP_CONSOLE_PORT_CONSOLE)
     250        {
     251           printk("illegal assignement of projtk channel");
     252         rtems_fatal_error_occurred (status);
     253        }
     254
    245255    }
    246256  return RTEMS_SUCCESSFUL;
Note: See TracChangeset for help on using the changeset viewer.