unistd.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef _ASM_X86_UNISTD_H
  2. #define _ASM_X86_UNISTD_H 1
  3. /* x32 syscall flag bit */
  4. #define __X32_SYSCALL_BIT 0x40000000
  5. #ifdef __KERNEL__
  6. # ifdef CONFIG_X86_X32_ABI
  7. # define __SYSCALL_MASK (~(__X32_SYSCALL_BIT))
  8. # else
  9. # define __SYSCALL_MASK (~0)
  10. # endif
  11. # ifdef CONFIG_X86_32
  12. # include <asm/unistd_32.h>
  13. # define __ARCH_WANT_STAT64
  14. # define __ARCH_WANT_SYS_IPC
  15. # define __ARCH_WANT_SYS_OLD_MMAP
  16. # define __ARCH_WANT_SYS_OLD_SELECT
  17. # else
  18. # include <asm/unistd_64.h>
  19. # include <asm/unistd_64_x32.h>
  20. # define __ARCH_WANT_COMPAT_SYS_TIME
  21. # endif
  22. # define __ARCH_WANT_OLD_READDIR
  23. # define __ARCH_WANT_OLD_STAT
  24. # define __ARCH_WANT_SYS_ALARM
  25. # define __ARCH_WANT_SYS_FADVISE64
  26. # define __ARCH_WANT_SYS_GETHOSTNAME
  27. # define __ARCH_WANT_SYS_GETPGRP
  28. # define __ARCH_WANT_SYS_LLSEEK
  29. # define __ARCH_WANT_SYS_NICE
  30. # define __ARCH_WANT_SYS_OLDUMOUNT
  31. # define __ARCH_WANT_SYS_OLD_GETRLIMIT
  32. # define __ARCH_WANT_SYS_OLD_UNAME
  33. # define __ARCH_WANT_SYS_PAUSE
  34. # define __ARCH_WANT_SYS_RT_SIGACTION
  35. # define __ARCH_WANT_SYS_RT_SIGSUSPEND
  36. # define __ARCH_WANT_SYS_SGETMASK
  37. # define __ARCH_WANT_SYS_SIGNAL
  38. # define __ARCH_WANT_SYS_SIGPENDING
  39. # define __ARCH_WANT_SYS_SIGPROCMASK
  40. # define __ARCH_WANT_SYS_SOCKETCALL
  41. # define __ARCH_WANT_SYS_TIME
  42. # define __ARCH_WANT_SYS_UTIME
  43. # define __ARCH_WANT_SYS_WAITPID
  44. /*
  45. * "Conditional" syscalls
  46. *
  47. * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
  48. * but it doesn't work on all toolchains, so we just do it by hand
  49. */
  50. # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
  51. #else
  52. # ifdef __i386__
  53. # include <asm/unistd_32.h>
  54. # elif defined(__ILP32__)
  55. # include <asm/unistd_x32.h>
  56. # else
  57. # include <asm/unistd_64.h>
  58. # endif
  59. #endif
  60. #endif /* _ASM_X86_UNISTD_H */