1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_LINKAGE_H
3 #define _ASM_X86_LINKAGE_H
5 #include <linux/stringify.h>
8 #define notrace __attribute__((no_instrument_function))
11 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
12 #endif /* CONFIG_X86_32 */
16 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_ALIGNMENT_16)
17 #define __ALIGN .p2align 4, 0x90
18 #define __ALIGN_STR __stringify(__ALIGN)
21 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
22 #define RET jmp __x86_return_thunk
23 #else /* CONFIG_RETPOLINE */
29 #endif /* CONFIG_RETPOLINE */
31 #else /* __ASSEMBLY__ */
33 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
34 #define ASM_RET "jmp __x86_return_thunk\n\t"
35 #else /* CONFIG_RETPOLINE */
37 #define ASM_RET "ret; int3\n\t"
39 #define ASM_RET "ret\n\t"
41 #endif /* CONFIG_RETPOLINE */
43 #endif /* __ASSEMBLY__ */
45 #endif /* _ASM_X86_LINKAGE_H */