Ignore:
Timestamp:
Feb 1, 2012, 8:32:28 PM (9 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 5, master
Children:
d1887baf
Parents:
41572c4
git-author:
Jennifer Averett <Jennifer.Averett@…> (02/01/12 20:32:28)
git-committer:
Joel Sherrill <joel.sherrill@…> (02/01/12 20:32:28)
Message:

Correct run-time selection of console port.

This was broken by conversion of console driver to libchip style.

File:
1 edited

Legend:

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

    r41572c4 r441b90e  
    2323#include <libchip/serial.h>
    2424#include <libchip/ns16550.h>
    25 
    26 BSP_output_char_function_type     BSP_output_char = _IBMPC_outch;
    27 BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
     25#include "../../../shared/console_private.h"
    2826
    2927rtems_device_minor_number         BSPPrintkPort = 0;
     
    3331);
    3432
    35 void BSP_com_outch(char ch)
     33void BSP_outch(char ch);
     34int BSP_inch(void);
     35
     36void BSP_outch(char ch)
    3637{
    37   console_tbl                   *cptr;
     38  if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
     39    _IBMPC_outch( ch );
     40  } else {
     41    console_tbl *cptr;
    3842
    39   cptr = &Console_Configuration_Ports[BSPPrintkPort];
    40 
    41   return cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
     43    cptr = &Console_Configuration_Ports[BSPPrintkPort];
     44    cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
     45  }
    4246}
    4347
    44 int BSP_com_inch( void )
     48int BSP_inch(void)
    4549{
    4650  int           result;
    47   console_tbl   *cptr;
    4851
    49   cptr = &Console_Configuration_Ports[BSPPrintkPort];
    50 
    51   do {
    52     result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
    53   } while (result == -1);
    54 
     52  if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
     53    result = BSP_wait_polled_input();
     54  } else {
     55    do {
     56      result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
     57    } while (result == -1);
     58  }
    5559  return result;
    5660}
    5761
     62BSP_output_char_function_type     BSP_output_char = BSP_outch;
     63BSP_polling_getchar_function_type BSP_poll_char = BSP_inch;
     64
Note: See TracChangeset for help on using the changeset viewer.