Commit Graph

2049 Commits

Author SHA1 Message Date
Joel Sherrill
b3fd16416c Fix from Eric Norum <eric@skatter.usask.ca>:
"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 ();
}
===============================================================
1998-08-21 15:32:19 +00:00
Joel Sherrill
d47de32ff7 Update from Eric Norum. 1998-08-21 14:04:31 +00:00
Joel Sherrill
3c7f112a9e Regenerated 1998-08-21 13:05:18 +00:00
Joel Sherrill
33679ec46e All warnings removed. 1998-08-21 13:04:55 +00:00
Joel Sherrill
c3a1c0585c Removed networkconfig.h since it reflects target specific initialization. 1998-08-21 13:04:36 +00:00
Joel Sherrill
a83dd86106 Patch from Eric Norum 1998-08-21 12:59:04 +00:00
Joel Sherrill
d9de76f670 Update from Eric Norum. 1998-08-21 12:55:03 +00:00
Joel Sherrill
dd89471b86 Changed version. 1998-08-21 12:54:51 +00:00
Joel Sherrill
bd89c6c5a4 Added Networking and Obsoleted KA9Q manual. 1998-08-21 12:54:39 +00:00
Joel Sherrill
7c32af798e Added networking to public documents. 1998-08-21 12:54:19 +00:00
Joel Sherrill
6b384d927f Changed date/version. 1998-08-21 12:54:02 +00:00
Joel Sherrill
bbdab89563 Added initialization of missing termios structure entries. 1998-08-21 12:52:08 +00:00
Joel Sherrill
ab09043a27 Fixed warning about pointer/integer conversion which turned out to be
a missed "&" on a write.
1998-08-21 12:51:29 +00:00
Joel Sherrill
fd808baef4 Fixed discrepancies noted by John Oleynick <johno@sirius.com>. 1998-08-21 12:48:44 +00:00
Joel Sherrill
3f6b1baa92 Made the description of timeing generation more accurate. 1998-08-20 22:37:47 +00:00
Joel Sherrill
1e291bb060 Changed wording to read better for PSIM. 1998-08-20 22:37:12 +00:00
Joel Sherrill
7ddc6484ab New times. 1998-08-20 22:36:45 +00:00
Joel Sherrill
829c0c1964 Changed distribution level for this document. 1998-08-20 22:36:38 +00:00
Joel Sherrill
53c3f5fe24 Switched from generating tables based on CPU model to BSP. 1998-08-20 22:35:54 +00:00
Joel Sherrill
6a31f1dd2b Changed version. 1998-08-20 22:35:25 +00:00
Joel Sherrill
3866cd6ab4 PowerPC Supplement now part of support documentation. 1998-08-20 22:34:50 +00:00
Joel Sherrill
895dd076f0 rtems_support.html added. 1998-08-20 22:34:25 +00:00
Joel Sherrill
ad5074e3da New file 1998-08-20 22:32:06 +00:00
Joel Sherrill
3dd11faadf rtems_full.html sed'ed to get right version number. 1998-08-20 22:30:46 +00:00
Joel Sherrill
d7ee43ffb3 PowerPC now part of customer support version. 1998-08-20 22:30:28 +00:00
Joel Sherrill
a9cfa2380f changed version to 980820pm-BSD 1998-08-20 22:11:31 +00:00
Joel Sherrill
28e7d7faed Patches from Eric Norum 1998-08-20 22:04:22 +00:00
Joel Sherrill
96b3916409 Added CVS Ids 1998-08-20 21:56:40 +00:00
Joel Sherrill
ff0f694d46 Fixed many warnings. 1998-08-20 21:47:37 +00:00
Joel Sherrill
50ea4814aa changed version to 980820-BSD 1998-08-20 16:04:58 +00:00
Joel Sherrill
7c16a331ed Regenerated. 1998-08-20 16:02:47 +00:00
Joel Sherrill
2394b5abec Changed to avoid use of gets(). 1998-08-20 15:56:57 +00:00
Joel Sherrill
dcc240473f Updated to reflect TCP/IP stack transition. 1998-08-20 15:46:13 +00:00
Joel Sherrill
f205fe6d1c Updated to reflect stack transition. 1998-08-20 15:46:07 +00:00
Joel Sherrill
d9e62248e4 Temporarily leave strsep out of the build. 1998-08-20 15:38:30 +00:00
Joel Sherrill
4e1d5c69f6 Added missing file. 1998-08-20 15:38:15 +00:00
Joel Sherrill
53ee76b453 Removed stub implementation 1998-08-20 15:37:42 +00:00
Joel Sherrill
0280cb66f5 FreeBSD stack compiles for the first time (except libc/strsep.c) 1998-08-20 14:39:09 +00:00
Joel Sherrill
3f098aed45 FreeBSD stack compiles for the first time (except libc/strsep.c). 1998-08-20 14:37:17 +00:00
Joel Sherrill
c197b6c2ec Base files 1998-08-20 12:54:04 +00:00
Joel Sherrill
888497d232 Base files 1998-08-20 12:45:04 +00:00
Joel Sherrill
f31f46d2b2 Base version. 1998-08-20 12:37:35 +00:00
Joel Sherrill
39e6e65a2c Base files 1998-08-19 21:32:28 +00:00
Joel Sherrill
4328ba112f First version produced. 1998-08-19 20:50:47 +00:00
Joel Sherrill
071536e655 Renamed files ... just about to produce the first copy of the manual. 1998-08-19 20:45:19 +00:00
Joel Sherrill
ab0c6890bf Baseline 1998-08-19 20:29:35 +00:00
Joel Sherrill
26b5c77fb1 changed version to 980819 1998-08-19 20:25:21 +00:00
Joel Sherrill
8b2ee37c38 Patch from Eric Valette <valette@crf.canon.fr>:
- Use the "hlt" instruction for the Idle thread,
        - Optimise interrupt PATH leadding to thread wakeup,
        - Preparation for Intel exception management that should
        come before the end of the week...
1998-08-19 20:09:59 +00:00
Joel Sherrill
7549e147ae Fixed obsolete reference to BSDINSTALL. 1998-08-19 20:02:10 +00:00
Joel Sherrill
0375c72aaa Patch from Aleksey <qqi@world.std.com>:
This patch has same changes as one I sent to you earlier plus
    it fixes _heap_size problem for pc386 we had discussed earlier.

    Now, _heap_size is defined and set to 0 in pc386/startup/bspstart.c

    It can be patched to desireable value in binary image. If it is
    left unpatched, then startup code will determine size of memory
    (on the assumption that at least 2MB are present) and use
    max possible heap.
1998-08-19 14:47:39 +00:00