|
16 | 16 | #include <linux/kobject.h>
|
17 | 17 | #include <linux/moduleparam.h>
|
18 | 18 | #include <linux/tracepoint.h>
|
| 19 | +#include <linux/export.h> |
19 | 20 |
|
20 | 21 | #include <linux/percpu.h>
|
21 | 22 | #include <asm/module.h>
|
|
25 | 26 | /* Not Yet Implemented */
|
26 | 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 | 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 | 31 | struct modversion_info
|
44 | 32 | {
|
45 | 33 | unsigned long crc;
|
@@ -98,11 +86,8 @@ void trim_init_extable(struct module *m);
|
98 | 86 | extern const struct gtype##_id __mod_##gtype##_table \
|
99 | 87 | __attribute__ ((unused, alias(__stringify(name))))
|
100 | 88 |
|
101 |
| -extern struct module __this_module; |
102 |
| -#define THIS_MODULE (&__this_module) |
103 | 89 | #else /* !MODULE */
|
104 | 90 | #define MODULE_GENERIC_TABLE(gtype,name)
|
105 |
| -#define THIS_MODULE ((struct module *)0) |
106 | 91 | #endif
|
107 | 92 |
|
108 | 93 | /* Generic info of form tag = "info" */
|
@@ -218,52 +203,6 @@ struct module_use {
|
218 | 203 | struct module *source, *target;
|
219 | 204 | };
|
220 | 205 |
|
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 | 206 | enum module_state
|
268 | 207 | {
|
269 | 208 | MODULE_STATE_LIVE,
|
@@ -581,11 +520,6 @@ int unregister_module_notifier(struct notifier_block * nb);
|
581 | 520 | extern void print_modules(void);
|
582 | 521 |
|
583 | 522 | #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 | 523 |
|
590 | 524 | /* Given an address, look for it in the exception tables. */
|
591 | 525 | static inline const struct exception_table_entry *
|
|
0 commit comments