syscall_table.c 1.7 KB

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