blob: 569c9a1dabbd0bdc89deb1f46eb552c85d56634e [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001Description: Add/fix support for m68k, mips, paris, sparc
2Author: Guillem Jover <guillem@debian.org>
3Origin: vendor
4Forwarded: no
5Last-Update: 2014-10-09
6
7
8---
9 harness/main.c | 10 +++++++++
10 src/libaio.h | 1
11 src/syscall-m68k.h | 5 ++++
12 src/syscall-mips.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
13 src/syscall-parisc.h | 6 +++++
14 src/syscall.h | 6 +++++
15 6 files changed, 82 insertions(+)
16
17--- /dev/null
18+++ b/src/syscall-m68k.h
19@@ -0,0 +1,5 @@
20+#define __NR_io_setup 241
21+#define __NR_io_destroy 242
22+#define __NR_io_getevents 243
23+#define __NR_io_submit 244
24+#define __NR_io_cancel 245
25--- a/src/syscall.h
26+++ b/src/syscall.h
27@@ -27,6 +27,12 @@
28 #include "syscall-arm.h"
29 #elif defined(__sparc__)
30 #include "syscall-sparc.h"
31+#elif defined(__m68k__)
32+#include "syscall-m68k.h"
33+#elif defined(__hppa__)
34+#include "syscall-parisc.h"
35+#elif defined(__mips__)
36+#include "syscall-mips.h"
37 #elif defined(__aarch64__) || defined(__loongarch__) || defined(__riscv)
38 #include "syscall-generic.h"
39 #else
40--- /dev/null
41+++ b/src/syscall-mips.h
42@@ -0,0 +1,54 @@
43+/*
44+ * This file is subject to the terms and conditions of the GNU General Public
45+ * License. See the file "COPYING" in the main directory of this archive
46+ * for more details.
47+ *
48+ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
49+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
50+ */
51+
52+#ifndef _MIPS_SIM_ABI32
53+#define _MIPS_SIM_ABI32 1
54+#define _MIPS_SIM_NABI32 2
55+#define _MIPS_SIM_ABI64 3
56+#endif
57+
58+#if _MIPS_SIM == _MIPS_SIM_ABI32
59+
60+/*
61+ * Linux o32 style syscalls are in the range from 4000 to 4999.
62+ */
63+#define __NR_Linux 4000
64+#define __NR_io_setup (__NR_Linux + 241)
65+#define __NR_io_destroy (__NR_Linux + 242)
66+#define __NR_io_getevents (__NR_Linux + 243)
67+#define __NR_io_submit (__NR_Linux + 244)
68+#define __NR_io_cancel (__NR_Linux + 245)
69+
70+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
71+
72+#if _MIPS_SIM == _MIPS_SIM_ABI64
73+
74+/*
75+ * Linux 64-bit syscalls are in the range from 5000 to 5999.
76+ */
77+#define __NR_Linux 5000
78+#define __NR_io_setup (__NR_Linux + 200)
79+#define __NR_io_destroy (__NR_Linux + 201)
80+#define __NR_io_getevents (__NR_Linux + 202)
81+#define __NR_io_submit (__NR_Linux + 203)
82+#define __NR_io_cancel (__NR_Linux + 204)
83+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
84+
85+#if _MIPS_SIM == _MIPS_SIM_NABI32
86+
87+/*
88+ * Linux N32 syscalls are in the range from 6000 to 6999.
89+ */
90+#define __NR_Linux 6000
91+#define __NR_io_setup (__NR_Linux + 200)
92+#define __NR_io_destroy (__NR_Linux + 201)
93+#define __NR_io_getevents (__NR_Linux + 202)
94+#define __NR_io_submit (__NR_Linux + 203)
95+#define __NR_io_cancel (__NR_Linux + 204)
96+#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
97--- a/src/libaio.h
98+++ b/src/libaio.h
99@@ -74,6 +74,7 @@ typedef enum io_iocb_cmd {
100
101 /* big endian, 64 bits */
102 #elif defined(__powerpc64__) || defined(__s390x__) || \
103+ (defined(__hppa__) && defined(__arch64__)) || \
104 (defined(__sparc__) && defined(__arch64__)) || \
105 (defined(__aarch64__) && defined(__AARCH64EB__)) || \
106 (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
107--- /dev/null
108+++ b/src/syscall-parisc.h
109@@ -0,0 +1,6 @@
110+#define __NR_Linux 0
111+#define __NR_io_setup (__NR_Linux + 215)
112+#define __NR_io_destroy (__NR_Linux + 216)
113+#define __NR_io_getevents (__NR_Linux + 217)
114+#define __NR_io_submit (__NR_Linux + 218)
115+#define __NR_io_cancel (__NR_Linux + 219)
116--- a/harness/main.c
117+++ b/harness/main.c
118@@ -12,7 +12,17 @@
119 #include <libaio.h>
120
121 #if __LP64__ == 0
122+#if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
123 #define KERNEL_RW_POINTER ((void *)0xc0010000)
124+#elif defined(__arm__) || defined(__m68k__) || defined(__s390__)
125+#define KERNEL_RW_POINTER ((void *)0x00010000)
126+#elif defined(__hppa__)
127+#define KERNEL_RW_POINTER ((void *)0x10100000)
128+#elif defined(__sparc__)
129+#define KERNEL_RW_POINTER ((void *)0xf0010000)
130+#else
131+#error Unknown kernel memory address.
132+#endif
133 #else
134 //#warning Not really sure where kernel memory is. Guessing.
135 #define KERNEL_RW_POINTER ((void *)0xffffffff81000000)