Changeset 7338299c in rtems


Ignore:
Timestamp:
Jun 10, 2013, 12:24:52 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
fed92f5f
Parents:
58cde54
git-author:
Sebastian Huber <sebastian.huber@…> (06/10/13 12:24:52)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/12/13 14:11:25)
Message:

termios: Expand critical section

Use interrupt disable/enable to protect the complete refill state
change. This avoids race conditions for the task driven configuration
and a later SMP support.

File:
1 edited

Legend:

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

    r58cde54 r7338299c  
    12941294  int len;
    12951295
     1296  rtems_interrupt_disable(level);
     1297
    12961298  /* check for XOF/XON to send */
    12971299  if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
     
    13001302    (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
    13011303
    1302     rtems_interrupt_disable(level);
    13031304    tty->t_dqlen--;
    13041305    tty->flow_ctrl |= FL_ISNTXOF;
    1305     rtems_interrupt_enable(level);
    13061306
    13071307    nToSend = 1;
     
    13181318    (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
    13191319
    1320     rtems_interrupt_disable(level);
    13211320    tty->t_dqlen--;
    13221321    tty->flow_ctrl &= ~FL_ISNTXOF;
    1323     rtems_interrupt_enable(level);
    13241322
    13251323    nToSend = 1;
     
    13371335    nToSend = 0;
    13381336  } else {
    1339     rtems_interrupt_disable(level);
    13401337    len = tty->t_dqlen;
    13411338    tty->t_dqlen = 0;
    1342     rtems_interrupt_enable(level);
    13431339
    13441340    newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
     
    13701366      /* Buffer not empty, but output stops due to XOFF */
    13711367      /* set flag, that output has been stopped */
    1372       rtems_interrupt_disable(level);
    13731368      tty->flow_ctrl |= FL_OSTOP;
    13741369      tty->rawOutBufState = rob_busy; /*apm*/
    1375       rtems_interrupt_enable(level);
    13761370      nToSend = 0;
    13771371    } else {
     
    13961390  }
    13971391
     1392  rtems_interrupt_enable(level);
     1393
    13981394  if (wakeUpWriterTask) {
    13991395    rtems_semaphore_release (tty->rawOutBuf.Semaphore);
Note: See TracChangeset for help on using the changeset viewer.