public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] cyg_io_lookup () and handles
@ 2001-06-12 12:53 Trenton D. Adams
  2001-06-13 11:24 ` Jonathan Larmour
  0 siblings, 1 reply; 6+ messages in thread
From: Trenton D. Adams @ 2001-06-12 12:53 UTC (permalink / raw)
  To: 'eCos'

I think this is a simple easy to answer question.
When creating drivers, does the driver developer select their own handle
for their device?  If so, how does one pick a handle that doesn't
conflict with any of the system device handles?

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

* Re: [ECOS] cyg_io_lookup () and handles
  2001-06-12 12:53 [ECOS] cyg_io_lookup () and handles Trenton D. Adams
@ 2001-06-13 11:24 ` Jonathan Larmour
  2001-06-13 11:48   ` Trenton D. Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Larmour @ 2001-06-13 11:24 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: 'eCos'

"Trenton D. Adams" wrote:
> 
> I think this is a simple easy to answer question.
> When creating drivers, does the driver developer select their own handle
> for their device?  If so, how does one pick a handle that doesn't
> conflict with any of the system device handles?

The developer is in control of the code they are using so it's up to them
to only have unique names in their sources :-). Just name new ones
unambiguously, preferably based around what is distinctive about their
driver.

There's no standard as such because the only way to make names truly unique
is to have a central registration authority, and that's just too much
overhead for something small like 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
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] 6+ messages in thread

* RE: [ECOS] cyg_io_lookup () and handles
  2001-06-13 11:24 ` Jonathan Larmour
@ 2001-06-13 11:48   ` Trenton D. Adams
  2001-06-13 12:09     ` Jonathan Larmour
  2001-06-14  4:16     ` Bart Veer
  0 siblings, 2 replies; 6+ messages in thread
From: Trenton D. Adams @ 2001-06-13 11:48 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: 'eCos'

Ok, this is fine.  But does this mean I'm going to have to go looking
through the sources just to find what handles I can use?  After all,
isn't a handle just an unsigned integer identifier?  Or is it just the
"/dev/ser1" kind of thing?  In which case I could call mine
"/dev/mySuperWirelessDeviceThingy"! LOL

-----Original Message-----
From: jlarmour@cambridge.redhat.com
[ mailto:jlarmour@cambridge.redhat.com ] On Behalf Of Jonathan Larmour
Sent: Wednesday, June 13, 2001 12:24 PM
To: Trenton D. Adams
Cc: 'eCos'
Subject: Re: [ECOS] cyg_io_lookup () and handles


"Trenton D. Adams" wrote:
> 
> I think this is a simple easy to answer question.
> When creating drivers, does the driver developer select their own 
> handle for their device?  If so, how does one pick a handle that 
> doesn't conflict with any of the system device handles?

The developer is in control of the code they are using so it's up to
them to only have unique names in their sources :-). Just name new ones
unambiguously, preferably based around what is distinctive about their
driver.

There's no standard as such because the only way to make names truly
unique is to have a central registration authority, and that's just too
much overhead for something small like 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 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] 6+ messages in thread

* Re: [ECOS] cyg_io_lookup () and handles
  2001-06-13 11:48   ` Trenton D. Adams
@ 2001-06-13 12:09     ` Jonathan Larmour
  2001-06-13 12:21       ` Trenton D. Adams
  2001-06-14  4:16     ` Bart Veer
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Larmour @ 2001-06-13 12:09 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: 'eCos'

"Trenton D. Adams" wrote:
> 
> Ok, this is fine.  But does this mean I'm going to have to go looking
> through the sources just to find what handles I can use?  After all,
> isn't a handle just an unsigned integer identifier?  Or is it just the
> "/dev/ser1" kind of thing? 

I assumed you were referring to the latter.

> In which case I could call mine
> "/dev/mySuperWirelessDeviceThingy"! LOL

The chances of a collision given the small number of names is miniscule. An
d in any case, since you are presumably going to test your code before you
put it in an embedded device, you'll know soon enough if it can't even find
the device, nevermind use it!

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] 6+ messages in thread

* RE: [ECOS] cyg_io_lookup () and handles
  2001-06-13 12:09     ` Jonathan Larmour
