syscall_table.c 1.6 KB

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