blob: 8ea34f94e973c41322625743f92fe16bc0ed35fa [file] [log] [blame]
H. Peter Anvin303395a2011-11-11 16:07:41 -08001/* System call table for i386. */
2
3#include <linux/linkage.h>
4#include <linux/sys.h>
5#include <linux/cache.h>
6#include <asm/asm-offsets.h>
7
Brian Gerst2aa4a712015-03-03 22:31:33 -05008#ifdef CONFIG_IA32_EMULATION
9#define SYM(sym, compat) compat
10#else
11#define SYM(sym, compat) sym
12#define ia32_sys_call_table sys_call_table
Ingo Molnarbace7112015-06-08 21:20:26 +020013#define __NR_syscall_compat_max __NR_syscall_max
Brian Gerst2aa4a712015-03-03 22:31:33 -050014#endif
15
16#define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void SYM(sym, compat)(void) ;
H. Peter Anvin303395a2011-11-11 16:07:41 -080017#include <asm/syscalls_32.h>
18#undef __SYSCALL_I386
19
Brian Gerst2aa4a712015-03-03 22:31:33 -050020#define __SYSCALL_I386(nr, sym, compat) [nr] = SYM(sym, compat),
H. Peter Anvin303395a2011-11-11 16:07:41 -080021
22typedef asmlinkage void (*sys_call_ptr_t)(void);
23
24extern asmlinkage void sys_ni_syscall(void);
25
Ingo Molnarbace7112015-06-08 21:20:26 +020026__visible const sys_call_ptr_t ia32_sys_call_table[__NR_syscall_compat_max+1] = {
H. Peter Anvin303395a2011-11-11 16:07:41 -080027 /*
H. Peter Anvin61f1e7e2011-11-18 16:25:07 -080028 * Smells like a compiler bug -- it doesn't work
H. Peter Anvin303395a2011-11-11 16:07:41 -080029 * when the & below is removed.
30 */
Ingo Molnarbace7112015-06-08 21:20:26 +020031 [0 ... __NR_syscall_compat_max] = &sys_ni_syscall,
H. Peter Anvin303395a2011-11-11 16:07:41 -080032#include <asm/syscalls_32.h>
33};