public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.com>
To: Nielsen Linus <Linus.Nielsen@elema.siemens.se>
Cc: "'ecos-discuss@sources.redhat.com'" <ecos-discuss@sources.redhat.com>
Subject: Re: [ECOS] The select() method
Date: Tue, 13 Mar 2001 13:03:00 -0000	[thread overview]
Message-ID: <3AAE8B07.4BBF27E7@redhat.com> (raw)
In-Reply-To: <63E7EC6F3685D311B640080006279198035835BB@visbur.siemens.se>

Nielsen Linus wrote:
> 
> I recently fetched the latest version of eCos from the CVS .
> I am beginning to write a simple character device just to
> understand how it is done.
> 
> I wonder how the select() method is supposed to be implemented?
> What does eCos expect it to do? Is it like poll() in Linux or what?
> I can't find a simple character device in the CVS to look at, and
> not any docs either.

Not a good situation I know. I think the generic serial driver is bound to
be the closest fit to what you are looking for. See
io/serial/current/src/common/serial.c

If you try to blot out the flow control stuff it should be okay. Basically
the driver exports a function like serial_select in its DEVIO_TABLE (see
io/common/current/include/devtab.h). When something calls select on an fd
associated with this driver, then e.g. serial_select is called and
cyg_selrecord() is used to register that this device is being "selected"
for reading/writing/exceptions.

Then at any other point in the driver, when one of the conditions has been
fulfilled to cause something to be woken up by a select, e.g. an rx buffer
going from empty to non-empty, or a tx buffer filling up, then
cyg_selwakeup() is called to indicate this.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

      reply	other threads:[~2001-03-13 13:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-09  4:57 Nielsen Linus
2001-03-13 13:03 ` Jonathan Larmour [this message]

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=3AAE8B07.4BBF27E7@redhat.com \
    --to=jlarmour@redhat.com \
    --cc=Linus.Nielsen@elema.siemens.se \
    --cc=ecos-discuss@sources.redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).