1
0

syscall_arch.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #define __SYSCALL_LL_E(x) (x)
  2. #define __SYSCALL_LL_O(x) (x)
  3. static __inline long __syscall0(long n)
  4. {
  5. unsigned long ret;
  6. __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n) : "rcx", "r11", "memory");
  7. return ret;
  8. }
  9. static __inline long __syscall1(long n, long a1)
  10. {
  11. unsigned long ret;
  12. __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1) : "rcx", "r11", "memory");
  13. return ret;
  14. }
  15. static __inline long __syscall2(long n, long a1, long a2)
  16. {
  17. unsigned long ret;
  18. __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2)
  19. : "rcx", "r11", "memory");
  20. return ret;
  21. }
  22. static __inline long __syscall3(long n, long a1, long a2, long a3)
  23. {
  24. unsigned long ret;
  25. __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  26. "d"(a3) : "rcx", "r11", "memory");
  27. return ret;
  28. }
  29. static __inline long __syscall4(long n, long a1, long a2, long a3, long a4)
  30. {
  31. unsigned long ret;
  32. register long r10 __asm__("r10") = a4;
  33. __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  34. "d"(a3), "r"(r10): "rcx", "r11", "memory");
  35. return ret;
  36. }
  37. static __inline long __syscall5(long n, long a1, long a2, long a3, long a4, long a5)
  38. {
  39. unsigned long ret;
  40. register long r10 __asm__("r10") = a4;
  41. register long r8 __asm__("r8") = a5;
  42. __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  43. "d"(a3), "r"(r10), "r"(r8) : "rcx", "r11", "memory");
  44. return ret;
  45. }
  46. static __inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6)
  47. {
  48. unsigned long ret;
  49. register long r10 __asm__("r10") = a4;
  50. register long r8 __asm__("r8") = a5;
  51. register long r9 __asm__("r9") = a6;
  52. __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
  53. "d"(a3), "r"(r10), "r"(r8), "r"(r9) : "rcx", "r11", "memory");
  54. return ret;
  55. }
  56. #define VDSO_USEFUL
  57. #define VDSO_CGT_SYM "__vdso_clock_gettime"
  58. #define VDSO_CGT_VER "LINUX_2.6"
  59. #define VDSO_GETCPU_SYM "__vdso_getcpu"
  60. #define VDSO_GETCPU_VER "LINUX_2.6"
  61. #define IPC_64 0