Changeset 664db30b in rtems


Ignore:
Timestamp:
Oct 18, 2000, 3:51:41 PM (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
8ad5399
Parents:
1fc2292d
Message:

2000-10-18 Charles-Antoine Gauthier <charles.gauthier@…>

  • console/console.c, console/serial_mouse.c, include/bsp.h: Add the ability to set parity, number of data bits and number of stop bits to the existing i386 serial drivers.
Location:
c/src/lib/libbsp/i386/pc386
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/ChangeLog

    r1fc2292d r664db30b  
     12000-10-18       Charles-Antoine Gauthier <charles.gauthier@nrc.ca>
     2
     3        * console/console.c, console/serial_mouse.c, include/bsp.h:
     4        Add the ability to set parity, number of data bits and
     5        number of stop bits to the existing i386 serial drivers.
     6
    172000-10-17      Joel Sherrill <joel@OARcorp.com>
    28
  • c/src/lib/libbsp/i386/pc386/console/console.c

    r1fc2292d r664db30b  
    227227       */
    228228      /* 9600-8-N-1 */
    229       BSP_uart_init(BSPConsolePort, 9600, 0);
     229      BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0);
    230230     
    231231     
     
    455455conSetAttr(int minor, const struct termios *t)
    456456{
    457   int baud;
     457  unsigned long baud, databits, parity, stopbits;
    458458
    459459  switch (t->c_cflag & CBAUD)
     
    511511      break;
    512512    default:
    513       baud = 0;
    514513      rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
    515514      return 0;
    516515    }
    517516
    518   BSP_uart_set_baud(BSPConsolePort, baud);
     517  if (t->c_cflag & PARENB) {
     518    /* Parity is enabled */
     519    if (t->c_cflag & PARODD) {
     520      /* Parity is odd */
     521      parity = PEN;
     522    }
     523    else {
     524      /* Parity is even */
     525      parity = PEN | EPS;
     526    }
     527  }
     528  else {
     529    /* No parity */
     530    parity = 0;
     531  }
     532 
     533  switch (t->c_cflag & CSIZE) {
     534    case CS5: databits = CHR_5_BITS; break;
     535    case CS6: databits = CHR_6_BITS; break;
     536    case CS7: databits = CHR_7_BITS; break;
     537    case CS8: databits = CHR_8_BITS; break;
     538   }
     539
     540  if (t->c_cflag & CSTOPB) {
     541    /* 2 stop bits */
     542    stopbits = STB;
     543  }
     544  else {
     545    /* 1 stop bit */
     546    stopbits = 0;
     547  }
     548
     549  BSP_uart_set_attributes(BSPConsolePort, baud, databits, parity, stopbits);
    519550
    520551  return 0;
  • c/src/lib/libbsp/i386/pc386/console/serial_mouse.c

    r1fc2292d r664db30b  
    1919 *
    2020 * $Log$
     21 * Revision 1.1  2000/08/30 08:15:30  joel
     22 * 2000-08-26  Rosimildo da Silva  <rdasilva@connecttel.com>
     23 *
     24 *      * Major rework of the "/dev/console" driver.
     25 *      * Added termios support for stdin ( keyboard ).
     26 *      * Added ioctls() to support modes similar to Linux( XLATE,
     27 *      RAW, MEDIUMRAW ).
     28 *      * Added Keyboard mapping and handling of the keyboard's leds.
     29 *      * Added Micro FrameBuffer driver ( "/dev/fb0" ) for bare VGA
     30 *      controller ( 16 colors ).
     31 *      * Added PS/2 and Serial mouse support for PC386 BSP.
     32 *      * console/defkeymap.c: New file.
     33 *      * console/fb_vga.c: New file.
     34 *      * console/fb_vga.h: New file.
     35 *      * console/i386kbd.h: New file.
     36 *      * console/kd.h: New file.
     37 *      * console/keyboard.c: New file.
     38 *      * console/keyboard.h: New file.
     39 *      * console/mouse_parser.c: New file.
     40 *      * console/mouse_parser.h: New file.
     41 *      * console/pc_keyb.c: New file.
     42 *      * console/ps2_drv.h: New file.
     43 *      * console/ps2_mouse.c: New file.
     44 *      * console/ps2_mouse.h: New file.
     45 *      * console/serial_mouse.c: New file.
     46 *      * console/serial_mouse.h: New file.
     47 *      * console/vgainit.c: New file.
     48 *      * console/vt.c: New file.
     49 *      * console/Makefile.am: Reflect new files.
     50 *      * console/console.c, console/inch.c, console/outch.c: Console
     51 *      functionality modifications.
     52 *      * startup/Makefile.am: Pick up tty_drv.c and gdb_glue.c
     53 *
    2154 ****************************************************************************/
    2255
     
    127160   */
    128161  /* 9600-8-N-1, without hardware flow control */
    129   BSP_uart_init( BSP_UART_PORT, 1200, 0 );
     162  BSP_uart_init( BSP_UART_PORT, 1200, CHR_8_BITS, 0, 0, 0 );
    130163  status = BSP_install_rtems_irq_handler( &serial_mouse_isr_data );
    131164  if( !status )
  • c/src/lib/libbsp/i386/pc386/include/bsp.h

    r1fc2292d r664db30b  
    6161
    6262#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1
     63
     64#if STACK_MINIMUM_SIZE < (4 * 1024)
    6365#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
     66#else
     67#define CONFIGURE_INTERRUPT_STACK_MEMORY STACK_MINIMUM_SIZE
     68#endif
    6469
    6570/*
Note: See TracChangeset for help on using the changeset viewer.