| Age | Commit message (Collapse) | Author |
|
into ppc970.osdl.org:/home/torvalds/v2.6/linux
|
|
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>
|
|
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>
|
|
into kroah.com:/home/greg/linux/BK/usb-2.6
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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.
|
|
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.
|
|
From: Brian Gerst <bgerst@didntduck.org>
Move the __this_module structure to the modpost code where it really
belongs.
|
|
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.
|
|
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.
|
|
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).
|
|
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).
|
|
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.
|
|
Uses local_t for module reference counts.
|
|
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().
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Restores .modinfo section, and uses it to store license and vermagic.
|
|
This comment seems to want to include SET_MODULE_OWNER as one of the
deprecated facilities.
|
|
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.
|
|
This implements a simple notifier so oprofile can notice removed and
added modules properly
|
|
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.
|
|
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.
|
|
By making module_text_address return the module it found, we
simplify symbol_put_addr significantly.
|
|
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.
|
|
|
|
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
|
|
it's a noop in 2.5 now that the behvaiour of implicitly exporting
all symbols is gone.
|
|
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
|
|
|
|
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.
|
|
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.
|