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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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 /*
  3  * Please do not include this explicitly.
  4  * This is used by C files generated by modpost.
  5  */
  6 
  7 #ifndef __LINUX_EXPORT_INTERNAL_H__
  8 #define __LINUX_EXPORT_INTERNAL_H__
  9 
 10 #include <linux/compiler.h>
 11 #include <linux/types.h>
 12 
 13 #if defined(CONFIG_HAVE_ARCH_PREL32_RELOCATIONS)
 14 /*
 15  * relative reference: this reduces the size by half on 64-bit architectures,
 16  * and eliminates the need for absolute relocations that require runtime
 17  * processing on relocatable kernels.
 18  */
 19 #define __KSYM_ALIGN            ".balign 4"
 20 #define __KSYM_REF(sym)         ".long " #sym "- ."
 21 #elif defined(CONFIG_64BIT)
 22 #define __KSYM_ALIGN            ".balign 8"
 23 #define __KSYM_REF(sym)         ".quad " #sym
 24 #else
 25 #define __KSYM_ALIGN            ".balign 4"
 26 #define __KSYM_REF(sym)         ".long " #sym
 27 #endif
 28 
 29 /*
 30  * For every exported symbol, do the following:
 31  *
 32  * - Put the name of the symbol and namespace (empty string "" for none) in
 33  *   __ksymtab_strings.
 34  * - Place a struct kernel_symbol entry in the __ksymtab section.
 35  *
 36  * Note on .section use: we specify progbits since usage of the "M" (SHF_MERGE)
 37  * section flag requires it. Use '%progbits' instead of '@progbits' since the
 38  * former apparently works on all arches according to the binutils source.
 39  */
 40 #define __KSYMTAB(name, sym, sec, ns)                                           \
 41         asm("   .section \"__ksymtab_strings\",\"aMS\",%progbits,1"     "\n"    \
 42             "__kstrtab_" #name ":"                                      "\n"    \
 43             "   .asciz \"" #name "\""                                   "\n"    \
 44             "__kstrtabns_" #name ":"                                    "\n"    \
 45             "   .asciz \"" ns "\""                                      "\n"    \
 46             "   .previous"                                              "\n"    \
 47             "   .section \"___ksymtab" sec "+" #name "\", \"a\""        "\n"    \
 48                 __KSYM_ALIGN                                            "\n"    \
 49             "__ksymtab_" #name ":"                                      "\n"    \
 50                 __KSYM_REF(sym)                                         "\n"    \
 51                 __KSYM_REF(__kstrtab_ ##name)                           "\n"    \
 52                 __KSYM_REF(__kstrtabns_ ##name)                         "\n"    \
 53             "   .previous"                                              "\n"    \
 54         )
 55 
 56 #if defined(CONFIG_PARISC) && defined(CONFIG_64BIT)
 57 #define KSYM_FUNC(name)         P%name
 58 #else
 59 #define KSYM_FUNC(name)         name
 60 #endif
 61 
 62 #define KSYMTAB_FUNC(name, sec, ns)     __KSYMTAB(name, KSYM_FUNC(name), sec, ns)
 63 #define KSYMTAB_DATA(name, sec, ns)     __KSYMTAB(name, name, sec, ns)
 64 
 65 #define SYMBOL_CRC(sym, crc, sec)   \
 66         asm(".section \"___kcrctab" sec "+" #sym "\",\"a\""     "\n" \
 67             ".balign 4"                                         "\n" \
 68             "__crc_" #sym ":"                                   "\n" \
 69             ".long " #crc                                       "\n" \
 70             ".previous"                                         "\n")
 71 
 72 #endif /* __LINUX_EXPORT_INTERNAL_H__ */
 73 

~ [ 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