xref: /openbmc/linux/arch/x86/entry/syscall_32.c (revision 6218d0f6b8dece1f2e82f0a47a0e6b8ecb631ef6)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
200398a00SIngo Molnar /* System call table for i386. */
300398a00SIngo Molnar 
400398a00SIngo Molnar #include <linux/linkage.h>
500398a00SIngo Molnar #include <linux/sys.h>
600398a00SIngo Molnar #include <linux/cache.h>
725c619e5SBrian Gerst #include <linux/syscalls.h>
808720988SBrian Gerst #include <asm/unistd.h>
9034042ccSAndy Lutomirski #include <asm/syscall.h>
1000398a00SIngo Molnar 
11*6218d0f6SMasahiro Yamada #ifdef CONFIG_IA32_EMULATION
12*6218d0f6SMasahiro Yamada #define __SYSCALL_WITH_COMPAT(nr, native, compat)	__SYSCALL(nr, compat)
13*6218d0f6SMasahiro Yamada #else
14*6218d0f6SMasahiro Yamada #define __SYSCALL_WITH_COMPAT(nr, native, compat)	__SYSCALL(nr, native)
15*6218d0f6SMasahiro Yamada #endif
16*6218d0f6SMasahiro Yamada 
17*6218d0f6SMasahiro Yamada #define __SYSCALL(nr, sym) extern long __ia32_##sym(const struct pt_regs *);
18ebeb8c82SDominik Brodowski 
1900398a00SIngo Molnar #include <asm/syscalls_32.h>
20*6218d0f6SMasahiro Yamada #undef __SYSCALL
2100398a00SIngo Molnar 
22*6218d0f6SMasahiro Yamada #define __SYSCALL(nr, sym) [nr] = __ia32_##sym,
2300398a00SIngo Molnar 
2408720988SBrian Gerst __visible const sys_call_ptr_t ia32_sys_call_table[__NR_ia32_syscall_max+1] = {
2500398a00SIngo Molnar 	/*
2600398a00SIngo Molnar 	 * Smells like a compiler bug -- it doesn't work
2700398a00SIngo Molnar 	 * when the & below is removed.
2800398a00SIngo Molnar 	 */
2925c619e5SBrian Gerst 	[0 ... __NR_ia32_syscall_max] = &__ia32_sys_ni_syscall,
3000398a00SIngo Molnar #include <asm/syscalls_32.h>
3100398a00SIngo Molnar };
32