syscall_arch.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #define __SYSCALL_LL_E(x) (x)
  2. #define __SYSCALL_LL_O(x) (x)
  3. static inline long __syscall0(long n)
  4. {
  5. register long r0 __asm__("r0") = n;
  6. register long r3 __asm__("r3");
  7. __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
  8. : "+r"(r0), "=r"(r3)
  9. :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
  10. return r3;
  11. }
  12. static inline long __syscall1(long n, long a)
  13. {
  14. register long r0 __asm__("r0") = n;
  15. register long r3 __asm__("r3") = a;
  16. __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
  17. : "+r"(r0), "+r"(r3)
  18. :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
  19. return r3;
  20. }
  21. static inline long __syscall2(long n, long a, long b)
  22. {
  23. register long r0 __asm__("r0") = n;
  24. register long r3 __asm__("r3") = a;
  25. register long r4 __asm__("r4") = b;
  26. __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
  27. : "+r"(r0), "+r"(r3), "+r"(r4)
  28. :: "memory", "cr0", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
  29. return r3;
  30. }
  31. static inline long __syscall3(long n, long a, long b, long c)
  32. {
  33. register long r0 __asm__("r0") = n;
  34. register long r3 __asm__("r3") = a;
  35. register long r4 __asm__("r4") = b;
  36. register long r5 __asm__("r5") = c;
  37. __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
  38. : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5)
  39. :: "memory", "cr0", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
  40. return r3;
  41. }
  42. static inline long __syscall4(long n, long a, long b, long c, long d)
  43. {
  44. register long r0 __asm__("r0") = n;
  45. register long r3 __asm__("r3") = a;
  46. register long r4 __asm__("r4") = b;
  47. register long r5 __asm__("r5") = c;
  48. register long r6 __asm__("r6") = d;
  49. __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
  50. : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6)
  51. :: "memory", "cr0", "r7", "r8", "r9", "r10", "r11", "r12");
  52. return r3;
  53. }
  54. static inline long __syscall5(long n, long a, long b, long c, long d, long e)
  55. {
  56. register long r0 __asm__("r0") = n;
  57. register long r3 __asm__("r3") = a;
  58. register long r4 __asm__("r4") = b;
  59. register long r5 __asm__("r5") = c;
  60. register long r6 __asm__("r6") = d;
  61. register long r7 __asm__("r7") = e;
  62. __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
  63. : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7)
  64. :: "memory", "cr0", "r8", "r9", "r10", "r11", "r12");
  65. return r3;
  66. }
  67. static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
  68. {
  69. register long r0 __asm__("r0") = n;
  70. register long r3 __asm__("r3") = a;
  71. register long r4 __asm__("r4") = b;
  72. register long r5 __asm__("r5") = c;
  73. register long r6 __asm__("r6") = d;
  74. register long r7 __asm__("r7") = e;
  75. register long r8 __asm__("r8") = f;
  76. __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
  77. : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7), "+r"(r8)
  78. :: "memory", "cr0", "r9", "r10", "r11", "r12");
  79. return r3;
  80. }
  81. #define SO_RCVTIMEO_OLD 18
  82. #define SO_SNDTIMEO_OLD 19
  83. #define VDSO_USEFUL
  84. #define VDSO_CGT_SYM "__kernel_clock_gettime"
  85. #define VDSO_CGT_VER "LINUX_2.6.15"