Paolo 'Blaisorblade' Giarrusso | 80f9507 | 2005-05-01 08:58:55 -0700 | [diff] [blame] | 1 | /* System call table for UML/x86-64, copied from arch/x86_64/kernel/syscall.c |
| 2 | * with some changes for UML. */ |
| 3 | |
| 4 | #include <linux/linkage.h> |
| 5 | #include <linux/sys.h> |
| 6 | #include <linux/cache.h> |
Al Viro | ecec5ba | 2007-05-15 20:36:00 +0100 | [diff] [blame^] | 7 | #include <kern_constants.h> |
Paolo 'Blaisorblade' Giarrusso | 80f9507 | 2005-05-01 08:58:55 -0700 | [diff] [blame] | 8 | |
| 9 | #define __NO_STUBS |
| 10 | |
| 11 | /* Below you can see, in terms of #define's, the differences between the x86-64 |
| 12 | * and the UML syscall table. */ |
| 13 | |
| 14 | /* Not going to be implemented by UML, since we have no hardware. */ |
| 15 | #define stub_iopl sys_ni_syscall |
| 16 | #define sys_ioperm sys_ni_syscall |
| 17 | |
| 18 | /* The UML TLS problem. Note that x86_64 does not implement this, so the below |
| 19 | * is needed only for the ia32 compatibility. */ |
| 20 | /*#define sys_set_thread_area sys_ni_syscall |
| 21 | #define sys_get_thread_area sys_ni_syscall*/ |
| 22 | |
Paolo 'Blaisorblade' Giarrusso | 80f9507 | 2005-05-01 08:58:55 -0700 | [diff] [blame] | 23 | /* On UML we call it this way ("old" means it's not mmap2) */ |
| 24 | #define sys_mmap old_mmap |
| 25 | /* On x86-64 sys_uname is actually sys_newuname plus a compatibility trick. |
| 26 | * See arch/x86_64/kernel/sys_x86_64.c */ |
| 27 | #define sys_uname sys_uname64 |
| 28 | |
| 29 | #define stub_clone sys_clone |
| 30 | #define stub_fork sys_fork |
| 31 | #define stub_vfork sys_vfork |
| 32 | #define stub_execve sys_execve |
| 33 | #define stub_rt_sigsuspend sys_rt_sigsuspend |
| 34 | #define stub_sigaltstack sys_sigaltstack |
| 35 | #define stub_rt_sigreturn sys_rt_sigreturn |
| 36 | |
| 37 | #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; |
| 38 | #undef _ASM_X86_64_UNISTD_H_ |
| 39 | #include <asm-x86_64/unistd.h> |
| 40 | |
| 41 | #undef __SYSCALL |
| 42 | #define __SYSCALL(nr, sym) [ nr ] = sym, |
| 43 | #undef _ASM_X86_64_UNISTD_H_ |
| 44 | |
| 45 | typedef void (*sys_call_ptr_t)(void); |
| 46 | |
| 47 | extern void sys_ni_syscall(void); |
| 48 | |
Al Viro | ecec5ba | 2007-05-15 20:36:00 +0100 | [diff] [blame^] | 49 | sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = { |
Paolo 'Blaisorblade' Giarrusso | 80f9507 | 2005-05-01 08:58:55 -0700 | [diff] [blame] | 50 | /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ |
Al Viro | ecec5ba | 2007-05-15 20:36:00 +0100 | [diff] [blame^] | 51 | [0 ... UM_NR_syscall_max] = &sys_ni_syscall, |
Paolo 'Blaisorblade' Giarrusso | 80f9507 | 2005-05-01 08:58:55 -0700 | [diff] [blame] | 52 | #include <asm-x86_64/unistd.h> |
| 53 | }; |