Selaa lähdekoodia

libaio: update to 0.3.110, bump copyright, add license

Signed-off-by: Steven Barth <steven@midlink.org>
Steven Barth 10 vuotta sitten
vanhempi
commit
ad60b567be

+ 4
- 3
libs/libaio/Makefile Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 #
2
-# Copyright (C) 2007-2010 OpenWrt.org
2
+# Copyright (C) 2007-2014 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -8,13 +8,14 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=libaio
11
-PKG_VERSION:=0.3.109
11
+PKG_VERSION:=0.3.110
12 12
 PKG_RELEASE:=1
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
15 15
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libaio/
16
-PKG_MD5SUM:=435a5b16ca6198eaf01155263d855756
16
+PKG_MD5SUM:=2a35602e43778383e2f4907a4ca39ab8
17 17
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
18
+PKG_LICENSE:=LGPL-2.1
18 19
 
19 20
 PKG_USE_MIPS16:=0
20 21
 

+ 0
- 1098
libs/libaio/patches/001-arches_from_debian_package_0.3.109-4.patch
File diff suppressed because it is too large
Näytä tiedosto


+ 566
- 0
libs/libaio/patches/001_arches.patch Näytä tiedosto

@@ -0,0 +1,566 @@
1
+---
2
+ harness/main.c       |   10 ++
3
+ src/libaio.h         |    1 
4
+ src/syscall-m68k.h   |   78 +++++++++++++++++
5
+ src/syscall-mips.h   |  223 +++++++++++++++++++++++++++++++++++++++++++++++++++
6
+ src/syscall-parisc.h |  146 +++++++++++++++++++++++++++++++++
7
+ src/syscall-sparc.h  |   20 +++-
8
+ src/syscall.h        |    6 +
9
+ 7 files changed, 479 insertions(+), 5 deletions(-)
10
+
11
+--- /dev/null
12
++++ b/src/syscall-m68k.h
13
+@@ -0,0 +1,78 @@
14
++#define __NR_io_setup		241
15
++#define __NR_io_destroy		242
16
++#define __NR_io_getevents	243
17
++#define __NR_io_submit		244
18
++#define __NR_io_cancel		245
19
++
20
++#define io_syscall1(type,fname,sname,atype,a) \
21
++type fname(atype a) \
22
++{ \
23
++register long __res __asm__ ("%d0") = __NR_##sname; \
24
++register long __a __asm__ ("%d1") = (long)(a); \
25
++__asm__ __volatile__ ("trap  #0" \
26
++		      : "+d" (__res) \
27
++		      : "d" (__a)  ); \
28
++return (type) __res; \
29
++}
30
++
31
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
32
++type fname(atype a,btype b) \
33
++{ \
34
++register long __res __asm__ ("%d0") = __NR_##sname; \
35
++register long __a __asm__ ("%d1") = (long)(a); \
36
++register long __b __asm__ ("%d2") = (long)(b); \
37
++__asm__ __volatile__ ("trap  #0" \
38
++		      : "+d" (__res) \
39
++		      : "d" (__a), "d" (__b) \
40
++		     ); \
41
++return (type) __res; \
42
++}
43
++
44
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
45
++type fname(atype a,btype b,ctype c) \
46
++{ \
47
++register long __res __asm__ ("%d0") = __NR_##sname; \
48
++register long __a __asm__ ("%d1") = (long)(a); \
49
++register long __b __asm__ ("%d2") = (long)(b); \
50
++register long __c __asm__ ("%d3") = (long)(c); \
51
++__asm__ __volatile__ ("trap  #0" \
52
++		      : "+d" (__res) \
53
++		      : "d" (__a), "d" (__b), \
54
++			"d" (__c) \
55
++		     ); \
56
++return (type) __res; \
57
++}
58
++
59
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
60
++type fname (atype a, btype b, ctype c, dtype d) \
61
++{ \
62
++register long __res __asm__ ("%d0") = __NR_##sname; \
63
++register long __a __asm__ ("%d1") = (long)(a); \
64
++register long __b __asm__ ("%d2") = (long)(b); \
65
++register long __c __asm__ ("%d3") = (long)(c); \
66
++register long __d __asm__ ("%d4") = (long)(d); \
67
++__asm__ __volatile__ ("trap  #0" \
68
++		      : "+d" (__res) \
69
++		      : "d" (__a), "d" (__b), \
70
++			"d" (__c), "d" (__d)  \
71
++		     ); \
72
++return (type) __res; \
73
++}
74
++
75
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
76
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
77
++{ \
78
++register long __res __asm__ ("%d0") = __NR_##sname; \
79
++register long __a __asm__ ("%d1") = (long)(a); \
80
++register long __b __asm__ ("%d2") = (long)(b); \
81
++register long __c __asm__ ("%d3") = (long)(c); \
82
++register long __d __asm__ ("%d4") = (long)(d); \
83
++register long __e __asm__ ("%d5") = (long)(e); \
84
++__asm__ __volatile__ ("trap  #0" \
85
++		      : "+d" (__res) \
86
++		      : "d" (__a), "d" (__b), \
87
++			"d" (__c), "d" (__d), "d" (__e)  \
88
++		     ); \
89
++return (type) __res; \
90
++}
91
++
92
+--- a/src/syscall.h
93
++++ b/src/syscall.h
94
+@@ -28,6 +28,12 @@
95
+ #include "syscall-sparc.h"
96
+ #elif defined(__aarch64__)
97
+ #include "syscall-arm64.h"
98
++#elif defined(__m68k__)
99
++#include "syscall-m68k.h"
100
++#elif defined(__hppa__)
101
++#include "syscall-parisc.h"
102
++#elif defined(__mips__)
103
++#include "syscall-mips.h"
104
+ #else
105
+ #warning "using generic syscall method"
106
+ #include "syscall-generic.h"
107
+--- /dev/null
108
++++ b/src/syscall-mips.h
109
+@@ -0,0 +1,223 @@
110
++/*
111
++ * This file is subject to the terms and conditions of the GNU General Public
112
++ * License.  See the file "COPYING" in the main directory of this archive
113
++ * for more details.
114
++ *
115
++ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
116
++ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
117
++ *
118
++ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
119
++ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
120
++ */
121
++
122
++#ifndef _MIPS_SIM_ABI32
123
++#define _MIPS_SIM_ABI32			1
124
++#define _MIPS_SIM_NABI32		2
125
++#define _MIPS_SIM_ABI64			3
126
++#endif
127
++
128
++#if _MIPS_SIM == _MIPS_SIM_ABI32
129
++
130
++/*
131
++ * Linux o32 style syscalls are in the range from 4000 to 4999.
132
++ */
133
++#define __NR_Linux			4000
134
++#define __NR_io_setup			(__NR_Linux + 241)
135
++#define __NR_io_destroy			(__NR_Linux + 242)
136
++#define __NR_io_getevents		(__NR_Linux + 243)
137
++#define __NR_io_submit			(__NR_Linux + 244)
138
++#define __NR_io_cancel			(__NR_Linux + 245)
139
++
140
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
141
++
142
++#if _MIPS_SIM == _MIPS_SIM_ABI64
143
++
144
++/*
145
++ * Linux 64-bit syscalls are in the range from 5000 to 5999.
146
++ */
147
++#define __NR_Linux			5000
148
++#define __NR_io_setup			(__NR_Linux + 200)
149
++#define __NR_io_destroy			(__NR_Linux + 201)
150
++#define __NR_io_getevents		(__NR_Linux + 202)
151
++#define __NR_io_submit			(__NR_Linux + 203)
152
++#define __NR_io_cancel			(__NR_Linux + 204)
153
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
154
++
155
++#if _MIPS_SIM == _MIPS_SIM_NABI32
156
++
157
++/*
158
++ * Linux N32 syscalls are in the range from 6000 to 6999.
159
++ */
160
++#define __NR_Linux			6000
161
++#define __NR_io_setup			(__NR_Linux + 200)
162
++#define __NR_io_destroy			(__NR_Linux + 201)
163
++#define __NR_io_getevents		(__NR_Linux + 202)
164
++#define __NR_io_submit			(__NR_Linux + 203)
165
++#define __NR_io_cancel			(__NR_Linux + 204)
166
++#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
167
++
168
++#define io_syscall1(type,fname,sname,atype,a) \
169
++type fname(atype a) \
170
++{ \
171
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
172
++	register unsigned long __a3 asm("$7"); \
173
++	unsigned long __v0; \
174
++	\
175
++	__asm__ volatile ( \
176
++	".set\tnoreorder\n\t" \
177
++	"li\t$2, %3\t\t\t# " #fname "\n\t" \
178
++	"syscall\n\t" \
179
++	"move\t%0, $2\n\t" \
180
++	".set\treorder" \
181
++	: "=&r" (__v0), "=r" (__a3) \
182
++	: "r" (__a0), "i" (__NR_##sname) \
183
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
184
++	  "memory"); \
185
++	\
186
++	if (__a3 == 0) \
187
++		return (type) __v0; \
188
++	return (type) -1; \
189
++}
190
++
191
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
192
++type fname(atype a, btype b) \
193
++{ \
194
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
195
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
196
++	register unsigned long __a3 asm("$7"); \
197
++	unsigned long __v0; \
198
++	\
199
++	__asm__ volatile ( \
200
++	".set\tnoreorder\n\t" \
201
++	"li\t$2, %4\t\t\t# " #fname "\n\t" \
202
++	"syscall\n\t" \
203
++	"move\t%0, $2\n\t" \
204
++	".set\treorder" \
205
++	: "=&r" (__v0), "=r" (__a3) \
206
++	: "r" (__a0), "r" (__a1), "i" (__NR_##sname) \
207
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
208
++	  "memory"); \
209
++	\
210
++	if (__a3 == 0) \
211
++		return (type) __v0; \
212
++	return (type) -1; \
213
++}
214
++
215
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
216
++type fname(atype a, btype b, ctype c) \
217
++{ \
218
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
219
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
220
++	register unsigned long __a2 asm("$6") = (unsigned long) c; \
221
++	register unsigned long __a3 asm("$7"); \
222
++	unsigned long __v0; \
223
++	\
224
++	__asm__ volatile ( \
225
++	".set\tnoreorder\n\t" \
226
++	"li\t$2, %5\t\t\t# " #fname "\n\t" \
227
++	"syscall\n\t" \
228
++	"move\t%0, $2\n\t" \
229
++	".set\treorder" \
230
++	: "=&r" (__v0), "=r" (__a3) \
231
++	: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
232
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
233
++	  "memory"); \
234
++	\
235
++	if (__a3 == 0) \
236
++		return (type) __v0; \
237
++	return (type) -1; \
238
++}
239
++
240
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
241
++type fname(atype a, btype b, ctype c, dtype d) \
242
++{ \
243
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
244
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
245
++	register unsigned long __a2 asm("$6") = (unsigned long) c; \
246
++	register unsigned long __a3 asm("$7") = (unsigned long) d; \
247
++	unsigned long __v0; \
248
++	\
249
++	__asm__ volatile ( \
250
++	".set\tnoreorder\n\t" \
251
++	"li\t$2, %5\t\t\t# " #fname "\n\t" \
252
++	"syscall\n\t" \
253
++	"move\t%0, $2\n\t" \
254
++	".set\treorder" \
255
++	: "=&r" (__v0), "+r" (__a3) \
256
++	: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
257
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
258
++	  "memory"); \
259
++	\
260
++	if (__a3 == 0) \
261
++		return (type) __v0; \
262
++	return (type) -1; \
263
++}
264
++
265
++#if (_MIPS_SIM == _MIPS_SIM_ABI32)
266
++
267
++/*
268
++ * Using those means your brain needs more than an oil change ;-)
269
++ */
270
++
271
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
272
++type fname(atype a, btype b, ctype c, dtype d, etype e) \
273
++{ \
274
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
275
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
276
++	register unsigned long __a2 asm("$6") = (unsigned long) c; \
277
++	register unsigned long __a3 asm("$7") = (unsigned long) d; \
278
++	unsigned long __v0; \
279
++	\
280
++	__asm__ volatile ( \
281
++	".set\tnoreorder\n\t" \
282
++	"lw\t$2, %6\n\t" \
283
++	"subu\t$29, 32\n\t" \
284
++	"sw\t$2, 16($29)\n\t" \
285
++	"li\t$2, %5\t\t\t# " #fname "\n\t" \
286
++	"syscall\n\t" \
287
++	"move\t%0, $2\n\t" \
288
++	"addiu\t$29, 32\n\t" \
289
++	".set\treorder" \
290
++	: "=&r" (__v0), "+r" (__a3) \
291
++	: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \
292
++	  "m" ((unsigned long)e) \
293
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
294
++	  "memory"); \
295
++	\
296
++	if (__a3 == 0) \
297
++		return (type) __v0; \
298
++	return (type) -1; \
299
++}
300
++
301
++#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
302
++
303
++#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
304
++
305
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
306
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
307
++{ \
308
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
309
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
310
++	register unsigned long __a2 asm("$6") = (unsigned long) c; \
311
++	register unsigned long __a3 asm("$7") = (unsigned long) d; \
312
++	register unsigned long __a4 asm("$8") = (unsigned long) e; \
313
++	unsigned long __v0; \
314
++	\
315
++	__asm__ volatile ( \
316
++	".set\tnoreorder\n\t" \
317
++	"li\t$2, %6\t\t\t# " #fname "\n\t" \
318
++	"syscall\n\t" \
319
++	"move\t%0, $2\n\t" \
320
++	".set\treorder" \
321
++	: "=&r" (__v0), "+r" (__a3) \
322
++	: "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \
323
++	: "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
324
++	  "memory"); \
325
++	\
326
++	if (__a3 == 0) \
327
++		return (type) __v0; \
328
++	return (type) -1; \
329
++}
330
++
331
++#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
332
++
333
+--- a/src/libaio.h
334
++++ b/src/libaio.h
335
+@@ -66,6 +66,7 @@ typedef enum io_iocb_cmd {
336
+ 
337
+ /* big endian, 64 bits */
338
+ #elif defined(__powerpc64__) || defined(__s390x__) || \
339
++      (defined(__hppa__) && defined(__arch64__)) || \
340
+       (defined(__sparc__) && defined(__arch64__)) || \
341
+       (defined(__aarch64__) && defined(__AARCH64EB__))
342
+ #define PADDED(x, y)	unsigned y; x
343
+--- /dev/null
344
++++ b/src/syscall-parisc.h
345
+@@ -0,0 +1,146 @@
346
++/*
347
++ * Linux system call numbers.
348
++ *
349
++ * Cary Coutant says that we should just use another syscall gateway
350
++ * page to avoid clashing with the HPUX space, and I think he's right:
351
++ * it will would keep a branch out of our syscall entry path, at the
352
++ * very least.  If we decide to change it later, we can ``just'' tweak
353
++ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
354
++ * 1024 or something.  Oh, and recompile libc. =)
355
++ *
356
++ * 64-bit HPUX binaries get the syscall gateway address passed in a register
357
++ * from the kernel at startup, which seems a sane strategy.
358
++ */
359
++
360
++#define __NR_Linux                0
361
++#define __NR_io_setup           (__NR_Linux + 215)
362
++#define __NR_io_destroy         (__NR_Linux + 216)
363
++#define __NR_io_getevents       (__NR_Linux + 217)
364
++#define __NR_io_submit          (__NR_Linux + 218)
365
++#define __NR_io_cancel          (__NR_Linux + 219)
366
++
367
++#define SYS_ify(syscall_name)   __NR_##syscall_name
368
++
369
++/* Assume all syscalls are done from PIC code just to be
370
++ * safe. The worst case scenario is that you lose a register
371
++ * and save/restore r19 across the syscall. */
372
++#define PIC
373
++
374
++/* Definition taken from glibc 2.3.3
375
++ * sysdeps/unix/sysv/linux/hppa/sysdep.h
376
++ */
377
++
378
++#ifdef PIC
379
++/* WARNING: CANNOT BE USED IN A NOP! */
380
++# define K_STW_ASM_PIC	"       copy %%r19, %%r4\n"
381
++# define K_LDW_ASM_PIC	"       copy %%r4, %%r19\n"
382
++# define K_USING_GR4	"%r4",
383
++#else
384
++# define K_STW_ASM_PIC	" \n"
385
++# define K_LDW_ASM_PIC	" \n"
386
++# define K_USING_GR4
387
++#endif
388
++
389
++/* GCC has to be warned that a syscall may clobber all the ABI
390
++   registers listed as "caller-saves", see page 8, Table 2
391
++   in section 2.2.6 of the PA-RISC RUN-TIME architecture
392
++   document. However! r28 is the result and will conflict with
393
++   the clobber list so it is left out. Also the input arguments
394
++   registers r20 -> r26 will conflict with the list so they
395
++   are treated specially. Although r19 is clobbered by the syscall
396
++   we cannot say this because it would violate ABI, thus we say
397
++   r4 is clobbered and use that register to save/restore r19
398
++   across the syscall. */
399
++
400
++#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
401
++			 "%r20", "%r29", "%r31"
402
++
403
++#undef K_INLINE_SYSCALL
404
++#define K_INLINE_SYSCALL(name, nr, args...)	({			\
405
++	long __sys_res;							\
406
++	{								\
407
++		register unsigned long __res __asm__("r28");		\
408
++		K_LOAD_ARGS_##nr(args)					\
409
++		/* FIXME: HACK stw/ldw r19 around syscall */		\
410
++		__asm__ volatile(					\
411
++			K_STW_ASM_PIC					\
412
++			"	ble  0x100(%%sr2, %%r0)\n"		\
413
++			"	ldi %1, %%r20\n"			\
414
++			K_LDW_ASM_PIC					\
415
++			: "=r" (__res)					\
416
++			: "i" (SYS_ify(name)) K_ASM_ARGS_##nr		\
417
++			: "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr	\
418
++		);							\
419
++		__sys_res = (long)__res;				\
420
++	}								\
421
++	__sys_res;							\
422
++})
423
++
424
++#define K_LOAD_ARGS_0()
425
++#define K_LOAD_ARGS_1(r26)					\
426
++	register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);   \
427
++	K_LOAD_ARGS_0()
428
++#define K_LOAD_ARGS_2(r26,r25)					\
429
++	register unsigned long __r25 __asm__("r25") = (unsigned long)(r25);   \
430
++	K_LOAD_ARGS_1(r26)
431
++#define K_LOAD_ARGS_3(r26,r25,r24)				\
432
++	register unsigned long __r24 __asm__("r24") = (unsigned long)(r24);   \
433
++	K_LOAD_ARGS_2(r26,r25)
434
++#define K_LOAD_ARGS_4(r26,r25,r24,r23)				\
435
++	register unsigned long __r23 __asm__("r23") = (unsigned long)(r23);   \
436
++	K_LOAD_ARGS_3(r26,r25,r24)
437
++#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22)			\
438
++	register unsigned long __r22 __asm__("r22") = (unsigned long)(r22);   \
439
++	K_LOAD_ARGS_4(r26,r25,r24,r23)
440
++#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21)			\
441
++	register unsigned long __r21 __asm__("r21") = (unsigned long)(r21);   \
442
++	K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
443
++
444
++/* Even with zero args we use r20 for the syscall number */
445
++#define K_ASM_ARGS_0
446
++#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
447
++#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
448
++#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
449
++#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
450
++#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
451
++#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
452
++
453
++/* The registers not listed as inputs but clobbered */
454
++#define K_CLOB_ARGS_6
455
++#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
456
++#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
457
++#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
458
++#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
459
++#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
460
++#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
461
++
462
++#define io_syscall1(type,fname,sname,type1,arg1)			\
463
++type fname(type1 arg1)							\
464
++{									\
465
++    return K_INLINE_SYSCALL(sname, 1, arg1);				\
466
++}
467
++
468
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)		\
469
++type fname(type1 arg1, type2 arg2)					\
470
++{									\
471
++    return K_INLINE_SYSCALL(sname, 2, arg1, arg2);			\
472
++}
473
++
474
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)	\
475
++type fname(type1 arg1, type2 arg2, type3 arg3)				\
476
++{									\
477
++    return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3);		\
478
++}
479
++
480
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
481
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
482
++{									\
483
++    return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4);		\
484
++}
485
++
486
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
487
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
488
++{									\
489
++    return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5);	\
490
++}
491
++
492
+--- a/harness/main.c
493
++++ b/harness/main.c
494
+@@ -12,7 +12,17 @@
495
+ #include <libaio.h>
496
+ 
497
+ #if __LP64__ == 0
498
++#if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
499
+ #define KERNEL_RW_POINTER	((void *)0xc0010000)
500
++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__)
501
++#define KERNEL_RW_POINTER	((void *)0x00010000)
502
++#elif defined(__hppa__)
503
++#define KERNEL_RW_POINTER	((void *)0x10100000)
504
++#elif defined(__sparc__)
505
++#define KERNEL_RW_POINTER	((void *)0xf0010000)
506
++#else
507
++#error Unknown kernel memory address.
508
++#endif
509
+ #else
510
+ //#warning Not really sure where kernel memory is.  Guessing.
511
+ #define KERNEL_RW_POINTER	((void *)0xffffffff81000000)
512
+--- a/src/syscall-sparc.h
513
++++ b/src/syscall-sparc.h
514
+@@ -20,7 +20,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
515
+                       : "=r" (__res), "=&r" (__o0) \
516
+                       : "1" (__o0), "r" (__g1) \
517
+                       : "cc"); \
518
+-return (type) __res; \
519
++if (__res < -255 || __res >= 0) \
520
++	return (type) __res; \
521
++return -1; \
522
+ }
523
+ 
524
+ #define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
525
+@@ -38,7 +40,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
526
+                       : "=r" (__res), "=&r" (__o0) \
527
+                       : "1" (__o0), "r" (__o1), "r" (__g1) \
528
+                       : "cc"); \
529
+-return (type) __res; \
530
++if (__res < -255 || __res >= 0) \
531
++	return (type) __res; \
532
++return -1; \
533
+ }
534
+ 
535
+ #define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
536
+@@ -57,7 +61,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
537
+                       : "=r" (__res), "=&r" (__o0) \
538
+                       : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \
539
+                       : "cc"); \
540
+-return (type) __res; \
541
++if (__res < -255 || __res >= 0) \
542
++	return (type) __res; \
543
++return -1; \
544
+ }
545
+ 
546
+ #define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
547
+@@ -77,7 +83,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
548
+                       : "=r" (__res), "=&r" (__o0) \
549
+                       : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \
550
+                       : "cc"); \
551
+-return (type) __res; \
552
++if (__res < -255 || __res >= 0) \
553
++	return (type) __res; \
554
++return -1; \
555
+ }
556
+ 
557
+ #define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
558
+@@ -99,5 +107,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
559
+                       : "=r" (__res), "=&r" (__o0) \
560
+                       : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \
561
+                       : "cc"); \
562
+-return (type) __res; \
563
++if (__res < -255 || __res >= 0) \
564
++	return (type) __res; \
565
++return -1; \
566
+ }

