[PATCH libaio 08/11] Add x32 support
authorGuillem Jover <guillem@hadrons.org>
Sun, 12 Apr 2020 01:36:39 +0000 (03:36 +0200)
committerPeter Michael Green <plugwash@raspbian.org>
Mon, 15 Nov 2021 00:13:31 +0000 (00:13 +0000)
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0008-Add-x32-support.patch

harness/main.c
src/libaio.h
src/syscall-x86_64.h

index ac0fba2593cd296d657cc4ec4893478a114a1be6..db42a1855a38294e7742f26446399430d2138c23 100644 (file)
@@ -14,7 +14,7 @@
 #if __LP64__ == 0
 #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
 #define KERNEL_RW_POINTER      ((void *)0xc0010000)
-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
+#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__)
 #define KERNEL_RW_POINTER      ((void *)0x00010000)
 #elif defined(__hppa__)
 #define KERNEL_RW_POINTER      ((void *)0x10100000)
index c748454df7c81da9ab223689dc86ecad4f004ba8..9695a53700c1fcbf0860cccc145bd2bfe7c9ce7c 100644 (file)
@@ -51,7 +51,9 @@ typedef enum io_iocb_cmd {
 } io_iocb_cmd_t;
 
 /* little endian, 32 bits */
-#if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
+#if defined(__i386__) || \
+    (defined(__x86_64__) && defined(__ILP32__)) || \
+    (defined(__arm__) && !defined(__ARMEB__)) || \
     (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
     defined(__bfin__) || \
     (defined(__MIPSEL__) && !defined(__mips64)) || \
index 0eccef342e2a47b2a0849079a86ed521681db3de..6a44d538adb3f3ba41635f5d1931b210eb55f273 100644 (file)
@@ -1,6 +1,16 @@
+#if __ILP32__
+#define __X32_SYSCALL_BIT      0x40000000UL
+#define __NR_io_setup          (__X32_SYSCALL_BIT + 543)
+#define __NR_io_destroy                (__X32_SYSCALL_BIT + 207)
+#define __NR_io_submit         (__X32_SYSCALL_BIT + 544)
+#define __NR_io_cancel         (__X32_SYSCALL_BIT + 210)
+#define __NR_io_getevents      (__X32_SYSCALL_BIT + 208)
+#define __NR_io_pgetevents     (__X32_SYSCALL_BIT + 333)
+#else
 #define __NR_io_setup          206
 #define __NR_io_destroy                207
 #define __NR_io_getevents      208
 #define __NR_io_submit         209
 #define __NR_io_cancel         210
 #define __NR_io_pgetevents     333
+#endif