summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/powerpc/tqm8xx/console/console.c')
-rw-r--r--c/src/lib/libbsp/powerpc/tqm8xx/console/console.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c b/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
index 312bed2a87..b28987899e 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
@@ -778,26 +778,29 @@ sccPollRead (int minor)
static ssize_t
sccInterruptWrite (int minor, const char *buf, size_t len)
{
- int chan = minor;
+ if (len > 0) {
+ int chan = minor;
- if ((sccPrepTxBd[chan]->status & M8xx_BD_READY) == 0) {
- sccPrepTxBd[chan]->buffer = (char *)buf;
- sccPrepTxBd[chan]->length = len;
- rtems_cache_flush_multiple_data_lines((const void *)buf,len);
- /*
- * clear status, set ready bit
- */
- sccPrepTxBd[chan]->status =
- (sccPrepTxBd[chan]->status
- & M8xx_BD_WRAP)
- | M8xx_BD_READY | M8xx_BD_INTERRUPT;
- if ((sccPrepTxBd[chan]->status & M8xx_BD_WRAP) != 0) {
- sccPrepTxBd[chan] = sccFrstTxBd[chan];
- }
- else {
- sccPrepTxBd[chan]++;
+ if ((sccPrepTxBd[chan]->status & M8xx_BD_READY) == 0) {
+ sccPrepTxBd[chan]->buffer = (char *)buf;
+ sccPrepTxBd[chan]->length = len;
+ rtems_cache_flush_multiple_data_lines((const void *)buf,len);
+ /*
+ * clear status, set ready bit
+ */
+ sccPrepTxBd[chan]->status =
+ (sccPrepTxBd[chan]->status
+ & M8xx_BD_WRAP)
+ | M8xx_BD_READY | M8xx_BD_INTERRUPT;
+ if ((sccPrepTxBd[chan]->status & M8xx_BD_WRAP) != 0) {
+ sccPrepTxBd[chan] = sccFrstTxBd[chan];
+ }
+ else {
+ sccPrepTxBd[chan]++;
+ }
}
}
+
return 0;
}