~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/export.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 #ifndef _LINUX_EXPORT_H
  3 #define _LINUX_EXPORT_H
  4 
  5 #include <linux/compiler.h>
  6 #include <linux/linkage.h>
  7 #include <linux/stringify.h>
  8 
  9 /*
 10  * This comment block is used by fixdep. Please do not remove.
 11  *
 12  * When CONFIG_MODVERSIONS is changed from n to y, all source files having
 13  * EXPORT_SYMBOL variants must be re-compiled because genksyms is run as a
 14  * side effect of the *.o build rule.
 15  */
 16 
 17 #ifdef CONFIG_64BIT
 18 #define __EXPORT_SYMBOL_REF(sym)                        \
 19         .balign 8                               ASM_NL  \
 20         .quad sym
 21 #else
 22 #define __EXPORT_SYMBOL_REF(sym)                        \
 23         .balign 4                               ASM_NL  \
 24         .long sym
 25 #endif
 26 
 27 #define ___EXPORT_SYMBOL(sym, license, ns)              \
 28         .section ".export_symbol","a"           ASM_NL  \
 29         __export_symbol_##sym:                  ASM_NL  \
 30                 .asciz license                  ASM_NL  \
 31                 .asciz ns                       ASM_NL  \
 32                 __EXPORT_SYMBOL_REF(sym)        ASM_NL  \
 33         .previous
 34 
 35 #if defined(__DISABLE_EXPORTS)
 36 
 37 /*
 38  * Allow symbol exports to be disabled completely so that C code may
 39  * be reused in other execution contexts such as the UEFI stub or the
 40  * decompressor.
 41  */
 42 #define __EXPORT_SYMBOL(sym, license, ns)
 43 
 44 #elif defined(__GENKSYMS__)
 45 
 46 #define __EXPORT_SYMBOL(sym, license, ns)       __GENKSYMS_EXPORT_SYMBOL(sym)
 47 
 48 #elif defined(__ASSEMBLY__)
 49 
 50 #define __EXPORT_SYMBOL(sym, license, ns) \
 51         ___EXPORT_SYMBOL(sym, license, ns)
 52 
 53 #else
 54 
 55 #define __EXPORT_SYMBOL(sym, license, ns)                       \
 56         extern typeof(sym) sym;                                 \
 57         __ADDRESSABLE(sym)                                      \
 58         asm(__stringify(___EXPORT_SYMBOL(sym, license, ns)))
 59 
 60 #endif
 61 
 62 #ifdef DEFAULT_SYMBOL_NAMESPACE
 63 #define _EXPORT_SYMBOL(sym, license)    __EXPORT_SYMBOL(sym, license, __stringify(DEFAULT_SYMBOL_NAMESPACE))
 64 #else
 65 #define _EXPORT_SYMBOL(sym, license)    __EXPORT_SYMBOL(sym, license, "")
 66 #endif
 67 
 68 #define EXPORT_SYMBOL(sym)              _EXPORT_SYMBOL(sym, "")
 69 #define EXPORT_SYMBOL_GPL(sym)          _EXPORT_SYMBOL(sym, "GPL")
 70 #define EXPORT_SYMBOL_NS(sym, ns)       __EXPORT_SYMBOL(sym, "", __stringify(ns))
 71 #define EXPORT_SYMBOL_NS_GPL(sym, ns)   __EXPORT_SYMBOL(sym, "GPL", __stringify(ns))
 72 
 73 #endif /* _LINUX_EXPORT_H */
 74 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php