004_arches_x32.patch 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Index: libaio-0.3.109/src/syscall-x86_64.h
  2. ===================================================================
  3. --- libaio-0.3.109.orig/src/syscall-x86_64.h 2009-10-09 11:17:02.000000000 -0700
  4. +++ libaio-0.3.109/src/syscall-x86_64.h 2013-03-03 07:15:13.000000000 -0800
  5. @@ -1,8 +1,18 @@
  6. +#ifndef __NR_io_setup
  7. #define __NR_io_setup 206
  8. +#endif
  9. +#ifndef __NR_io_destroy
  10. #define __NR_io_destroy 207
  11. +#endif
  12. +#ifndef __NR_io_getevents
  13. #define __NR_io_getevents 208
  14. +#endif
  15. +#ifndef __NR_io_submit
  16. #define __NR_io_submit 209
  17. +#endif
  18. +#ifndef __NR_io_cancel
  19. #define __NR_io_cancel 210
  20. +#endif
  21. #define __syscall_clobber "r11","rcx","memory"
  22. #define __syscall "syscall"
  23. @@ -42,10 +52,11 @@
  24. type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
  25. { \
  26. long __res; \
  27. -__asm__ volatile ("movq %5,%%r10 ;" __syscall \
  28. +register long __a4 asm ("r10") = (long) arg4; \
  29. +__asm__ volatile (__syscall \
  30. : "=a" (__res) \
  31. : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
  32. - "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
  33. + "d" ((long)(arg3)),"r" (__a4)); \
  34. return __res; \
  35. }
  36. @@ -54,10 +65,11 @@
  37. type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
  38. { \
  39. long __res; \
  40. -__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \
  41. +register long __a4 asm ("r10") = (long) arg4; \
  42. +register long __a5 asm ("r8") = (long) arg5; \
  43. +__asm__ volatile (__syscall \
  44. : "=a" (__res) \
  45. : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
  46. - "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \
  47. - __syscall_clobber,"r8","r10" ); \
  48. + "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
  49. return __res; \
  50. }
  51. Index: libaio-0.3.109/harness/main.c
  52. ===================================================================
  53. --- libaio-0.3.109.orig/harness/main.c 2013-03-03 06:58:51.000000000 -0800
  54. +++ libaio-0.3.109/harness/main.c 2013-03-03 07:23:40.000000000 -0800
  55. @@ -14,7 +14,7 @@
  56. #if __LP64__ == 0
  57. #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
  58. #define KERNEL_RW_POINTER ((void *)0xc0010000)
  59. -#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
  60. +#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__)
  61. #define KERNEL_RW_POINTER ((void *)0x00010000)
  62. #elif defined(__hppa__)
  63. #define KERNEL_RW_POINTER ((void *)0x10100000)