diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-03 00:24:24 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 15:27:00 -0700 |
commit | 4d435f9d8ff01ae726a2a84edb9c2457787a337e (patch) | |
tree | c4c65b739187731e89893cd10faf270067c81a56 /kernel/module.c | |
parent | 93e028148fce0be9787de7fb097fa4c8582b78c1 (diff) | |
download | op-kernel-dev-4d435f9d8ff01ae726a2a84edb9c2457787a337e.zip op-kernel-dev-4d435f9d8ff01ae726a2a84edb9c2457787a337e.tar.gz |
[PATCH] lockdep: add is_module_address()
Add is_module_address() method - to be used by lockdep.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 281172f..0351625 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2159,6 +2159,29 @@ const struct exception_table_entry *search_module_extables(unsigned long addr) return e; } +/* + * Is this a valid module address? + */ +int is_module_address(unsigned long addr) +{ + unsigned long flags; + struct module *mod; + + spin_lock_irqsave(&modlist_lock, flags); + + list_for_each_entry(mod, &modules, list) { + if (within(addr, mod->module_core, mod->core_size)) { + spin_unlock_irqrestore(&modlist_lock, flags); + return 1; + } + } + + spin_unlock_irqrestore(&modlist_lock, flags); + + return 0; +} + + /* Is this a valid kernel address? We don't grab the lock: we are oopsing. */ struct module *__module_text_address(unsigned long addr) { |