1*45db1c61SH. Peter Anvin /* 2*45db1c61SH. Peter Anvin * System call table for UML/i386, copied from arch/x86/kernel/syscall_*.c 3*45db1c61SH. Peter Anvin * with some changes for UML. 4*45db1c61SH. Peter Anvin */ 5*45db1c61SH. Peter Anvin 6*45db1c61SH. Peter Anvin #include <linux/linkage.h> 7*45db1c61SH. Peter Anvin #include <linux/sys.h> 8*45db1c61SH. Peter Anvin #include <linux/cache.h> 9*45db1c61SH. Peter Anvin #include <generated/user_constants.h> 10*45db1c61SH. Peter Anvin 11*45db1c61SH. Peter Anvin #define __NO_STUBS 12*45db1c61SH. Peter Anvin 13*45db1c61SH. Peter Anvin /* 14*45db1c61SH. Peter Anvin * Below you can see, in terms of #define's, the differences between the x86-64 15*45db1c61SH. Peter Anvin * and the UML syscall table. 16*45db1c61SH. Peter Anvin */ 17*45db1c61SH. Peter Anvin 18*45db1c61SH. Peter Anvin /* Not going to be implemented by UML, since we have no hardware. */ 19*45db1c61SH. Peter Anvin #define stub_iopl sys_ni_syscall 20*45db1c61SH. Peter Anvin #define sys_ioperm sys_ni_syscall 21*45db1c61SH. Peter Anvin 22*45db1c61SH. Peter Anvin #define sys_vm86old sys_ni_syscall 23*45db1c61SH. Peter Anvin #define sys_vm86 sys_ni_syscall 24*45db1c61SH. Peter Anvin 25*45db1c61SH. Peter Anvin #define old_mmap sys_old_mmap 26*45db1c61SH. Peter Anvin 27*45db1c61SH. Peter Anvin #define ptregs_fork sys_fork 28*45db1c61SH. Peter Anvin #define ptregs_execve sys_execve 29*45db1c61SH. Peter Anvin #define ptregs_iopl sys_iopl 30*45db1c61SH. Peter Anvin #define ptregs_vm86old sys_vm86old 31*45db1c61SH. Peter Anvin #define ptregs_clone sys_clone 32*45db1c61SH. Peter Anvin #define ptregs_vm86 sys_vm86 33*45db1c61SH. Peter Anvin #define ptregs_sigaltstack sys_sigaltstack 34*45db1c61SH. Peter Anvin #define ptregs_vfork sys_vfork 35*45db1c61SH. Peter Anvin 36*45db1c61SH. Peter Anvin #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; 37*45db1c61SH. Peter Anvin #include <asm/syscalls_32.h> 38*45db1c61SH. Peter Anvin 39*45db1c61SH. Peter Anvin #undef __SYSCALL_I386 40*45db1c61SH. Peter Anvin #define __SYSCALL_I386(nr, sym, compat) [ nr ] = sym, 41*45db1c61SH. Peter Anvin 42*45db1c61SH. Peter Anvin typedef void (*sys_call_ptr_t)(void); 43*45db1c61SH. Peter Anvin 44*45db1c61SH. Peter Anvin extern void sys_ni_syscall(void); 45*45db1c61SH. Peter Anvin 46*45db1c61SH. Peter Anvin sys_call_ptr_t sys_call_table[] __cacheline_aligned = { 47*45db1c61SH. Peter Anvin /* 48*45db1c61SH. Peter Anvin * Smells like a compiler bug -- it doesn't work 49*45db1c61SH. Peter Anvin * when the & below is removed. 50*45db1c61SH. Peter Anvin */ 51*45db1c61SH. Peter Anvin [0 ... __NR_syscall_max] = &sys_ni_syscall, 52*45db1c61SH. Peter Anvin #include <asm/syscalls_32.h> 53*45db1c61SH. Peter Anvin }; 54*45db1c61SH. Peter Anvin 55*45db1c61SH. Peter Anvin int syscall_table_size = sizeof(sys_call_table); 56