blob: aa3336a7cb150ccf170d4356f113c2fb7fb12292 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
H. Peter Anvin303395a2011-11-11 16:07:41 -08002/* System call table for i386. */
3
4#include <linux/linkage.h>
5#include <linux/sys.h>
6#include <linux/cache.h>
7#include <asm/asm-offsets.h>
Andy Lutomirski034042c2015-10-05 17:48:06 -07008#include <asm/syscall.h>
H. Peter Anvin303395a2011-11-11 16:07:41 -08009
Dominik Brodowskif8781c42018-04-05 11:53:05 +020010#ifdef CONFIG_IA32_EMULATION
Dominik Brodowskiebeb8c82018-04-05 11:53:04 +020011/* On X86_64, we use struct pt_regs * to pass parameters to syscalls */
12#define __SYSCALL_I386(nr, sym, qual) extern asmlinkage long sym(const struct pt_regs *);
13
14/* this is a lie, but it does not hurt as sys_ni_syscall just returns -EINVAL */
15extern asmlinkage long sys_ni_syscall(const struct pt_regs *);
16
Dominik Brodowskif8781c42018-04-05 11:53:05 +020017#else /* CONFIG_IA32_EMULATION */
Dominik Brodowskiebeb8c82018-04-05 11:53:04 +020018#define __SYSCALL_I386(nr, sym, qual) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
19extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
Dominik Brodowskif8781c42018-04-05 11:53:05 +020020#endif /* CONFIG_IA32_EMULATION */
Dominik Brodowskiebeb8c82018-04-05 11:53:04 +020021
H. Peter Anvin303395a2011-11-11 16:07:41 -080022#include <asm/syscalls_32.h>
23#undef __SYSCALL_I386
24
Andy Lutomirskicfcbadb2016-01-28 15:11:24 -080025#define __SYSCALL_I386(nr, sym, qual) [nr] = sym,
H. Peter Anvin303395a2011-11-11 16:07:41 -080026
Ingo Molnarbace7112015-06-08 21:20:26 +020027__visible const sys_call_ptr_t ia32_sys_call_table[__NR_syscall_compat_max+1] = {
H. Peter Anvin303395a2011-11-11 16:07:41 -080028 /*
H. Peter Anvin61f1e7e2011-11-18 16:25:07 -080029 * Smells like a compiler bug -- it doesn't work
H. Peter Anvin303395a2011-11-11 16:07:41 -080030 * when the & below is removed.
31 */
Ingo Molnarbace7112015-06-08 21:20:26 +020032 [0 ... __NR_syscall_compat_max] = &sys_ni_syscall,
H. Peter Anvin303395a2011-11-11 16:07:41 -080033#include <asm/syscalls_32.h>
34};