tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/sys/dev
On Fri, Jun 3, 2011 at 5:17 PM, Matt Thomas <matt%3am-software.com@localhost>
wrote:
>
> On Jun 2, 2011, at 11:36 PM, YAMAMOTO Takashi wrote:
>>>
>>> sys/device.h has CFDRIVER_DECL, which defines (not declares) a
>>> cfdriver struct. So something like
>>>
>>> #ifndef _MODULE
>>> #define CFDRIVER_DECL(x) extern struct cfdriver __CONCAT(x,_cd)
>>> #else
>>> #define CFDRIVER_DECL(x) \
>>> struct cfdriver __CONCAT(x,_cd) = { ... }
>>> #endif
>>>
>>> would work. (Already working here.)
Actually this needs more work...
>> can't it be non-conditional?
>> eg. make a driver always provide the structure.
The basic idea is that.
>> (note that i'm autoconf-ignorant. :-)
>
> The problem is when you have multiple attachments for a device.
> Who declares foo_cd?
>
> This of all the attachments for ehci.
>
> maybe there needs to be a ehci_cd.o which just does the CFDRIVER_DECL and let
> the loader grab it.
ehci's cfdriver belongs to 'ehci' device, as in sys/conf/files, and
would become 'ehci.kmod'. Attachments would become non-driver modules
(no cfdriver entry), like 'ehci_pci.kmod' or 'ehci_cardbus.kmod',
which depend on 'ehci.kmod'.
Home |
Main Index |
Thread Index |
Old Index