From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: linux-kernel@vger.kernel.org
Subject: Linux tty layer hackery: Heads up and RFC
Date: Thu, 21 Jul 2005 18:46:32 +0100 [thread overview]
Message-ID: <1121967993.19424.18.camel@localhost.localdomain> (raw)
At the moment tty buffers are attached directly to the tty. This is
causing a lot of the problems related to tty layer locking, also
problems at high speed and also with bursty data (such as occurs in
virtualised environments)
I'm working on ripping out the flip buffers and replacing them with a
pool of dynamically allocated buffers. This allows both for old style
"byte I/O" devices and also helps virtualisation and smart devices where
large blocks of data suddenely materialise and need storing.
So far so good. Lots of drivers reference tty->flip.*. Several of them
also call directly and unsafely into function pointers it provides. This
will all break. Most drivers can use tty_insert_flip_char which can be
kept as an API but others need more.
At the moment I've added the following interfaces, if people think more
will be needed now is a good time to say
int tty_buffer_request_room(tty, size)
Try and ensure at least size bytes are available, returns actual room
(may be zero). At the moment it just uses the flipbuf space but that
will change. Repeated calls without characters being added are not
cumulative. (ie if you call it with 1, 1, 1, and then 4 you'll have four
characters of space. The other functions will also try and grow buffers
in future but this will be a more efficient way when you know block
sizes.
int tty_insert_flip_char(tty, ch, flag)
As before insert a character if there is room. Now returns 1 for
success, 0 for failure.
int tty_insert_flip_string(tty, str, len)
Insert a block of non error characters. Returns the number inserted.
int tty_prepare_flip_string(tty, strptr, len)
Adjust the buffer to allow len characters to be added. Returns a buffer
pointer in strptr and the length available. This allows for hardware
that needs to use functions like insl or mencpy_fromio.
I've converted a fair number of drivers to this API ready and I'll post
some patches for review soon.
Alan
next reply other threads:[~2005-07-21 17:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-21 17:46 Alan Cox [this message]
2005-07-21 17:47 ` Linux tty layer hackery: Heads up and RFC Sergei Organov
2005-07-22 14:57 ` Rogier Wolff
2005-07-22 16:16 ` Alan Cox
2005-07-26 9:55 ` Mark Underwood
2005-07-26 11:11 ` Alan Cox
2005-07-26 12:38 ` Mark Underwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1121967993.19424.18.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox