diff options
Diffstat (limited to 'include/linux/module.h')
-rw-r--r-- | include/linux/module.h | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 2cbc0b87e329..ac481e2094fd 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -178,7 +178,7 @@ void *__symbol_get_gpl(const char *symbol); | |||
178 | #define __CRC_SYMBOL(sym, sec) \ | 178 | #define __CRC_SYMBOL(sym, sec) \ |
179 | extern void *__crc_##sym __attribute__((weak)); \ | 179 | extern void *__crc_##sym __attribute__((weak)); \ |
180 | static const unsigned long __kcrctab_##sym \ | 180 | static const unsigned long __kcrctab_##sym \ |
181 | __attribute_used__ \ | 181 | __used \ |
182 | __attribute__((section("__kcrctab" sec), unused)) \ | 182 | __attribute__((section("__kcrctab" sec), unused)) \ |
183 | = (unsigned long) &__crc_##sym; | 183 | = (unsigned long) &__crc_##sym; |
184 | #else | 184 | #else |
@@ -193,7 +193,7 @@ void *__symbol_get_gpl(const char *symbol); | |||
193 | __attribute__((section("__ksymtab_strings"))) \ | 193 | __attribute__((section("__ksymtab_strings"))) \ |
194 | = MODULE_SYMBOL_PREFIX #sym; \ | 194 | = MODULE_SYMBOL_PREFIX #sym; \ |
195 | static const struct kernel_symbol __ksymtab_##sym \ | 195 | static const struct kernel_symbol __ksymtab_##sym \ |
196 | __attribute_used__ \ | 196 | __used \ |
197 | __attribute__((section("__ksymtab" sec), unused)) \ | 197 | __attribute__((section("__ksymtab" sec), unused)) \ |
198 | = { (unsigned long)&sym, __kstrtab_##sym } | 198 | = { (unsigned long)&sym, __kstrtab_##sym } |
199 | 199 | ||
@@ -446,11 +446,14 @@ static inline void __module_get(struct module *module) | |||
446 | __mod ? __mod->name : "kernel"; \ | 446 | __mod ? __mod->name : "kernel"; \ |
447 | }) | 447 | }) |
448 | 448 | ||
449 | /* For kallsyms to ask for address resolution. NULL means not found. */ | 449 | /* For kallsyms to ask for address resolution. namebuf should be at |
450 | const char *module_address_lookup(unsigned long addr, | 450 | * least KSYM_NAME_LEN long: a pointer to namebuf is returned if |
451 | unsigned long *symbolsize, | 451 | * found, otherwise NULL. */ |
452 | unsigned long *offset, | 452 | char *module_address_lookup(unsigned long addr, |
453 | char **modname); | 453 | unsigned long *symbolsize, |
454 | unsigned long *offset, | ||
455 | char **modname, | ||
456 | char *namebuf); | ||
454 | int lookup_module_symbol_name(unsigned long addr, char *symname); | 457 | int lookup_module_symbol_name(unsigned long addr, char *symname); |
455 | int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name); | 458 | int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name); |
456 | 459 | ||
@@ -516,10 +519,11 @@ static inline void module_put(struct module *module) | |||
516 | #define module_name(mod) "kernel" | 519 | #define module_name(mod) "kernel" |
517 | 520 | ||
518 | /* For kallsyms to ask for address resolution. NULL means not found. */ | 521 | /* For kallsyms to ask for address resolution. NULL means not found. */ |
519 | static inline const char *module_address_lookup(unsigned long addr, | 522 | static inline char *module_address_lookup(unsigned long addr, |
520 | unsigned long *symbolsize, | 523 | unsigned long *symbolsize, |
521 | unsigned long *offset, | 524 | unsigned long *offset, |
522 | char **modname) | 525 | char **modname, |
526 | char *namebuf) | ||
523 | { | 527 | { |
524 | return NULL; | 528 | return NULL; |
525 | } | 529 | } |
@@ -574,7 +578,9 @@ struct device_driver; | |||
574 | #ifdef CONFIG_SYSFS | 578 | #ifdef CONFIG_SYSFS |
575 | struct module; | 579 | struct module; |
576 | 580 | ||
577 | extern struct kset module_subsys; | 581 | extern struct kset *module_kset; |
582 | extern struct kobj_type module_ktype; | ||
583 | extern int module_sysfs_initialized; | ||
578 | 584 | ||
579 | int mod_sysfs_init(struct module *mod); | 585 | int mod_sysfs_init(struct module *mod); |
580 | int mod_sysfs_setup(struct module *mod, | 586 | int mod_sysfs_setup(struct module *mod, |
@@ -607,21 +613,6 @@ static inline void module_remove_modinfo_attrs(struct module *mod) | |||
607 | 613 | ||
608 | #endif /* CONFIG_SYSFS */ | 614 | #endif /* CONFIG_SYSFS */ |
609 | 615 | ||
610 | #if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES) | ||
611 | |||
612 | void module_add_driver(struct module *mod, struct device_driver *drv); | ||
613 | void module_remove_driver(struct device_driver *drv); | ||
614 | |||
615 | #else /* not both CONFIG_SYSFS && CONFIG_MODULES */ | ||
616 | |||
617 | static inline void module_add_driver(struct module *mod, struct device_driver *drv) | ||
618 | { } | ||
619 | |||
620 | static inline void module_remove_driver(struct device_driver *drv) | ||
621 | { } | ||
622 | |||
623 | #endif | ||
624 | |||
625 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) | 616 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) |
626 | 617 | ||
627 | /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ | 618 | /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ |