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

TOMOYO Linux Cross Reference
Linux/tools/perf/util/include/linux/linkage.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 */
  2 
  3 #ifndef PERF_LINUX_LINKAGE_H_
  4 #define PERF_LINUX_LINKAGE_H_
  5 
  6 /* linkage.h ... for including arch/x86/lib/memcpy_64.S */
  7 
  8 /* Some toolchains use other characters (e.g. '`') to mark new line in macro */
  9 #ifndef ASM_NL
 10 #define ASM_NL           ;
 11 #endif
 12 
 13 #ifndef __ALIGN
 14 #define __ALIGN         .align 4,0x90
 15 #define __ALIGN_STR     ".align 4,0x90"
 16 #endif
 17 
 18 /* SYM_T_FUNC -- type used by assembler to mark functions */
 19 #ifndef SYM_T_FUNC
 20 #define SYM_T_FUNC                              STT_FUNC
 21 #endif
 22 
 23 /* SYM_A_* -- align the symbol? */
 24 #define SYM_A_ALIGN                             ALIGN
 25 
 26 /* SYM_L_* -- linkage of symbols */
 27 #define SYM_L_GLOBAL(name)                      .globl name
 28 #define SYM_L_WEAK(name)                        .weak name
 29 #define SYM_L_LOCAL(name)                       /* nothing */
 30 
 31 #define ALIGN __ALIGN
 32 
 33 /* === generic annotations === */
 34 
 35 /* SYM_ENTRY -- use only if you have to for non-paired symbols */
 36 #ifndef SYM_ENTRY
 37 #define SYM_ENTRY(name, linkage, align...)              \
 38         linkage(name) ASM_NL                            \
 39         align ASM_NL                                    \
 40         name:
 41 #endif
 42 
 43 /* SYM_START -- use only if you have to */
 44 #ifndef SYM_START
 45 #define SYM_START(name, linkage, align...)              \
 46         SYM_ENTRY(name, linkage, align)
 47 #endif
 48 
 49 /* SYM_END -- use only if you have to */
 50 #ifndef SYM_END
 51 #define SYM_END(name, sym_type)                         \
 52         .type name sym_type ASM_NL                      \
 53         .set .L__sym_size_##name, .-name ASM_NL         \
 54         .size name, .-name
 55 #endif
 56 
 57 /* SYM_ALIAS -- use only if you have to */
 58 #ifndef SYM_ALIAS
 59 #define SYM_ALIAS(alias, name, sym_type, linkage)                       \
 60         linkage(alias) ASM_NL                                           \
 61         .set alias, name ASM_NL                                         \
 62         .type alias sym_type ASM_NL                                     \
 63         .set .L__sym_size_##alias, .L__sym_size_##name ASM_NL           \
 64         .size alias, .L__sym_size_##alias
 65 #endif
 66 
 67 /* SYM_FUNC_START -- use for global functions */
 68 #ifndef SYM_FUNC_START
 69 #define SYM_FUNC_START(name)                            \
 70         SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
 71 #endif
 72 
 73 /* SYM_FUNC_START_LOCAL -- use for local functions */
 74 #ifndef SYM_FUNC_START_LOCAL
 75 #define SYM_FUNC_START_LOCAL(name)                      \
 76         SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN)
 77 #endif
 78 
 79 /* SYM_FUNC_START_WEAK -- use for weak functions */
 80 #ifndef SYM_FUNC_START_WEAK
 81 #define SYM_FUNC_START_WEAK(name)                       \
 82         SYM_START(name, SYM_L_WEAK, SYM_A_ALIGN)
 83 #endif
 84 
 85 /*
 86  * SYM_FUNC_END -- the end of SYM_FUNC_START_LOCAL, SYM_FUNC_START,
 87  * SYM_FUNC_START_WEAK, ...
 88  */
 89 #ifndef SYM_FUNC_END
 90 #define SYM_FUNC_END(name)                              \
 91         SYM_END(name, SYM_T_FUNC)
 92 #endif
 93 
 94 /*
 95  * SYM_FUNC_ALIAS -- define a global alias for an existing function
 96  */
 97 #ifndef SYM_FUNC_ALIAS
 98 #define SYM_FUNC_ALIAS(alias, name)                                     \
 99         SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_GLOBAL)
100 #endif
101 
102 /*
103  * SYM_FUNC_ALIAS_LOCAL -- define a local alias for an existing function
104  */
105 #ifndef SYM_FUNC_ALIAS_LOCAL
106 #define SYM_FUNC_ALIAS_LOCAL(alias, name)                               \
107         SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_LOCAL)
108 #endif
109 
110 /*
111  * SYM_FUNC_ALIAS_WEAK -- define a weak global alias for an existing function
112  */
113 #ifndef SYM_FUNC_ALIAS_WEAK
114 #define SYM_FUNC_ALIAS_WEAK(alias, name)                                \
115         SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_WEAK)
116 #endif
117 
118 #ifndef SYM_FUNC_ALIAS_MEMFUNC
119 #define SYM_FUNC_ALIAS_MEMFUNC SYM_FUNC_ALIAS
120 #endif
121 
122 // In the kernel sources (include/linux/cfi_types.h), this has a different
123 // definition when CONFIG_CFI_CLANG is used, for tools/ just use the !clang
124 // definition:
125 #ifndef SYM_TYPED_START
126 #define SYM_TYPED_START(name, linkage, align...)        \
127         SYM_START(name, linkage, align)
128 #endif
129 
130 #ifndef SYM_TYPED_FUNC_START
131 #define SYM_TYPED_FUNC_START(name)                      \
132         SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
133 #endif
134 
135 #endif  /* PERF_LINUX_LINKAGE_H_ */
136 

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