blob: 7d17b3addbbb385c30e603686ddee19530e81ccb [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001// SPDX-License-Identifier: GPL-2.0
2/* 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>
8#include <asm/syscall.h>
9
10#ifdef CONFIG_IA32_EMULATION
11/* 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 *);
Olivier Deprez0e641232021-09-23 10:07:05 +020013#define __sys_ni_syscall __ia32_sys_ni_syscall
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000014#else /* CONFIG_IA32_EMULATION */
15#define __SYSCALL_I386(nr, sym, qual) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
16extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
Olivier Deprez0e641232021-09-23 10:07:05 +020017#define __sys_ni_syscall sys_ni_syscall
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000018#endif /* CONFIG_IA32_EMULATION */
19
20#include <asm/syscalls_32.h>
21#undef __SYSCALL_I386
22
23#define __SYSCALL_I386(nr, sym, qual) [nr] = sym,
24
25__visible const sys_call_ptr_t ia32_sys_call_table[__NR_syscall_compat_max+1] = {
26 /*
27 * Smells like a compiler bug -- it doesn't work
28 * when the & below is removed.
29 */
Olivier Deprez0e641232021-09-23 10:07:05 +020030 [0 ... __NR_syscall_compat_max] = &__sys_ni_syscall,
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000031#include <asm/syscalls_32.h>
32};