+ 0
- 124
libs/libaio/patches/002-avr32_support.patch Näytä tiedosto

@@ -1,124 +0,0 @@
1
-Index: libaio-0.3.109/src/libaio.h
2
-===================================================================
3
---- libaio-0.3.109.orig/src/libaio.h	2014-06-11 10:41:12.537824814 +0200
4
-+++ libaio-0.3.109/src/libaio.h	2014-06-11 10:41:12.537824814 +0200
5
-@@ -134,6 +134,10 @@
6
- #define PADDEDptr(x, y) x
7
- #define PADDEDul(x, y)  unsigned long x
8
- #  endif
9
-+#elif defined(__avr32__) /* big endian, 32 bits */
10
-+#define PADDED(x, y)	unsigned y; x
11
-+#define PADDEDptr(x, y)	unsigned y; x
12
-+#define PADDEDul(x, y)	unsigned y; unsigned long x;
13
- #else
14
- #error	endian?
15
- #endif
16
-Index: libaio-0.3.109/src/syscall-avr32.h
17
-===================================================================
18
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
19
-+++ libaio-0.3.109/src/syscall-avr32.h	2014-06-11 10:41:12.537824814 +0200
20
-@@ -0,0 +1,91 @@
21
-+/*
22
-+ * Copyright (C) 2007 Atmel Corporation
23
-+ *
24
-+ * This program is free software; you can redistribute it and/or modify
25
-+ * it under the terms of the GNU General Public License version 2 as
26
-+ * published by the Free Software Foundation.
27
-+ */
28
-+
29
-+#define __NR_io_setup		197
30
-+#define __NR_io_destroy		198
31
-+#define __NR_io_getevents	199
32
-+#define __NR_io_submit		200
33
-+#define __NR_io_cancel		201
34
-+
35
-+#define io_syscall1(type,fname,sname,type1,arg1)			\
36
-+type fname(type1 arg1)							\
37
-+{									\
38
-+	register long __r12 __asm__("r12") = (long)arg1;		\
39
-+	register long __res_r12 __asm__("r12");				\
40
-+	register long __scno __asm__("r8") = __NR_##sname;		\
41
-+	__asm__ __volatile__("scall"					\
42
-+			     : "=r"(__res_r12)				\
43
-+			     : "0"(__r12), "r"(__scno)			\
44
-+			     : "memory");				\
45
-+	return (type) __res_r12;					\
46
-+}
47
-+
48
-+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)		\
49
-+type fname(type1 arg1, type2 arg2)					\
50
-+{									\
51
-+	register long __r12 __asm__("r12") = (long)arg1;		\
52
-+	register long __r11 __asm__("r11") = (long)arg2;		\
53
-+	register long __res_r12 __asm__("r12");				\
54
-+	register long __scno __asm__("r8") = __NR_##sname;		\
55
-+	__asm__ __volatile__("scall"					\
56
-+			     : "=r"(__res_r12)				\
57
-+			     : "0"(__r12), "r"(__r11), "r"(__scno)	\
58
-+			     : "memory");				\
59
-+	return (type) __res_r12;					\
60
-+}
61
-+
62
-+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)	\
63
-+type fname(type1 arg1, type2 arg2, type3 arg3)				\
64
-+{									\
65
-+	register long __r12 __asm__("r12") = (long)arg1;		\
66
-+	register long __r11 __asm__("r11") = (long)arg2;		\
67
-+	register long __r10 __asm__("r10") = (long)arg3;		\
68
-+	register long __res_r12 __asm__("r12");				\
69
-+	register long __scno __asm__("r8") = __NR_##sname;		\
70
-+	__asm__ __volatile__("scall"					\
71
-+			     : "=r"(__res_r12)				\
72
-+			     : "0"(__r12), "r"(__r11), "r"(__r10),	\
73
-+			       "r"(__scno)				\
74
-+			     : "memory");				\
75
-+	return (type) __res_r12;					\
76
-+}
77
-+
78
-+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
79
-+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
80
-+{									\
81
-+	register long __r12 __asm__("r12") = (long)arg1;		\
82
-+	register long __r11 __asm__("r11") = (long)arg2;		\
83
-+	register long __r10 __asm__("r10") = (long)arg3;		\
84
-+	register long __r9 __asm__("r9") = (long)arg4;			\
85
-+	register long __res_r12 __asm__("r12");				\
86
-+	register long __scno __asm__("r8") = __NR_##sname;		\
87
-+	__asm__ __volatile__("scall"					\
88
-+			     : "=r"(__res_r12)				\
89
-+			     : "0"(__r12), "r"(__r11), "r"(__r10),	\
90
-+			       "r"(__r9), "r"(__scno)			\
91
-+			     : "memory");				\
92
-+	return (type) __res_r12;					\
93
-+}
94
-+
95
-+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
96
-+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
97
-+{									\
98
-+	register long __r12 __asm__("r12") = (long)arg1;		\
99
-+	register long __r11 __asm__("r11") = (long)arg2;		\
100
-+	register long __r10 __asm__("r10") = (long)arg3;		\
101
-+	register long __r9 __asm__("r9") = (long)arg4;			\
102
-+	register long __r5 __asm__("r5") = (long)arg5;			\
103
-+	register long __res_r12 __asm__("r12");				\
104
-+	register long __scno __asm__("r8") = __NR_##sname;		\
105
-+	__asm__ __volatile__("scall"					\
106
-+			     : "=r"(__res_r12)				\
107
-+			     : "0"(__r12), "r"(__r11), "r"(__r10),	\
108
-+			       "r"(__r9), "r"(__r5), "r"(__scno)	\
109
-+			     : "memory");				\
110
-+	return (type) __res_r12;					\
111
-+}
112
-Index: libaio-0.3.109/src/syscall.h
113
-===================================================================
114
---- libaio-0.3.109.orig/src/syscall.h	2014-06-11 10:41:12.537824814 +0200
115
-+++ libaio-0.3.109/src/syscall.h	2014-06-11 10:41:12.537824814 +0200
116
-@@ -38,6 +38,8 @@
117
- #include "syscall-sh.h"
118
- #elif defined(__aarch64__)
119
- #include "syscall-arm64.h"
120
-+#elif defined(__avr32__)
121
-+#include "syscall-avr32.h"
122
- #else
123
- #error "add syscall-arch.h"
124
- #endif

