summaryrefslogtreecommitdiff
path: root/include/linux/module.h
AgeCommit message (Collapse)Author
2005-03-11Merge bk://linux-sam.bkbits.net/kbuildLinus Torvalds
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2005-03-11[PATCH] Make lots of things staticAdrian Bunk
This is a megarollup of ~60 patches which give various things static scope. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-31The wrong version of the parmtype patch was merged, incompletely, andAndreas Gruenbacher
the part that got merged got broken on the way. Here are the fixes: Move __MODULE_INFO to modparam.h: This macro is used in modparam.h; there are users who include this header but not module.h. The latter includes modparam.h already. __MODULE_INFO(parmtype, name##type, #name ":" #type) does not evaluate to __MODULE_INFO(parmtype, footype, "foo:int") as was the idea, but to __MODULE_INFO(parmtype, fooint, "foo:int") when type is bound to int. In more complicated cases, we get syntax erros. Re-introduce the __MODULE_PARM_TYPE macro; this is cleaner than renaming the type parameter. Add the parmtype definition which was dropped during the merge to to the obsolete but still heavily used MODULE_PARM macro. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Sam Ravnborf <sam@ravnbrg.org>
2005-01-09Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman
into kroah.com:/home/greg/linux/BK/usb-2.6
2005-01-07[PATCH] Remove EXPORT_SYMBOL_NOVERSRusty Russell
Vadim Lobanov points out that EXPORT_SYMBOL_NOVERS is no longer used; in fact, SH still uses it, but once we fix that, the kernel is clean. Remove it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-12-20[PATCH] module sysfs: module parameters reimplemented using attr groupTejun Heo
Reimplement parameter attributes using attribute group. This makes more sense, for, while they reside in a separate subdirectory, they belong to the ownig module and their lifetime exactly equals the lifetime of the owning module, and it's simpler. Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-12-20[PATCH] module sysfs: sections attr reimplemented using attr groupTejun Heo
Reimplement section attributes using attribute group. This makes more sense, for, while they reside in a separate subdirectory, they belong to the ownig module and their lifetime exactly equals the lifetime of the owning module, and it's simpler. Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-12-20[PATCH] module sysfs: expand module_attribute methodsTejun Heo
Modify module_attribute show/store methods to accept self argument to enable further extensions. Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-12-20[PATCH] module sysfs: make module.mkobj inlineTejun Heo
Make module.mkobj inline. As this is simpler and what's usually done with kobjs when it's representing an entity. Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-11-24[PATCH] dont deprecate MODULE_PARMAndrew Morton
Let's revert this for now so all those warnings do not soil our 2.6.10 release. We'll get Rusty's kernel-wide-sweep fixup patches in for 2.6.11, and then we can put this warning back. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-25[PATCH] Builtin Module Parameters in sysfs tooRusty Russell
Currently, only module parameters in loaded modules are exported in /sys/modules/, while those of "modules" built into the kernel can be set by the kernel command line, but not read or set via sysfs. - move module parameters from /sys/modules/$(module_name)/$(parameter_name) to /sys/modules/$(module_name)/parameters/$(parameter_name) - remove dummy kernel_param for exporting refcnt, add "struct module *"-based attribute instead - also export module paramters for "modules" which are built into the kernel, so parameters are always accessible at /sys/modules/$(KBUILD_MODNAME)/$(parameter_name) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified) Signed-off-by: Dominik Brodowski <linux@brodo.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-25[PATCH] Fix for MODULE_PARM obsoleteRusty Russell
There is no __attribute_unused__: use __attribute__((__unused__)). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-25[PATCH] MODULE_PARM must die: make it warn first.Rusty Russell
This patch adds a warning whenever MODULE_PARM is used. Successive patches change them over to module_param. Help appreciated! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-19[PATCH] modules: put srcversion checksum in each modinfo sectionMatt Domsch
Separate the module source and header checksum into a separate modinfo field srcversion. With CONFIG_MODULE_SRCVERSION_ALL=y, put srcversion into every module, not just those with MODULE_VERSION("something"). Patch by Rusty Russell, trivial merging and testing by Matt Domsch Signed-off-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-18Trivial Makefile mergeLinus Torvalds
2004-10-18[PATCH] mark inter_module_* deprecatedChristoph Hellwig
These had been officially deprecated since Rusty's module rewrite, but never got the __deprecated marker. The only remaining users are drm and mtd, so we'll get some warnings for common builds. But maybe that's the only way to get the drm people to fix the mess :) Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-18[PATCH] remove MOD_INC_USE_COUNT/MOD_DEC_USE_COUNTChristoph Hellwig
They've been marked deprecated since 2.5.x and there's no more users. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-28[PATCH] module.h build fixAndrew Morton
From: Ingo Molnar <mingo@elte.hu> Forward-declare the structures before using them, rather than relying on previous inclusions. akpm: The breakage was introduced by bk-driver-core.patch Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-22[PATCH] Put symbolic links between drivers and modules in the sysfs treeGreg Kroah-Hartman
This functionality is essential for us to work out which drivers are supplied by which modules. We use this in turn to work out which modules are necessary to find the root device (and hence what initrd/initramfs needs to insert). If you look at debian at the moment, it uses a huge mapping table on /proc/scsi/* to do this. If we implement the sysfs feature, we can simply go from /sys/block/<device> to the actual device to the driver and then to the module with no need of any fixed tables. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-06-26[PATCH] Fix race between CONFIG_DEBUG_SLABALLOC and modulesRusty Russell
store_stackinfo() does an unlocked module list walk during normal runtime which opens up a race with the module load/unload code. This can be triggered by simply unloading and loading a module in a loop with CONFIG_DEBUG_PAGEALLOC resulting in store_stackinfo() tripping over bad list pointers. kernel_text_address doesn't take any locks, because during an OOPS we don't want to deadlock. Rename that to __kernel_text_address, and make kernel_text_address take the lock. Signed-off-by: Zwane Mwaikambo <zwane@fsmlabs.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified) Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-04[PATCH] Module section offsets in /sys/moduleJonathan Corbet
So here I am trying to write about how one can apply gdb to a running kernel, and I'd like to tell people how to debug loadable modules. Only with the 2.6 module loader, there's no way to find out where the various sections in the module image ended up, so you can't do much. This patch attempts to fix that by adding a "sections" subdirectory to every module's entry in /sys/module; each attribute in that directory associates a beginning address with the section name. Those attributes can be used by a a simple script to generate an add-symbol-file command for gdb, something like: #!/bin/bash # # gdbline module image # # Outputs an add-symbol-file line suitable for pasting into gdb to examine # a loaded module. # cd /sys/module/$1/sections echo -n add-symbol-file $2 `/bin/cat .text` for section in .[a-z]* *; do if [ $section != ".text" ]; then echo " \\" echo -n " -s" $section `/bin/cat $section` fi done echo Currently, this feature is absent if CONFIG_KALLSYMS is not set. I do wonder if CONFIG_DEBUG_INFO might not be a better choice, now that I think about it. Section names are unmunged, so "ls -a" is needed to see most of them. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-05-14[PATCH] implement print_modules()Andrew Morton
From: Arjan van de Ven <arjanv@redhat.com>, Rusty Russell <rusty@rustcorp.com.au> The patch below resolves the "Not Yet Implemented" print_modules() thing. This is a really useful feature for distros; it allows us to do statistical analysis on which modules are present how often in oopses compared to how often they are used normally. In addition it helps to spot candidates for certain bugs without having to go back to the customer asking for this information.
2004-05-07Add modules to sysfsGreg Kroah-Hartman
This patch adds basic kobject support to struct module, and it creates a /sys/module directory which contains all of the individual modules. Each module currently exports the refcount (if they are unloadable) and any module paramaters that are marked exportable in sysfs. Was written by me and Rusty over and over many times during the past 6 months.
2004-04-11[PATCH] Move __this_module to modpostAndrew Morton
From: Brian Gerst <bgerst@didntduck.org> Move the __this_module structure to the modpost code where it really belongs.
2004-02-26[PATCH] Add a MODULE_VERSION macroAndrew Morton
From: Rusty Russell <rusty@au1.ibm.com> The way it works is that the .mod file contains the name of the module (as before), but succeeding lines are the constituent parts (assumed to be .c files, which usually works: if they use MODULE_VERSION in a file for which this isn't true we'll get a warning). As we postprocess modules, we look in the .modinfo section for a "version=", which is placed by the MODULE_VERSION() macro. This will be of form "version=<macroarg>" "\0" [24 chars] "\0". The 24 chars are replaced by the md4 sum of the .c files and any files they #include using '#include "file"' which are found in the current directory. Whitespace is collapsed outside strings, and comments are ignored for purposes of the sum. The result is a .modinfo entry such as version=1.16ac-rustytest B13E9451C4CA3B89577DEFF At the kernel summit, various people asked for a MODULE_VERSION macro to store module strings (for later access through sysfs). A simple md4 is needed to identify changes in modules which, inevitably, do not update the version. It skips whitespace and comments, and includes #includes which are in the same dir. The module versions should be set according to this definition, based on the RPM one, or CVS Revision tags. Violators will be shot. [<epoch>`:']<version>[`-'<extraversion>] <epoch>: A (small) unsigned integer which allows you to start versions anew. If not mentioned, it's zero. eg. "2:1.0" is after "1:2.0". <version>: The <version> may contain only alphanumerics. <extraversion>: Like <version>, but inserted for local customizations, eg "rh3" or "rusty1". Comparison of two versions (assuming same epoch): Split each into all-digit and all-alphabetical parts. Compare each one one at a time: digit parts numerically, alphabetical in ASCII order. So 0.10 comes after 0.9.
2004-02-26[PATCH] Add kallsyms_lookupname()Andrew Morton
From: Rusty Russell <rusty@au1.ibm.com> Attached patch adds a kallsyms_lookupname() function for lookups of a symbol name to an address. Debuggers such as ppc[64] xmon can use this. It's intentionally not exported as a symbol for module use, since it can be used to circumvent other symbol export restrictions.
2004-01-19[PATCH] sort exception tablesPaul Mackerras
This patch arranges for the exception tables to be sorted on most architectures. It sorts the main kernel exception table on startup and the module exception tables when they get loaded. The main table is sorted reasonably early - just after kmem_cache_init - but that could be moved even earlier if necessary. There is now a lib/extable.c which includes the sort_extable() function from arch/ppc/mm/extable.c and the search_extable() function from arch/i386/mm/extable.c, which had been copied to many architectures. On many architectures, arch/$(ARCH)/mm/extable.c became empty and so I have removed it. There are four architectures which do things differently from i386: alpha, ia64, sparc and sparc64. Alpha and ia64 store the offset from the offset from the exception table entry to the instruction, and sparc and sparc64 have range entries in the table. For those architectures I have added empty sort_extable functions. The maintainers for those architectures can implement something better if they care to. As it is they are no worse off than before. Although it is a moderately sizable patch, it ends up with a net reduction of 377 lines in the size of the kernel source. :) I have tested this on x86 and ppc with a module that uses __get_user in an init function, deliberately laid out to get the exception table out of order, and it works (whereas it oopsed without this patch).
2004-01-19[PATCH] make gcc 3.4 compilation workAndrew Morton
From: David Mosberger <davidm@napali.hpl.hp.com> With gcc-3.4 we need "attribute((used))" declarations to get "make modules_install" to work. Otherwise these sections get dropped from the final image (I assume).
2003-07-18[PATCH] module_put_and_exitRusty Russell
Author: Neil Brown Define module_put_and_exit() and use it for nfsd/lockd Both nfsd and lockd have threads which expect to hold a reference to the module while the thread is running. In order for the thread to be able to put_module() the module before exiting, the put_module code must be call from outside the module. This patch provides module_put_and_exit in non-modular code which a thread-in-a-module can call. It also gets nfsd and lockd to use it as appropriate. Note that in lockd, we can __get_module in the thread itself as the creator of the thread is waiting for the thread to startup. In nfsd and for the 'reclaimer' threaded started by locked, we __get_module first and put_module if the thread failed to start.
2003-07-18[PATCH] Resolve module local_t conflictRusty Russell
Uses local_t for module reference counts.
2003-06-30[PATCH] Identify Code Section Of Modules for kallsymsRusty Russell
Remember the size of the SHF_EXECINSTR sections, which are conveniently at the start of the modules, and use that to more reliably implement module_text_address().
2003-06-06[PATCH] kallsyms in procRusty Russell
This adds a /proc/kallsyms if you have CONFIG_KALLSYMS in your kernel. The output is nm-like, with symbols in caps (global) if exported using EXPORT_SYMBOL, rather than the normal static vs. non-static differentiation. This is useful for things like performance monitoring tools (profiling etc) that want to match addresses to names in user space.
2003-06-05[PATCH] per-cpu support inside modules (minimal)Andrew Morton
From: Rusty Russell <rusty@rustcorp.com.au> OK, this does the *minimum* required to support DEFINE_PER_CPU inside modules. If we decide to change kmalloc_percpu later, great, we can turf this out. Basically, overallocates the amount of per-cpu data at boot to at least PERCPU_ENOUGH_ROOM if CONFIG_MODULES=y (arch-specific by default 32k: I have only 7744 bytes of percpu data in my kernel here, so makes sense), and a special allocator in module.c dishes it out.
2003-05-19[NET]: Fix netdevice unregister races.David S. Miller
We had two major issues when unregistering networking devices. 1) Even trying to run hotplug asynchronously could deadlock if keventd was currently trying to get the RTNL semaphore in order to process linkwatch events. 2) Unregister needs to wait for the last reference to go away before the finalization of the unregister can execute. This cannot occur under the RTNL semaphore as this is deadlock prone as well. The solution is to do all of this stuff after dropping the RTNL semaphore. rtnl_lock, if it is about to protect a region of code that could unregister network devices, registers a list to which unregistered netdevs are attached. At rtnl_unlock time this list is processed to wait for refcounts to drop to zero and then finalize the unregister.
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.