Source-Changes-D archive

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

Re: CVS commit: src/sys/kern




Am 27.07.2009 um 18:57 schrieb Matthias Drochner:


marc%msys.ch@localhost said:
yes, please mail me some hints, I find it gross myself, but did not
yet find a better way.

It is pretty easy:
-in files.gpio, change the declaration to
defpseudodev gpiosim: gpiobus
and remove the "attach" line
-in the kernel config, change "gpiosim0 at root" (or what you have there) to
pseudo-device gpiosim 1
(or a higher number if you want multiple instances)
-add a gpiosimattach(int) function to gpiosim.c. It will be called
automatically, with the integer argument from the config file, as
usual for pseudo devices.
In that function, you can call config_attach_pseudo(9) to attach
the actual instances. See eg sys/dev/vnd.c for an example.
You can do that multiple times, hinted by the integer argument,
if you want to allow multiple instances.
(You can attach or detach at runtime as well if you have a way
to initiate that from a control program or so.)

Many thanks, I got it working and will commit it soon. Much nicer this way!

- Marc



Home | Main Index | Thread Index | Old Index