Go to the documentation of this file. 1 #ifndef _LINUX_EXPORT_H
2 #define _LINUX_EXPORT_H
13 #ifdef CONFIG_SYMBOL_PREFIX
14 #define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
16 #define MODULE_SYMBOL_PREFIX ""
26 extern struct module __this_module;
27 #define THIS_MODULE (&__this_module)
29 #define THIS_MODULE ((struct module *)0)
35 #ifdef CONFIG_MODVERSIONS
38 #define __CRC_SYMBOL(sym, sec) \
39 extern void *__crc_##sym __attribute__((weak)); \
40 static const unsigned long __kcrctab_##sym \
42 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
43 = (unsigned long) &__crc_##sym;
45 #define __CRC_SYMBOL(sym, sec)
49 #define __EXPORT_SYMBOL(sym, sec) \
50 extern typeof(sym) sym; \
51 __CRC_SYMBOL(sym, sec) \
52 static const char __kstrtab_##sym[] \
53 __attribute__((section("__ksymtab_strings"), aligned(1))) \
54 = MODULE_SYMBOL_PREFIX #sym; \
55 static const struct kernel_symbol __ksymtab_##sym \
57 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
58 = { (unsigned long)&sym, __kstrtab_##sym }
60 #define EXPORT_SYMBOL(sym) \
61 __EXPORT_SYMBOL(sym, "")
63 #define EXPORT_SYMBOL_GPL(sym) \
64 __EXPORT_SYMBOL(sym, "_gpl")
66 #define EXPORT_SYMBOL_GPL_FUTURE(sym) \
67 __EXPORT_SYMBOL(sym, "_gpl_future")
69 #ifdef CONFIG_UNUSED_SYMBOLS
70 #define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
71 #define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
73 #define EXPORT_UNUSED_SYMBOL(sym)
74 #define EXPORT_UNUSED_SYMBOL_GPL(sym)
81 #define EXPORT_SYMBOL(sym)
82 #define EXPORT_SYMBOL_GPL(sym)
83 #define EXPORT_SYMBOL_GPL_FUTURE(sym)
84 #define EXPORT_UNUSED_SYMBOL(sym)
85 #define EXPORT_UNUSED_SYMBOL_GPL(sym)