diff options
Diffstat (limited to 'include/linux/module.h')
| -rw-r--r-- | include/linux/module.h | 73 |
1 files changed, 1 insertions, 72 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 863921637d9f..3cb7839a60b9 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/kobject.h> | 16 | #include <linux/kobject.h> |
| 17 | #include <linux/moduleparam.h> | 17 | #include <linux/moduleparam.h> |
| 18 | #include <linux/tracepoint.h> | 18 | #include <linux/tracepoint.h> |
| 19 | #include <linux/export.h> | ||
| 19 | 20 | ||
| 20 | #include <linux/percpu.h> | 21 | #include <linux/percpu.h> |
| 21 | #include <asm/module.h> | 22 | #include <asm/module.h> |
| @@ -25,21 +26,8 @@ | |||
| 25 | /* Not Yet Implemented */ | 26 | /* Not Yet Implemented */ |
| 26 | #define MODULE_SUPPORTED_DEVICE(name) | 27 | #define MODULE_SUPPORTED_DEVICE(name) |
| 27 | 28 | ||
| 28 | /* Some toolchains use a `_' prefix for all user symbols. */ | ||
| 29 | #ifdef CONFIG_SYMBOL_PREFIX | ||
| 30 | #define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX | ||
| 31 | #else | ||
| 32 | #define MODULE_SYMBOL_PREFIX "" | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN | 29 | #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN |
| 36 | 30 | ||
| 37 | struct kernel_symbol | ||
| 38 | { | ||
| 39 | unsigned long value; | ||
| 40 | const char *name; | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct modversion_info | 31 | struct modversion_info |
| 44 | { | 32 | { |
| 45 | unsigned long crc; | 33 | unsigned long crc; |
| @@ -98,11 +86,8 @@ void trim_init_extable(struct module *m); | |||
| 98 | extern const struct gtype##_id __mod_##gtype##_table \ | 86 | extern const struct gtype##_id __mod_##gtype##_table \ |
| 99 | __attribute__ ((unused, alias(__stringify(name)))) | 87 | __attribute__ ((unused, alias(__stringify(name)))) |
| 100 | 88 | ||
| 101 | extern struct module __this_module; | ||
| 102 | #define THIS_MODULE (&__this_module) | ||
| 103 | #else /* !MODULE */ | 89 | #else /* !MODULE */ |
| 104 | #define MODULE_GENERIC_TABLE(gtype,name) | 90 | #define MODULE_GENERIC_TABLE(gtype,name) |
| 105 | #define THIS_MODULE ((struct module *)0) | ||
| 106 | #endif | 91 | #endif |
| 107 | 92 | ||
| 108 | /* Generic info of form tag = "info" */ | 93 | /* Generic info of form tag = "info" */ |
| @@ -150,11 +135,6 @@ extern struct module __this_module; | |||
| 150 | /* What your module does. */ | 135 | /* What your module does. */ |
| 151 | #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) | 136 | #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) |
| 152 | 137 | ||
| 153 | /* One for each parameter, describing how to use it. Some files do | ||
| 154 | multiple of these per line, so can't just use MODULE_INFO. */ | ||
| 155 | #define MODULE_PARM_DESC(_parm, desc) \ | ||
| 156 | __MODULE_INFO(parm, _parm, #_parm ":" desc) | ||
| 157 | |||
| 158 | #define MODULE_DEVICE_TABLE(type,name) \ | 138 | #define MODULE_DEVICE_TABLE(type,name) \ |
| 159 | MODULE_GENERIC_TABLE(type##_device,name) | 139 | MODULE_GENERIC_TABLE(type##_device,name) |
| 160 | 140 | ||
| @@ -218,52 +198,6 @@ struct module_use { | |||
| 218 | struct module *source, *target; | 198 | struct module *source, *target; |
| 219 | }; | 199 | }; |
| 220 | 200 | ||
| 221 | #ifndef __GENKSYMS__ | ||
| 222 | #ifdef CONFIG_MODVERSIONS | ||
| 223 | /* Mark the CRC weak since genksyms apparently decides not to | ||
| 224 | * generate a checksums for some symbols */ | ||
| 225 | #define __CRC_SYMBOL(sym, sec) \ | ||
| 226 | extern void *__crc_##sym __attribute__((weak)); \ | ||
| 227 | static const unsigned long __kcrctab_##sym \ | ||
| 228 | __used \ | ||
| 229 | __attribute__((section("___kcrctab" sec "+" #sym), unused)) \ | ||
| 230 | = (unsigned long) &__crc_##sym; | ||
| 231 | #else | ||
| 232 | #define __CRC_SYMBOL(sym, sec) | ||
| 233 | #endif | ||
| 234 | |||
| 235 | /* For every exported symbol, place a struct in the __ksymtab section */ | ||
| 236 | #define __EXPORT_SYMBOL(sym, sec) \ | ||
| 237 | extern typeof(sym) sym; \ | ||
| 238 | __CRC_SYMBOL(sym, sec) \ | ||
| 239 | static const char __kstrtab_##sym[] \ | ||
| 240 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ | ||
| 241 | = MODULE_SYMBOL_PREFIX #sym; \ | ||
| 242 | static const struct kernel_symbol __ksymtab_##sym \ | ||
| 243 | __used \ | ||
| 244 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ | ||
| 245 | = { (unsigned long)&sym, __kstrtab_##sym } | ||
| 246 | |||
| 247 | #define EXPORT_SYMBOL(sym) \ | ||
| 248 | __EXPORT_SYMBOL(sym, "") | ||
| 249 | |||
| 250 | #define EXPORT_SYMBOL_GPL(sym) \ | ||
| 251 | __EXPORT_SYMBOL(sym, "_gpl") | ||
| 252 | |||
| 253 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ | ||
| 254 | __EXPORT_SYMBOL(sym, "_gpl_future") | ||
| 255 | |||
| 256 | |||
| 257 | #ifdef CONFIG_UNUSED_SYMBOLS | ||
| 258 | #define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused") | ||
| 259 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl") | ||
| 260 | #else | ||
| 261 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
| 262 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
| 263 | #endif | ||
| 264 | |||
| 265 | #endif | ||
| 266 | |||
| 267 | enum module_state | 201 | enum module_state |
| 268 | { | 202 | { |
| 269 | MODULE_STATE_LIVE, | 203 | MODULE_STATE_LIVE, |
| @@ -581,11 +515,6 @@ int unregister_module_notifier(struct notifier_block * nb); | |||
| 581 | extern void print_modules(void); | 515 | extern void print_modules(void); |
| 582 | 516 | ||
| 583 | #else /* !CONFIG_MODULES... */ | 517 | #else /* !CONFIG_MODULES... */ |
| 584 | #define EXPORT_SYMBOL(sym) | ||
| 585 | #define EXPORT_SYMBOL_GPL(sym) | ||
| 586 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) | ||
| 587 | #define EXPORT_UNUSED_SYMBOL(sym) | ||
| 588 | #define EXPORT_UNUSED_SYMBOL_GPL(sym) | ||
| 589 | 518 | ||
| 590 | /* Given an address, look for it in the exception tables. */ | 519 | /* Given an address, look for it in the exception tables. */ |
| 591 | static inline const struct exception_table_entry * | 520 | static inline const struct exception_table_entry * |