+ 139
- 0
libs/libaio/patches/002_arches_sh.patch Näytä tiedosto

@@ -0,0 +1,139 @@
1
+From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2
+Subject: Add SH supprt
3
+
4
+The test-suite logs can be found at:
5
+
6
+  <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535288>
7
+
8
+
9
+---
10
+ harness/main.c   |    2 -
11
+ src/libaio.h     |    4 ++
12
+ src/syscall-sh.h |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
13
+ src/syscall.h    |    2 +
14
+ 4 files changed, 84 insertions(+), 2 deletions(-)
15
+
16
+
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
+--- a/src/libaio.h
29
++++ b/src/libaio.h
30
+@@ -51,7 +51,8 @@ typedef enum io_iocb_cmd {
31
+ 
32
+ /* little endian, 32 bits */
33
+ #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
34
+-    defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \
35
++    (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
36
++    defined(__bfin__) || defined(__MIPSEL__) || \
37
+     defined(__cris__)
38
+ #define PADDED(x, y)	x; unsigned y
39
+ #define PADDEDptr(x, y)	x; unsigned y
40
+@@ -76,6 +77,7 @@ typedef enum io_iocb_cmd {
41
+ /* big endian, 32 bits */
42
+ #elif defined(__PPC__) || defined(__s390__) || \
43
+       (defined(__arm__) && defined(__ARMEB__)) || \
44
++      (defined(__sh__) && defined (__BIG_ENDIAN__)) || \
45
+       defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
46
+       defined(__hppa__) || defined(__frv__) || defined(__avr32__)
47
+ #define PADDED(x, y)	unsigned y; x
48
+--- /dev/null
49
++++ b/src/syscall-sh.h
50
+@@ -0,0 +1,78 @@
51
++/* Copy from ./arch/sh/include/asm/unistd_32.h */
52
++#define __NR_io_setup       245
53
++#define __NR_io_destroy     246
54
++#define __NR_io_getevents   247
55
++#define __NR_io_submit      248
56
++#define __NR_io_cancel      249
57
++
58
++#define io_syscall1(type,fname,sname,type1,arg1) \
59
++type fname(type1 arg1) \
60
++{ \
61
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
62
++register long __sc4 __asm__ ("r4") = (long) arg1; \
63
++__asm__ __volatile__ ("trapa    #0x11" \
64
++	: "=z" (__sc0) \
65
++	: "0" (__sc0), "r" (__sc4) \
66
++	: "memory"); \
67
++	return (type) __sc0;\
68
++}
69
++
70
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
71
++type fname(type1 arg1,type2 arg2) \
72
++{ \
73
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
74
++register long __sc4 __asm__ ("r4") = (long) arg1; \
75
++register long __sc5 __asm__ ("r5") = (long) arg2; \
76
++	__asm__ __volatile__ ("trapa    #0x12" \
77
++	: "=z" (__sc0) \
78
++	: "0" (__sc0), "r" (__sc4), "r" (__sc5) \
79
++	: "memory"); \
80
++	return (type) __sc0;\
81
++}
82
++
83
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
84
++type fname(type1 arg1,type2 arg2,type3 arg3) \
85
++{ \
86
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
87
++register long __sc4 __asm__ ("r4") = (long) arg1; \
88
++register long __sc5 __asm__ ("r5") = (long) arg2; \
89
++register long __sc6 __asm__ ("r6") = (long) arg3; \
90
++	__asm__ __volatile__ ("trapa    #0x13" \
91
++	: "=z" (__sc0) \
92
++	: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \
93
++	: "memory"); \
94
++	return (type) __sc0;\
95
++}
96
++
97
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
98
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
99
++{ \
100
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
101
++register long __sc4 __asm__ ("r4") = (long) arg1; \
102
++register long __sc5 __asm__ ("r5") = (long) arg2; \
103
++register long __sc6 __asm__ ("r6") = (long) arg3; \
104
++register long __sc7 __asm__ ("r7") = (long) arg4; \
105
++__asm__ __volatile__ ("trapa    #0x14" \
106
++	: "=z" (__sc0) \
107
++	: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6),  \
108
++	"r" (__sc7) \
109
++	: "memory" ); \
110
++	return (type) __sc0;\
111
++}
112
++
113
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
114
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
115
++{ \
116
++register long __sc3 __asm__ ("r3") = __NR_##sname; \
117
++register long __sc4 __asm__ ("r4") = (long) arg1; \
118
++register long __sc5 __asm__ ("r5") = (long) arg2; \
119
++register long __sc6 __asm__ ("r6") = (long) arg3; \
120
++register long __sc7 __asm__ ("r7") = (long) arg4; \
121
++register long __sc0 __asm__ ("r0") = (long) arg5; \
122
++__asm__ __volatile__ ("trapa    #0x15" \
123
++	: "=z" (__sc0) \
124
++	: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7),  \
125
++	"r" (__sc3) \
126
++	: "memory" ); \
127
++	return (type) __sc0;\
128
++}
129
+--- a/src/syscall.h
130
++++ b/src/syscall.h
131
+@@ -34,6 +34,8 @@
132
+ #include "syscall-parisc.h"
133
+ #elif defined(__mips__)
134
+ #include "syscall-mips.h"
135
++#elif defined(__sh__)
136
++#include "syscall-sh.h"
137
+ #else
138
+ #warning "using generic syscall method"
139
+ #include "syscall-generic.h"

+ 117
- 0
libs/libaio/patches/003_arches_sparc64.patch Näytä tiedosto

@@ -0,0 +1,117 @@
1
+---
2
+ src/syscall-sparc64.h |   98 ++++++++++++++++++++++++++++++++++++++++++++++++++
3
+ src/syscall.h         |    2 +
4
+ 2 files changed, 100 insertions(+)
5
+
6
+--- a/src/syscall.h
7
++++ b/src/syscall.h
8
+@@ -24,6 +24,8 @@
9
+ #include "syscall-alpha.h"
10
+ #elif defined(__arm__)
11
+ #include "syscall-arm.h"
12
++#elif defined(__sparc__) && defined(__arch64__)
13
++#include "syscall-sparc64.h"
14
+ #elif defined(__sparc__)
15
+ #include "syscall-sparc.h"
16
+ #elif defined(__aarch64__)
17
+--- /dev/null
18
++++ b/src/syscall-sparc64.h
19
+@@ -0,0 +1,98 @@
20
++#define __NR_io_setup		268
21
++#define __NR_io_destroy		269
22
++#define __NR_io_submit		270
23
++#define __NR_io_cancel		271
24
++#define __NR_io_getevents	272
25
++
26
++#define io_syscall1(type,fname,sname,type1,arg1)			  \
27
++type fname(type1 arg1)							  \
28
++{									  \
29
++	unsigned long __res;						  \
30
++	register unsigned long __g1 __asm__("g1") = __NR_##sname;	  \
31
++	register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
32
++	__asm__ __volatile__("t		0x6d\n\t"			  \
33
++			     "sub	%%g0, %%o0, %0\n\t"		  \
34
++			     "movcc	%%xcc, %%o0, %0\n"		  \
35
++			     "1:"					  \
36
++			     : "=r" (__res), "=&r" (__o0)		  \
37
++			     : "1" (__o0), "r" (__g1)			  \
38
++			     : "cc");					  \
39
++	return (type) __res;						  \
40
++}
41
++
42
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)		  \
43
++type fname(type1 arg1, type2 arg2)					  \
44
++{									  \
45
++	unsigned long __res;						  \
46
++	register unsigned long __g1 __asm__("g1") = __NR_##sname;	  \
47
++	register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
48
++	register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
49
++	__asm__ __volatile__("t		0x6d\n\t"			  \
50
++			     "sub	%%g0, %%o0, %0\n\t"		  \
51
++			     "movcc	%%xcc, %%o0, %0\n"		  \
52
++			     "1:"					  \
53
++			     : "=r" (__res), "=&r" (__o0)		  \
54
++			     : "1" (__o0), "r" (__o1), "r" (__g1)	  \
55
++			     : "cc");					  \
56
++	return (type) __res;						  \
57
++}
58
++
59
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)	  \
60
++type fname(type1 arg1, type2 arg2, type3 arg3)				  \
61
++{									  \
62
++	unsigned long __res;						  \
63
++	register unsigned long __g1 __asm__("g1") = __NR_##sname;	  \
64
++	register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
65
++	register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
66
++	register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
67
++	__asm__ __volatile__("t		0x6d\n\t"			  \
68
++			     "sub	%%g0, %%o0, %0\n\t"		  \
69
++			     "movcc	%%xcc, %%o0, %0\n"		  \
70
++			     "1:"					  \
71
++			     : "=r" (__res), "=&r" (__o0)		  \
72
++			     : "1" (__o0), "r" (__o1), "r" (__o2),	  \
73
++			       "r" (__g1)	  			  \
74
++			     : "cc");					  \
75
++	return (type) __res;						  \
76
++}
77
++
78
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
79
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4)		  \
80
++{									  \
81
++	unsigned long __res;						  \
82
++	register unsigned long __g1 __asm__("g1") = __NR_##sname;	  \
83
++	register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
84
++	register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
85
++	register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
86
++	register unsigned long __o3 __asm__("o3") = (unsigned long) arg4; \
87
++	__asm__ __volatile__("t		0x6d\n\t"			  \
88
++			     "sub	%%g0, %%o0, %0\n\t"		  \
89
++			     "movcc	%%xcc, %%o0, %0\n"		  \
90
++			     "1:"					  \
91
++			     : "=r" (__res), "=&r" (__o0)		  \
92
++			     : "1" (__o0), "r" (__o1), "r" (__o2),	  \
93
++			       "r" (__o3), "r" (__g1)	  		  \
94
++			     : "cc");					  \
95
++	return (type) __res;						  \
96
++}
97
++
98
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
99
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	  \
100
++{									  \
101
++	unsigned long __res;						  \
102
++	register unsigned long __g1 __asm__("g1") = __NR_##sname;	  \
103
++	register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
104
++	register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
105
++	register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
106
++	register unsigned long __o3 __asm__("o3") = (unsigned long) arg4; \
107
++	register unsigned long __o4 __asm__("o4") = (unsigned long) arg5; \
108
++	__asm__ __volatile__("t		0x6d\n\t"			  \
109
++			     "sub	%%g0, %%o0, %0\n\t"		  \
110
++			     "movcc	%%xcc, %%o0, %0\n"		  \
111
++			     "1:"					  \
112
++			     : "=r" (__res), "=&r" (__o0)		  \
113
++			     : "1" (__o0), "r" (__o1), "r" (__o2),	  \
114
++			       "r" (__o3), "r" (__o4), "r" (__g1)	  \
115
++			     : "cc");					  \
116
++	return (type) __res;						  \
117
++}

