Changeset 292dbff in rtems for c/src/lib/libbsp/i386


Ignore:
Timestamp:
May 6, 2016, 7:52:08 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
93fb8797
Parents:
beefa112
git-author:
Chris Johns <chrisj@…> (05/06/16 07:52:08)
git-committer:
Chris Johns <chrisj@…> (05/11/16 01:45:01)
Message:

i386/pc386: Fix printk with the console changes.

File:
1 edited

Legend:

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

    rbeefa112 r292dbff  
    2828#include "../../../shared/console_private.h"
    2929
    30 rtems_device_minor_number         BSPPrintkPort = 0;
    31 
    32 #if (BSP_IS_EDISON == 1)
    33 void edison_write_polled(int minor, char cChar); /* XXX */
    34 int edison_inbyte_nonblocking_polled(int minor);
    35 #endif
    36 
    37 #if BSP_ENABLE_COM1_COM4
    38 int ns16550_inbyte_nonblocking_polled( int minor );
    39 #endif
     30rtems_device_minor_number BSPPrintkPort = 0;
    4031
    4132void BSP_outch(char ch);
     
    4536{
    4637  #if BSP_ENABLE_VGA
    47     if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
    48       _IBMPC_outch( ch );
    49       return;
     38    bool isVga =  BSPPrintkPort == BSP_CONSOLE_VGA;
     39  #else
     40    bool isVga = false;
     41  #endif
     42
     43  if ( !isVga ) {
     44    console_tbl *port = Console_Port_Tbl[BSPPrintkPort];
     45    if (port->pDeviceFns && port->pDeviceFns->deviceWritePolled) {
     46      port->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
     47      /*
     48       * No termios so expand the LF to LF/CR.
     49       */
     50      if ( ch == '\n')
     51        port->pDeviceFns->deviceWritePolled( BSPPrintkPort, '\r' );
    5052    }
     53    return;
     54  }
     55
     56  #if BSP_ENABLE_VGA
     57    _IBMPC_outch( ch );
    5158  #endif
    52   console_tbl *cptr;
    53 
    54   cptr = &Console_Configuration_Ports[BSPPrintkPort];
    55   cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
    5659}
    5760
    58 int BSP_inch(void) 
     61int BSP_inch(void)
    5962{
    60   int           result = -1;
     63  #if BSP_ENABLE_VGA
     64    bool isVga =  BSPPrintkPort == BSP_CONSOLE_VGA;
     65  #else
     66    bool isVga = false;
     67  #endif
     68
     69  int result = -1;
     70
     71  if ( !isVga ) {
     72    console_tbl *port = Console_Port_Tbl[BSPPrintkPort];
     73    if (port->pDeviceFns && port->pDeviceFns->deviceRead) {
     74      do {
     75        result = port->pDeviceFns->deviceRead( BSPPrintkPort );
     76      } while (result == -1);
     77      return result;
     78    }
     79  }
    6180
    6281  #if BSP_ENABLE_VGA
    63     if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
    64       result = BSP_wait_polled_input();
    65     } else
     82    result = BSP_wait_polled_input();
    6683  #endif
    67   #if BSP_ENABLE_COM1_COM4
    68     {
    69       do {
    70         result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
    71       } while (result == -1);
    72     }
    73   #endif
    74   #if (BSP_IS_EDISON == 1)
    75     do {
    76       result = edison_inbyte_nonblocking_polled( BSPPrintkPort );
    77     } while (result == -1);
    78   #endif
     84
    7985  return result;
    8086}
     
    8288BSP_output_char_function_type     BSP_output_char = BSP_outch;
    8389BSP_polling_getchar_function_type BSP_poll_char = BSP_inch;
    84 
Note: See TracChangeset for help on using the changeset viewer.