syscall_table.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <linux/config.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. /* For __NR_time. The x86-64 name hopefully will change from sys_time64 to
  18. * sys_time (since the current situation is bogus). I've sent a patch to cleanup
  19. * this. Remove below the obsoleted line. */
  20. #define sys_time64 um_time
  21. #define sys_time um_time
  22. /* 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. #define stub_clone sys_clone
  28. #define stub_fork sys_fork
  29. #define stub_vfork sys_vfork
  30. #define stub_execve sys_execve
  31. #define stub_rt_sigsuspend sys_rt_sigsuspend
  32. #define stub_sigaltstack sys_sigaltstack
  33. #define stub_rt_sigreturn sys_rt_sigreturn
  34. #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ;
  35. #undef _ASM_X86_64_UNISTD_H_
  36. #include <asm-x86_64/unistd.h>
  37. #undef __SYSCALL
  38. #define __SYSCALL(nr, sym) [ nr ] = sym,
  39. #undef _ASM_X86_64_UNISTD_H_
  40. typedef void (*sys_call_ptr_t)(void);
  41. extern void sys_ni_syscall(void);
  42. sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = {
  43. /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */
  44. [0 ... __NR_syscall_max] = &sys_ni_syscall,
  45. #include <asm-x86_64/unistd.h>
  46. };