18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * syscall_wrapper.h - x86 specific wrappers to syscall definitions
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef _ASM_X86_SYSCALL_WRAPPER_H
78c2ecf20Sopenharmony_ci#define _ASM_X86_SYSCALL_WRAPPER_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cistruct pt_regs;
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciextern long __x64_sys_ni_syscall(const struct pt_regs *regs);
128c2ecf20Sopenharmony_ciextern long __ia32_sys_ni_syscall(const struct pt_regs *regs);
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/*
158c2ecf20Sopenharmony_ci * Instead of the generic __SYSCALL_DEFINEx() definition, the x86 version takes
168c2ecf20Sopenharmony_ci * struct pt_regs *regs as the only argument of the syscall stub(s) named as:
178c2ecf20Sopenharmony_ci * __x64_sys_*()         - 64-bit native syscall
188c2ecf20Sopenharmony_ci * __ia32_sys_*()        - 32-bit native syscall or common compat syscall
198c2ecf20Sopenharmony_ci * __ia32_compat_sys_*() - 32-bit compat syscall
208c2ecf20Sopenharmony_ci * __x32_compat_sys_*()  - 64-bit X32 compat syscall
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * The registers are decoded according to the ABI:
238c2ecf20Sopenharmony_ci * 64-bit: RDI, RSI, RDX, R10, R8, R9
248c2ecf20Sopenharmony_ci * 32-bit: EBX, ECX, EDX, ESI, EDI, EBP
258c2ecf20Sopenharmony_ci *
268c2ecf20Sopenharmony_ci * The stub then passes the decoded arguments to the __se_sys_*() wrapper to
278c2ecf20Sopenharmony_ci * perform sign-extension (omitted for zero-argument syscalls).  Finally the
288c2ecf20Sopenharmony_ci * arguments are passed to the __do_sys_*() function which is the actual
298c2ecf20Sopenharmony_ci * syscall.  These wrappers are marked as inline so the compiler can optimize
308c2ecf20Sopenharmony_ci * the functions where appropriate.
318c2ecf20Sopenharmony_ci *
328c2ecf20Sopenharmony_ci * Example assembly (slightly re-ordered for better readability):
338c2ecf20Sopenharmony_ci *
348c2ecf20Sopenharmony_ci * <__x64_sys_recv>:		<-- syscall with 4 parameters
358c2ecf20Sopenharmony_ci *	callq	<__fentry__>
368c2ecf20Sopenharmony_ci *
378c2ecf20Sopenharmony_ci *	mov	0x70(%rdi),%rdi	<-- decode regs->di
388c2ecf20Sopenharmony_ci *	mov	0x68(%rdi),%rsi	<-- decode regs->si
398c2ecf20Sopenharmony_ci *	mov	0x60(%rdi),%rdx	<-- decode regs->dx
408c2ecf20Sopenharmony_ci *	mov	0x38(%rdi),%rcx	<-- decode regs->r10
418c2ecf20Sopenharmony_ci *
428c2ecf20Sopenharmony_ci *	xor	%r9d,%r9d	<-- clear %r9
438c2ecf20Sopenharmony_ci *	xor	%r8d,%r8d	<-- clear %r8
448c2ecf20Sopenharmony_ci *
458c2ecf20Sopenharmony_ci *	callq	__sys_recvfrom	<-- do the actual work in __sys_recvfrom()
468c2ecf20Sopenharmony_ci *				    which takes 6 arguments
478c2ecf20Sopenharmony_ci *
488c2ecf20Sopenharmony_ci *	cltq			<-- extend return value to 64-bit
498c2ecf20Sopenharmony_ci *	retq			<-- return
508c2ecf20Sopenharmony_ci *
518c2ecf20Sopenharmony_ci * This approach avoids leaking random user-provided register content down
528c2ecf20Sopenharmony_ci * the call chain.
538c2ecf20Sopenharmony_ci */
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* Mapping of registers to parameters for syscalls on x86-64 and x32 */
568c2ecf20Sopenharmony_ci#define SC_X86_64_REGS_TO_ARGS(x, ...)					\
578c2ecf20Sopenharmony_ci	__MAP(x,__SC_ARGS						\
588c2ecf20Sopenharmony_ci		,,regs->di,,regs->si,,regs->dx				\
598c2ecf20Sopenharmony_ci		,,regs->r10,,regs->r8,,regs->r9)			\
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci/* SYSCALL_PT_ARGS is Adapted from s390x */
638c2ecf20Sopenharmony_ci#define SYSCALL_PT_ARG6(m, t1, t2, t3, t4, t5, t6)			\
648c2ecf20Sopenharmony_ci	SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5), m(t6, (regs->bp))
658c2ecf20Sopenharmony_ci#define SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5)				\
668c2ecf20Sopenharmony_ci	SYSCALL_PT_ARG4(m, t1, t2, t3, t4),  m(t5, (regs->di))
678c2ecf20Sopenharmony_ci#define SYSCALL_PT_ARG4(m, t1, t2, t3, t4)				\
688c2ecf20Sopenharmony_ci	SYSCALL_PT_ARG3(m, t1, t2, t3),  m(t4, (regs->si))
698c2ecf20Sopenharmony_ci#define SYSCALL_PT_ARG3(m, t1, t2, t3)					\
708c2ecf20Sopenharmony_ci	SYSCALL_PT_ARG2(m, t1, t2), m(t3, (regs->dx))
718c2ecf20Sopenharmony_ci#define SYSCALL_PT_ARG2(m, t1, t2)					\
728c2ecf20Sopenharmony_ci	SYSCALL_PT_ARG1(m, t1), m(t2, (regs->cx))
738c2ecf20Sopenharmony_ci#define SYSCALL_PT_ARG1(m, t1) m(t1, (regs->bx))
748c2ecf20Sopenharmony_ci#define SYSCALL_PT_ARGS(x, ...) SYSCALL_PT_ARG##x(__VA_ARGS__)
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define __SC_COMPAT_CAST(t, a)						\
778c2ecf20Sopenharmony_ci	(__typeof(__builtin_choose_expr(__TYPE_IS_L(t), 0, 0U)))	\
788c2ecf20Sopenharmony_ci	(unsigned int)a
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci/* Mapping of registers to parameters for syscalls on i386 */
818c2ecf20Sopenharmony_ci#define SC_IA32_REGS_TO_ARGS(x, ...)					\
828c2ecf20Sopenharmony_ci	SYSCALL_PT_ARGS(x, __SC_COMPAT_CAST,				\
838c2ecf20Sopenharmony_ci			__MAP(x, __SC_TYPE, __VA_ARGS__))		\
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci#define __SYS_STUB0(abi, name)						\
868c2ecf20Sopenharmony_ci	long __##abi##_##name(const struct pt_regs *regs);		\
878c2ecf20Sopenharmony_ci	ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO);			\
888c2ecf20Sopenharmony_ci	long __##abi##_##name(const struct pt_regs *regs)		\
898c2ecf20Sopenharmony_ci		__alias(__do_##name);
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define __SYS_STUBx(abi, name, ...)					\
928c2ecf20Sopenharmony_ci	long __##abi##_##name(const struct pt_regs *regs);		\
938c2ecf20Sopenharmony_ci	ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO);			\
948c2ecf20Sopenharmony_ci	long __##abi##_##name(const struct pt_regs *regs)		\
958c2ecf20Sopenharmony_ci	{								\
968c2ecf20Sopenharmony_ci		return __se_##name(__VA_ARGS__);			\
978c2ecf20Sopenharmony_ci	}
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci#define __COND_SYSCALL(abi, name)					\
1008c2ecf20Sopenharmony_ci	__weak long __##abi##_##name(const struct pt_regs *__unused)	\
1018c2ecf20Sopenharmony_ci	{								\
1028c2ecf20Sopenharmony_ci		return sys_ni_syscall();				\
1038c2ecf20Sopenharmony_ci	}
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci#define __SYS_NI(abi, name)						\
1068c2ecf20Sopenharmony_ci	SYSCALL_ALIAS(__##abi##_##name, sys_ni_posix_timers);
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#ifdef CONFIG_X86_64
1098c2ecf20Sopenharmony_ci#define __X64_SYS_STUB0(name)						\
1108c2ecf20Sopenharmony_ci	__SYS_STUB0(x64, sys_##name)
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define __X64_SYS_STUBx(x, name, ...)					\
1138c2ecf20Sopenharmony_ci	__SYS_STUBx(x64, sys##name,					\
1148c2ecf20Sopenharmony_ci		    SC_X86_64_REGS_TO_ARGS(x, __VA_ARGS__))
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci#define __X64_COND_SYSCALL(name)					\
1178c2ecf20Sopenharmony_ci	__COND_SYSCALL(x64, sys_##name)
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci#define __X64_SYS_NI(name)						\
1208c2ecf20Sopenharmony_ci	__SYS_NI(x64, sys_##name)
1218c2ecf20Sopenharmony_ci#else /* CONFIG_X86_64 */
1228c2ecf20Sopenharmony_ci#define __X64_SYS_STUB0(name)
1238c2ecf20Sopenharmony_ci#define __X64_SYS_STUBx(x, name, ...)
1248c2ecf20Sopenharmony_ci#define __X64_COND_SYSCALL(name)
1258c2ecf20Sopenharmony_ci#define __X64_SYS_NI(name)
1268c2ecf20Sopenharmony_ci#endif /* CONFIG_X86_64 */
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
1298c2ecf20Sopenharmony_ci#define __IA32_SYS_STUB0(name)						\
1308c2ecf20Sopenharmony_ci	__SYS_STUB0(ia32, sys_##name)
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define __IA32_SYS_STUBx(x, name, ...)					\
1338c2ecf20Sopenharmony_ci	__SYS_STUBx(ia32, sys##name,					\
1348c2ecf20Sopenharmony_ci		    SC_IA32_REGS_TO_ARGS(x, __VA_ARGS__))
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define __IA32_COND_SYSCALL(name)					\
1378c2ecf20Sopenharmony_ci	__COND_SYSCALL(ia32, sys_##name)
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci#define __IA32_SYS_NI(name)						\
1408c2ecf20Sopenharmony_ci	__SYS_NI(ia32, sys_##name)
1418c2ecf20Sopenharmony_ci#else /* CONFIG_X86_32 || CONFIG_IA32_EMULATION */
1428c2ecf20Sopenharmony_ci#define __IA32_SYS_STUB0(name)
1438c2ecf20Sopenharmony_ci#define __IA32_SYS_STUBx(x, name, ...)
1448c2ecf20Sopenharmony_ci#define __IA32_COND_SYSCALL(name)
1458c2ecf20Sopenharmony_ci#define __IA32_SYS_NI(name)
1468c2ecf20Sopenharmony_ci#endif /* CONFIG_X86_32 || CONFIG_IA32_EMULATION */
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci#ifdef CONFIG_IA32_EMULATION
1498c2ecf20Sopenharmony_ci/*
1508c2ecf20Sopenharmony_ci * For IA32 emulation, we need to handle "compat" syscalls *and* create
1518c2ecf20Sopenharmony_ci * additional wrappers (aptly named __ia32_sys_xyzzy) which decode the
1528c2ecf20Sopenharmony_ci * ia32 regs in the proper order for shared or "common" syscalls. As some
1538c2ecf20Sopenharmony_ci * syscalls may not be implemented, we need to expand COND_SYSCALL in
1548c2ecf20Sopenharmony_ci * kernel/sys_ni.c and SYS_NI in kernel/time/posix-stubs.c to cover this
1558c2ecf20Sopenharmony_ci * case as well.
1568c2ecf20Sopenharmony_ci */
1578c2ecf20Sopenharmony_ci#define __IA32_COMPAT_SYS_STUB0(name)					\
1588c2ecf20Sopenharmony_ci	__SYS_STUB0(ia32, compat_sys_##name)
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#define __IA32_COMPAT_SYS_STUBx(x, name, ...)				\
1618c2ecf20Sopenharmony_ci	__SYS_STUBx(ia32, compat_sys##name,				\
1628c2ecf20Sopenharmony_ci		    SC_IA32_REGS_TO_ARGS(x, __VA_ARGS__))
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci#define __IA32_COMPAT_COND_SYSCALL(name)				\
1658c2ecf20Sopenharmony_ci	__COND_SYSCALL(ia32, compat_sys_##name)
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci#define __IA32_COMPAT_SYS_NI(name)					\
1688c2ecf20Sopenharmony_ci	__SYS_NI(ia32, compat_sys_##name)
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci#else /* CONFIG_IA32_EMULATION */
1718c2ecf20Sopenharmony_ci#define __IA32_COMPAT_SYS_STUB0(name)
1728c2ecf20Sopenharmony_ci#define __IA32_COMPAT_SYS_STUBx(x, name, ...)
1738c2ecf20Sopenharmony_ci#define __IA32_COMPAT_COND_SYSCALL(name)
1748c2ecf20Sopenharmony_ci#define __IA32_COMPAT_SYS_NI(name)
1758c2ecf20Sopenharmony_ci#endif /* CONFIG_IA32_EMULATION */
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci#ifdef CONFIG_X86_X32
1798c2ecf20Sopenharmony_ci/*
1808c2ecf20Sopenharmony_ci * For the x32 ABI, we need to create a stub for compat_sys_*() which is aware
1818c2ecf20Sopenharmony_ci * of the x86-64-style parameter ordering of x32 syscalls. The syscalls common
1828c2ecf20Sopenharmony_ci * with x86_64 obviously do not need such care.
1838c2ecf20Sopenharmony_ci */
1848c2ecf20Sopenharmony_ci#define __X32_COMPAT_SYS_STUB0(name)					\
1858c2ecf20Sopenharmony_ci	__SYS_STUB0(x32, compat_sys_##name)
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci#define __X32_COMPAT_SYS_STUBx(x, name, ...)				\
1888c2ecf20Sopenharmony_ci	__SYS_STUBx(x32, compat_sys##name,				\
1898c2ecf20Sopenharmony_ci		    SC_X86_64_REGS_TO_ARGS(x, __VA_ARGS__))
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci#define __X32_COMPAT_COND_SYSCALL(name)					\
1928c2ecf20Sopenharmony_ci	__COND_SYSCALL(x32, compat_sys_##name)
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci#define __X32_COMPAT_SYS_NI(name)					\
1958c2ecf20Sopenharmony_ci	__SYS_NI(x32, compat_sys_##name)
1968c2ecf20Sopenharmony_ci#else /* CONFIG_X86_X32 */
1978c2ecf20Sopenharmony_ci#define __X32_COMPAT_SYS_STUB0(name)
1988c2ecf20Sopenharmony_ci#define __X32_COMPAT_SYS_STUBx(x, name, ...)
1998c2ecf20Sopenharmony_ci#define __X32_COMPAT_COND_SYSCALL(name)
2008c2ecf20Sopenharmony_ci#define __X32_COMPAT_SYS_NI(name)
2018c2ecf20Sopenharmony_ci#endif /* CONFIG_X86_X32 */
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci#ifdef CONFIG_COMPAT
2058c2ecf20Sopenharmony_ci/*
2068c2ecf20Sopenharmony_ci * Compat means IA32_EMULATION and/or X86_X32. As they use a different
2078c2ecf20Sopenharmony_ci * mapping of registers to parameters, we need to generate stubs for each
2088c2ecf20Sopenharmony_ci * of them.
2098c2ecf20Sopenharmony_ci */
2108c2ecf20Sopenharmony_ci#define COMPAT_SYSCALL_DEFINE0(name)					\
2118c2ecf20Sopenharmony_ci	static long							\
2128c2ecf20Sopenharmony_ci	__do_compat_sys_##name(const struct pt_regs *__unused);		\
2138c2ecf20Sopenharmony_ci	__IA32_COMPAT_SYS_STUB0(name)					\
2148c2ecf20Sopenharmony_ci	__X32_COMPAT_SYS_STUB0(name)					\
2158c2ecf20Sopenharmony_ci	static long							\
2168c2ecf20Sopenharmony_ci	__do_compat_sys_##name(const struct pt_regs *__unused)
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci#define COMPAT_SYSCALL_DEFINEx(x, name, ...)					\
2198c2ecf20Sopenharmony_ci	static long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__));	\
2208c2ecf20Sopenharmony_ci	static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
2218c2ecf20Sopenharmony_ci	__IA32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__)				\
2228c2ecf20Sopenharmony_ci	__X32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__)				\
2238c2ecf20Sopenharmony_ci	static long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__))	\
2248c2ecf20Sopenharmony_ci	{									\
2258c2ecf20Sopenharmony_ci		return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
2268c2ecf20Sopenharmony_ci	}									\
2278c2ecf20Sopenharmony_ci	static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci/*
2308c2ecf20Sopenharmony_ci * As some compat syscalls may not be implemented, we need to expand
2318c2ecf20Sopenharmony_ci * COND_SYSCALL_COMPAT in kernel/sys_ni.c and COMPAT_SYS_NI in
2328c2ecf20Sopenharmony_ci * kernel/time/posix-stubs.c to cover this case as well.
2338c2ecf20Sopenharmony_ci */
2348c2ecf20Sopenharmony_ci#define COND_SYSCALL_COMPAT(name) 					\
2358c2ecf20Sopenharmony_ci	__IA32_COMPAT_COND_SYSCALL(name)				\
2368c2ecf20Sopenharmony_ci	__X32_COMPAT_COND_SYSCALL(name)
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define COMPAT_SYS_NI(name)						\
2398c2ecf20Sopenharmony_ci	__IA32_COMPAT_SYS_NI(name)					\
2408c2ecf20Sopenharmony_ci	__X32_COMPAT_SYS_NI(name)
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci#endif /* CONFIG_COMPAT */
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci#define __SYSCALL_DEFINEx(x, name, ...)					\
2458c2ecf20Sopenharmony_ci	static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__));	\
2468c2ecf20Sopenharmony_ci	static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
2478c2ecf20Sopenharmony_ci	__X64_SYS_STUBx(x, name, __VA_ARGS__)				\
2488c2ecf20Sopenharmony_ci	__IA32_SYS_STUBx(x, name, __VA_ARGS__)				\
2498c2ecf20Sopenharmony_ci	static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__))	\
2508c2ecf20Sopenharmony_ci	{								\
2518c2ecf20Sopenharmony_ci		long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
2528c2ecf20Sopenharmony_ci		__MAP(x,__SC_TEST,__VA_ARGS__);				\
2538c2ecf20Sopenharmony_ci		__PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__));	\
2548c2ecf20Sopenharmony_ci		return ret;						\
2558c2ecf20Sopenharmony_ci	}								\
2568c2ecf20Sopenharmony_ci	static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci/*
2598c2ecf20Sopenharmony_ci * As the generic SYSCALL_DEFINE0() macro does not decode any parameters for
2608c2ecf20Sopenharmony_ci * obvious reasons, and passing struct pt_regs *regs to it in %rdi does not
2618c2ecf20Sopenharmony_ci * hurt, we only need to re-define it here to keep the naming congruent to
2628c2ecf20Sopenharmony_ci * SYSCALL_DEFINEx() -- which is essential for the COND_SYSCALL() and SYS_NI()
2638c2ecf20Sopenharmony_ci * macros to work correctly.
2648c2ecf20Sopenharmony_ci */
2658c2ecf20Sopenharmony_ci#define SYSCALL_DEFINE0(sname)						\
2668c2ecf20Sopenharmony_ci	SYSCALL_METADATA(_##sname, 0);					\
2678c2ecf20Sopenharmony_ci	static long __do_sys_##sname(const struct pt_regs *__unused);	\
2688c2ecf20Sopenharmony_ci	__X64_SYS_STUB0(sname)						\
2698c2ecf20Sopenharmony_ci	__IA32_SYS_STUB0(sname)						\
2708c2ecf20Sopenharmony_ci	static long __do_sys_##sname(const struct pt_regs *__unused)
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci#define COND_SYSCALL(name)						\
2738c2ecf20Sopenharmony_ci	__X64_COND_SYSCALL(name)					\
2748c2ecf20Sopenharmony_ci	__IA32_COND_SYSCALL(name)
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci#define SYS_NI(name)							\
2778c2ecf20Sopenharmony_ci	__X64_SYS_NI(name)						\
2788c2ecf20Sopenharmony_ci	__IA32_SYS_NI(name)
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci/*
2828c2ecf20Sopenharmony_ci * For VSYSCALLS, we need to declare these three syscalls with the new
2838c2ecf20Sopenharmony_ci * pt_regs-based calling convention for in-kernel use.
2848c2ecf20Sopenharmony_ci */
2858c2ecf20Sopenharmony_cilong __x64_sys_getcpu(const struct pt_regs *regs);
2868c2ecf20Sopenharmony_cilong __x64_sys_gettimeofday(const struct pt_regs *regs);
2878c2ecf20Sopenharmony_cilong __x64_sys_time(const struct pt_regs *regs);
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci#endif /* _ASM_X86_SYSCALL_WRAPPER_H */
290