Subject: Re: foo_init()s in main() [was: CVS commit: src/sys]
To: Bill Studenmund <email@example.com>
From: Jason Thorpe <firstname.lastname@example.org>
Date: 11/22/2005 14:18:31
On Nov 22, 2005, at 1:53 PM, Bill Studenmund wrote:
> How do you think we should encode dependencies? I agree that the
> way is uncentralized. However someone who studies the whole system can
> tune it so that things get loaded in the right order (just pick the
> set of "FIRST", "SECOND", and so on). How would we do that w/o the
> list of values?
The init routine for each subsystem could easily enough call init
routines for the subsystems on which it depends. Each of those init
routines would internally handle the "once" handling.
/* do stuff */
So, consider a network driver, which would call if_attach()...
if_attach() would in turn call if_init(), which would in turn call
For things like lists / tables / etc., we can change to using static
initializers for those.