Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | // 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 Deprez | 0e64123 | 2021-09-23 10:07:05 +0200 | [diff] [blame^] | 13 | #define __sys_ni_syscall __ia32_sys_ni_syscall |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 14 | #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); |
| 16 | extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); |
Olivier Deprez | 0e64123 | 2021-09-23 10:07:05 +0200 | [diff] [blame^] | 17 | #define __sys_ni_syscall sys_ni_syscall |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 18 | #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 Deprez | 0e64123 | 2021-09-23 10:07:05 +0200 | [diff] [blame^] | 30 | [0 ... __NR_syscall_compat_max] = &__sys_ni_syscall, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 31 | #include <asm/syscalls_32.h> |
| 32 | }; |