Changeset 45544f0 in rtems


Ignore:
Timestamp:
Oct 27, 1999, 8:50:57 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 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.

Location:
c/src/lib/libbsp/i386/pc386
Files:
2 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;
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    re4487b6 r45544f0  
    137137|          Returns: Nothing.
    138138+--------------------------------------------------------------------------*/
    139 void bsp_start( void )
     139void bsp_start_default( void )
    140140{
    141141  /*
     
    208208#endif
    209209} /* bsp_start */
     210
     211/*
     212 *  By making this a weak alias for bsp_start_default, a brave soul
     213 *  can override the actual bsp_start routine used.
     214 */
     215
     216void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default")));
Note: See TracChangeset for help on using the changeset viewer.