1 #ifndef __ASM_GENERIC_EXPORT_H
2 #define __ASM_GENERIC_EXPORT_H
22 #ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
23 #define KSYM(name) _##name
25 #define KSYM(name) name
29 * note on .section use: @progbits vs %progbits nastiness doesn't matter,
30 * since we immediately emit into those sections anyway.
32 .macro ___EXPORT_SYMBOL name
,val
,sec
34 .globl
KSYM(__ksymtab_
\name
)
35 .section ___ksymtab\sec
+\name
,"a"
37 KSYM(__ksymtab_
\name
):
38 __put
\val
, KSYM(__kstrtab_
\name
)
40 .section __ksymtab_strings
,"a"
41 KSYM(__kstrtab_
\name
):
42 #ifdef CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
48 #ifdef CONFIG_MODVERSIONS
49 .section ___kcrctab\sec
+\name
,"a"
51 KSYM(__kcrctab_
\name
):
52 #if defined(CONFIG_MODULE_REL_CRCS)
53 .long KSYM(__crc_
\name
) - .
55 .long KSYM(__crc_
\name
)
57 .weak
KSYM(__crc_
\name
)
64 #if defined(__KSYM_DEPS__)
66 #define __EXPORT_SYMBOL(sym, val, sec) === __KSYM_##sym ===
68 #elif defined(CONFIG_TRIM_UNUSED_KSYMS)
70 #include <linux/kconfig.h>
71 #include <generated/autoksyms.h>
73 #define __EXPORT_SYMBOL(sym, val, sec) \
74 __cond_export_sym(sym, val, sec, __is_defined(__KSYM_##sym))
75 #define __cond_export_sym(sym, val, sec, conf) \
76 ___cond_export_sym(sym, val, sec, conf)
77 #define ___cond_export_sym(sym, val, sec, enabled) \
78 __cond_export_sym_##enabled(sym, val, sec)
79 #define __cond_export_sym_1(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
80 #define __cond_export_sym_0(sym, val, sec) /* nothing */
83 #define __EXPORT_SYMBOL(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
86 #define EXPORT_SYMBOL(name) \
87 __EXPORT_SYMBOL(name, KSYM_FUNC(KSYM(name)),)
88 #define EXPORT_SYMBOL_GPL(name) \
89 __EXPORT_SYMBOL(name, KSYM_FUNC(KSYM(name)), _gpl)
90 #define EXPORT_DATA_SYMBOL(name) \
91 __EXPORT_SYMBOL(name, KSYM(name),)
92 #define EXPORT_DATA_SYMBOL_GPL(name) \
93 __EXPORT_SYMBOL(name, KSYM(name),_gpl)