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
6 Signed-off-by: Guillem Jover <guillem@hadrons.org>
10 src/syscall-x86_64.h | 10 ++++++++++
11 3 files changed, 14 insertions(+), 2 deletions(-)
13 diff --git a/harness/main.c b/harness/main.c
14 index ac0fba2..db42a18 100644
19 #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
20 #define KERNEL_RW_POINTER ((void *)0xc0010000)
21 -#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
22 +#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__)
23 #define KERNEL_RW_POINTER ((void *)0x00010000)
24 #elif defined(__hppa__)
25 #define KERNEL_RW_POINTER ((void *)0x10100000)
26 diff --git a/src/libaio.h b/src/libaio.h
27 index c748454..9695a53 100644
30 @@ -51,7 +51,9 @@ typedef enum io_iocb_cmd {
33 /* little endian, 32 bits */
34 -#if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
35 +#if defined(__i386__) || \
36 + (defined(__x86_64__) && defined(__ILP32__)) || \
37 + (defined(__arm__) && !defined(__ARMEB__)) || \
38 (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
39 defined(__bfin__) || \
40 (defined(__MIPSEL__) && !defined(__mips64)) || \
41 diff --git a/src/syscall-x86_64.h b/src/syscall-x86_64.h
42 index 0eccef3..6a44d53 100644
43 --- a/src/syscall-x86_64.h
44 +++ b/src/syscall-x86_64.h
47 +#define __X32_SYSCALL_BIT 0x40000000UL
48 +#define __NR_io_setup (__X32_SYSCALL_BIT + 543)
49 +#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
50 +#define __NR_io_submit (__X32_SYSCALL_BIT + 544)
51 +#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
52 +#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
53 +#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)
55 #define __NR_io_setup 206
56 #define __NR_io_destroy 207
57 #define __NR_io_getevents 208
58 #define __NR_io_submit 209
59 #define __NR_io_cancel 210
60 #define __NR_io_pgetevents 333
63 2.26.0.292.g33ef6b2f38