Commit | Line | Data |
---|---|---|
80f95078 PBG |
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> | |
ecec5ba6 | 7 | #include <kern_constants.h> |
80f95078 PBG |
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 | ||
80f95078 PBG |
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_ | |
96a388de | 39 | #include <asm-x86/unistd_64.h> |
80f95078 PBG |
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 | ||
ecec5ba6 | 49 | sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = { |
80f95078 | 50 | /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ |
ecec5ba6 | 51 | [0 ... UM_NR_syscall_max] = &sys_ni_syscall, |
96a388de | 52 | #include <asm-x86/unistd_64.h> |
80f95078 | 53 | }; |