[nycbug-talk] Understanding sys/module.h , *module_t and *modeventhand_t

Tim A. techneck at goldenpath.org
Thu Apr 10 13:05:27 EDT 2008


>> As for the module list, I think here it is in
>> sys/kern/kern_module.c:
>>
>> ...
>> typedef TAILQ_HEAD(, module) modulelist_t;
>> struct module {
>> 	TAILQ_ENTRY(module)	link;	/* chain together all modules */
>> 	TAILQ_ENTRY(module)	flink;	/* all modules in a file */
>> 	struct linker_file	*file;	/* file which contains this module */
>> 	int			refs;	/* reference count */
>> 	int 			id;	/* unique id number */
>> 	char 			*name;	/* module name */
>> 	modeventhand_t 		handler;	/* event handler */
>> 	void 			*arg;	/* argument for handler */
>> 	modspecific_t 		data;	/* module specific data */
>> };
>> ...
>>
>>   
>
> That is exactly what I was looking for.
> Thank you, so much! I owe you dinner :)
>
> I thought for sure it would have turned up in cscope by searching the 
> headers.

In retrospect, I probably should have just greped /sys/ for "struct 
module {"
Silly me. Playing around with cscope so much (which I'm loving by the 
way), I neglected the obvious.




More information about the talk mailing list