diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-09-23 13:20:34 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-09-23 13:20:34 +0000 |
commit | 8a496e462e37f78fbbd20009f036623f062ccea1 (patch) | |
tree | 439d94e57e7aac3fc654885307c5c80c7fb564a9 /c/src/lib/libc/termios.c | |
parent | Switched "NEW_GAS" flag. (diff) | |
download | rtems-8a496e462e37f78fbbd20009f036623f062ccea1.tar.bz2 |
Patch from Aleksey (Quality Quorum <qqi@world.std.com>):
1. Finally fixes raw interrupts for pc386
2. Makes some minor cleanup in console and startup
3. Makes rtems_termios_dequeue_characters() to return count of
outstanding chars - it allows to simplify console isrs a little
bit.
4. pc386 uart modified to be friendlier to termios parameter changes,
to have minor performance improvement and to take advantage of
of above termios modification.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libc/termios.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/c/src/lib/libc/termios.c b/c/src/lib/libc/termios.c index f3637d37e3..c2a43c7707 100644 --- a/c/src/lib/libc/termios.c +++ b/c/src/lib/libc/termios.c @@ -894,9 +894,10 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) * device transmit interrupt handler. * The second argument is the number of characters transmitted so far. * This value will always be 1 for devices which generate an interrupt - * for each transmitted character. + * for each transmitted character. + * It returns number of characters left to transmit */ -void +int rtems_termios_dequeue_characters (void *ttyp, int len) { struct rtems_termios_tty *tty = ttyp; @@ -906,13 +907,14 @@ rtems_termios_dequeue_characters (void *ttyp, int len) if (tty->rawOutBufState == rob_wait) rtems_semaphore_release (tty->rawOutBufSemaphore); if ( tty->rawOutBufHead == tty->rawOutBufTail ) - return; + return 0; newTail = (tty->rawOutBufTail + len) % RAW_OUTPUT_BUFFER_SIZE; if (newTail == tty->rawOutBufHead) { /* * Buffer empty */ tty->rawOutBufState = rob_idle; + nToSend = 0; } else { /* @@ -926,4 +928,8 @@ rtems_termios_dequeue_characters (void *ttyp, int len) tty->rawOutBufState = rob_busy; } tty->rawOutBufTail = newTail; + + return nToSend; } + + |