public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] poll.h and polling stuff???
@ 2001-07-25  1:43 tsmith
  0 siblings, 0 replies; 11+ messages in thread
From: tsmith @ 2001-07-25  1:43 UTC (permalink / raw)
  To: ecos-discuss

[implementing poll]

I've added

    cdl_component CYGPKG_ISO_POLL {
        display       "poll.h functions"
        flavor        none
        no_define
            
        cdl_interface CYGINT_ISO_POLL {
            display       "poll() functions"
            requires      { 1 >= CYGINT_ISO_POLL }
        }
            
        cdl_option CYGBLD_ISO_POLL_HEADER {
            display       "Poll implementation header"
            flavor        booldata
            default_value 0
        }
    }

to isoinfra.cdl which I think is right. I based this bit of code(?) on the locale section. What does the "requires { 1 >= CYGINT_ISO_POLL }" do? It requires itself therefore is always enabled?

I've also added "poll.cxx" to the end of the "compile" statement in fileio.cdl.

The poll.h has been put in isoinfra/current/include and poll.cxx put next to select.cxx.

I don't think anymore modifications are needed?

I might have some code working today :)

Tim

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

* Re: [ECOS] poll.h and polling stuff???
  2001-07-25  3:27 ` Robin Farine
@ 2001-07-25 11:20   ` Jonathan Larmour
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Larmour @ 2001-07-25 11:20 UTC (permalink / raw)
  To: Robin Farine; +Cc: tsmith, ecos-discuss

Robin Farine wrote:
> 
> tsmith@megaroms.co.uk writes:
> 
> > In fact I've tried that bit of CDL in my last mail and it doesn't seem to
> > define CYGINT_ISO_POLL as 1 as hoped. Help appreciated.
> 
> I suppose that in this case you do not need an interface at all. They represent
> an abstract service that other components depend upon.

Actually you do, for a consistent system that behaves correctly when poll
is both present and absent.

What Tim is probably missing is to put "implements CYGINT_ISO_POLL" in
fileio.cdl.

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
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* Re: [ECOS] poll.h and polling stuff???
  2001-07-25  2:19 tsmith
@ 2001-07-25  3:27 ` Robin Farine
  2001-07-25 11:20   ` Jonathan Larmour
  0 siblings, 1 reply; 11+ messages in thread
From: Robin Farine @ 2001-07-25  3:27 UTC (permalink / raw)
  To: tsmith; +Cc: ecos-discuss

tsmith@megaroms.co.uk writes:

> In fact I've tried that bit of CDL in my last mail and it doesn't seem to
> define CYGINT_ISO_POLL as 1 as hoped. Help appreciated.

I suppose that in this case you do not need an interface at all. They represent
an abstract service that other components depend upon.

In the POLL case, you define a concrete service that doesn't realize an abstract
interface in contrast to a serial driver, for instance, which provides abstract
read/write/... operations to clients but requires a concrete, hardware specific
implementation that realizes the serial interface by defining these operations.

Robin

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

* Re: [ECOS] poll.h and polling stuff???
@ 2001-07-25  2:19 tsmith
  2001-07-25  3:27 ` Robin Farine
  0 siblings, 1 reply; 11+ messages in thread
From: tsmith @ 2001-07-25  2:19 UTC (permalink / raw)
  To: ecos-discuss

In fact I've tried that bit of CDL in my last mail and it doesn't seem to define CYGINT_ISO_POLL as 1 as hoped. Help appreciated.

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

* Re: [ECOS] poll.h and polling stuff???
@ 2001-07-24  8:07 tsmith
  0 siblings, 0 replies; 11+ messages in thread
From: tsmith @ 2001-07-24  8:07 UTC (permalink / raw)
  To: ecos-discuss

>It may be easier just to add poll() to select.cxx. From what I remember
>when poll() is available, select() is normally implemented in terms of
>poll(). So the current select() would be modified to be poll(), and you
>would add a new select() that wraps it. Probably :-).

I'm doing it the other way round :) Emulating the poll() with calls to select(). I've not got enough time to try and learn about the underlying file system.


I'm now going to have to rapidly learn CDL.....

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

* Re: [ECOS] poll.h and polling stuff???
@ 2001-07-24  8:05 tsmith
  0 siblings, 0 replies; 11+ messages in thread
From: tsmith @ 2001-07-24  8:05 UTC (permalink / raw)
  To: ecos-discuss

>It may be easier just to add poll() to select.cxx. From what I remember
>when poll() is available, select() is normally implemented in terms of
>poll(). So the current select() would be modified to be poll(), and you
>would add a new select() that wraps it. Probably :-).

I'm doing it the other way round :) Emulating the poll() with calls to select(). I've not got enough time to try and learn about the underlying file system.


I'm now going to have to rapidly learn CDL.....

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

* Re: [ECOS] poll.h and polling stuff???
  2001-07-24  4:29 tsmith
  2001-07-24  5:14 ` Gary Thomas
