Changeset 15f3a91 in rtems


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

libchip: Use Termios API change for NS16550

This avoids a race condition on SMP configurations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/libchip/serial/ns16550.c

    r6896ca2 r15f3a91  
    551551    if (ctx->transmitFifoChars > 0
    552552        && (get( port, NS16550_LINE_STATUS) & SP_LSR_THOLD) != 0) {
    553       unsigned chars = ctx->transmitFifoChars;
    554 
    555       /*
    556        * We finished the transmission, so clear the number of characters in the
    557        * transmit FIFO.
    558        */
    559       ctx->transmitFifoChars = 0;
    560553
    561554      /* Dequeue transmitted characters */
    562       if (rtems_termios_dequeue_characters( d->termios_data, chars) == 0) {
    563         /* Nothing to do */
    564         ns16550_enable_interrupts( c, NS16550_ENABLE_ALL_INTR_EXCEPT_TX);
    565       }
     555      rtems_termios_dequeue_characters(
     556        d->termios_data,
     557        ctx->transmitFifoChars
     558      );
    566559    }
    567560  } while ((get( port, NS16550_INTERRUPT_ID) & SP_IID_0) == 0);
     
    596589  }
    597590
    598   if (len > 0) {
    599     ctx->transmitFifoChars = out;
     591  ctx->transmitFifoChars = out;
     592
     593  if (out > 0) {
    600594    ns16550_enable_interrupts( c, NS16550_ENABLE_ALL_INTR);
     595  } else {
     596    ns16550_enable_interrupts( c, NS16550_ENABLE_ALL_INTR_EXCEPT_TX);
    601597  }
    602598
Note: See TracChangeset for help on using the changeset viewer.