[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cdi-devel] Proposed Dynamic Driver Loading System



Kevin Wolf wrote:
On Sun, Jan 03, 2010 at 10:27:53AM +1000, Matthew Iselin wrote:
On Sun, Jan 3, 2010 at 9:38 AM, Kevin Wolf <kevin@xxxxxxxxxx> wrote:
On Sun, Jan 03, 2010 at 09:23:30AM +1000, Matthew Iselin wrote:
A simple <your scripting language here> script could be added and
called to update the list during the build of CDI.
Actually I think C would be the right tool. Link all object files in the whole
tree together and add a small main() function that enumerates all the drivers
in it. All the parsing is done by the compiler.
Hm, good point. A little more complicated, but also comes with the
bonus of needing no new dependency on Perl or Python or <your
scripting language here>.

Hm, I was just missing that driver enumeration is OS specific. So with
this approach we wouldn't be able to share the tool (unless you want to
compile everything twice: once for the OS and once with a different
cdi-osdep.h for the generation of this list). I'm not even sure that all
OSes want to have the list in the same format, so probably it's better
anyway if we only describe how you can do it and leave it to the CDI
implementations.

Just wanted to say that this is also what I proposed to do but my mail
seems to be too long to be readable and answerable. ;-)
(I proposed to scan all the available drivers either on startup of the
system or after everything is built and to create a list of drivers
which would be driver-specific and...

[...]
This is why my table consists of pointers instead of directly putting
the data there - it's not a static size.

...which would contain pointers to bus-specific structures. Yes, it's a
good idea to use the cdi_bus_data structure here.)


Max aka XanClic