@ 2001-06-13 12:21       ` Trenton D. Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Trenton D. Adams @ 2001-06-13 12:21 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: eCos Discussion

I'm used to windows programming so I naturally thought a handle was an
unsigned 32-bit integer.  Microsoft reserves certain handles for their
own use, and leaves anything above the reserved ones to other
programmers.

> -----Original Message-----
> From: jlarmour@cambridge.redhat.com 
> [ mailto:jlarmour@cambridge.redhat.com ] On Behalf Of Jonathan Larmour
> Sent: Wednesday, June 13, 2001 1:09 PM
> To: Trenton D. Adams
> Cc: 'eCos'
> Subject: Re: [ECOS] cyg_io_lookup () and handles
> 
> 
> "Trenton D. Adams" wrote:
> > 
> > Ok, this is fine.  But does this mean I'm going to have to 
> go looking 
> > through the sources just to find what handles I can use?  
> After all, 
> > isn't a handle just an unsigned integer identifier?  Or is 
> it just the 
> > "/dev/ser1" kind of thing?
> 
> I assumed you were referring to the latter.
> 
> > In which case I could call mine "/dev/mySuperWirelessDeviceThingy"! 
> > LOL
> 
> The chances of a collision given the small number of names is 
> miniscule. An d in any case, since you are presumably going 
> to test your code before you put it in an embedded device, 
> you'll know soon enough if it can't even find the device, 
> nevermind use it!
> 
> 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] 6+ messages in thread

* Re: [ECOS] cyg_io_lookup () and handles
  2001-06-13 11:48   ` Trenton D. Adams
  2001-06-13 12:09     ` Jonathan Larmour
@ 2001-06-14  4:16     ` Bart Veer
  1 sibling, 0 replies; 6+ messages in thread
From: Bart Veer @ 2001-06-14  4:16 UTC (permalink / raw)
  To: tadams; +Cc: ecos-discuss

>>>>> "Trenton" == Trenton D Adams <tadams@extremeeng.com> writes:

    Trenton> Ok, this is fine. But does this mean I'm going to have to
    Trenton> go looking through the sources just to find what handles
    Trenton> I can use? After all, isn't a handle just an unsigned
    Trenton> integer identifier? Or is it just the "/dev/ser1" kind of
    Trenton> thing? In which case I could call mine
    Trenton> "/dev/mySuperWirelessDeviceThingy"! LOL

If you are really worried, how about just running something like the
following (untested):

#include <devtab.h>

int
main(int argc, char** argv)
{
    cyg_devtab_entry_t *dev;
    for (dev = &(__DEVTAB__[0]); dev != &__DEVTAB_END__; dev++) {
        printf("Device %s\n", dev->name);
    }
}

The real point is to remember the typical kind of target system that
eCos is intended for. There will only be a small number of devices in
the system and you should have a pretty good idea what they are.
Admittedly the documentation could be more explicit about this sort of
thing, e.g. the documentation for a given target might have a section
listing all of the devices that will be present plus details of
relevant configuration options etc.

Now in theory we could add complexity to the build system to check
that all devtab entries are unique, or add code bloat by doing a
run-time check, but in practice there are many more important things
to work on.

Bart

    Trenton> -----Original Message-----
    Trenton> From: jlarmour@cambridge.redhat.com
    Trenton> [ mailto:jlarmour@cambridge.redhat.com ] On Behalf Of Jonathan Larmour
    Trenton> Sent: Wednesday, June 13, 2001 12:24 PM
    Trenton> To: Trenton D. Adams
    Trenton> Cc: 'eCos'
    Trenton> Subject: Re: [ECOS] cyg_io_lookup () and handles


    Trenton> "Trenton D. Adams" wrote:
    >> 
    >> I think this is a simple easy to answer question.
    >> When creating drivers, does the driver developer select their own 
    >> handle for their device?  If so, how does one pick a handle that 
    >> doesn't conflict with any of the system device handles?

    Jifl> The developer is in control of the code they are using so
    Jifl> it's up to them to only have unique names in their sources
    Jifl> :-). Just name new ones unambiguously, preferably based
    Jifl> around what is distinctive about their driver.

    Jifl> There's no standard as such because the only way to make names truly
    Jifl> unique is to have a central registration authority, and that's just too
    Jifl> much overhead for something small like this :-).

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

end of thread, other threads:[~2001-06-14  4:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-12 12:53 [ECOS] cyg_io_lookup () and handles Trenton D. Adams
2001-06-13 11:24 ` Jonathan Larmour
2001-06-13 11:48   ` Trenton D. Adams
2001-06-13 12:09     ` Jonathan Larmour
2001-06-13 12:21       ` Trenton D. Adams
2001-06-14  4:16     ` Bart Veer

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