1
2
3#ifndef PERF_LINUX_LINKAGE_H_
4#define PERF_LINUX_LINKAGE_H_
5
6
7
8
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
19#ifndef SYM_T_FUNC
20#define SYM_T_FUNC STT_FUNC
21#endif
22
23
24#define SYM_A_ALIGN ALIGN
25
26
27#define SYM_L_GLOBAL(name) .globl name
28#define SYM_L_WEAK(name) .weak name
29#define SYM_L_LOCAL(name)
30
31#define ALIGN __ALIGN
32
33
34
35
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
44#ifndef SYM_START
45#define SYM_START(name, linkage, align...) \
46 SYM_ENTRY(name, linkage, align)
47#endif
48
49
50#ifndef SYM_END
51#define SYM_END(name, sym_type) \
52 .type name sym_type ASM_NL \
53 .size name, .-name
54#endif
55
56
57
58
59
60#ifndef SYM_FUNC_START_ALIAS
61#define SYM_FUNC_START_ALIAS(name) \
62 SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
63#endif
64
65
66#ifndef SYM_FUNC_START
67
68
69
70
71#define SYM_FUNC_START(name) \
72 SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
73#endif
74
75
76#ifndef SYM_FUNC_START_LOCAL
77
78#define SYM_FUNC_START_LOCAL(name) \
79 SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN)
80#endif
81
82
83#ifndef SYM_FUNC_END_ALIAS
84#define SYM_FUNC_END_ALIAS(name) \
85 SYM_END(name, SYM_T_FUNC)
86#endif
87
88
89#ifndef SYM_FUNC_START_WEAK
90#define SYM_FUNC_START_WEAK(name) \
91 SYM_START(name, SYM_L_WEAK, SYM_A_ALIGN)
92#endif
93
94
95
96
97
98#ifndef SYM_FUNC_END
99
100#define SYM_FUNC_END(name) \
101 SYM_END(name, SYM_T_FUNC)
102#endif
103
104#endif
105