1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Save registers before calling assembly functions. This avoids
4 * disturbance of register allocation in some inline assembly constructs.
5 * Copyright 2001,2002 by Andi Kleen, SuSE Labs.
7 #include <linux/linkage.h>
10 #include <asm/export.h>
12 /* rdi: arg1 ... normal C conventions. rax is saved/restored. */
13 .macro THUNK name, func, put_ret_addr_in_rdi=0
14 SYM_FUNC_START_NOALIGN(\name)
28 .if \put_ret_addr_in_rdi
29 /* 8(%rbp) is return addr on stack */
39 #ifdef CONFIG_PREEMPTION
40 THUNK preempt_schedule_thunk, preempt_schedule
41 THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
42 EXPORT_SYMBOL(preempt_schedule_thunk)
43 EXPORT_SYMBOL(preempt_schedule_notrace_thunk)
46 #ifdef CONFIG_PREEMPTION
47 SYM_CODE_START_LOCAL_NOALIGN(.L_restore)
59 _ASM_NOKPROBE(.L_restore)
60 SYM_CODE_END(.L_restore)