145db1c61SH. Peter Anvin /* 245db1c61SH. Peter Anvin * System call table for UML/i386, copied from arch/x86/kernel/syscall_*.c 345db1c61SH. Peter Anvin * with some changes for UML. 445db1c61SH. Peter Anvin */ 545db1c61SH. Peter Anvin 645db1c61SH. Peter Anvin #include <linux/linkage.h> 745db1c61SH. Peter Anvin #include <linux/sys.h> 845db1c61SH. Peter Anvin #include <linux/cache.h> 945db1c61SH. Peter Anvin #include <generated/user_constants.h> 1045db1c61SH. Peter Anvin 1145db1c61SH. Peter Anvin #define __NO_STUBS 1245db1c61SH. Peter Anvin 1345db1c61SH. Peter Anvin /* 1445db1c61SH. Peter Anvin * Below you can see, in terms of #define's, the differences between the x86-64 1545db1c61SH. Peter Anvin * and the UML syscall table. 1645db1c61SH. Peter Anvin */ 1745db1c61SH. Peter Anvin 1845db1c61SH. Peter Anvin /* Not going to be implemented by UML, since we have no hardware. */ 19*47db9e7cSH. Peter Anvin #define sys_iopl sys_ni_syscall 2045db1c61SH. Peter Anvin #define sys_ioperm sys_ni_syscall 2145db1c61SH. Peter Anvin 2245db1c61SH. Peter Anvin #define sys_vm86old sys_ni_syscall 2345db1c61SH. Peter Anvin #define sys_vm86 sys_ni_syscall 2445db1c61SH. Peter Anvin 2545db1c61SH. Peter Anvin #define old_mmap sys_old_mmap 2645db1c61SH. Peter Anvin 2745db1c61SH. Peter Anvin #define ptregs_fork sys_fork 2845db1c61SH. Peter Anvin #define ptregs_execve sys_execve 2945db1c61SH. Peter Anvin #define ptregs_iopl sys_iopl 3045db1c61SH. Peter Anvin #define ptregs_vm86old sys_vm86old 3145db1c61SH. Peter Anvin #define ptregs_clone sys_clone 3245db1c61SH. Peter Anvin #define ptregs_vm86 sys_vm86 3345db1c61SH. Peter Anvin #define ptregs_sigaltstack sys_sigaltstack 3445db1c61SH. Peter Anvin #define ptregs_vfork sys_vfork 3545db1c61SH. Peter Anvin 3645db1c61SH. Peter Anvin #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; 3745db1c61SH. Peter Anvin #include <asm/syscalls_32.h> 3845db1c61SH. Peter Anvin 3945db1c61SH. Peter Anvin #undef __SYSCALL_I386 4045db1c61SH. Peter Anvin #define __SYSCALL_I386(nr, sym, compat) [ nr ] = sym, 4145db1c61SH. Peter Anvin 4245db1c61SH. Peter Anvin typedef void (*sys_call_ptr_t)(void); 4345db1c61SH. Peter Anvin 4445db1c61SH. Peter Anvin extern void sys_ni_syscall(void); 4545db1c61SH. Peter Anvin 46a074335aSH. Peter Anvin const sys_call_ptr_t sys_call_table[] __cacheline_aligned = { 4745db1c61SH. Peter Anvin /* 4845db1c61SH. Peter Anvin * Smells like a compiler bug -- it doesn't work 4945db1c61SH. Peter Anvin * when the & below is removed. 5045db1c61SH. Peter Anvin */ 5145db1c61SH. Peter Anvin [0 ... __NR_syscall_max] = &sys_ni_syscall, 5245db1c61SH. Peter Anvin #include <asm/syscalls_32.h> 5345db1c61SH. Peter Anvin }; 5445db1c61SH. Peter Anvin 5545db1c61SH. Peter Anvin int syscall_table_size = sizeof(sys_call_table); 56