public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] The select() method
@ 2001-03-09  4:57 Nielsen Linus
  2001-03-13 13:03 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Nielsen Linus @ 2001-03-09  4:57 UTC (permalink / raw)
  To: 'ecos-discuss@sources.redhat.com'

Hello!

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.

/Linus

--
Linus Nielsen Feltzing
mailto:linus@haxx.se

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] The select() method
  2001-03-09  4:57 [ECOS] The select() method Nielsen Linus
@ 2001-03-13 13:03 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2001-03-13 13:03 UTC (permalink / raw)
  To: Nielsen Linus; +Cc: 'ecos-discuss@sources.redhat.com'

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-13 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-09  4:57 [ECOS] The select() method Nielsen Linus
2001-03-13 13:03 ` Jonathan Larmour

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).