1 #ifndef __ASM_GENERIC_EXPORT_H
2 #define __ASM_GENERIC_EXPORT_H
7 #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
9 #elif defined(CONFIG_64BIT)
18 .macro __put
, val
, name
19 #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
20 .long \val
- ., \name
- ., 0
21 #elif defined(CONFIG_64BIT)
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 __ksymtab_
\name
35 .section ___ksymtab\sec
+\name
,"a"
38 __put
\val
, __kstrtab_
\name
40 .section __ksymtab_strings
,"a"
44 #ifdef CONFIG_MODVERSIONS
45 .section ___kcrctab\sec
+\name
,"a"
48 #if defined(CONFIG_MODULE_REL_CRCS)
59 #if defined(CONFIG_TRIM_UNUSED_KSYMS)
61 #include <linux/kconfig.h>
62 #include <generated/autoksyms.h>
64 .macro __ksym_marker sym
65 .section
".discard.ksym","a"
70 #define __EXPORT_SYMBOL(sym, val, sec) \
72 __cond_export_sym(sym, val, sec, __is_defined(__KSYM_##sym))
73 #define __cond_export_sym(sym, val, sec, conf) \
74 ___cond_export_sym(sym, val, sec, conf)
75 #define ___cond_export_sym(sym, val, sec, enabled) \
76 __cond_export_sym_##enabled(sym, val, sec)
77 #define __cond_export_sym_1(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
78 #define __cond_export_sym_0(sym, val, sec) /* nothing */
81 #define __EXPORT_SYMBOL(sym, val, sec) ___EXPORT_SYMBOL sym, val, sec
84 #define EXPORT_SYMBOL(name) \
85 __EXPORT_SYMBOL(name, KSYM_FUNC(name),)
86 #define EXPORT_SYMBOL_GPL(name) \
87 __EXPORT_SYMBOL(name, KSYM_FUNC(name), _gpl)
88 #define EXPORT_DATA_SYMBOL(name) \
89 __EXPORT_SYMBOL(name, name,)
90 #define EXPORT_DATA_SYMBOL_GPL(name) \
91 __EXPORT_SYMBOL(name, name,_gpl)