From 8a496e462e37f78fbbd20009f036623f062ccea1 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 23 Sep 1998 13:20:34 +0000 Subject: Patch from Aleksey (Quality Quorum ): 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. --- c/src/exec/libcsupport/include/rtems/libio.h | 2 +- c/src/exec/libcsupport/src/termios.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'c/src/exec/libcsupport') 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; } + + -- cgit v1.2.3