+ 65
- 0
libs/libaio/patches/004_arches_x32.patch Näytä tiedosto

@@ -0,0 +1,65 @@
1
+Index: libaio-0.3.109/src/syscall-x86_64.h
2
+===================================================================
3
+--- libaio-0.3.109.orig/src/syscall-x86_64.h	2009-10-09 11:17:02.000000000 -0700
4
++++ libaio-0.3.109/src/syscall-x86_64.h	2013-03-03 07:15:13.000000000 -0800
5
+@@ -1,8 +1,18 @@
6
++#ifndef __NR_io_setup
7
+ #define __NR_io_setup		206
8
++#endif
9
++#ifndef __NR_io_destroy
10
+ #define __NR_io_destroy		207
11
++#endif
12
++#ifndef __NR_io_getevents
13
+ #define __NR_io_getevents	208
14
++#endif
15
++#ifndef __NR_io_submit
16
+ #define __NR_io_submit		209
17
++#endif
18
++#ifndef __NR_io_cancel
19
+ #define __NR_io_cancel		210
20
++#endif
21
+ 
22
+ #define __syscall_clobber "r11","rcx","memory" 
23
+ #define __syscall "syscall"
24
+@@ -42,10 +52,11 @@
25
+ type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
26
+ {									\
27
+ long __res;								\
28
+-__asm__ volatile ("movq %5,%%r10 ;" __syscall				\
29
++register long __a4 asm ("r10") = (long) arg4;                           \
30
++__asm__ volatile (__syscall						\
31
+ 	: "=a" (__res)							\
32
+ 	: "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),	\
33
+-	  "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
34
++	  "d" ((long)(arg3)),"r" (__a4)); \
35
+ return __res;								\
36
+ } 
37
+ 
38
+@@ -54,10 +65,11 @@
39
+ type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5)	\
40
+ {									\
41
+ long __res;								\
42
+-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall		\
43
++register long __a4 asm ("r10") = (long) arg4;				\
44
++register long __a5 asm ("r8") = (long) arg5;                            \
45
++__asm__ volatile (__syscall						\
46
+ 	: "=a" (__res)							\
47
+ 	: "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),	\
48
+-	  "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) :	\
49
+-	__syscall_clobber,"r8","r10" );					\
50
++	  "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
51
+ return __res;								\
52
+ }
53
+Index: libaio-0.3.109/harness/main.c
54
+===================================================================
55
+--- libaio-0.3.109.orig/harness/main.c	2013-03-03 06:58:51.000000000 -0800
56
++++ libaio-0.3.109/harness/main.c	2013-03-03 07:23:40.000000000 -0800
57
+@@ -14,7 +14,7 @@
58
+ #if __LP64__ == 0
59
+ #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
60
+ #define KERNEL_RW_POINTER	((void *)0xc0010000)
61
+-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
62
++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__)
63
+ #define KERNEL_RW_POINTER	((void *)0x00010000)
64
+ #elif defined(__hppa__)
65
+ #define KERNEL_RW_POINTER	((void *)0x10100000)

