recipes: Start mass upgrade
[dragora.git] / patches / libaio / 0007-Add-SH-support.patch
blob45a837d9c60a5061a6b6328a6fed9ba3c10b7c99
1 From 29782e82f83ed000edecc56ac77285864ec2672b Mon Sep 17 00:00:00 2001
2 From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 Date: Sun, 12 Apr 2020 03:30:41 +0200
4 Subject: [PATCH libaio 07/11] Add SH support
6 Signed-off-by: Guillem Jover <guillem@hadrons.org>
7 ---
8 harness/main.c | 2 +-
9 src/libaio.h | 3 ++-
10 src/syscall-sh.h | 6 ++++++
11 src/syscall.h | 2 ++
12 4 files changed, 11 insertions(+), 2 deletions(-)
13 create mode 100644 src/syscall-sh.h
15 diff --git a/harness/main.c b/harness/main.c
16 index 99d393f..ac0fba2 100644
17 --- a/harness/main.c
18 +++ b/harness/main.c
19 @@ -14,7 +14,7 @@
20 #if __LP64__ == 0
21 #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
22 #define KERNEL_RW_POINTER ((void *)0xc0010000)
23 -#elif defined(__arm__) || defined(__m68k__) || defined(__s390__)
24 +#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
25 #define KERNEL_RW_POINTER ((void *)0x00010000)
26 #elif defined(__hppa__)
27 #define KERNEL_RW_POINTER ((void *)0x10100000)
28 diff --git a/src/libaio.h b/src/libaio.h
29 index 29005d0..c748454 100644
30 --- a/src/libaio.h
31 +++ b/src/libaio.h
32 @@ -52,7 +52,7 @@ typedef enum io_iocb_cmd {
34 /* little endian, 32 bits */
35 #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
36 - defined(__sh__) || \
37 + (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
38 defined(__bfin__) || \
39 (defined(__MIPSEL__) && !defined(__mips64)) || \
40 defined(__cris__) || (defined(__riscv) && __riscv_xlen == 32) || \
41 @@ -88,6 +88,7 @@ typedef enum io_iocb_cmd {
42 /* big endian, 32 bits */
43 #elif defined(__PPC__) || defined(__s390__) || \
44 (defined(__arm__) && defined(__ARMEB__)) || \
45 + (defined(__sh__) && defined (__BIG_ENDIAN__)) || \
46 defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
47 defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \
48 (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
49 diff --git a/src/syscall-sh.h b/src/syscall-sh.h
50 new file mode 100644
51 index 0000000..6c00573
52 --- /dev/null
53 +++ b/src/syscall-sh.h
54 @@ -0,0 +1,6 @@
55 +/* Copy from ./arch/sh/include/asm/unistd_32.h */
56 +#define __NR_io_setup 245
57 +#define __NR_io_destroy 246
58 +#define __NR_io_getevents 247
59 +#define __NR_io_submit 248
60 +#define __NR_io_cancel 249
61 diff --git a/src/syscall.h b/src/syscall.h
62 index a88876f..b86d745 100644
63 --- a/src/syscall.h
64 +++ b/src/syscall.h
65 @@ -33,6 +33,8 @@
66 #include "syscall-parisc.h"
67 #elif defined(__mips__)
68 #include "syscall-mips.h"
69 +#elif defined(__sh__)
70 +#include "syscall-sh.h"
71 #elif defined(__aarch64__) || defined(__riscv)
72 #include "syscall-generic.h"
73 #else
74 --
75 2.26.0.292.g33ef6b2f38