1 #ifndef __ASM_LINKAGE_H
2 #define __ASM_LINKAGE_H
4 #define __ALIGN .align 2
5 #define __ALIGN_STR ".align 2"
7 #if defined(CONFIG_ARM64_BTI_KERNEL) && defined(__aarch64__)
10 * Since current versions of gas reject the BTI instruction unless we
11 * set the architecture version to v8.5 we use the hint instruction
14 #define BTI_C hint 34 ;
17 * When using in-kernel BTI we need to ensure that PCS-conformant assembly
18 * functions have suitable annotations. Override SYM_FUNC_START to insert
19 * a BTI landing pad at the start of everything.
21 #define SYM_FUNC_START(name) \
22 SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \
25 #define SYM_FUNC_START_NOALIGN(name) \
26 SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE) \
29 #define SYM_FUNC_START_LOCAL(name) \
30 SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN) \
33 #define SYM_FUNC_START_LOCAL_NOALIGN(name) \
34 SYM_START(name, SYM_L_LOCAL, SYM_A_NONE) \
37 #define SYM_FUNC_START_WEAK(name) \
38 SYM_START(name, SYM_L_WEAK, SYM_A_ALIGN) \
41 #define SYM_FUNC_START_WEAK_NOALIGN(name) \
42 SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \
48 * Annotate a function as position independent, i.e., safe to be called before
49 * the kernel virtual mapping is activated.
51 #define SYM_FUNC_START_PI(x) \
52 SYM_FUNC_START_ALIAS(__pi_##x); \
55 #define SYM_FUNC_START_WEAK_PI(x) \
56 SYM_FUNC_START_ALIAS(__pi_##x); \
57 SYM_FUNC_START_WEAK(x)
59 #define SYM_FUNC_END_PI(x) \
61 SYM_FUNC_END_ALIAS(__pi_##x)