1 /* SPDX-License-Identifier: GPL-2.0 */
3 #include <linux/stringify.h>
4 #include <linux/linkage.h>
5 #include <asm/dwarf2.h>
6 #include <asm/cpufeatures.h>
7 #include <asm/alternative-asm.h>
8 #include <asm/nospec-branch.h>
11 .section .text.__x86.indirect_thunk
13 ENTRY(__x86_indirect_thunk_\reg)
17 ENDPROC(__x86_indirect_thunk_\reg)
21 * Despite being an assembler file we can't just use .irp here
22 * because __KSYM_DEPS__ only uses the C preprocessor and would
23 * only see one instance of "__x86_indirect_thunk_\reg" rather
24 * than one per register with the correct names. So we do it
25 * the simple and nasty way...
27 #define __EXPORT_THUNK(sym) _ASM_NOKPROBE(sym)
28 #define EXPORT_THUNK(reg) __EXPORT_THUNK(__x86_indirect_thunk_ ## reg)
29 #define GENERATE_THUNK(reg) THUNK reg ; EXPORT_THUNK(reg)
31 GENERATE_THUNK(_ASM_AX)
32 GENERATE_THUNK(_ASM_BX)
33 GENERATE_THUNK(_ASM_CX)
34 GENERATE_THUNK(_ASM_DX)
35 GENERATE_THUNK(_ASM_SI)
36 GENERATE_THUNK(_ASM_DI)
37 GENERATE_THUNK(_ASM_BP)