1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
From dad807a71fdc9af5e26fa45b9f0e338fe517c1d3 Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Date: Sun, 12 Apr 2020 03:30:41 +0200
Subject: [PATCH libaio 18/26] Add SH support
Signed-off-by: Guillem Jover <guillem@hadrons.org>
---
harness/main.c | 2 +-
src/libaio.h | 3 ++-
src/syscall-sh.h | 6 ++++++
src/syscall.h | 2 ++
4 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 src/syscall-sh.h
diff --git a/harness/main.c b/harness/main.c
index 99d393f..ac0fba2 100644
--- a/harness/main.c
+++ b/harness/main.c
@@ -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)
diff --git a/src/libaio.h b/src/libaio.h
index 684bc7e..474dbd6 100644
--- a/src/libaio.h
+++ b/src/libaio.h
@@ -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
index 0000000..6c00573
--- /dev/null
+++ b/src/syscall-sh.h
@@ -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
diff --git a/src/syscall.h b/src/syscall.h
index e3825df..57dd1fa 100644
--- a/src/syscall.h
+++ b/src/syscall.h
@@ -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
--
2.43.0
|