+ 63
- 0
libs/libaio/patches/005_arches_mips.patch Näytä tiedosto

@@ -0,0 +1,63 @@
1
+Description: Fix mips/mipsel syscall wrappers to return correct error values.
2
+Author: Jurica Stanojkovic <Jurica.Stanojkovic@rt-rk.com>
3
+Forwarded: no
4
+Last-Update: 2012-09-24
5
+
6
+
7
+diff -upNr a/src/syscall-mips.h b/src/syscall-mips.h
8
+--- a/src/syscall-mips.h	2012-09-13 11:46:35.652286733 +0200
9
++++ b/src/syscall-mips.h	2012-09-13 16:09:17.964407909 +0200
10
+@@ -76,7 +76,7 @@ type fname(atype a) \
11
+ 	\
12
+ 	if (__a3 == 0) \
13
+ 		return (type) __v0; \
14
+-	return (type) -1; \
15
++	return (type) 0 - __v0; \
16
+ }
17
+ 
18
+ #define io_syscall2(type,fname,sname,atype,a,btype,b) \
19
+@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
20
+ 	\
21
+ 	if (__a3 == 0) \
22
+ 		return (type) __v0; \
23
+-	return (type) -1; \
24
++	return (type) 0 - __v0; \
25
+ }
26
+ 
27
+ #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
28
+@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
29
+ 	\
30
+ 	if (__a3 == 0) \
31
+ 		return (type) __v0; \
32
+-	return (type) -1; \
33
++	return (type) 0 - __v0; \
34
+ }
35
+ 
36
+ #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
37
+@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
38
+ 	\
39
+ 	if (__a3 == 0) \
40
+ 		return (type) __v0; \
41
+-	return (type) -1; \
42
++	return (type) 0 - __v0; \
43
+ }
44
+ 
45
+ #if (_MIPS_SIM == _MIPS_SIM_ABI32)
46
+@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
47
+ 	\
48
+ 	if (__a3 == 0) \
49
+ 		return (type) __v0; \
50
+-	return (type) -1; \
51
++	return (type) 0 - __v0; \
52
+ }
53
+ 
54
+ #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
55
+@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
56
+ 	\
57
+ 	if (__a3 == 0) \
58
+ 		return (type) __v0; \
59
+-	return (type) -1; \
60
++	return (type) 0 - __v0; \
61
+ }
62
+ 
63
+ #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */

