diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/module.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index c3d3fc4ffb18..d246da0b0f8c 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -354,6 +354,8 @@ struct module | |||
| 354 | #define MODULE_ARCH_INIT {} | 354 | #define MODULE_ARCH_INIT {} |
| 355 | #endif | 355 | #endif |
| 356 | 356 | ||
| 357 | extern struct mutex module_mutex; | ||
| 358 | |||
| 357 | /* FIXME: It'd be nice to isolate modules during init, too, so they | 359 | /* FIXME: It'd be nice to isolate modules during init, too, so they |
| 358 | aren't used before they (may) fail. But presently too much code | 360 | aren't used before they (may) fail. But presently too much code |
| 359 | (IDE & SCSI) require entry into the module during init.*/ | 361 | (IDE & SCSI) require entry into the module during init.*/ |
| @@ -379,6 +381,31 @@ static inline int within_module_init(unsigned long addr, struct module *mod) | |||
| 379 | addr < (unsigned long)mod->module_init + mod->init_size; | 381 | addr < (unsigned long)mod->module_init + mod->init_size; |
| 380 | } | 382 | } |
| 381 | 383 | ||
| 384 | /* Search for module by name: must hold module_mutex. */ | ||
| 385 | struct module *find_module(const char *name); | ||
| 386 | |||
| 387 | struct symsearch { | ||
| 388 | const struct kernel_symbol *start, *stop; | ||
| 389 | const unsigned long *crcs; | ||
| 390 | enum { | ||
| 391 | NOT_GPL_ONLY, | ||
| 392 | GPL_ONLY, | ||
| 393 | WILL_BE_GPL_ONLY, | ||
| 394 | } licence; | ||
| 395 | bool unused; | ||
| 396 | }; | ||
| 397 | |||
| 398 | /* Search for an exported symbol by name. */ | ||
| 399 | const struct kernel_symbol *find_symbol(const char *name, | ||
| 400 | struct module **owner, | ||
| 401 | const unsigned long **crc, | ||
| 402 | bool gplok, | ||
| 403 | bool warn); | ||
| 404 | |||
| 405 | /* Walk the exported symbol table */ | ||
| 406 | bool each_symbol(bool (*fn)(const struct symsearch *arr, struct module *owner, | ||
| 407 | unsigned int symnum, void *data), void *data); | ||
| 408 | |||
| 382 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if | 409 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if |
| 383 | symnum out of range. */ | 410 | symnum out of range. */ |
| 384 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, | 411 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, |
| @@ -452,6 +479,7 @@ static inline void __module_get(struct module *module) | |||
| 452 | #define symbol_put_addr(p) do { } while(0) | 479 | #define symbol_put_addr(p) do { } while(0) |
| 453 | 480 | ||
| 454 | #endif /* CONFIG_MODULE_UNLOAD */ | 481 | #endif /* CONFIG_MODULE_UNLOAD */ |
| 482 | int use_module(struct module *a, struct module *b); | ||
| 455 | 483 | ||
| 456 | /* This is a #define so the string doesn't get put in every .o file */ | 484 | /* This is a #define so the string doesn't get put in every .o file */ |
| 457 | #define module_name(mod) \ | 485 | #define module_name(mod) \ |
