0001
0002 #ifndef _ASM_X86_LINKAGE_H
0003 #define _ASM_X86_LINKAGE_H
0004
0005 #include <linux/stringify.h>
0006 #include <asm/ibt.h>
0007
0008 #undef notrace
0009 #define notrace __attribute__((no_instrument_function))
0010
0011 #ifdef CONFIG_X86_32
0012 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
0013 #endif
0014
0015 #ifdef __ASSEMBLY__
0016
0017 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_ALIGNMENT_16)
0018 #define __ALIGN .p2align 4, 0x90
0019 #define __ALIGN_STR __stringify(__ALIGN)
0020 #endif
0021
0022 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
0023 #define RET jmp __x86_return_thunk
0024 #else
0025 #ifdef CONFIG_SLS
0026 #define RET ret; int3
0027 #else
0028 #define RET ret
0029 #endif
0030 #endif
0031
0032 #else
0033
0034 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
0035 #define ASM_RET "jmp __x86_return_thunk\n\t"
0036 #else
0037 #ifdef CONFIG_SLS
0038 #define ASM_RET "ret; int3\n\t"
0039 #else
0040 #define ASM_RET "ret\n\t"
0041 #endif
0042 #endif
0043
0044 #endif
0045
0046
0047 #define SYM_FUNC_START(name) \
0048 SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \
0049 ENDBR
0050
0051
0052 #define SYM_FUNC_START_NOALIGN(name) \
0053 SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE) \
0054 ENDBR
0055
0056
0057 #define SYM_FUNC_START_LOCAL(name) \
0058 SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN) \
0059 ENDBR
0060
0061
0062 #define SYM_FUNC_START_LOCAL_NOALIGN(name) \
0063 SYM_START(name, SYM_L_LOCAL, SYM_A_NONE) \
0064 ENDBR
0065
0066
0067 #define SYM_FUNC_START_WEAK(name) \
0068 SYM_START(name, SYM_L_WEAK, SYM_A_ALIGN) \
0069 ENDBR
0070
0071
0072 #define SYM_FUNC_START_WEAK_NOALIGN(name) \
0073 SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \
0074 ENDBR
0075
0076 #endif
0077