diff options
Diffstat (limited to 'include/linux/module.h')
-rw-r--r-- | include/linux/module.h | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 2d366098eab5..2c599175c583 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -156,6 +156,11 @@ extern struct module __this_module; | |||
156 | */ | 156 | */ |
157 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) | 157 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) |
158 | 158 | ||
159 | /* Optional firmware file (or files) needed by the module | ||
160 | * format is simply firmware file name. Multiple firmware | ||
161 | * files require multiple MODULE_FIRMWARE() specifiers */ | ||
162 | #define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) | ||
163 | |||
159 | /* Given an address, look for it in the exception tables */ | 164 | /* Given an address, look for it in the exception tables */ |
160 | const struct exception_table_entry *search_exception_tables(unsigned long add); | 165 | const struct exception_table_entry *search_exception_tables(unsigned long add); |
161 | 166 | ||
@@ -203,6 +208,15 @@ void *__symbol_get_gpl(const char *symbol); | |||
203 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ | 208 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ |
204 | __EXPORT_SYMBOL(sym, "_gpl_future") | 209 | __EXPORT_SYMBOL(sym, "_gpl_future") |
205 | 210 | ||
211 | |||
212 | #ifdef CONFIG_UNUSED_SYMBOLS | ||
213 | #define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused") | ||
214 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl") | ||
215 | #else | ||
216 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
217 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
218 | #endif | ||
219 | |||
206 | #endif | 220 | #endif |
207 | 221 | ||
208 | struct module_ref | 222 | struct module_ref |
@@ -218,17 +232,17 @@ enum module_state | |||
218 | }; | 232 | }; |
219 | 233 | ||
220 | /* Similar stuff for section attributes. */ | 234 | /* Similar stuff for section attributes. */ |
221 | #define MODULE_SECT_NAME_LEN 32 | ||
222 | struct module_sect_attr | 235 | struct module_sect_attr |
223 | { | 236 | { |
224 | struct module_attribute mattr; | 237 | struct module_attribute mattr; |
225 | char name[MODULE_SECT_NAME_LEN]; | 238 | char *name; |
226 | unsigned long address; | 239 | unsigned long address; |
227 | }; | 240 | }; |
228 | 241 | ||
229 | struct module_sect_attrs | 242 | struct module_sect_attrs |
230 | { | 243 | { |
231 | struct attribute_group grp; | 244 | struct attribute_group grp; |
245 | int nsections; | ||
232 | struct module_sect_attr attrs[0]; | 246 | struct module_sect_attr attrs[0]; |
233 | }; | 247 | }; |
234 | 248 | ||
@@ -261,6 +275,15 @@ struct module | |||
261 | unsigned int num_gpl_syms; | 275 | unsigned int num_gpl_syms; |
262 | const unsigned long *gpl_crcs; | 276 | const unsigned long *gpl_crcs; |
263 | 277 | ||
278 | /* unused exported symbols. */ | ||
279 | const struct kernel_symbol *unused_syms; | ||
280 | unsigned int num_unused_syms; | ||
281 | const unsigned long *unused_crcs; | ||
282 | /* GPL-only, unused exported symbols. */ | ||
283 | const struct kernel_symbol *unused_gpl_syms; | ||
284 | unsigned int num_unused_gpl_syms; | ||
285 | const unsigned long *unused_gpl_crcs; | ||
286 | |||
264 | /* symbols that will be GPL-only in the near future. */ | 287 | /* symbols that will be GPL-only in the near future. */ |
265 | const struct kernel_symbol *gpl_future_syms; | 288 | const struct kernel_symbol *gpl_future_syms; |
266 | unsigned int num_gpl_future_syms; | 289 | unsigned int num_gpl_future_syms; |
@@ -285,6 +308,9 @@ struct module | |||
285 | /* The size of the executable code in each section. */ | 308 | /* The size of the executable code in each section. */ |
286 | unsigned long init_text_size, core_text_size; | 309 | unsigned long init_text_size, core_text_size; |
287 | 310 | ||
311 | /* The handle returned from unwind_add_table. */ | ||
312 | void *unwind_info; | ||
313 | |||
288 | /* Arch-specific module values */ | 314 | /* Arch-specific module values */ |
289 | struct mod_arch_specific arch; | 315 | struct mod_arch_specific arch; |
290 | 316 | ||
@@ -337,13 +363,12 @@ static inline int module_is_live(struct module *mod) | |||
337 | /* Is this address in a module? (second is with no locks, for oops) */ | 363 | /* Is this address in a module? (second is with no locks, for oops) */ |
338 | struct module *module_text_address(unsigned long addr); | 364 | struct module *module_text_address(unsigned long addr); |
339 | 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); | ||
340 | 367 | ||
341 | /* Returns module and fills in value, defined and namebuf, or NULL if | 368 | /* Returns module and fills in value, defined and namebuf, or NULL if |
342 | symnum out of range. */ | 369 | symnum out of range. */ |
343 | struct module *module_get_kallsym(unsigned int symnum, | 370 | struct module *module_get_kallsym(unsigned int symnum, unsigned long *value, |
344 | unsigned long *value, | 371 | char *type, char *name, size_t namelen); |
345 | char *type, | ||
346 | char namebuf[128]); | ||
347 | 372 | ||
348 | /* Look for this name: can be of form module:name. */ | 373 | /* Look for this name: can be of form module:name. */ |
349 | unsigned long module_kallsyms_lookup_name(const char *name); | 374 | unsigned long module_kallsyms_lookup_name(const char *name); |
@@ -453,6 +478,8 @@ void module_remove_driver(struct device_driver *); | |||
453 | #define EXPORT_SYMBOL(sym) | 478 | #define EXPORT_SYMBOL(sym) |
454 | #define EXPORT_SYMBOL_GPL(sym) | 479 | #define EXPORT_SYMBOL_GPL(sym) |
455 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) | 480 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) |
481 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
482 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
456 | 483 | ||
457 | /* Given an address, look for it in the exception tables. */ | 484 | /* Given an address, look for it in the exception tables. */ |
458 | static inline const struct exception_table_entry * | 485 | static inline const struct exception_table_entry * |
@@ -473,6 +500,11 @@ static inline struct module *__module_text_address(unsigned long addr) | |||
473 | return NULL; | 500 | return NULL; |
474 | } | 501 | } |
475 | 502 | ||
503 | static inline int is_module_address(unsigned long addr) | ||
504 | { | ||
505 | return 0; | ||
506 | } | ||
507 | |||
476 | /* Get/put a kernel symbol (calls should be symmetric) */ | 508 | /* Get/put a kernel symbol (calls should be symmetric) */ |
477 | #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) | 509 | #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) |
478 | #define symbol_put(x) do { } while(0) | 510 | #define symbol_put(x) do { } while(0) |
@@ -506,8 +538,8 @@ static inline const char *module_address_lookup(unsigned long addr, | |||
506 | 538 | ||
507 | static inline struct module *module_get_kallsym(unsigned int symnum, | 539 | static inline struct module *module_get_kallsym(unsigned int symnum, |
508 | unsigned long *value, | 540 | unsigned long *value, |
509 | char *type, | 541 | char *type, char *name, |
510 | char namebuf[128]) | 542 | size_t namelen) |
511 | { | 543 | { |
512 | return NULL; | 544 | return NULL; |
513 | } | 545 | } |