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/exec/libcsupport | |
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 'c/src/exec/libcsupport')
-rw-r--r-- | c/src/exec/libcsupport/include/rtems/libio.h | 2 | ||||
-rw-r--r-- | c/src/exec/libcsupport/src/termios.c | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/c/src/exec/libcsupport/include/rtems/libio.h b/c/src/exec/libcsupport/include/rtems/libio.h index 3cc87d1d87..dcdda85aec 100644 --- a/c/src/exec/libcsupport/include/rtems/libio.h +++ b/c/src/exec/libcsupport/include/rtems/libio.h @@ -157,7 +157,7 @@ rtems_status_code rtems_termios_read (void *arg); rtems_status_code rtems_termios_write (void *arg); rtems_status_code rtems_termios_ioctl (void *arg); int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); -void rtems_termios_dequeue_characters (void *ttyp, int len); +int rtems_termios_dequeue_characters (void *ttyp, int len); void rtems_termios_reserve_resources( rtems_configuration_table *configuration, rtems_unsigned32 number_of_devices diff --git a/c/src/exec/libcsupport/src/termios.c b/c/src/exec/libcsupport/src/termios.c index f3637d37e3..c2a43c7707 100644 --- a/c/src/exec/libcsupport/src/termios.c +++ b/c/src/exec/libcsupport/src/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; } + + |