tech-kern archive

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

Re: kernel constructor



On Sun, Nov 09, 2014 at 05:46:21PM -0800, Matt Thomas wrote:
> No more link sets please.

I agree.

> Can't we use __attributes__((__constructor__))
> and __attributes__((destructor));

How about splitting the $subsystem_init() function from the function
marked as __constructor__: let the constructor function register the
$subsystem_init() function as a callback passing either a simple
integral priority or (even better, but not sure if this is
overengeneering) some representation of the dependencies - then
(topological) sort all registered callbacks and call them one after the
other.

Martin


Home | Main Index | Thread Index | Old Index