diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-24 17:29:11 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-25 17:03:21 +0200 |
commit | e18db9f0cffcb143e5fdec27539efb417cb4ebf3 (patch) | |
tree | 804edba552541bea8d5ea5c38680903373bf6c27 /c/src/lib/libcpu/powerpc | |
parent | bsps/arm: Rename function (diff) | |
download | rtems-e18db9f0cffcb143e5fdec27539efb417cb4ebf3.tar.bz2 |
termios: Update due to API changes
Termios notifies now the driver about an inactive transmit with the
length argument set to zero.
Diffstat (limited to '')
5 files changed, 29 insertions, 18 deletions
diff --git a/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c b/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c index d8f6c41423..f5467397bd 100644 --- a/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c +++ b/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c @@ -292,13 +292,12 @@ static int mpc55xx_esci_termios_poll_write( int minor, const char *out, */ static int mpc55xx_esci_termios_write( int minor, const char *out, size_t n) { - mpc55xx_esci_driver_entry *e = &mpc55xx_esci_driver_table [minor]; - rtems_interrupt_level level; + if (n > 0) { + mpc55xx_esci_driver_entry *e = &mpc55xx_esci_driver_table [minor]; - rtems_interrupt_disable(level); - e->regs->DR.B.D = out [0]; - e->transmit_in_progress = true; - rtems_interrupt_enable(level); + e->regs->DR.B.D = out [0]; + e->transmit_in_progress = true; + } return 0; } diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c index f3e7ff081e..8f56c708a5 100644 --- a/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c +++ b/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c @@ -144,10 +144,13 @@ ssize_t m5xx_uart_write( size_t len ) { - volatile m5xxSCIRegisters_t *regs = sci_descs[minor].regs; + if (len > 0) { + volatile m5xxSCIRegisters_t *regs = sci_descs[minor].regs; + + regs->scdr = *buf; /* start transmission */ + regs->sccr1 |= QSMCM_SCI_TIE; /* enable interrupt */ + } - regs->scdr = *buf; /* start transmission */ - regs->sccr1 |= QSMCM_SCI_TIE; /* enable interrupt */ return 0; } diff --git a/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c index 1ae1dbedce..b43d95c83d 100644 --- a/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c +++ b/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c @@ -1090,12 +1090,15 @@ m8xx_uart_write( size_t len ) { - while( (TxBd[minor]->status) & M8260_BD_READY ); + if (len > 0) { + while( (TxBd[minor]->status) & M8260_BD_READY ); + + rtems_cache_flush_multiple_data_lines( buf, len ); + TxBd[minor]->buffer = (char *) buf; + TxBd[minor]->length = len; + TxBd[minor]->status = M8260_BD_READY | M8260_BD_WRAP | M8260_BD_INTERRUPT; + } - rtems_cache_flush_multiple_data_lines( buf, len ); - TxBd[minor]->buffer = (char *) buf; - TxBd[minor]->length = len; - TxBd[minor]->status = M8260_BD_READY | M8260_BD_WRAP | M8260_BD_INTERRUPT; return 0; } diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c b/c/src/lib/libcpu/powerpc/ppc403/console/console.c index 58d0138398..0e74879947 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c +++ b/c/src/lib/libcpu/powerpc/ppc403/console/console.c @@ -271,8 +271,11 @@ spiPollRead (int minor) static int spiInterruptWrite (int minor, const char *buf, int len) { - port->SPTB = *buf; /* write char to send */ - port->SPTC |= TCRIntEnabled; /* always enable tx interrupt */ + if (len > 0) { + port->SPTB = *buf; /* write char to send */ + port->SPTC |= TCRIntEnabled; /* always enable tx interrupt */ + } + return 0; } diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c index 033a9ef41e..206d209c82 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c +++ b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c @@ -296,8 +296,11 @@ spiStopRemoteTx (int minor) static ssize_t InterruptWrite (int minor, const char *buf, size_t len) { - port->IER |= IER_XMT; /* always enable tx interrupt */ - port->THR = *buf; /* write char to send */ + if (len > 0) { + port->IER |= IER_XMT; /* always enable tx interrupt */ + port->THR = *buf; /* write char to send */ + } + return 0; } |