0008-Add-x32-support.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. From 15e2be45860c5f7bac4beed0551ec8257e863d7e Mon Sep 17 00:00:00 2001
  2. From: Guillem Jover <guillem@hadrons.org>
  3. Date: Sun, 12 Apr 2020 03:36:39 +0200
  4. Subject: [PATCH libaio 08/11] Add x32 support
  5. Signed-off-by: Guillem Jover <guillem@hadrons.org>
  6. ---
  7. harness/main.c | 2 +-
  8. src/libaio.h | 4 +++-
  9. src/syscall-x86_64.h | 10 ++++++++++
  10. 3 files changed, 14 insertions(+), 2 deletions(-)
  11. diff --git a/harness/main.c b/harness/main.c
  12. index ac0fba2..db42a18 100644
  13. --- a/harness/main.c
  14. +++ b/harness/main.c
  15. @@ -14,7 +14,7 @@
  16. #if __LP64__ == 0
  17. #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
  18. #define KERNEL_RW_POINTER ((void *)0xc0010000)
  19. -#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
  20. +#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__)
  21. #define KERNEL_RW_POINTER ((void *)0x00010000)
  22. #elif defined(__hppa__)
  23. #define KERNEL_RW_POINTER ((void *)0x10100000)
  24. diff --git a/src/libaio.h b/src/libaio.h
  25. index c748454..9695a53 100644
  26. --- a/src/libaio.h
  27. +++ b/src/libaio.h
  28. @@ -51,7 +51,9 @@ typedef enum io_iocb_cmd {
  29. } io_iocb_cmd_t;
  30. /* little endian, 32 bits */
  31. -#if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
  32. +#if defined(__i386__) || \
  33. + (defined(__x86_64__) && defined(__ILP32__)) || \
  34. + (defined(__arm__) && !defined(__ARMEB__)) || \
  35. (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
  36. defined(__bfin__) || \
  37. (defined(__MIPSEL__) && !defined(__mips64)) || \
  38. diff --git a/src/syscall-x86_64.h b/src/syscall-x86_64.h
  39. index 0eccef3..6a44d53 100644
  40. --- a/src/syscall-x86_64.h
  41. +++ b/src/syscall-x86_64.h
  42. @@ -1,6 +1,16 @@
  43. +#if __ILP32__
  44. +#define __X32_SYSCALL_BIT 0x40000000UL
  45. +#define __NR_io_setup (__X32_SYSCALL_BIT + 543)
  46. +#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
  47. +#define __NR_io_submit (__X32_SYSCALL_BIT + 544)
  48. +#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
  49. +#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
  50. +#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)
  51. +#else
  52. #define __NR_io_setup 206
  53. #define __NR_io_destroy 207
  54. #define __NR_io_getevents 208
  55. #define __NR_io_submit 209
  56. #define __NR_io_cancel 210
  57. #define __NR_io_pgetevents 333
  58. +#endif
  59. --
  60. 2.26.0.292.g33ef6b2f38