Initialize for libaio
This commit is contained in:
commit
b9cdbf4220
13 changed files with 3896 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
libaio-0.3.109.tar.bz2
|
1
.libaio.metadata
Normal file
1
.libaio.metadata
Normal file
|
@ -0,0 +1 @@
|
|||
023e149e77fcba114ea56fbb011b5d2dbdd93936f710989f08768f8e8ee0b6f1 libaio-0.3.109.tar.bz2
|
681
00_arches.patch
Normal file
681
00_arches.patch
Normal file
|
@ -0,0 +1,681 @@
|
|||
---
|
||||
harness/main.c | 8 +
|
||||
src/libaio.h | 24 +++++
|
||||
src/syscall-m68k.h | 78 +++++++++++++++++
|
||||
src/syscall-mips.h | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
src/syscall-parisc.h | 146 +++++++++++++++++++++++++++++++++
|
||||
src/syscall-sparc.h | 130 +++++++++++++++++++++++++++++
|
||||
src/syscall.h | 8 +
|
||||
7 files changed, 617 insertions(+)
|
||||
|
||||
Index: libaio-0.3.109/harness/main.c
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/harness/main.c
|
||||
+++ libaio-0.3.109/harness/main.c
|
||||
@@ -12,7 +12,15 @@
|
||||
#include <libaio.h>
|
||||
|
||||
#if __LP64__ == 0
|
||||
+#if defined(__i386__) || defined(__pwoerpc__) || defined(__mips__)
|
||||
#define KERNEL_RW_POINTER ((void *)0xc0010000)
|
||||
+#elif defined(__arm__) || defined(__m68k__) || defined(__s390__)
|
||||
+#define KERNEL_RW_POINTER ((void *)0x00010000)
|
||||
+#elif defined(__hppa__)
|
||||
+#define KERNEL_RW_POINTER ((void *)0x10100000)
|
||||
+#elif defined(__sparc__)
|
||||
+#define KERNEL_RW_POINTER ((void *)0xf0010000)
|
||||
+#endif
|
||||
#else
|
||||
//#warning Not really sure where kernel memory is. Guessing.
|
||||
#define KERNEL_RW_POINTER ((void *)0xffffffff81000000)
|
||||
Index: libaio-0.3.109/src/libaio.h
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/src/libaio.h
|
||||
+++ libaio-0.3.109/src/libaio.h
|
||||
@@ -83,6 +83,30 @@ typedef enum io_iocb_cmd {
|
||||
#define PADDEDptr(x, y) x; unsigned y
|
||||
#define PADDEDul(x, y) unsigned long x; unsigned y
|
||||
# endif
|
||||
+#elif defined(__m68k__) /* big endian, 32 bits */
|
||||
+#define PADDED(x, y) unsigned y; x
|
||||
+#define PADDEDptr(x, y) unsigned y; x
|
||||
+#define PADDEDul(x, y) unsigned y; unsigned long x
|
||||
+#elif defined(__sparc__) /* big endian, 32 bits */
|
||||
+#define PADDED(x, y) unsigned y; x
|
||||
+#define PADDEDptr(x, y) unsigned y; x
|
||||
+#define PADDEDul(x, y) unsigned y; unsigned long x
|
||||
+#elif defined(__hppa__) /* big endian, 32 bits */
|
||||
+#define PADDED(x, y) unsigned y; x
|
||||
+#define PADDEDptr(x, y) unsigned y; x
|
||||
+#define PADDEDul(x, y) unsigned y; unsigned long x
|
||||
+#elif defined(__mips__)
|
||||
+# if defined (__MIPSEB__) /* big endian, 32 bits */
|
||||
+#define PADDED(x, y) unsigned y; x
|
||||
+#define PADDEDptr(x, y) unsigned y; x
|
||||
+#define PADDEDul(x, y) unsigned y; unsigned long x
|
||||
+# elif defined(__MIPSEL__) /* little endian, 32 bits */
|
||||
+#define PADDED(x, y) x; unsigned y
|
||||
+#define PADDEDptr(x, y) x; unsigned y
|
||||
+#define PADDEDul(x, y) unsigned long x; unsigned y
|
||||
+# else
|
||||
+# error "neither mipseb nor mipsel?"
|
||||
+# endif
|
||||
#else
|
||||
#error endian?
|
||||
#endif
|
||||
Index: libaio-0.3.109/src/syscall-m68k.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ libaio-0.3.109/src/syscall-m68k.h
|
||||
@@ -0,0 +1,78 @@
|
||||
+#define __NR_io_setup 241
|
||||
+#define __NR_io_destroy 242
|
||||
+#define __NR_io_getevents 243
|
||||
+#define __NR_io_submit 244
|
||||
+#define __NR_io_cancel 245
|
||||
+
|
||||
+#define io_syscall1(type,fname,sname,atype,a) \
|
||||
+type fname(atype a) \
|
||||
+{ \
|
||||
+register long __res __asm__ ("%d0") = __NR_##sname; \
|
||||
+register long __a __asm__ ("%d1") = (long)(a); \
|
||||
+__asm__ __volatile__ ("trap #0" \
|
||||
+ : "+d" (__res) \
|
||||
+ : "d" (__a) ); \
|
||||
+return (type) __res; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall2(type,fname,sname,atype,a,btype,b) \
|
||||
+type fname(atype a,btype b) \
|
||||
+{ \
|
||||
+register long __res __asm__ ("%d0") = __NR_##sname; \
|
||||
+register long __a __asm__ ("%d1") = (long)(a); \
|
||||
+register long __b __asm__ ("%d2") = (long)(b); \
|
||||
+__asm__ __volatile__ ("trap #0" \
|
||||
+ : "+d" (__res) \
|
||||
+ : "d" (__a), "d" (__b) \
|
||||
+ ); \
|
||||
+return (type) __res; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
|
||||
+type fname(atype a,btype b,ctype c) \
|
||||
+{ \
|
||||
+register long __res __asm__ ("%d0") = __NR_##sname; \
|
||||
+register long __a __asm__ ("%d1") = (long)(a); \
|
||||
+register long __b __asm__ ("%d2") = (long)(b); \
|
||||
+register long __c __asm__ ("%d3") = (long)(c); \
|
||||
+__asm__ __volatile__ ("trap #0" \
|
||||
+ : "+d" (__res) \
|
||||
+ : "d" (__a), "d" (__b), \
|
||||
+ "d" (__c) \
|
||||
+ ); \
|
||||
+return (type) __res; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
|
||||
+type fname (atype a, btype b, ctype c, dtype d) \
|
||||
+{ \
|
||||
+register long __res __asm__ ("%d0") = __NR_##sname; \
|
||||
+register long __a __asm__ ("%d1") = (long)(a); \
|
||||
+register long __b __asm__ ("%d2") = (long)(b); \
|
||||
+register long __c __asm__ ("%d3") = (long)(c); \
|
||||
+register long __d __asm__ ("%d4") = (long)(d); \
|
||||
+__asm__ __volatile__ ("trap #0" \
|
||||
+ : "+d" (__res) \
|
||||
+ : "d" (__a), "d" (__b), \
|
||||
+ "d" (__c), "d" (__d) \
|
||||
+ ); \
|
||||
+return (type) __res; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
|
||||
+type fname (atype a,btype b,ctype c,dtype d,etype e) \
|
||||
+{ \
|
||||
+register long __res __asm__ ("%d0") = __NR_##sname; \
|
||||
+register long __a __asm__ ("%d1") = (long)(a); \
|
||||
+register long __b __asm__ ("%d2") = (long)(b); \
|
||||
+register long __c __asm__ ("%d3") = (long)(c); \
|
||||
+register long __d __asm__ ("%d4") = (long)(d); \
|
||||
+register long __e __asm__ ("%d5") = (long)(e); \
|
||||
+__asm__ __volatile__ ("trap #0" \
|
||||
+ : "+d" (__res) \
|
||||
+ : "d" (__a), "d" (__b), \
|
||||
+ "d" (__c), "d" (__d), "d" (__e) \
|
||||
+ ); \
|
||||
+return (type) __res; \
|
||||
+}
|
||||
+
|
||||
Index: libaio-0.3.109/src/syscall-mips.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ libaio-0.3.109/src/syscall-mips.h
|
||||
@@ -0,0 +1,223 @@
|
||||
+/*
|
||||
+ * This file is subject to the terms and conditions of the GNU General Public
|
||||
+ * License. See the file "COPYING" in the main directory of this archive
|
||||
+ * for more details.
|
||||
+ *
|
||||
+ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
|
||||
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
|
||||
+ *
|
||||
+ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
|
||||
+ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
|
||||
+ */
|
||||
+
|
||||
+#ifndef _MIPS_SIM_ABI32
|
||||
+#define _MIPS_SIM_ABI32 1
|
||||
+#define _MIPS_SIM_NABI32 2
|
||||
+#define _MIPS_SIM_ABI64 3
|
||||
+#endif
|
||||
+
|
||||
+#if _MIPS_SIM == _MIPS_SIM_ABI32
|
||||
+
|
||||
+/*
|
||||
+ * Linux o32 style syscalls are in the range from 4000 to 4999.
|
||||
+ */
|
||||
+#define __NR_Linux 4000
|
||||
+#define __NR_io_setup (__NR_Linux + 241)
|
||||
+#define __NR_io_destroy (__NR_Linux + 242)
|
||||
+#define __NR_io_getevents (__NR_Linux + 243)
|
||||
+#define __NR_io_submit (__NR_Linux + 244)
|
||||
+#define __NR_io_cancel (__NR_Linux + 245)
|
||||
+
|
||||
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
|
||||
+
|
||||
+#if _MIPS_SIM == _MIPS_SIM_ABI64
|
||||
+
|
||||
+/*
|
||||
+ * Linux 64-bit syscalls are in the range from 5000 to 5999.
|
||||
+ */
|
||||
+#define __NR_Linux 5000
|
||||
+#define __NR_io_setup (__NR_Linux + 200)
|
||||
+#define __NR_io_destroy (__NR_Linux + 201)
|
||||
+#define __NR_io_getevents (__NR_Linux + 202)
|
||||
+#define __NR_io_submit (__NR_Linux + 203)
|
||||
+#define __NR_io_cancel (__NR_Linux + 204)
|
||||
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
|
||||
+
|
||||
+#if _MIPS_SIM == _MIPS_SIM_NABI32
|
||||
+
|
||||
+/*
|
||||
+ * Linux N32 syscalls are in the range from 6000 to 6999.
|
||||
+ */
|
||||
+#define __NR_Linux 6000
|
||||
+#define __NR_io_setup (__NR_Linux + 200)
|
||||
+#define __NR_io_destroy (__NR_Linux + 201)
|
||||
+#define __NR_io_getevents (__NR_Linux + 202)
|
||||
+#define __NR_io_submit (__NR_Linux + 203)
|
||||
+#define __NR_io_cancel (__NR_Linux + 204)
|
||||
+#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
|
||||
+
|
||||
+#define io_syscall1(type,fname,sname,atype,a) \
|
||||
+type fname(atype a) \
|
||||
+{ \
|
||||
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
|
||||
+ register unsigned long __a3 asm("$7"); \
|
||||
+ unsigned long __v0; \
|
||||
+ \
|
||||
+ __asm__ volatile ( \
|
||||
+ ".set\tnoreorder\n\t" \
|
||||
+ "li\t$2, %3\t\t\t# " #fname "\n\t" \
|
||||
+ "syscall\n\t" \
|
||||
+ "move\t%0, $2\n\t" \
|
||||
+ ".set\treorder" \
|
||||
+ : "=&r" (__v0), "=r" (__a3) \
|
||||
+ : "r" (__a0), "i" (__NR_##sname) \
|
||||
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
|
||||
+ "memory"); \
|
||||
+ \
|
||||
+ if (__a3 == 0) \
|
||||
+ return (type) __v0; \
|
||||
+ return (type) -1; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall2(type,fname,sname,atype,a,btype,b) \
|
||||
+type fname(atype a, btype b) \
|
||||
+{ \
|
||||
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
|
||||
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
|
||||
+ register unsigned long __a3 asm("$7"); \
|
||||
+ unsigned long __v0; \
|
||||
+ \
|
||||
+ __asm__ volatile ( \
|
||||
+ ".set\tnoreorder\n\t" \
|
||||
+ "li\t$2, %4\t\t\t# " #fname "\n\t" \
|
||||
+ "syscall\n\t" \
|
||||
+ "move\t%0, $2\n\t" \
|
||||
+ ".set\treorder" \
|
||||
+ : "=&r" (__v0), "=r" (__a3) \
|
||||
+ : "r" (__a0), "r" (__a1), "i" (__NR_##sname) \
|
||||
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
|
||||
+ "memory"); \
|
||||
+ \
|
||||
+ if (__a3 == 0) \
|
||||
+ return (type) __v0; \
|
||||
+ return (type) -1; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
|
||||
+type fname(atype a, btype b, ctype c) \
|
||||
+{ \
|
||||
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
|
||||
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
|
||||
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
|
||||
+ register unsigned long __a3 asm("$7"); \
|
||||
+ unsigned long __v0; \
|
||||
+ \
|
||||
+ __asm__ volatile ( \
|
||||
+ ".set\tnoreorder\n\t" \
|
||||
+ "li\t$2, %5\t\t\t# " #fname "\n\t" \
|
||||
+ "syscall\n\t" \
|
||||
+ "move\t%0, $2\n\t" \
|
||||
+ ".set\treorder" \
|
||||
+ : "=&r" (__v0), "=r" (__a3) \
|
||||
+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
|
||||
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
|
||||
+ "memory"); \
|
||||
+ \
|
||||
+ if (__a3 == 0) \
|
||||
+ return (type) __v0; \
|
||||
+ return (type) -1; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
|
||||
+type fname(atype a, btype b, ctype c, dtype d) \
|
||||
+{ \
|
||||
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
|
||||
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
|
||||
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
|
||||
+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
|
||||
+ unsigned long __v0; \
|
||||
+ \
|
||||
+ __asm__ volatile ( \
|
||||
+ ".set\tnoreorder\n\t" \
|
||||
+ "li\t$2, %5\t\t\t# " #fname "\n\t" \
|
||||
+ "syscall\n\t" \
|
||||
+ "move\t%0, $2\n\t" \
|
||||
+ ".set\treorder" \
|
||||
+ : "=&r" (__v0), "+r" (__a3) \
|
||||
+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
|
||||
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
|
||||
+ "memory"); \
|
||||
+ \
|
||||
+ if (__a3 == 0) \
|
||||
+ return (type) __v0; \
|
||||
+ return (type) -1; \
|
||||
+}
|
||||
+
|
||||
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
|
||||
+
|
||||
+/*
|
||||
+ * Using those means your brain needs more than an oil change ;-)
|
||||
+ */
|
||||
+
|
||||
+#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
|
||||
+type fname(atype a, btype b, ctype c, dtype d, etype e) \
|
||||
+{ \
|
||||
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
|
||||
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
|
||||
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
|
||||
+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
|
||||
+ unsigned long __v0; \
|
||||
+ \
|
||||
+ __asm__ volatile ( \
|
||||
+ ".set\tnoreorder\n\t" \
|
||||
+ "lw\t$2, %6\n\t" \
|
||||
+ "subu\t$29, 32\n\t" \
|
||||
+ "sw\t$2, 16($29)\n\t" \
|
||||
+ "li\t$2, %5\t\t\t# " #fname "\n\t" \
|
||||
+ "syscall\n\t" \
|
||||
+ "move\t%0, $2\n\t" \
|
||||
+ "addiu\t$29, 32\n\t" \
|
||||
+ ".set\treorder" \
|
||||
+ : "=&r" (__v0), "+r" (__a3) \
|
||||
+ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \
|
||||
+ "m" ((unsigned long)e) \
|
||||
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
|
||||
+ "memory"); \
|
||||
+ \
|
||||
+ if (__a3 == 0) \
|
||||
+ return (type) __v0; \
|
||||
+ return (type) -1; \
|
||||
+}
|
||||
+
|
||||
+#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
|
||||
+
|
||||
+#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
|
||||
+
|
||||
+#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
|
||||
+type fname (atype a,btype b,ctype c,dtype d,etype e) \
|
||||
+{ \
|
||||
+ register unsigned long __a0 asm("$4") = (unsigned long) a; \
|
||||
+ register unsigned long __a1 asm("$5") = (unsigned long) b; \
|
||||
+ register unsigned long __a2 asm("$6") = (unsigned long) c; \
|
||||
+ register unsigned long __a3 asm("$7") = (unsigned long) d; \
|
||||
+ register unsigned long __a4 asm("$8") = (unsigned long) e; \
|
||||
+ unsigned long __v0; \
|
||||
+ \
|
||||
+ __asm__ volatile ( \
|
||||
+ ".set\tnoreorder\n\t" \
|
||||
+ "li\t$2, %6\t\t\t# " #fname "\n\t" \
|
||||
+ "syscall\n\t" \
|
||||
+ "move\t%0, $2\n\t" \
|
||||
+ ".set\treorder" \
|
||||
+ : "=&r" (__v0), "+r" (__a3) \
|
||||
+ : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \
|
||||
+ : "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
|
||||
+ "memory"); \
|
||||
+ \
|
||||
+ if (__a3 == 0) \
|
||||
+ return (type) __v0; \
|
||||
+ return (type) -1; \
|
||||
+}
|
||||
+
|
||||
+#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
|
||||
+
|
||||
Index: libaio-0.3.109/src/syscall-parisc.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ libaio-0.3.109/src/syscall-parisc.h
|
||||
@@ -0,0 +1,146 @@
|
||||
+/*
|
||||
+ * Linux system call numbers.
|
||||
+ *
|
||||
+ * Cary Coutant says that we should just use another syscall gateway
|
||||
+ * page to avoid clashing with the HPUX space, and I think he's right:
|
||||
+ * it will would keep a branch out of our syscall entry path, at the
|
||||
+ * very least. If we decide to change it later, we can ``just'' tweak
|
||||
+ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
|
||||
+ * 1024 or something. Oh, and recompile libc. =)
|
||||
+ *
|
||||
+ * 64-bit HPUX binaries get the syscall gateway address passed in a register
|
||||
+ * from the kernel at startup, which seems a sane strategy.
|
||||
+ */
|
||||
+
|
||||
+#define __NR_Linux 0
|
||||
+#define __NR_io_setup (__NR_Linux + 215)
|
||||
+#define __NR_io_destroy (__NR_Linux + 216)
|
||||
+#define __NR_io_getevents (__NR_Linux + 217)
|
||||
+#define __NR_io_submit (__NR_Linux + 218)
|
||||
+#define __NR_io_cancel (__NR_Linux + 219)
|
||||
+
|
||||
+#define SYS_ify(syscall_name) __NR_##syscall_name
|
||||
+
|
||||
+/* Assume all syscalls are done from PIC code just to be
|
||||
+ * safe. The worst case scenario is that you lose a register
|
||||
+ * and save/restore r19 across the syscall. */
|
||||
+#define PIC
|
||||
+
|
||||
+/* Definition taken from glibc 2.3.3
|
||||
+ * sysdeps/unix/sysv/linux/hppa/sysdep.h
|
||||
+ */
|
||||
+
|
||||
+#ifdef PIC
|
||||
+/* WARNING: CANNOT BE USED IN A NOP! */
|
||||
+# define K_STW_ASM_PIC " copy %%r19, %%r4\n"
|
||||
+# define K_LDW_ASM_PIC " copy %%r4, %%r19\n"
|
||||
+# define K_USING_GR4 "%r4",
|
||||
+#else
|
||||
+# define K_STW_ASM_PIC " \n"
|
||||
+# define K_LDW_ASM_PIC " \n"
|
||||
+# define K_USING_GR4
|
||||
+#endif
|
||||
+
|
||||
+/* GCC has to be warned that a syscall may clobber all the ABI
|
||||
+ registers listed as "caller-saves", see page 8, Table 2
|
||||
+ in section 2.2.6 of the PA-RISC RUN-TIME architecture
|
||||
+ document. However! r28 is the result and will conflict with
|
||||
+ the clobber list so it is left out. Also the input arguments
|
||||
+ registers r20 -> r26 will conflict with the list so they
|
||||
+ are treated specially. Although r19 is clobbered by the syscall
|
||||
+ we cannot say this because it would violate ABI, thus we say
|
||||
+ r4 is clobbered and use that register to save/restore r19
|
||||
+ across the syscall. */
|
||||
+
|
||||
+#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
|
||||
+ "%r20", "%r29", "%r31"
|
||||
+
|
||||
+#undef K_INLINE_SYSCALL
|
||||
+#define K_INLINE_SYSCALL(name, nr, args...) ({ \
|
||||
+ long __sys_res; \
|
||||
+ { \
|
||||
+ register unsigned long __res __asm__("r28"); \
|
||||
+ K_LOAD_ARGS_##nr(args) \
|
||||
+ /* FIXME: HACK stw/ldw r19 around syscall */ \
|
||||
+ __asm__ volatile( \
|
||||
+ K_STW_ASM_PIC \
|
||||
+ " ble 0x100(%%sr2, %%r0)\n" \
|
||||
+ " ldi %1, %%r20\n" \
|
||||
+ K_LDW_ASM_PIC \
|
||||
+ : "=r" (__res) \
|
||||
+ : "i" (SYS_ify(name)) K_ASM_ARGS_##nr \
|
||||
+ : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \
|
||||
+ ); \
|
||||
+ __sys_res = (long)__res; \
|
||||
+ } \
|
||||
+ __sys_res; \
|
||||
+})
|
||||
+
|
||||
+#define K_LOAD_ARGS_0()
|
||||
+#define K_LOAD_ARGS_1(r26) \
|
||||
+ register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \
|
||||
+ K_LOAD_ARGS_0()
|
||||
+#define K_LOAD_ARGS_2(r26,r25) \
|
||||
+ register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \
|
||||
+ K_LOAD_ARGS_1(r26)
|
||||
+#define K_LOAD_ARGS_3(r26,r25,r24) \
|
||||
+ register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \
|
||||
+ K_LOAD_ARGS_2(r26,r25)
|
||||
+#define K_LOAD_ARGS_4(r26,r25,r24,r23) \
|
||||
+ register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \
|
||||
+ K_LOAD_ARGS_3(r26,r25,r24)
|
||||
+#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22) \
|
||||
+ register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \
|
||||
+ K_LOAD_ARGS_4(r26,r25,r24,r23)
|
||||
+#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \
|
||||
+ register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \
|
||||
+ K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
|
||||
+
|
||||
+/* Even with zero args we use r20 for the syscall number */
|
||||
+#define K_ASM_ARGS_0
|
||||
+#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
|
||||
+#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
|
||||
+#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
|
||||
+#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
|
||||
+#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
|
||||
+#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
|
||||
+
|
||||
+/* The registers not listed as inputs but clobbered */
|
||||
+#define K_CLOB_ARGS_6
|
||||
+#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
|
||||
+#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
|
||||
+#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
|
||||
+#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
|
||||
+#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
|
||||
+#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
|
||||
+
|
||||
+#define io_syscall1(type,fname,sname,type1,arg1) \
|
||||
+type fname(type1 arg1) \
|
||||
+{ \
|
||||
+ return K_INLINE_SYSCALL(sname, 1, arg1); \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
|
||||
+type fname(type1 arg1, type2 arg2) \
|
||||
+{ \
|
||||
+ return K_INLINE_SYSCALL(sname, 2, arg1, arg2); \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
|
||||
+type fname(type1 arg1, type2 arg2, type3 arg3) \
|
||||
+{ \
|
||||
+ return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3); \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
|
||||
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
|
||||
+{ \
|
||||
+ return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4); \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
|
||||
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
|
||||
+{ \
|
||||
+ return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5); \
|
||||
+}
|
||||
+
|
||||
Index: libaio-0.3.109/src/syscall-sparc.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ libaio-0.3.109/src/syscall-sparc.h
|
||||
@@ -0,0 +1,130 @@
|
||||
+/* $Id: unistd.h,v 1.74 2002/02/08 03:57:18 davem Exp $ */
|
||||
+
|
||||
+/*
|
||||
+ * System calls under the Sparc.
|
||||
+ *
|
||||
+ * Don't be scared by the ugly clobbers, it is the only way I can
|
||||
+ * think of right now to force the arguments into fixed registers
|
||||
+ * before the trap into the system call with gcc 'asm' statements.
|
||||
+ *
|
||||
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
|
||||
+ *
|
||||
+ * SunOS compatibility based upon preliminary work which is:
|
||||
+ *
|
||||
+ * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+#define __NR_io_setup 268
|
||||
+#define __NR_io_destroy 269
|
||||
+#define __NR_io_submit 270
|
||||
+#define __NR_io_cancel 271
|
||||
+#define __NR_io_getevents 272
|
||||
+
|
||||
+
|
||||
+#define io_syscall1(type,fname,sname,type1,arg1) \
|
||||
+type fname(type1 arg1) \
|
||||
+{ \
|
||||
+long __res; \
|
||||
+register long __g1 __asm__ ("g1") = __NR_##sname; \
|
||||
+register long __o0 __asm__ ("o0") = (long)(arg1); \
|
||||
+__asm__ __volatile__ ("t 0x10\n\t" \
|
||||
+ "bcc 1f\n\t" \
|
||||
+ "mov %%o0, %0\n\t" \
|
||||
+ "sub %%g0, %%o0, %0\n\t" \
|
||||
+ "1:\n\t" \
|
||||
+ : "=r" (__res), "=&r" (__o0) \
|
||||
+ : "1" (__o0), "r" (__g1) \
|
||||
+ : "cc"); \
|
||||
+if (__res < -255 || __res >= 0) \
|
||||
+ return (type) __res; \
|
||||
+return -1; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
|
||||
+type fname(type1 arg1,type2 arg2) \
|
||||
+{ \
|
||||
+long __res; \
|
||||
+register long __g1 __asm__ ("g1") = __NR_##sname; \
|
||||
+register long __o0 __asm__ ("o0") = (long)(arg1); \
|
||||
+register long __o1 __asm__ ("o1") = (long)(arg2); \
|
||||
+__asm__ __volatile__ ("t 0x10\n\t" \
|
||||
+ "bcc 1f\n\t" \
|
||||
+ "mov %%o0, %0\n\t" \
|
||||
+ "sub %%g0, %%o0, %0\n\t" \
|
||||
+ "1:\n\t" \
|
||||
+ : "=r" (__res), "=&r" (__o0) \
|
||||
+ : "1" (__o0), "r" (__o1), "r" (__g1) \
|
||||
+ : "cc"); \
|
||||
+if (__res < -255 || __res >= 0) \
|
||||
+ return (type) __res; \
|
||||
+return -1; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
|
||||
+type fname(type1 arg1,type2 arg2,type3 arg3) \
|
||||
+{ \
|
||||
+long __res; \
|
||||
+register long __g1 __asm__ ("g1") = __NR_##sname; \
|
||||
+register long __o0 __asm__ ("o0") = (long)(arg1); \
|
||||
+register long __o1 __asm__ ("o1") = (long)(arg2); \
|
||||
+register long __o2 __asm__ ("o2") = (long)(arg3); \
|
||||
+__asm__ __volatile__ ("t 0x10\n\t" \
|
||||
+ "bcc 1f\n\t" \
|
||||
+ "mov %%o0, %0\n\t" \
|
||||
+ "sub %%g0, %%o0, %0\n\t" \
|
||||
+ "1:\n\t" \
|
||||
+ : "=r" (__res), "=&r" (__o0) \
|
||||
+ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \
|
||||
+ : "cc"); \
|
||||
+if (__res < -255 || __res>=0) \
|
||||
+ return (type) __res; \
|
||||
+return -1; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
|
||||
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
|
||||
+{ \
|
||||
+long __res; \
|
||||
+register long __g1 __asm__ ("g1") = __NR_##sname; \
|
||||
+register long __o0 __asm__ ("o0") = (long)(arg1); \
|
||||
+register long __o1 __asm__ ("o1") = (long)(arg2); \
|
||||
+register long __o2 __asm__ ("o2") = (long)(arg3); \
|
||||
+register long __o3 __asm__ ("o3") = (long)(arg4); \
|
||||
+__asm__ __volatile__ ("t 0x10\n\t" \
|
||||
+ "bcc 1f\n\t" \
|
||||
+ "mov %%o0, %0\n\t" \
|
||||
+ "sub %%g0, %%o0, %0\n\t" \
|
||||
+ "1:\n\t" \
|
||||
+ : "=r" (__res), "=&r" (__o0) \
|
||||
+ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \
|
||||
+ : "cc"); \
|
||||
+if (__res < -255 || __res>=0) \
|
||||
+ return (type) __res; \
|
||||
+return -1; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
|
||||
+ type5,arg5) \
|
||||
+type fname(type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
|
||||
+{ \
|
||||
+long __res; \
|
||||
+register long __g1 __asm__ ("g1") = __NR_##sname; \
|
||||
+register long __o0 __asm__ ("o0") = (long)(arg1); \
|
||||
+register long __o1 __asm__ ("o1") = (long)(arg2); \
|
||||
+register long __o2 __asm__ ("o2") = (long)(arg3); \
|
||||
+register long __o3 __asm__ ("o3") = (long)(arg4); \
|
||||
+register long __o4 __asm__ ("o4") = (long)(arg5); \
|
||||
+__asm__ __volatile__ ("t 0x10\n\t" \
|
||||
+ "bcc 1f\n\t" \
|
||||
+ "mov %%o0, %0\n\t" \
|
||||
+ "sub %%g0, %%o0, %0\n\t" \
|
||||
+ "1:\n\t" \
|
||||
+ : "=r" (__res), "=&r" (__o0) \
|
||||
+ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \
|
||||
+ : "cc"); \
|
||||
+if (__res < -255 || __res>=0) \
|
||||
+ return (type) __res; \
|
||||
+return -1; \
|
||||
+}
|
||||
+
|
||||
Index: libaio-0.3.109/src/syscall.h
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/src/syscall.h
|
||||
+++ libaio-0.3.109/src/syscall.h
|
||||
@@ -24,6 +24,14 @@
|
||||
#include "syscall-alpha.h"
|
||||
#elif defined(__arm__)
|
||||
#include "syscall-arm.h"
|
||||
+#elif defined(__m68k__)
|
||||
+#include "syscall-m68k.h"
|
||||
+#elif defined(__sparc__)
|
||||
+#include "syscall-sparc.h"
|
||||
+#elif defined(__hppa__)
|
||||
+#include "syscall-parisc.h"
|
||||
+#elif defined(__mips__)
|
||||
+#include "syscall-mips.h"
|
||||
#else
|
||||
#error "add syscall-arch.h"
|
||||
#endif
|
145
00_arches_sh.patch
Normal file
145
00_arches_sh.patch
Normal file
|
@ -0,0 +1,145 @@
|
|||
From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
|
||||
Subject: Add SH supprt
|
||||
|
||||
The test-suite logs can be found at:
|
||||
|
||||
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535288>
|
||||
|
||||
|
||||
---
|
||||
harness/main.c | 2 -
|
||||
src/libaio.h | 10 +++++++
|
||||
src/syscall-sh.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
src/syscall.h | 2 +
|
||||
4 files changed, 91 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: libaio-0.3.109/harness/main.c
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/harness/main.c
|
||||
+++ libaio-0.3.109/harness/main.c
|
||||
@@ -14,7 +14,7 @@
|
||||
#if __LP64__ == 0
|
||||
#if defined(__i386__) || defined(__pwoerpc__) || 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: libaio-0.3.109/src/libaio.h
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/src/libaio.h
|
||||
+++ libaio-0.3.109/src/libaio.h
|
||||
@@ -107,6 +107,16 @@ typedef enum io_iocb_cmd {
|
||||
# else
|
||||
# error "neither mipseb nor mipsel?"
|
||||
# endif
|
||||
+#elif defined(__sh__) /* sh3/sh4*/
|
||||
+# if defined (__BIG_ENDIAN__) /* big endian, 32 bits */
|
||||
+#define PADDED(x, y) unsigned y; x
|
||||
+#define PADDEDptr(x, y) unsigned y; x
|
||||
+#define PADDEDul(x, y) unsigned y; unsigned long x
|
||||
+# elif defined(__LITTLE_ENDIAN__) /* little endian, 32 bits */
|
||||
+#define PADDED(x, y) x; unsigned y
|
||||
+#define PADDEDptr(x, y) x; unsigned y
|
||||
+#define PADDEDul(x, y) unsigned long x; unsigned y
|
||||
+# endif
|
||||
#else
|
||||
#error endian?
|
||||
#endif
|
||||
Index: libaio-0.3.109/src/syscall-sh.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ libaio-0.3.109/src/syscall-sh.h
|
||||
@@ -0,0 +1,78 @@
|
||||
+/* 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
|
||||
+
|
||||
+#define io_syscall1(type,fname,sname,type1,arg1) \
|
||||
+type fname(type1 arg1) \
|
||||
+{ \
|
||||
+register long __sc0 __asm__ ("r3") = __NR_##sname; \
|
||||
+register long __sc4 __asm__ ("r4") = (long) arg1; \
|
||||
+__asm__ __volatile__ ("trapa #0x11" \
|
||||
+ : "=z" (__sc0) \
|
||||
+ : "0" (__sc0), "r" (__sc4) \
|
||||
+ : "memory"); \
|
||||
+ return (type) __sc0;\
|
||||
+}
|
||||
+
|
||||
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
|
||||
+type fname(type1 arg1,type2 arg2) \
|
||||
+{ \
|
||||
+register long __sc0 __asm__ ("r3") = __NR_##sname; \
|
||||
+register long __sc4 __asm__ ("r4") = (long) arg1; \
|
||||
+register long __sc5 __asm__ ("r5") = (long) arg2; \
|
||||
+ __asm__ __volatile__ ("trapa #0x12" \
|
||||
+ : "=z" (__sc0) \
|
||||
+ : "0" (__sc0), "r" (__sc4), "r" (__sc5) \
|
||||
+ : "memory"); \
|
||||
+ return (type) __sc0;\
|
||||
+}
|
||||
+
|
||||
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
|
||||
+type fname(type1 arg1,type2 arg2,type3 arg3) \
|
||||
+{ \
|
||||
+register long __sc0 __asm__ ("r3") = __NR_##sname; \
|
||||
+register long __sc4 __asm__ ("r4") = (long) arg1; \
|
||||
+register long __sc5 __asm__ ("r5") = (long) arg2; \
|
||||
+register long __sc6 __asm__ ("r6") = (long) arg3; \
|
||||
+ __asm__ __volatile__ ("trapa #0x13" \
|
||||
+ : "=z" (__sc0) \
|
||||
+ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \
|
||||
+ : "memory"); \
|
||||
+ return (type) __sc0;\
|
||||
+}
|
||||
+
|
||||
+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
|
||||
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
|
||||
+{ \
|
||||
+register long __sc0 __asm__ ("r3") = __NR_##sname; \
|
||||
+register long __sc4 __asm__ ("r4") = (long) arg1; \
|
||||
+register long __sc5 __asm__ ("r5") = (long) arg2; \
|
||||
+register long __sc6 __asm__ ("r6") = (long) arg3; \
|
||||
+register long __sc7 __asm__ ("r7") = (long) arg4; \
|
||||
+__asm__ __volatile__ ("trapa #0x14" \
|
||||
+ : "=z" (__sc0) \
|
||||
+ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), \
|
||||
+ "r" (__sc7) \
|
||||
+ : "memory" ); \
|
||||
+ return (type) __sc0;\
|
||||
+}
|
||||
+
|
||||
+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
|
||||
+type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
|
||||
+{ \
|
||||
+register long __sc3 __asm__ ("r3") = __NR_##sname; \
|
||||
+register long __sc4 __asm__ ("r4") = (long) arg1; \
|
||||
+register long __sc5 __asm__ ("r5") = (long) arg2; \
|
||||
+register long __sc6 __asm__ ("r6") = (long) arg3; \
|
||||
+register long __sc7 __asm__ ("r7") = (long) arg4; \
|
||||
+register long __sc0 __asm__ ("r0") = (long) arg5; \
|
||||
+__asm__ __volatile__ ("trapa #0x15" \
|
||||
+ : "=z" (__sc0) \
|
||||
+ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \
|
||||
+ "r" (__sc3) \
|
||||
+ : "memory" ); \
|
||||
+ return (type) __sc0;\
|
||||
+}
|
||||
Index: libaio-0.3.109/src/syscall.h
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/src/syscall.h
|
||||
+++ libaio-0.3.109/src/syscall.h
|
||||
@@ -32,6 +32,8 @@
|
||||
#include "syscall-parisc.h"
|
||||
#elif defined(__mips__)
|
||||
#include "syscall-mips.h"
|
||||
+#elif defined(__sh__)
|
||||
+#include "syscall-sh.h"
|
||||
#else
|
||||
#error "add syscall-arch.h"
|
||||
#endif
|
17
01_link_libgcc.patch
Normal file
17
01_link_libgcc.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
src/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: libaio-0.3.109/src/Makefile
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/src/Makefile
|
||||
+++ libaio-0.3.109/src/Makefile
|
||||
@@ -6,7 +6,7 @@ ARCH := $(shell uname -m | sed -e s/i.86
|
||||
CFLAGS := -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC $(OPTFLAGS)
|
||||
SO_CFLAGS=-shared $(CFLAGS)
|
||||
L_CFLAGS=$(CFLAGS)
|
||||
-LINK_FLAGS=
|
||||
+LINK_FLAGS := -lgcc
|
||||
|
||||
soname=libaio.so.1
|
||||
minor=0
|
65
02_libdevdir.patch
Normal file
65
02_libdevdir.patch
Normal file
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
Makefile | 9 ++++++++-
|
||||
src/Makefile | 12 +++++++-----
|
||||
2 files changed, 15 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: libaio-0.3.109/Makefile
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/Makefile
|
||||
+++ libaio-0.3.109/Makefile
|
||||
@@ -5,9 +5,11 @@ RELEASE=$(shell awk '/Release:/ { print
|
||||
CVSTAG = $(NAME)_$(subst .,-,$(VERSION))_$(subst .,-,$(RELEASE))
|
||||
RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
|
||||
|
||||
+DESTDIR=
|
||||
prefix=/usr
|
||||
includedir=$(prefix)/include
|
||||
libdir=$(prefix)/lib
|
||||
+libdevdir=$(prefix)/lib
|
||||
|
||||
pkgname := libaio
|
||||
ver := $(shell cat .version)
|
||||
@@ -23,7 +25,12 @@ all:
|
||||
@$(MAKE) -C src
|
||||
|
||||
install:
|
||||
- @$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
|
||||
+ @$(MAKE) -C src install \
|
||||
+ DESTDIR=$(DESTDIR) \
|
||||
+ prefix=$(prefix) \
|
||||
+ includedir=$(includedir) \
|
||||
+ libdir=$(libdir) \
|
||||
+ libdevdir=$(libdevdir)
|
||||
|
||||
check:
|
||||
@$(MAKE) -C harness check
|
||||
Index: libaio-0.3.109/src/Makefile
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/src/Makefile
|
||||
+++ libaio-0.3.109/src/Makefile
|
||||
@@ -1,6 +1,8 @@
|
||||
+DESTDIR=
|
||||
prefix=/usr
|
||||
includedir=$(prefix)/include
|
||||
libdir=$(prefix)/lib
|
||||
+libdevdir=$(prefix)/lib
|
||||
|
||||
ARCH := $(shell uname -m | sed -e s/i.86/i386/)
|
||||
CFLAGS := -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC $(OPTFLAGS)
|
||||
@@ -51,11 +53,11 @@ $(libname): $(libaio_sobjs) libaio.map
|
||||
$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
|
||||
|
||||
install: $(all_targets)
|
||||
- install -D -m 644 libaio.h $(includedir)/libaio.h
|
||||
- install -D -m 644 libaio.a $(libdir)/libaio.a
|
||||
- install -D -m 755 $(libname) $(libdir)/$(libname)
|
||||
- ln -sf $(libname) $(libdir)/$(soname)
|
||||
- ln -sf $(libname) $(libdir)/libaio.so
|
||||
+ install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
|
||||
+ install -D -m 644 libaio.a $(DESTDIR)$(libdevdir)/libaio.a
|
||||
+ install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
|
||||
+ ln -sf $(libdir)/$(libname) $(DESTDIR)$(libdir)/$(soname)
|
||||
+ ln -sf $(libdir)/$(libname) $(DESTDIR)$(libdevdir)/libaio.so
|
||||
|
||||
$(libaio_objs): libaio.h
|
||||
|
2671
03_man_errors.patch
Normal file
2671
03_man_errors.patch
Normal file
File diff suppressed because it is too large
Load diff
7
baselibs.conf
Normal file
7
baselibs.conf
Normal file
|
@ -0,0 +1,7 @@
|
|||
libaio1
|
||||
obsoletes "libaio-<targettype> < <version>"
|
||||
provides "libaio-<targettype> = <version>"
|
||||
libaio-devel
|
||||
requires -libaio-<targettype>
|
||||
requires "libaio1-<targettype> = <version>"
|
||||
|
34
libaio-aarch64-support.diff
Normal file
34
libaio-aarch64-support.diff
Normal file
|
@ -0,0 +1,34 @@
|
|||
Index: harness/cases/16.t
|
||||
===================================================================
|
||||
--- harness/cases/16.t.orig
|
||||
+++ harness/cases/16.t
|
||||
@@ -18,6 +18,8 @@
|
||||
#define SYS_eventfd 318
|
||||
#elif defined(__alpha__)
|
||||
#define SYS_eventfd 478
|
||||
+#elif defined(__aarch64__)
|
||||
+#define SYS_eventfd 1044
|
||||
#else
|
||||
#error define SYS_eventfd for your arch!
|
||||
#endif
|
||||
Index: src/libaio.h
|
||||
===================================================================
|
||||
--- src/libaio.h.orig
|
||||
+++ src/libaio.h
|
||||
@@ -117,6 +117,16 @@ typedef enum io_iocb_cmd {
|
||||
#define PADDEDptr(x, y) x; unsigned y
|
||||
#define PADDEDul(x, y) unsigned long x; unsigned y
|
||||
# endif
|
||||
+#elif defined(__aarch64__)
|
||||
+# if defined (__AARCH64EB__) /* big endian, 64 bits */
|
||||
+#define PADDED(x, y) unsigned y; x
|
||||
+#define PADDEDptr(x,y) x
|
||||
+#define PADDEDul(x, y) unsigned long x
|
||||
+# elif defined(__AARCH64EL__) /* little endian, 64 bits */
|
||||
+#define PADDED(x, y) x, y
|
||||
+#define PADDEDptr(x, y) x
|
||||
+#define PADDEDul(x, y) unsigned long x
|
||||
+# endif
|
||||
#else
|
||||
#error endian?
|
||||
#endif
|
58
libaio-generic-arch.diff
Normal file
58
libaio-generic-arch.diff
Normal file
|
@ -0,0 +1,58 @@
|
|||
From 5e96c73d5dfbdea8d0be82b7f3fc8d6735e5dfa7 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Frysinger <vapier@gentoo.org>
|
||||
Date: Sun, 17 Jan 2010 17:07:48 -0500
|
||||
Subject: [PATCH] add a generic syscall() fallback
|
||||
|
||||
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
||||
---
|
||||
src/syscall-generic.h | 29 +++++++++++++++++++++++++++++
|
||||
src/syscall.h | 3 ++-
|
||||
2 files changed, 31 insertions(+), 1 deletions(-)
|
||||
create mode 100644 src/syscall-generic.h
|
||||
|
||||
Index: src/syscall-generic.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ src/syscall-generic.h
|
||||
@@ -0,0 +1,29 @@
|
||||
+#include <errno.h>
|
||||
+#include <unistd.h>
|
||||
+#include <sys/syscall.h>
|
||||
+
|
||||
+#define _body_io_syscall(sname, args...) \
|
||||
+{ \
|
||||
+ int ret = syscall(__NR_##sname, ## args); \
|
||||
+ return ret < 0 ? -errno : ret; \
|
||||
+}
|
||||
+
|
||||
+#define io_syscall1(type,fname,sname,type1,arg1) \
|
||||
+type fname(type1 arg1) \
|
||||
+_body_io_syscall(sname, (long)arg1)
|
||||
+
|
||||
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
|
||||
+type fname(type1 arg1,type2 arg2) \
|
||||
+_body_io_syscall(sname, (long)arg1, (long)arg2)
|
||||
+
|
||||
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
|
||||
+type fname(type1 arg1,type2 arg2,type3 arg3) \
|
||||
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3)
|
||||
+
|
||||
+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
|
||||
+type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
|
||||
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3, (long)arg4)
|
||||
+
|
||||
+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, type5,arg5) \
|
||||
+type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
|
||||
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3, (long)arg4, (long)arg5)
|
||||
Index: src/syscall.h
|
||||
===================================================================
|
||||
--- src/syscall.h.orig
|
||||
+++ src/syscall.h
|
||||
@@ -35,5 +35,6 @@
|
||||
#elif defined(__sh__)
|
||||
#include "syscall-sh.h"
|
||||
#else
|
||||
-#error "add syscall-arch.h"
|
||||
+#warning "using generic syscall method"
|
||||
+#include "syscall-generic.h"
|
||||
#endif
|
13
libaio-optflags.diff
Normal file
13
libaio-optflags.diff
Normal file
|
@ -0,0 +1,13 @@
|
|||
Index: libaio-0.3.109/src/Makefile
|
||||
===================================================================
|
||||
--- libaio-0.3.109.orig/src/Makefile
|
||||
+++ libaio-0.3.109/src/Makefile
|
||||
@@ -3,7 +3,7 @@ includedir=$(prefix)/include
|
||||
libdir=$(prefix)/lib
|
||||
|
||||
ARCH := $(shell uname -m | sed -e s/i.86/i386/)
|
||||
-CFLAGS := -nostdlib -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC
|
||||
+CFLAGS := -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC $(OPTFLAGS)
|
||||
SO_CFLAGS=-shared $(CFLAGS)
|
||||
L_CFLAGS=$(CFLAGS)
|
||||
LINK_FLAGS=
|
93
libaio.changes
Normal file
93
libaio.changes
Normal file
|
@ -0,0 +1,93 @@
|
|||
* Sun Apr 17 2016 meissner@suse.com
|
||||
- libaio-optflags.diff: readd -stdlib to allow -fstack-protector-strong
|
||||
builds (unclear why it was not allowed)
|
||||
- 01_link_libgcc.patch, 02_libdevdir.patch: refreshed
|
||||
* Tue Aug 26 2014 fcrozat@suse.com
|
||||
- Add obsoletes/provides to baselibs.conf (bsc#881698)
|
||||
* Fri Mar 1 2013 dmueller@suse.com
|
||||
- Add libaio-aarch64-support.diff:
|
||||
* add support for aarch64
|
||||
- Add libaio-generic-arch.diff:
|
||||
* support all archtes (also aarch64)
|
||||
* Fri Feb 17 2012 coolo@suse.com
|
||||
- fix baselibs.conf after shlib split
|
||||
* Thu Feb 16 2012 mvyskocil@suse.cz
|
||||
- fix typo versoin/version
|
||||
* Mon Feb 13 2012 coolo@suse.com
|
||||
- patch license to follow spdx.org standard
|
||||
* Mon Nov 28 2011 jengelh@medozas.de
|
||||
- Remove redundant/unwanted tags/section (cf. specfile guidelines)
|
||||
- Employ shlib packaging
|
||||
* Mon Nov 28 2011 ro@suse.de
|
||||
- fix lib64 platform check
|
||||
* Wed Oct 5 2011 uli@suse.com
|
||||
- cross-build fix: use %%__cc macro
|
||||
* Fri Sep 30 2011 adrian@suse.de
|
||||
- drop debian arm hack to fix build on arm ;)
|
||||
* Tue Mar 15 2011 jengelh@medozas.de
|
||||
- Update to libaio 0.3.109
|
||||
* add ARM architecture support (grabbed from Debian arches tree)
|
||||
* replace check of __i386__ with __LP64__ in test harness
|
||||
- refreshed patches
|
||||
* Fri Feb 12 2010 jengelh@medozas.de
|
||||
- fix more symbolic links to not include a /usr/src/ prefix
|
||||
* Sat Jan 23 2010 jengelh@medozas.de
|
||||
- update to libaio 0.3.107
|
||||
- add more patches from Debian to fix compile errors on SPARC
|
||||
- package baselibs.conf
|
||||
* Sun Aug 2 2009 jansimon.moeller@opensuse.org
|
||||
- add ARM support to libaio sources
|
||||
* Tue Mar 3 2009 crrodriguez@suse.de
|
||||
- remove static libraries
|
||||
- fix -devel package dependencies
|
||||
* Wed Dec 10 2008 olh@suse.de
|
||||
- use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade
|
||||
(bnc#437293)
|
||||
* Thu Dec 4 2008 olh@suse.de
|
||||
- obsolete old -XXbit packages (bnc#437293)
|
||||
* Thu Apr 10 2008 ro@suse.de
|
||||
- added baselibs.conf file to build xxbit packages
|
||||
for multilib support
|
||||
* Thu Sep 27 2007 hare@suse.de
|
||||
- Fix dangling symlink (#307063)
|
||||
* Thu Aug 2 2007 hare@suse.de
|
||||
- Use RPM_OPT_FLAGS
|
||||
- Fix installation directories
|
||||
* Wed Jan 25 2006 mls@suse.de
|
||||
- converted neededforbuild to BuildRequires
|
||||
* Thu May 5 2005 schwab@suse.de
|
||||
- Fix ia64 assembler.
|
||||
* Wed Apr 27 2005 kukuk@suse.de
|
||||
- Update to version 0.3.104
|
||||
* Wed Dec 1 2004 kukuk@suse.de
|
||||
- Update to version 0.3.102 [#44374]
|
||||
* Tue Apr 20 2004 meissner@suse.de
|
||||
- fixed ppc64 alignment problems. [#38801/LTC#7503]
|
||||
* Fri Mar 12 2004 kukuk@suse.de
|
||||
- Update to 0.3.98 [Bug #35266]
|
||||
* Tue Mar 2 2004 ro@suse.de
|
||||
- use -fPIC for shared objects on ppc
|
||||
* Sun Jan 11 2004 adrian@suse.de
|
||||
- add %%defattr and %%run_ldconfig
|
||||
* Wed Oct 1 2003 schwab@suse.de
|
||||
- Fix for ia64.
|
||||
* Wed Apr 23 2003 coolo@suse.de
|
||||
- fix build for lib64
|
||||
* Wed Apr 23 2003 coolo@suse.de
|
||||
- use BuildRoot
|
||||
* Fri Apr 11 2003 ro@suse.de
|
||||
- fix header to be includable with glibc (#26033)
|
||||
* Thu Apr 3 2003 kukuk@suse.de
|
||||
- Add missing "const" to libaio.h [#26030]
|
||||
* Tue Oct 1 2002 meissner@suse.de
|
||||
- Fixed __syscall_return for ppc.
|
||||
* Fri Sep 20 2002 fehr@suse.de
|
||||
- Add syscall defines for x86_64
|
||||
- add Andreas fix for testsuite main program to compile on x86_64
|
||||
- add another fix to make testsuite build again on ia64
|
||||
* Thu Sep 19 2002 schwab@suse.de
|
||||
- Add missing bits for ia64.
|
||||
* Tue Sep 17 2002 ro@suse.de
|
||||
- removed bogus self-provides
|
||||
* Wed Sep 4 2002 fehr@suse.de
|
||||
- make package from libaio-0.3.15-2.5
|
110
libaio.spec
Normal file
110
libaio.spec
Normal file
|
@ -0,0 +1,110 @@
|
|||
#
|
||||
# spec file for package libaio
|
||||
#
|
||||
# Copyright (c) 2022-2023 ZhuningOS
|
||||
#
|
||||
|
||||
|
||||
Name: libaio
|
||||
%define lname libaio1
|
||||
# bug437293
|
||||
%ifarch ppc64
|
||||
Obsoletes: libaio-64bit
|
||||
%endif
|
||||
#
|
||||
Version: 0.3.109
|
||||
Release: 1.25
|
||||
Summary: Linux-Native Asynchronous I/O Access Library
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Libraries/C and C++
|
||||
Url: http://kernel.org/pub/linux/libs/aio/
|
||||
Source: libaio-%{version}.tar.bz2
|
||||
Source2: baselibs.conf
|
||||
Patch2: libaio-optflags.diff
|
||||
Patch3: 00_arches.patch
|
||||
Patch4: 00_arches_sh.patch
|
||||
Patch5: 01_link_libgcc.patch
|
||||
Patch6: 02_libdevdir.patch
|
||||
Patch7: 03_man_errors.patch
|
||||
Patch8: libaio-aarch64-support.diff
|
||||
Patch9: libaio-generic-arch.diff
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
The Linux-native asynchronous I/O facility ("async I/O", or "aio") has
|
||||
a richer API and capability set than the simple POSIX async I/O
|
||||
facility. This library provides the Linux-native API for async I/O. The
|
||||
POSIX async I/O facility requires this library to provide
|
||||
kernel-accelerated async I/O capabilities, as do applications that
|
||||
require the Linux-native async I/O API.
|
||||
|
||||
%package -n %lname
|
||||
Summary: Linux-Native Asynchronous I/O Access Library
|
||||
# O/P added 2011-11-27
|
||||
Group: System/Libraries
|
||||
Obsoletes: libaio < %version-%release
|
||||
Provides: libaio = %version-%release
|
||||
|
||||
%description -n %lname
|
||||
The Linux-native asynchronous I/O facility ("async I/O", or "aio") has
|
||||
a richer API and capability set than the simple POSIX async I/O
|
||||
facility. This library provides the Linux-native API for async I/O. The
|
||||
POSIX async I/O facility requires this library to provide
|
||||
kernel-accelerated async I/O capabilities, as do applications that
|
||||
require the Linux-native async I/O API.
|
||||
|
||||
%package devel
|
||||
Summary: Development Files for Linux-native Asynchronous I/O Access
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %lname = %version
|
||||
Requires: glibc-devel
|
||||
# bug437293
|
||||
%ifarch ppc64
|
||||
Obsoletes: libaio-devel-64bit
|
||||
%endif
|
||||
#
|
||||
|
||||
%description devel
|
||||
This package provides header files to include, and libraries to link
|
||||
with, for the Linux-native asynchronous I/O facility ("async I/O", or
|
||||
"aio").
|
||||
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch2 -p1
|
||||
%patch -p1 -P 3 -P 4 -P 5 -P 6 -P 7
|
||||
%patch8
|
||||
%patch9
|
||||
|
||||
%build
|
||||
make %{?_smp_mflags} CC="%__cc" OPTFLAGS="$RPM_OPT_FLAGS"
|
||||
|
||||
%install
|
||||
make install prefix=%{buildroot}/usr libdir=%{buildroot}/%{_lib}
|
||||
%if "%_lib" == "lib64"
|
||||
mv "%buildroot/usr/lib" "%buildroot/usr/lib64"
|
||||
%endif
|
||||
rm -f "%buildroot/%_libdir"/*.a
|
||||
# Strip dumb /usr/src/... off
|
||||
t=$(readlink -f "%buildroot/%_lib/libaio.so.1")
|
||||
ln -fs "${t##*/}" "%buildroot/%_lib/libaio.so.1"
|
||||
t=$(readlink -f "%buildroot/%_libdir/libaio.so")
|
||||
ln -fs "${t#%buildroot}" "%buildroot/%_libdir/libaio.so"
|
||||
|
||||
%post -n %lname -p /sbin/ldconfig
|
||||
|
||||
%postun -n %lname -p /sbin/ldconfig
|
||||
|
||||
%files -n %lname
|
||||
%defattr(644,root,root,755)
|
||||
%doc COPYING TODO
|
||||
%attr(0755,root,root) /%{_lib}/libaio.*
|
||||
|
||||
%files devel
|
||||
%defattr(644,root,root,755)
|
||||
/usr/include/libaio.h
|
||||
%_libdir/libaio.so
|
||||
|
||||
%changelog
|
Loading…
Add table
Reference in a new issue