Ignore:
Timestamp:
Mar 21, 2017, 7:39:48 PM (3 years ago)
Author:
Kevin Kirspel <kevin-kirspel@…>
Branches:
master
Children:
94a4865
Parents:
c4b058ca
git-author:
Kevin Kirspel <kevin-kirspel@…> (03/21/17 19:39:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/22/17 10:55:04)
Message:

termios: Synchronize with latest FreeBSD headers

Adding modified FreeBSD headers to synchronize RTEMS termios with
FreeBSD. Modify termios to support dedicated input and output baud for
termios structure. Updated BSPs to use dedicated input and output baud
in termios structure. Updated tools to use dedicated input and output
baud in termios structure. Updated termios testsuites to use dedicated
input and output baud in termios structure.

Close #2897.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/termios.c

    rc4b058ca r1c6926c1  
    3131#include <termios.h>
    3232#include <unistd.h>
     33#include <sys/fcntl.h>
    3334#include <sys/ttycom.h>
    3435
     
    847848  struct ttywakeup         *wakeup = (struct ttywakeup *)args->buffer;
    848849  rtems_status_code sc;
     850  int flags = *((int *)args->buffer);
    849851
    850852  args->ioctl_return = 0;
     
    866868    break;
    867869
    868   case RTEMS_IO_GET_ATTRIBUTES:
     870  case TIOCGETA:
    869871    *(struct termios *)args->buffer = tty->termios;
    870872    break;
    871873
    872   case RTEMS_IO_SET_ATTRIBUTES:
     874  case TIOCSETA:
     875  case TIOCSETAW:
     876  case TIOCSETAF:
    873877    tty->termios = *(struct termios *)args->buffer;
    874878
     879    if (args->command == TIOCSETAW || args->command == TIOCSETAF) {
     880      drainOutput (tty);
     881      if (args->command == TIOCSETAF) {
     882        flushInput (tty);
     883      }
     884    }
    875885    /* check for and process change in flow control options */
    876886    termios_set_flowctrl(tty);
     
    881891      tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
    882892    } else {
    883       tty->vtimeTicks = tty->termios.c_cc[VTIME] * 
     893      tty->vtimeTicks = tty->termios.c_cc[VTIME] *
    884894                    rtems_clock_get_ticks_per_second() / 10;
    885895      if (tty->termios.c_cc[VTIME]) {
     
    906916    break;
    907917
    908   case RTEMS_IO_TCDRAIN:
     918  case TIOCDRAIN:
    909919    drainOutput (tty);
    910920    break;
    911921
    912   case RTEMS_IO_TCFLUSH:
    913     switch ((intptr_t) args->buffer) {
    914       case TCIFLUSH:
    915         flushInput (tty);
    916         break;
    917       case TCOFLUSH:
    918         flushOutput (tty);
    919         break;
    920       case TCIOFLUSH:
    921         flushOutput (tty);
    922         flushInput (tty);
    923         break;
    924       default:
    925         sc = RTEMS_INVALID_NAME;
    926         break;
     922  case TIOCFLUSH:
     923    if (flags == 0) {
     924      flags = FREAD | FWRITE;
     925    } else {
     926      flags &= FREAD | FWRITE;
     927    }
     928    if (flags & FWRITE) {
     929      flushOutput (tty);
     930    }
     931    if (flags & FREAD) {
     932      flushInput (tty);
    927933    }
    928934    break;
Note: See TracChangeset for help on using the changeset viewer.