linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Viro <viro@math.psu.edu>
To: Abramo Bagnara <abramo@alsa-project.org>
Cc: Jeremy Elson <jelson@circlemud.org>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	linux-kernel@vger.kernel.org
Subject: Re: Mapping a piece of one process' addrspace to another?
Date: Wed, 7 Mar 2001 04:49:56 -0500 (EST)	[thread overview]
Message-ID: <Pine.GSO.4.21.0103070429140.2127-100000@weyl.math.psu.edu> (raw)
In-Reply-To: <3AA5FD4B.B2CE1AAF@alsa-project.org>



On Wed, 7 Mar 2001, Abramo Bagnara wrote:

> > No, they don't. OOB data is equivalent to data on parallel channel.
> 
> Al, you're perfectly right in principle (although last time I've checked
> pipe and unix socket did not support OOB data. Is this changed
> recently?).

ioctl() is OOB stuff. Replace with second pipe and you don't need it
anymore.

> But you're forgetting that we need to cope with non collaborative
> applications (that *use* ioctl).

Erm. If ioctls are device-specific - the program is already bound to
specific driver. If they are for class of devices (and if I guessed
right that's the case you are interested in - sound, isn't it?) we
could let the stub driver in kernel open two pipes and redirect
read()/write() on device to the first one turn ioctls into read()/write()
on the second. That way you can get userland programs serving that
stuff with no magic required.

I mean something along the lines of

foo_write(struct file *file, char *buf, size_t size, loff_t *ppos)
{
	return f1->f_ops->write(file, buf, size, ppos);
}
foo_ioctl(struct file *file, int cmd, long arg)
{
	loff_t dummy;
	switch (cmd) {
		case SNDCTL_DSP_RESET:
			f2->f_ops->write(file, "dsp_reset", 10, &dummy);
			return 0;
		....
	}
}
where f1 and f2 are named pipes opened at init time. Notice that
it doesn't introduce extra copying - just splits the stream with OOB data
into two normal byte streams that can be served by naive userland code.
After that any client that uses current sound API is able to talk to
userland drivers and said drivers don't have to pull any special tricks -
they just open two pipes and do usual select()/read()/write() loop.
Kernel side is also quite simple that way - plain redirect for read/write
and trivial decoder for the sound ioctls.
							Cheers,
								Al


  reply	other threads:[~2001-03-07  9:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-07  5:19 Mapping a piece of one process' addrspace to another? Jeremy Elson
2001-03-07  5:55 ` Alexander Viro
2001-03-07  6:02   ` Marcelo Tosatti
2001-03-07  8:13     ` Jeremy Elson
2001-03-07  8:40       ` Alexander Viro
2001-03-07  8:54         ` Jeremy Elson
2001-03-07  9:09           ` Alexander Viro
2001-03-07 23:22             ` James H. Cloos Jr.
2001-03-07  9:04         ` Abramo Bagnara
2001-03-07  9:10           ` Alexander Viro
2001-03-07  9:20             ` Abramo Bagnara
2001-03-07  9:49               ` Alexander Viro [this message]
2001-03-07 13:01                 ` Abramo Bagnara
2001-03-07 21:02                 ` Jeremy Elson
2001-03-07  8:58       ` Abramo Bagnara
2001-03-07 18:17     ` Pavel Machek
2001-03-07 10:51 Manfred Spraul
2001-03-07 13:57 Jesse Pollard

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=Pine.GSO.4.21.0103070429140.2127-100000@weyl.math.psu.edu \
    --to=viro@math.psu.edu \
    --cc=abramo@alsa-project.org \
    --cc=jelson@circlemud.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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;
as well as URLs for NNTP newsgroup(s).