tech-kern archive

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

Re: link-sets in modules



On Mon, May 28, 2012 at 06:51:43AM -0700, Paul Goyette wrote:
> I'm not sure this solves the problem.
> 
> From my earlier attempts at modularizing the ieee80211 code, it seems 
> that there are two separate mechanisms for finding the start and end of 
> a link set:
> 
> 1. Within a monolithically-linked kernel, we have the symbols
>    __{start,stop}_link_set_* but no program section table
> 
> 2. Within a module, we have the program section table (containing a
>    start address and size), but no symbols
> 
> Since the primary purpose of link_sets is to gather together some 
> unknown quantity of "info" from arbitrary contributors without imposing 
> any restrictions on quantity, I don't see how your proposal addresses 
> the need of figuring out the size/quantity portion of the equation.

If you look at (say) evcnt_init() is has:

        __link_set_decl(evcnts, struct evcnt);

        __link_set_foreach(evp, evcnts)
                evcnt_attach_static(*evp);

If could also call something like:
        __link_set_process(evcnts, evcnt_attach_static, evcnt_detach);

which would save data the module loader can use to process the program
section of a lodable module.

Plausibly this data could be in a linkset itself!

It would be an error to try to load a module which contained a linkset
without anything defined to process it.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index