forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user