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