diff options
author | Anders Kaseorg <andersk@mit.edu> | 2008-12-05 19:03:58 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-03-30 22:35:32 -0400 |
commit | 75a66614db21007bcc8c37f9c5d5b922981387b9 (patch) | |
tree | d02c905a3aee02ec25ce38700f47d0fa57d2cbf7 /include/linux/module.h | |
parent | a6e6abd575fcbe6572ebc7a70ad616406d206fa8 (diff) |
Ksplice: Add functions for walking kallsyms symbols
Impact: New API
kallsyms_lookup_name only returns the first match that it finds. Ksplice
needs information about all symbols with a given name in order to correctly
resolve local symbols.
kallsyms_on_each_symbol provides a generic mechanism for iterating over the
kallsyms table.
Cc: Jeff Arnold <jbarnold@mit.edu>
Cc: Tim Abbott <tabbott@mit.edu>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/module.h')
-rw-r--r-- | include/linux/module.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 69761ce0dbf0..c3d3fc4ffb18 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -387,6 +387,10 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, | |||
387 | /* Look for this name: can be of form module:name. */ | 387 | /* Look for this name: can be of form module:name. */ |
388 | unsigned long module_kallsyms_lookup_name(const char *name); | 388 | unsigned long module_kallsyms_lookup_name(const char *name); |
389 | 389 | ||
390 | int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, | ||
391 | struct module *, unsigned long), | ||
392 | void *data); | ||
393 | |||
390 | extern void __module_put_and_exit(struct module *mod, long code) | 394 | extern void __module_put_and_exit(struct module *mod, long code) |
391 | __attribute__((noreturn)); | 395 | __attribute__((noreturn)); |
392 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); | 396 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); |
@@ -566,6 +570,14 @@ static inline unsigned long module_kallsyms_lookup_name(const char *name) | |||
566 | return 0; | 570 | return 0; |
567 | } | 571 | } |
568 | 572 | ||
573 | static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, | ||
574 | struct module *, | ||
575 | unsigned long), | ||
576 | void *data) | ||
577 | { | ||
578 | return 0; | ||
579 | } | ||
580 | |||
569 | static inline int register_module_notifier(struct notifier_block * nb) | 581 | static inline int register_module_notifier(struct notifier_block * nb) |
570 | { | 582 | { |
571 | /* no events will happen anyway, so this can always succeed */ | 583 | /* no events will happen anyway, so this can always succeed */ |