[PATCH libaio 13/16] Add SH support
authorNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Sun, 12 Apr 2020 01:30:41 +0000 (03:30 +0200)
committerGuillem Jover <guillem@debian.org>
Sun, 6 Aug 2023 19:12:34 +0000 (20:12 +0100)
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0013-Add-SH-support.patch

harness/main.c
src/libaio.h
src/syscall-sh.h [new file with mode: 0644]
src/syscall.h

index 99d393f606b2f1e386064276c3d62bf7a0b9b27b..ac0fba2593cd296d657cc4ec4893478a114a1be6 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__)
+#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
 #define KERNEL_RW_POINTER      ((void *)0x00010000)
 #elif defined(__hppa__)
 #define KERNEL_RW_POINTER      ((void *)0x10100000)
index af02ec020f3ce3682248978755274d0131ec4593..2dbb6bb8c290910cdb4d377f102d0215c0b86f89 100644 (file)
@@ -52,7 +52,7 @@ typedef enum io_iocb_cmd {
 
 /* little endian, 32 bits */
 #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
-    defined(__sh__) || \
+    (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
     defined(__bfin__) || \
     (defined(__MIPSEL__) && !defined(__mips64)) || \
     defined(__cris__) || defined(__loongarch32) || \
@@ -90,6 +90,7 @@ typedef enum io_iocb_cmd {
 /* big endian, 32 bits */
 #elif defined(__PPC__) || defined(__s390__) || \
       (defined(__arm__) && defined(__ARMEB__)) || \
+      (defined(__sh__) && defined (__BIG_ENDIAN__)) || \
       defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
       defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \
       (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
diff --git a/src/syscall-sh.h b/src/syscall-sh.h
new file mode 100644 (file)
index 0000000..6c00573
--- /dev/null
@@ -0,0 +1,6 @@
+/* Copy from ./arch/sh/include/asm/unistd_32.h */
+#define __NR_io_setup       245
+#define __NR_io_destroy     246
+#define __NR_io_getevents   247
+#define __NR_io_submit      248
+#define __NR_io_cancel      249
index e3825dfdfb5c86373b79a7a2a4c5c80ba09bdf5c..57dd1fa24772b851f19019218b8364f18a7ddd96 100644 (file)
@@ -46,6 +46,8 @@
 #include "syscall-parisc.h"
 #elif defined(__mips__)
 #include "syscall-mips.h"
+#elif defined(__sh__)
+#include "syscall-sh.h"
 #elif defined(__aarch64__) || defined(__loongarch__) || defined(__riscv)
 #include "syscall-generic.h"
 #else