summaryrefslogtreecommitdiff
path: root/include/linux/module.h
AgeCommit message (Collapse)Author
2003-04-29[PATCH] __module_getRusty Russell
Introduces __module_get for places where we know we already hold a reference and ignoring the fact that the module is being "rmmod --wait"ed is simpler.
2003-04-29[PATCH] complete modinfo sectionRusty Russell
Restores .modinfo section, and uses it to store license and vermagic.
2003-04-06[PATCH] Grab SET_MODULE_OWNER from the clutches of the deprecatedZwane Mwaikambo
This comment seems to want to include SET_MODULE_OWNER as one of the deprecated facilities.
2003-04-02modules: Fix exporting symbols from modulesKai Germaschewski
This patch fixes two issues: o The CONFIG_MODVERSIONING=y case broke at compile time since some functions were not updated with the latest module changes o Exporting symbols from modules stopped working due to confusion of mod->num_syms and mod->num_ksyms. Rename mod->num_ksyms to mod->num_syms, which is more logical since the associated array is called ->syms, and for the kallsyms member use "num_symtab", since the associated array is ->symtab.
2003-04-01[PATCH] module load notificationJohn Levon
This implements a simple notifier so oprofile can notice removed and added modules properly
2003-04-01[PATCH] Extable list removalRusty Russell
This removes the extable list, and the struct exception_table, in favour of just iterating through the modules. Now all iteration is within kernel/module.c, this is a fairly trivial cleanup.
2003-04-01[PATCH] Symbol list removalRusty Russell
This removes the symbol list, and the concept of kernel symbol groups, in favour of just iterating through the modules. Now all iteration is within kernel/module.c, this is a fairly trivial cleanup.
2003-04-01[PATCH] module_text_address returns the module pointerRusty Russell
By making module_text_address return the module it found, we simplify symbol_put_addr significantly.
2003-03-21[PATCH] get rid of __MOD_INC_USE_COUNT/__MOD_DEC_USE_COUNTChristoph Hellwig
As the netfilter folks don't seem to have any interest in 2.5 currently I decided to fix their last uses of those old module interfaces myself. The implementation (get a reference first and release it again when not actually needed) might be slightly suboptimial but the netfilter team should just fix it if/when they get any interest in Linux 2.5/2.6. Also fix the MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT to give more accurate deprecation warnings.
2003-02-21Hand mergedKai Germaschewski
2003-02-19kbuild: [PATCH] adapt genksyms for current kbuildKai Germaschewski
By Rusty Russell. o generate output in a form feasible as linker script instead of munging it with sed during the build o remove checksum version 1 support o remove prefix support
2003-02-19[PATCH] kill EXPORT_NO_SYMBOLSChristoph Hellwig
it's a noop in 2.5 now that the behvaiour of implicitly exporting all symbols is gone.
2003-02-14kbuild: Module alias and device table supportRusty Russell
Introduces "MODULE_ALIAS" which modules can use to embed their own aliases for modprobe to use. Also adds a "finishing" step to modules to supplement their aliases based on MODULE_TABLE declarations, eg. 'usb:v0506p4601dl*dh*dc*dsc*dp*ic*isc*ip*' for drivers/usb/net/pegasus.o
2003-02-03Hand mergedKai Germaschewski
2003-02-03kbuild: Rename CONFIG_MODVERSIONING -> CONFIG_MODVERSIONSKai Germaschewski
CONFIG_MODVERSIONING was a temporary name introduced to distinguish between the old and new module version implementation. Since the traces of the old implementation are now gone from the build system, we rename the config option back in order to not confuse users more than necessary in 2.6. Also, remove some historic modversions cruft throughout the tree.
2003-02-02[PATCH] symbol_get linkage fixAndrew Morton
Patch from Rusty Russell <rusty@rustcorp.com.au> Make symbol_get() use undefined weak symbols if !CONFIG_MODULE. Many thanks to RTH for introducing undef weak symbols to me.
2003-01-25kbuild: gcc-3.3 warns about 2.5.59 EXPORT_SYMBOLKai Germaschewski
When building linux-2.5.59 with gcc-3.3 (on s390, if that matters), I get a warning like "warning: `__ksymtab___foo' defined but not used" each time that EXPORT_SYMBOL is used. by Arnd Bergmann
2003-01-24kbuild/modules: Record versions for unresolved symbolsKai Germaschewski
In the case of CONFIG_MODVERSIONING, the build step will only generate preliminary <module>.o objects, and an additional postprocessing step is necessary to record the versions of the unresolved symbols and add them into the final <module>.ko The version information for unresolved symbols is again recorded into a special section, "__versions", which contains an array of symbol name strings and checksum (struct modversion_info). Size is here not an issue, since this section will not be stored permanently in kernel memory. Makefile.modver takes care of the following steps: o Collect the version information for all exported symbols from vmlinux and all modules which export symbols. o For each module, generate a C file which contains the modversion information for all unresolved symbols in that module. o For each module, compile that C file to an object file o Finally, link the <module>.ko using the preliminary <module.o> + the version information above. The first two steps are currently done by not very efficient scripting, so there's room for performance improvement using some helper C code.
2003-01-24kbuild/modules: Track versions of exported symbolsKai Germaschewski
Store the information on the checksum alongside the rest of the information on exported symbols. To actually use them, we need something to check them against first, though ;) Also, fix some conditional debug code to actually compile.
2003-01-24kbuild: Generate versions for exported symbolsKai Germaschewski
Up to now, we had a way to store the checksums associated with the exported symbols, but they were not filled in yet. This is done with this patch, using the linker to actually do that for us. The comment added with this patch explains what magic exactly is going on.
2003-01-24kbuild: Add CONFIG_MODVERSIONING and __kcrctabKai Germaschewski
This patch adds the new config option CONFIG_MODVERSIONING which will be the new way of checking for ABI changes between kernel and module code. This and the following patches are in part based on an initial implementation by Rusty Russell and I believe some of the ideas go back to discussions on linux-kbuild, Keith Owens and Rusty. though I'm not sure I think credit for the basic idea of storing version info in sections goes to Keith Owens and Rusty. o Rename __gpl_ksymtab to __ksymtab_gpl since that looks more consistent and appending _gpl instead of putting it into the middle simplifies sharing code for EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() o Add CONFIG_MODVERSIONING o If CONFIG_MODVERSIONING is set, add a section __kcrctab{,_gpl}, which contains the ABI checksums for the exported symbols listed in __ksymtab{,_crc} Since we don't know the checksums yet at compilation time, just make them an unresolved symbol which gets filled in by the linker later.
2003-01-15[PATCH] remove MOD_IN_USEChristoph Hellwig
Another left-over from ancient module code, it was supposed to return non-zero if the module has a use count, but currently it always evaluates to 0. There are a few users of different types: (1) ioctl that perform a while(MOD_IN_USE) MOD_DEC_USE_COUNT loop. Just rip them out, we now have forced module unloading. (2) printk's that moan if the use-count in not zero in the exitfunc. Just rip them out, this can't happen. (3) if(MOD_IN_USE) MOD_DEC_USE_COUNT constructs in ->close of a few serial drivers. Just remove the conditional, we did a MOD_INC_USE_COUNT in ->open. (4) This one is interesting: drivers/sbus/char/display7seg.c uses the module use count to track openers. Replace this with an atomic_t. In addition remove tons of stale comments in network driver that aren't understandable for anyone who doesn't know ancient Linux module semantics.
2003-01-15[PATCH] remove GET_USE_COUNTChristoph Hellwig
This is a left-over from the old modules code, Rusty stubbed it out to always return 0. Three scsi pcmcia driver check it for beeing non-NULL, trying to work around their unload races. I've added #warnings there and stubbed out the GET_USE_COUNT so we can remove it from the core.
2003-01-15kbuild/modules: Save space on symbol listKai Germaschewski
The current code reserves 60 bytes for the symbol string of every exported symbol, unnecessarily wasting kernel memory since most symbols are much shorter. We revert to the 2.4 solution where the actual strings are saved out of line and only the pointers are kept. The latest module-init-tools already handle this case, people who are using older versions need to update to make sure depmod works properly. Saves 80 KB in vmlinux with my .config.
2003-01-11Make MOD_[INC|DEC]_USE_COUNT a true no-op for built-in modules.Linus Torvalds
This also avoids the nasty warnings that nobody seems to bother to fix.
2003-01-07[PATCH] small module patchAnton Blanchard
Add a missing inline, shows up when modules are turned off.
2003-01-05[PATCH] Remove mod_bound macro and unify kernel_text_address().Rusty Russell
Various archs (i386, m68k, s390, s390x, m68k, parisc, um, x86_64) implement kernel_text_address. Put this in kernel/extable.c, and the module iteration inside module.c. Other than cleanliness, this finally allows the module list and lock to be static to kernel/module.c (you didn't think I actually cared about those archs did you?) It also drops the module->init_size to zero when it's discarded, so bounds checking is simplified (and the /proc/modules size statistic will be more accurate, too).
2003-01-05Merge bk://are.twiddle.net/mod-2.5Linus Torvalds
into home.transmeta.com:/home/torvalds/v2.5/linux
2003-01-05[PATCH] Exception table cleanupRusty Russell
This patch combines the common exception table searching functionality for various architectures, to avoid unneccessary (and currently buggy) duplication, and so that the exception table list and lock can be kept private to module.c. The archs provide "struct exception_table" and "search_extable": the generic infrastructure drives the rest.
2003-01-05[PATCH] MODULE_LICENSE and EXPORT_SYMBOL_GPL supportRusty Russell
This implements EXPORT_SYMBOL_GPL and MODULE_LICENSE properly (so restrictions are enforced). Also fixes "proprietory" spelling.
2003-01-01[MODULES] Fix compiler warning wrt try_module_get whenRichard Henderson
modules are disabled.
2002-12-29[PATCH] more obsolete module API fixesChristoph Hellwig
completly remove the old try_inc_mod_count()
2002-12-29[PATCH] Minor compile fix for some modules.Rusty Russell
Expose declaration of __this_module outside #ifdef KBUILD_MODNAME (which is not defined for objects included in two modules).
2002-12-29[PATCH] Embed __this_module in module itself.Rusty Russell
Rather than have the module loader the module structure and resolve the symbols __this_module to it, make __this_module a real structure inside the module, using the linkonce trick we used for module names. This saves us an allocation (saving a page per module on archs which need the module structure close by), and means we don't have to fill in a few module fields.
2002-12-29[PATCH] more deprectation bitsChristoph Hellwig
Rename the deprecated attribute to __deprecated to make it obvious this is something special and to avoid namespace clashes. Mark old module interfaces deprecated.
2002-12-14[PATCH] MODULE_PARM support for older modulesRusty Russell
This is the backwards compatibility code for MODULE_PARM, and moves __MODULE_STRING() down to the graveyard at the bottom of module.h. It's complicated by the fact that many modules place MODULE_PARM() before the declaration (some do MODULE_PARM() for non-existant variables, too). To avoid breaking them, we have to do the name lookups at load time, rather than just storing a pointer 8( CONFIG_OBSOLETE_MODPARM is set to y without prompting: it's a useful marker for deprecating in 2.7.
2002-12-13[PATCH] Module init reentry fixRusty Russell
In some configurations, parport and bttv request a module inside their module_init function. Drop the lock around mod->init(), change module->live to module->state so we can detect modules which are in init.
2002-12-01[PATCH] module names fixRusty Russell
By Kai Germaschewski: "Well, I have another solution, which doesn't need additional Makefile magic or anything. I just put the module name into each .o file where <linux/module.h> is included. Putting it into the section .gnu.linkonce.modname has the effect that even for multi-part modules, we only end up with one copy of the name. Caveat: I'm using the preprocessor macro KBUILD_MODNAME to know what to put into .gnu.linkonce.modname. The following used to happen: (drivers/isdn/eicon/Makefile) divas-objs := common.o Divas_mod.o ... eicon-objs := common.o eicon_mod.o ... Divas_mod.o is compiled with -DKBUILD_MODNAME=divas eicon_mod.o is compiled with -DKBUILD_MODNAME=eicon common.o is compiled with -DKBUILD_MODNAME=divas_eicon So in the case above, both divas.o and eicon.o would end up with a .gnu.linkonce.modname section containing "divas_eicon" My fix to this is to not define KBUILD_MODNAME when compiling an object whilch will be linked into more than one module - so common.o gets no .gnu.linkonce.modname section at all. Works fine here. Now, doing this I remove one of the reasons why we would need modules linked as '.ko' ;), but it seems much cleaner than generating a temporary file, using objcopy etc."
2002-12-01[PATCH] v850 supportRusty Russell
On the v850, the elf toolchain uses a `_' prefix for all user symbols (I'm not sure why, since most toolchains seem to have dropped this sort of thing). The attached patch adds the ability to deal with this, if the macro MODULE_SYMBOL_PREFIX is defined by <asm/module.h>. This only affects places where symbol names come from the user, e.g., EXPORT_SYMBOL, or the explicit symbol-names used in kernel/module.c itself. [Tweaked a little by Rusty, original by Miles Bader]
2002-12-01[PATCH] Table fix for module-init-toolsRusty Russell
This patch allows the new depmod to generate the USB & PCI hotplug tables. Greg Banks and I are (slowly) working on a better solution, but allows the old-style "modules.pcimap" etc. to be generated in the short term. This patch adds a "__mod_XXX_table" symbol which is an alias to the module table, rather than a pointer. This makes it relatively trivial to extract the table. Previously, it required a pointer dereference, which means the relocations must be applied, which is why the old depmod needs so much of modutils (ie. it basically links the whole module in order to find the table). The old depmod can still be invoked using "-F System.map" to generate the tables (there'll be lots of other warnings, and it will generate a completely bogus modules.dep, but the tables should be OK.)
2002-11-19[PATCH] module device table restorationRusty Russell
Patch from Adam Richter. I have a nicer solution based on aliases, but it requires coordination with USB, PCI and PCMCIA maintainers, which is taking time. This restores the old code in the meantime: one week without this is too long for people who need it.
2002-11-18Parts of "module.c" was needed even when no module supportLinus Torvalds
was enabled, so split it up into "extable.c"
2002-11-18[PATCH] kallsyms for new modulesRusty Russell
Since I believe kallsyms is important, this reimplements it sanely, using the current module infrastructure, and not using an external kallsyms script. FYI, the previous interface was: int kallsyms_symbol_to_address( const char *name, /* Name to lookup */ unsigned long *token, /* Which module to start with */ const char **mod_name, /* Set to module name or "kernel" */ unsigned long *mod_start, /* Set to start address of module */ unsigned long *mod_end, /* Set to end address of module */ const char **sec_name, /* Set to section name */ unsigned long *sec_start, /* Set to start address of section */ unsigned long *sec_end, /* Set to end address of section */ const char **sym_name, /* Set to full symbol name */ unsigned long *sym_start, /* Set to start address of symbol */ unsigned long *sym_end /* Set to end address of symbol */ ); The new one is: /* Lookup an address. modname is set to NULL if it's in the kernel. */ const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname);
2002-11-16[PATCH] separate out moduleloader.hRusty Russell
Separates the module loading function prototypes (and elf.h) into moduleloader.h. AT_GID in elf.h clashes with xfs.h, but this also makes module.h less cluttered.
2002-11-13[PATCH] module_name macroRusty Russell
Fixes crypto so it compiles with !CONFIG_MODULES, and cleans up two other cases which did #ifdef CONFIG_MODULES.
2002-11-12Fix more CONFIG_MODULE_UNLOAD issuesLinus Torvalds
2002-11-10Re-introduce __MODULE_STRING, since some drivers depend on it.Linus Torvalds
(Yes, they should probably use __stringify() instead).
2002-11-10[PATCH] In-kernel Module LoaderRusty Russell
This is an implementation of the in-kernel module loader extending the try_inc_mod_count() primitive and making its use compulsory. This has the benifit of simplicity, and similarity to the existing scheme. To reduce the cost of the constant increments and decrements, reference counters are lockless and per-cpu. Eliminated (coming in following patches): o Modversions o Module parameters o kallsyms o EXPORT_SYMBOL_GPL and MODULE_LICENCE checks o DEVICE_TABLE support. New features: o Typesafe symbol_get/symbol_put o Single "insert this module" syscall interface allows trivial userspace. o Raceless loading and unloading You will need the trivial replacement module utilities from: http://ozlabs.org/~rusty/module-init-tools-0.6.tar.gz
2002-11-07[PATCH] Fix name of discarded section in modules.hPeter Chubb
Changeset willy@debian.org|ChangeSet|20021016154637|46581 in linux 2.5 changed the name of .exit.text to .text.exit. Unfortunately, one change got missed. Fix.
2002-10-11Fix defined but not used warnings by marking variablesRichard Henderson
with attribute unused.