On Wed, Mar 05, 2003 at 09:59:01PM -0700, M. Warner Losh wrote: > Here's a simple patch. However, it is a total suck-ass kludge (and > that's being generous). The ABI isn't THE ABI, but rather a > collection of ABIs. These ABIs change slowly and there is a certain > range that work together. Historically, we've been really bad about > bumping version numbers when things change in modules. Also, there's > no built-in versioning in the module names, which makes it harder to > have multiple versions around. As such, the version numbers are set > to 1 and never change.
My kernel coding skills are severely limited, so please adjust any pointing and laughing as appropriate. ... > +/* > + * Define the version. Change the symbol name when things get too > + * incompatible. version_5_1 means the 'ABI compatible with FreeBSD 5.1' > + */ > +char __version_5_1 = 1; ... Wouldn't it make more sense to have a symbol name that doesn't change across versions? Something like '_module_version' perhaps. Then the value of the symbol is the version which the module corresponds to. This would let you use something like kern.osreldate or a per-subsystem version index. This would also save you from having to search through files that say "_version_5_1" and instead just define '_module_version' using a #define in one of your headers. config.h: #define API_VERSION 500100 mymodule.c: long _module_version = API_VERSION; Another benefit(?) is that if _module_version is missing, you can decide that you don't care about versioning and just load the module. This could be useful for third-party modules that don't want to lock them down to a specific kernel/API/subsystem version. Not recommended, but optional. -- Sean Kelly | PGP KeyID: D2E5E296 [EMAIL PROTECTED] | http://www.zombie.org
pgp00000.pgp
Description: PGP signature

