1 #ifndef __ASM_GENERIC_EXPORT_H
2 #define __ASM_GENERIC_EXPORT_H
25 #ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
26 #define KSYM(name) _##name
28 #define KSYM(name) name
32 * note on .section use: @progbits vs %progbits nastiness doesn't matter,
33 * since we immediately emit into those sections anyway.
35 .macro ___EXPORT_SYMBOL name
,val
,sec
37 .globl
KSYM(__ksymtab_
\name
)
38 .section ___ksymtab\sec
+\name
,"a"
40 KSYM(__ksymtab_
\name
):
41 __put
\val
, KSYM(__kstrtab_
\name
)
43 .section __ksymtab_strings
,"a"
44 KSYM(__kstrtab_
\name
):
45 #ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
51 #ifdef CONFIG_MODVERSIONS
52 .section ___kcrctab\sec
+\name
,"a"
54 KSYM(__kcrctab_
\name
):
55 __put
KSYM(__crc_
\name
)
56 .weak
KSYM(__crc_
\name
)
63 #if defined(__KSYM_DEPS__)
65 #define __EXPORT_SYMBOL(sym, val, sec) === __KSYM_##sym ===
67 #elif defined(CONFIG_TRIM_UNUSED_KSYMS)
69 #include <linux/kconfig.h>
70 #include <generated/autoksyms.h>
72 #define __EXPORT_SYMBOL(sym, val, sec) \
73 __cond_export_sym(sym, val, sec, __is_defined(__KSYM_##sym))
74 #define __cond_export_sym(sym, val, sec, conf) \
75 ___cond_export_sym(sym, val, sec, conf)
76 #define ___cond_export_sym(sym, val, sec, enabled) \
77 __cond_export_sym_##enabled(sym, val, sec)
78 #define __cond_export_sym_1(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
79 #define __cond_export_sym_0(sym, val, sec) /* nothing */
82 #define __EXPORT_SYMBOL(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
85 #define EXPORT_SYMBOL(name) \
86 __EXPORT_SYMBOL(name, KSYM_FUNC(KSYM(name)),)
87 #define EXPORT_SYMBOL_GPL(name) \
88 __EXPORT_SYMBOL(name, KSYM_FUNC(KSYM(name)), _gpl)
89 #define EXPORT_DATA_SYMBOL(name) \
90 __EXPORT_SYMBOL(name, KSYM(name),)
91 #define EXPORT_DATA_SYMBOL_GPL(name) \
92 __EXPORT_SYMBOL(name, KSYM(name),_gpl)