tech-kern archive

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

Re: link-sets in modules



On Mon, 28 May 2012, David Laight wrote:

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.

I'm obviously missing something that is, or should be, intrinsically obvious, but...

How would __link_set_process() know how many entries to process? What would indicate the end of the data?

Plausibly this data could be in a linkset itself!

Hmm. If this data were available (at link time) in your model, it should already be available within the existing framework.


Since I'm lacking a clue or two, I'll defer further comments here until there's a prototype to work with.


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index