| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
* libc/termios.c: Fixed a memory leak in the termios
software. Basically the tty open function was allocating an input
raw buffer, an output raw buffer, and a cooked buffer that were
not getting released. I have attached a patch for the latest
snapshot. The patch also has a fix to ensure the tty link list
is updated correctly when a tty is closed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libc/termios.c: Fix a bug in the termios implementation in
the following scenario:
The General Terminal Interface document that me states that
if VMIN = 0 and VTIME = 0, then read() should return the minimum
of two values:
a) number of bytes available
b) number of bytes requested (I assume from the read call)
The current implementation of the fillBufferQueue() in termios.c is
always return 1 character with these setting values. I know the
termios buffer has more than one character available and my read()
call is requesting 1024 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libc/termios.c: Fix a bug in the termios implementation in
the following scenario:
The General Terminal Interface document that me states that
if VMIN = 0 and VTIME = 0, then read() should return the minimum
of two values:
a) number of bytes available
b) number of bytes requested (I assume from the read call)
The current implementation of the fillBufferQueue() in termios.c is
always return 1 character with these setting values. I know the
termios buffer has more than one character available and my read()
call is requesting 1024 bytes.
|
|
|
|
|
|
|
| |
* configure.in: Add libc/config.h
* libc/Makefile.am: Add INCLUDES += -I. to pickup config.h
* libc/.cvsignore: Add config.h and stamp-h
* libc/*.c: Add config.h support.
|
|
|
|
|
|
|
| |
* include/rtems/Makefile.am: Added termiostypes.h.
* libc/Makefile.am: Removed termiostypes.h.
* libc/termios.c: Changed include of "termiostypes.h" to
<rtems/termiostypes.h> since that is an RTEMS specific header file.
|
|
|
|
|
|
| |
* libc/termios.c, libc/termiostypes.h: Task driver driver model
and line discipline support from Thomas Doerfler
<Thomas.Doerfler@imd-systems.de>.
|
|
|
|
|
|
| |
the correct circumstances of DMA buffer size, serial
line interrupts, and ethernet interrupts the termios osend routine would
lock up waiting for the raw output buffer semaphore.
|
|
|
|
| |
ttyHead back link is set.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<charles.gauthier@iit.nrc.ca>, and Darlene A. Stewart
<Darlene.Stewart@nrc.ca> to add support for a number of very
significant things:
+ BSPs for many variations on the Motorola MBX8xx board series
+ Cache Manager including initial support for m68040
and PowerPC
+ Rework of mpc8xx libcpu code so all mpc8xx CPUs now use
same code base.
+ Rework of eth_comm BSP to utiltize above.
John reports this works on the 821 and 860
|
| |
|
|
|
|
| |
size of mininum application.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
<e.norum@sk.sympatico.ca> and concerns from Thomas Doerfler
<td@imd.m.ISAR.de> when he submitted the patch:
Since enabling XON/XOFF has such a major performance hit on `smart' output
devices I think it should be *off* by default. I think some thought should
be given to adding hooks for hardware that can support XON/XOFF without
software intervention, or for hardware like the 68360 SCC's that can use
large buffers, but still handle special characters immediately.
The patch you sent is a very good start, though. I just think that the
software flow control should be off -- to match the way the serial I/O
support has worked up until now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some lines for "documentation":
======================================
One thing should be noted: when XON/XOFF is enabled, the serial
device will always work with one-character buffers, so the interrupt
load for the CPU might get higer, especially on devices like MC68360
and MPC860, where the serial channels are capable of using big
buffers. But, once again, this only happens when XON/XOFF is actually
selected.
Please note that the flag IXON is set by default, so outgoing
XON/XOFF flow control is enabled by default.
XON/XOFF is controlled using the "standard" fields IXON/IXOFF in the
termios structure. The termios flag IXANY is not (yet) supported.
Hardware handshake for the incoming data stream is controlled using
the standard flag CRTSCTS. If this flag is set, whenever the receive
buffer is almost full, the driver function "device.stopRemoteTx()" is
called, when the receive buffer has more space available,
"device.startRemoteTx()" is called again. If the driver does not
provide these interface functions (entries in device structure are
NULL pointers), then these calls are suppressed.
Changes of the flow control options during operation should work at
any time, but this has not been extensively tested.
No changes to the device driver interface are needed.
================================================
One critical point when using this patch might be, that any BSP using
this version of termios will now have outgoing flow control enabled
by default, so the behaviour of these BSPs will change here. The
option IXON has already been set in older termios by default, but it
did not work until this patch. Maybe this option should be switched
off by default, what do you think?
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
I fixed the problems noted by Victor Vengerov.
1) Fix typo in cfsetispeed().
2) In rtems_termios_open, ensure that args->iop->data1 is set before calling
device-specific open routine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"Thomas Doerfler" <td@imd.m.isar.de> wrote:
>
> While implementing/testing the console/termios support for
> PPC403 in RTEMS-4.0.0-beta3, I am stuck at a certain location in
> termios.c:
>
> During "rtems_termios_initialize", the main control data structure
> "*tty" is allocated using malloc(). (Note, that malloc does not
> clear the allocated memory and my BSP does not clear memory during
> startup). Furtheron, a lot of fields of that structure are
> initialized, but the field "rawOutBufState" is not, and therefore
> keeps an arbitrary contents.
>
> When "osend()" is called the first time(with the serial device
> driver working in interrupt mode), termios gets stuck and will not
> call the device drivers output function.
>
> My questions now are:
>
> - anybody already experienced this bug?
> - is it a bug at all or did I do anything fundamentally wrong?
> - is there already a common bugfix for that?
>
> I don't like poking around in other people code, as long as I am
> not absolutely sure, what I do...
Yes, there's a bug there.
I thought that Joel had patched this already, but here's a patch to
fix this. This patch also addresses a concern that many others have
raised regarding enabling and disabling of transmitter interrupts.
First, here's the example I've been using of a simple UART-style
interrupt-driven driver:
===============================================================
void
device_write_routine (int minor, char *buf, int count)
{
UART->control_register &= ~UART_TRANSMITTER_READY;
UART->output_register = *buf;
UART->control_register |= UART_TRANSMIT_INTERRUPT_ENABLE;
}
void
device_transmit_interrupt_routine (int vector)
{
UART->control_register &= ~UART_TRANSMIT_INTERRUPT_ENABLE;
rtems_termios_dequeue_characters (device_ttyp, 1);
}
==============================================================
Several people have expressed their concern about the disable/enable
of transmitter interrupts for every character. On some machines
this disable/enable is an expensive operation. With the attached
patch applied you can write the two routines as:
==============================================================
void
device_write_routine (int minor, char *buf, int count)
{
code_to_clear_transmitter_ready_status ();
if (device_ttyp->rawOutBufState == rob_idle)
code_to_enable_transmitter_interrupts ();
code_to_send_one_character_to_transmitter (*buf);
}
void
device_transmit_interrupt_routine (int vector)
{
rtems_termios_dequeue_characters (device_ttyp, 1);
if (device_ttyp->rawOutBufState == rob_idle)
code_to_disable_transmitter_interrupts ();
}
===============================================================
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
returned a buffer which was not zero-filled, the reference count
was not correct. When the application exitted, the "lastClose"
handler was not being called to flush the output. This problem
had manifested itself on a variety of platforms.
The function rtems_termios_dequeue_characters() incorrectly incremented
the buffer pointers when it was invoked and there were no characters
in the ring buffer. This problem had also manifested itself on a
variety of platforms. The symptom was a strange repeating of the
data in the transmitter buffer when the transmitter serial device
was supposed to go idle.
|
|
|
|
|
|
|
|
|
| |
Haven't had a chance to do an extensive shake-out of 980710, but it
builds just fine on FreeBSD 2.2.5 (after termios is fixed using the
attached patch), and the tests run fine. FYI: FreeBSD doesn't support
System V IPC out of the box, but one only needs to add three options
to the kernel build configuration file, recompile the kernel, and
you're ready.
|
| |
|
|
|
|
| |
cfsetispeed().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Eric Norum per request from Geoffroy Montel:
> The rtems_termios_enqueue_raw_characters function type is void.
> The problem is that I can't return an error message if the input
> buffer is full.
> Could we add a return value?
Sure, but what would you do with the overflow indication? POSIX says,
``when the input limit is reached, the saved characters are thrown away
without notice''.
Anyhow, the change is so small I've done it and enclosed the patch.
|
|
|
|
|
| |
support for device driver support on tcsetattr(), and hardware
flow control callbacks.
|
|
|
|
|
| |
With this in place, it is possible to fdopen a TCP stream socket and
getc/fprintf/etc. on the STDIO stream!
|
|
|
|
|
|
| |
+ major and minor number elements in rtems_termios_open.
+ arg->ioctl_return in rtems_termios_ioctl routine.
|
| |
|
|
|
|
| |
properly reflect the const on the buffer pointer being passed in.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Added new entry point to add in per physical port resource requirements.
|
|
|
|
| |
ring buffer in conjunction with a counting semaphore.
|
|
|