@ 2001-07-24  6:37 ` Jonathan Larmour
  1 sibling, 0 replies; 11+ messages in thread
From: Jonathan Larmour @ 2001-07-24  6:37 UTC (permalink / raw)
  To: tsmith; +Cc: ecos-discuss

tsmith@megaroms.co.uk wrote:
> 
> [i'm still very new to ecos]
> 
> to add poll() i think i need to
> a) alter the cdl for the fileio package to compile poll.cxx
> b) write poll.cxx in the same directory as select.cxx

It may be easier just to add poll() to select.cxx. From what I remember
when poll() is available, select() is normally implemented in terms of
poll(). So the current select() would be modified to be poll(), and you
would add a new select() that wraps it. Probably :-).
 
> How do i get a poll.h file to appear in my ecos build? fileio.h doesn't look like the place to add stuff.

The isoinfra package is intended to manage "top level" header files. The
net stack is an exception because that's imported code. Instead what would
happen is that isoinfra would have a poll.h that probably includes a header
fragment from the actual implementation in fileio.... or possibly just
provides a sensible default if there's an implementation. For example
isoinfra's poll.h could include:

#if CYGINT_ISO_POLL
# ifdef CYGBLD_ISO_POLL_HEADER
#  include  CYGBLD_ISO_POLL_HEADER
# else

struct pollfd {
  int fd;
  short events;
  short revents;
};

typedef unsigned int nfds_t;

#define POLLIN       0x01 
#define POLLRDNORM   0x02
#define POLLRDBAND   0x04
#define POLLPRI      0x08
#define POLLOUT      0x10
#define POLLWRNORM   POLLOUT
#define POLLWRBAND   0x20
#define POLLERR      0x40
#define POLLHUP      0x80
#define POLLNVAL     0x100

#ifdef __cplusplus
extern "C" {
#endif

extern int
poll( struct pollfd /* fds */ [], nfds_t /* nfds */, int /* timeout */ );

#ifdef __cplusplus
} /* extern "C" */
#endif 

# endif
#endif

You can probably just cut and paste the above.

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
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* RE: [ECOS] poll.h and polling stuff???
  2001-07-24  4:29 tsmith
@ 2001-07-24  5:14 ` Gary Thomas
  2001-07-24  6:37 ` Jonathan Larmour
  1 sibling, 0 replies; 11+ messages in thread
From: Gary Thomas @ 2001-07-24  5:14 UTC (permalink / raw)
  To: tsmith; +Cc: ecos-discuss

On 24-Jul-2001 tsmith@megaroms.co.uk wrote:
> 
> [i'm still very new to ecos]
> 
> to add poll() i think i need to 
> a) alter the cdl for the fileio package to compile poll.cxx
> b) write poll.cxx in the same directory as select.cxx
> 

Yes.

> How do i get a poll.h file to appear in my ecos build? fileio.h doesn't look like the place to
> add stuff.

Simply add it to the same "include" directory which contains 'fileio.h'.  When
you build your tree ("ecosconfig tree" or ConfigTool equivalent), the makefiles
will be setup to propagate it appropriately.

> 
> TIA
> 
> and yes, i am trying to run before i can walk

A very good strategy indeed.

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

* RE: [ECOS] poll.h and polling stuff???
@ 2001-07-24  4:29 tsmith
  2001-07-24  5:14 ` Gary Thomas
  2001-07-24  6:37 ` Jonathan Larmour
  0 siblings, 2 replies; 11+ messages in thread
From: tsmith @ 2001-07-24  4:29 UTC (permalink / raw)
  To: ecos-discuss

[i'm still very new to ecos]

to add poll() i think i need to 
a) alter the cdl for the fileio package to compile poll.cxx
b) write poll.cxx in the same directory as select.cxx

How do i get a poll.h file to appear in my ecos build? fileio.h doesn't look like the place to add stuff.

TIA

and yes, i am trying to run before i can walk

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

* Re: [ECOS] poll.h and polling stuff???
  2001-07-23  5:57 tsmith
@ 2001-07-23  6:05 ` Jonathan Larmour
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Larmour @ 2001-07-23  6:05 UTC (permalink / raw)
  To: tsmith; +Cc: ecos-discuss

tsmith@megaroms.co.uk wrote:
> 
> does eCos support this stuff? when i've done the ecos build there is no sys/poll.h or poll.h. what options do i have to set or do i have to go direct through the kernel?
> 
> any help would be much appreciated

But everything you want to do with it should be achievable with select() -
at least in an embedded context where in general we're not talking about
many thousands of file descriptors.

Alternatively if you wanted to write it yourself, have a look at
io/fileio/current/src/select.cxx where select() is defined. poll() is just
a variant. If you did that, obviously it would be good for it to be
contributed back: http://sources.redhat.com/ecos/faq.html#contrib_how

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
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* [ECOS] poll.h and polling stuff???
@ 2001-07-23  5:57 tsmith
  2001-07-23  6:05 ` Jonathan Larmour
  0 siblings, 1 reply; 11+ messages in thread
From: tsmith @ 2001-07-23  5:57 UTC (permalink / raw)
  To: ecos-discuss

does eCos support this stuff? when i've done the ecos build there is no sys/poll.h or poll.h. what options do i have to set or do i have to go direct through the kernel?

any help would be much appreciated

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

end of thread, other threads:[~2001-07-25 11:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-25  1:43 [ECOS] poll.h and polling stuff??? tsmith
  -- strict thread matches above, loose matches on Subject: below --
2001-07-25  2:19 tsmith
2001-07-25  3:27 ` Robin Farine
2001-07-25 11:20   ` Jonathan Larmour
2001-07-24  8:07 tsmith
2001-07-24  8:05 tsmith
2001-07-24  4:29 tsmith
2001-07-24  5:14 ` Gary Thomas
2001-07-24  6:37 ` Jonathan Larmour
2001-07-23  5:57 tsmith
2001-07-23  6:05 ` 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).