Ignore:
Timestamp:
Sep 21, 2018, 10:21:42 PM (6 years ago)
Author:
nicolas.van.phan@…
Message:

TTY MUX 4 : Multiplex TTY character sending

Now, when a thread wants to write to a tty,
when the dev_txt_write() or dev_txt_sync_write() are called,
they all call soclib_mtty_aux() with a channel number.
The soclib_mtty_aux() function will write the string char by char,
with each char preceded by the channel number, so that the receiving end
knows to which tty a character is addressed to.

N.B. dev_txt_write() makes *synchronous* writes for the moment
because unlike the vci_tty_tsar, the vci_multi_tty doesn't raise
interrupt except when a new char is received, so we can't use the
interrupt mechanism for writes.

N.B. Now, the TTY DEV threads all write to the same register (WRITE),
but when a thread sends a 2-byte (tty dest. nb. + char), the two must be
send consecutively, without another thread sending a byte in between.
Consequently, a lock has been added to guarantee this atomicity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_txt.h

    r534 r539  
    106106    char      * buffer;    /*! local pointer on characters array                         */
    107107    uint32_t    count;     /*! number of characters in buffer                            */
     108    uint32_t    channel;   /*! channel, aka which tty to write to                        */
    108109}
    109110txt_sync_args_t;
Note: See TracChangeset for help on using the changeset viewer.