xref: /openbmc/linux/arch/x86/um/sys_call_table_64.c (revision 171f1bc7)
1 /*
2  * System call table for UML/x86-64, copied from arch/x86_64/kernel/syscall.c
3  * with some changes for UML.
4  */
5 
6 #include <linux/linkage.h>
7 #include <linux/sys.h>
8 #include <linux/cache.h>
9 
10 #define __NO_STUBS
11 
12 /*
13  * Below you can see, in terms of #define's, the differences between the x86-64
14  * and the UML syscall table.
15  */
16 
17 /* Not going to be implemented by UML, since we have no hardware. */
18 #define stub_iopl sys_ni_syscall
19 #define sys_ioperm sys_ni_syscall
20 
21 /*
22  * The UML TLS problem. Note that x86_64 does not implement this, so the below
23  * is needed only for the ia32 compatibility.
24  */
25 
26 /* On UML we call it this way ("old" means it's not mmap2) */
27 #define sys_mmap old_mmap
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_UNISTD_64_H
39 #include "../../x86/include/asm/unistd_64.h"
40 
41 #undef __SYSCALL
42 #define __SYSCALL(nr, sym) [ nr ] = sym,
43 #undef _ASM_X86_UNISTD_64_H
44 
45 typedef void (*sys_call_ptr_t)(void);
46 
47 extern void sys_ni_syscall(void);
48 
49 /*
50  * We used to have a trick here which made sure that holes in the
51  * x86_64 table were filled in with sys_ni_syscall, but a comment in
52  * unistd_64.h says that holes aren't allowed, so the trick was
53  * removed.
54  * The trick looked like this
55  *	[0 ... UM_NR_syscall_max] = &sys_ni_syscall
56  * before including unistd_64.h - the later initializations overwrote
57  * the sys_ni_syscall filler.
58  */
59 
60 sys_call_ptr_t sys_call_table[] __cacheline_aligned = {
61 #include <asm/unistd_64.h>
62 };
63 
64 int syscall_table_size = sizeof(sys_call_table);
65