1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 2 /* 3 * Please do not include this explicitly. 4 * This is used by C files generated by modpos 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_RELOCATION 14 /* 15 * relative reference: this reduces the size b 16 * and eliminates the need for absolute reloca 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 33 * __ksymtab_strings. 34 * - Place a struct kernel_symbol entry in the 35 * 36 * Note on .section use: we specify progbits s 37 * section flag requires it. Use '%progbits' i 38 * former apparently works on all arches accor 39 */ 40 #define __KSYMTAB(name, sym, sec, ns) 41 asm(" .section \"__ksymtab_strings\" 42 "__kstrtab_" #name ":" 43 " .asciz \"" #name "\"" 44 "__kstrtabns_" #name ":" 45 " .asciz \"" ns "\"" 46 " .previous" 47 " .section \"___ksymtab" sec "+" 48 __KSYM_ALIGN 49 "__ksymtab_" #name ":" 50 __KSYM_REF(sym) 51 __KSYM_REF(__kstrtab_ ##name) 52 __KSYM_REF(__kstrtabns_ ##name 53 " .previous" 54 ) 55 56 #if defined(CONFIG_PARISC) && defined(CONFIG_6 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) __KSYM 63 #define KSYMTAB_DATA(name, sec, ns) __KSYM 64 65 #define SYMBOL_CRC(sym, crc, sec) \ 66 asm(".section \"___kcrctab" sec "+" #s 67 ".balign 4" 68 "__crc_" #sym ":" 69 ".long " #crc 70 ".previous" 71 72 #endif /* __LINUX_EXPORT_INTERNAL_H__ */ 73
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.