+ 37
- 0
libs/libaio/patches/006_arches_mips_fix_padding.patch Näytä tiedosto

@@ -0,0 +1,37 @@
1
+Description: Fix structure padding for mips64
2
+Author: Guillem Jover <guillem@debian.org>
3
+Forwarded: no
4
+Last-Update: 2014-07-23
5
+
6
+---
7
+ src/libaio.h |    5 ++++-
8
+ 1 file changed, 4 insertions(+), 1 deletion(-)
9
+
10
+--- a/src/libaio.h
11
++++ b/src/libaio.h
12
+@@ -52,7 +52,8 @@ typedef enum io_iocb_cmd {
13
+ /* little endian, 32 bits */
14
+ #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
15
+     (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
16
+-    defined(__bfin__) || defined(__MIPSEL__) || \
17
++    defined(__bfin__) || \
18
++    (defined(__MIPSEL__) && !defined(__mips64)) || \
19
+     defined(__cris__)
20
+ #define PADDED(x, y)	x; unsigned y
21
+ #define PADDEDptr(x, y)	x; unsigned y
22
+@@ -60,6 +61,7 @@ typedef enum io_iocb_cmd {
23
+ 
24
+ /* little endian, 64 bits */
25
+ #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \
26
++      (defined(__mips64) && defined(__MIPSEL__)) || \
27
+       (defined(__aarch64__) && defined(__AARCH64EL__))
28
+ #define PADDED(x, y)	x, y
29
+ #define PADDEDptr(x, y)	x
30
+@@ -69,6 +71,7 @@ typedef enum io_iocb_cmd {
31
+ #elif defined(__powerpc64__) || defined(__s390x__) || \
32
+       (defined(__hppa__) && defined(__arch64__)) || \
33
+       (defined(__sparc__) && defined(__arch64__)) || \
34
++      (defined(__mips64) && defined(__MIPSEB__)) || \
35
+       (defined(__aarch64__) && defined(__AARCH64EB__))
36
+ #define PADDED(x, y)	unsigned y; x
37
+ #define PADDEDptr(x,y)	x