diff options
Diffstat (limited to 'include')
-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 03cb93d1865a..4f7ea12463d3 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -365,6 +365,18 @@ struct module *module_text_address(unsigned long addr); | |||
365 | struct module *__module_text_address(unsigned long addr); | 365 | struct module *__module_text_address(unsigned long addr); |
366 | int is_module_address(unsigned long addr); | 366 | int is_module_address(unsigned long addr); |
367 | 367 | ||
368 | static inline int within_module_core(unsigned long addr, struct module *mod) | ||
369 | { | ||
370 | return (unsigned long)mod->module_core <= addr && | ||
371 | addr < (unsigned long)mod->module_core + mod->core_size; | ||
372 | } | ||
373 | |||
374 | static inline int within_module_init(unsigned long addr, struct module *mod) | ||
375 | { | ||
376 | return (unsigned long)mod->module_init <= addr && | ||
377 | addr < (unsigned long)mod->module_init + mod->init_size; | ||
378 | } | ||
379 | |||
368 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if | 380 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if |
369 | symnum out of range. */ | 381 | symnum out of range. */ |
370 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, | 382 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, |