[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/libaio/devel libaio-0.3.106-convert-to-syscall2.patch, NONE, 1.1.2.1 libaio.spec, 1.23, 1.23.2.1



Author: jmoyer

Update of /cvs/dist/rpms/libaio/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv29054

Modified Files:
      Tag: private-jmoyer-syscall2-branch
	libaio.spec 
Added Files:
      Tag: private-jmoyer-syscall2-branch
	libaio-0.3.106-convert-to-syscall2.patch 
Log Message:
- remove system call assembler and replace with syscall(2)



libaio-0.3.106-convert-to-syscall2.patch:
 Makefile           |    2 +-
 io_queue_init.c    |    6 ++++--
 io_queue_release.c |    5 ++++-
 syscall-alpha.h    |    3 +++
 syscall-i386.h     |    6 ++++++
 syscall-ia64.h     |    3 +++
 syscall-ppc.h      |    3 +++
 syscall-s390.h     |    3 +++
 syscall-x86_64.h   |    3 +++
 syscall.h          |   41 +++++++++++++++++++++++++++++++++++++++++
 10 files changed, 71 insertions(+), 4 deletions(-)

--- NEW FILE libaio-0.3.106-convert-to-syscall2.patch ---
? src/compat-0_1.ol
? src/compat-0_1.os
? src/io_cancel.ol
? src/io_cancel.os
? src/io_destroy.ol
? src/io_destroy.os
? src/io_getevents.ol
? src/io_getevents.os
? src/io_queue_init.ol
? src/io_queue_init.os
? src/io_queue_release.ol
? src/io_queue_release.os
? src/io_queue_run.ol
? src/io_queue_run.os
? src/io_queue_wait.ol
? src/io_queue_wait.os
? src/io_setup.ol
? src/io_setup.os
? src/io_submit.ol
? src/io_submit.os
? src/libaio.so.1.0.1
Index: src/Makefile
===================================================================
RCS file: /usr/local/CVS/libaio/src/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- src/Makefile	25 Jan 2005 19:49:48 -0000	1.20
+++ src/Makefile	26 Apr 2007 18:57:46 -0000
@@ -25,7 +25,7 @@ libaio_srcs += io_getevents.c io_submit.
 libaio_srcs += io_setup.c io_destroy.c
 
 # internal functions
-libaio_srcs += raw_syscall.c
+# libaio_srcs += raw_syscall.c
 
 # old symbols
 libaio_srcs += compat-0_1.c
Index: src/io_queue_init.c
===================================================================
RCS file: /usr/local/CVS/libaio/src/io_queue_init.c,v
retrieving revision 1.5
diff -u -p -r1.5 io_queue_init.c
--- src/io_queue_init.c	20 May 2003 15:54:50 -0000	1.5
+++ src/io_queue_init.c	26 Apr 2007 18:57:46 -0000
@@ -25,9 +25,11 @@
 
 int io_queue_init(int maxevents, io_context_t *ctxp)
 {
+	int ret = -EINVAL;
+
 	if (maxevents > 0) {
 		*ctxp = NULL;
-		return io_setup(maxevents, ctxp);
+		ret = io_setup(maxevents, ctxp);
 	}
-	return -EINVAL;
+	return ret;
 }
Index: src/io_queue_release.c
===================================================================
RCS file: /usr/local/CVS/libaio/src/io_queue_release.c,v
retrieving revision 1.3
diff -u -p -r1.3 io_queue_release.c
--- src/io_queue_release.c	13 Sep 2002 03:30:12 -0000	1.3
+++ src/io_queue_release.c	26 Apr 2007 18:57:46 -0000
@@ -23,5 +23,8 @@
 
 int io_queue_release(io_context_t ctx)
 {
-	return io_destroy(ctx);
+	int ret;
+
+	ret = io_destroy(ctx);
+	return ret;
 }
Index: src/syscall-alpha.h
===================================================================
RCS file: /usr/local/CVS/libaio/src/syscall-alpha.h,v
retrieving revision 1.1
diff -u -p -r1.1 syscall-alpha.h
--- src/syscall-alpha.h	1 Apr 2005 20:31:32 -0000	1.1
+++ src/syscall-alpha.h	26 Apr 2007 18:57:46 -0000
@@ -4,6 +4,8 @@
 #define __NR_io_submit		401
 #define __NR_io_cancel		402
 
+#if 0
+
 #define inline_syscall_r0_asm
 #define inline_syscall_r0_out_constraint        "=v"
 
@@ -207,3 +209,4 @@ type fname (type1 arg1,type2 arg2,type3 
 {									\
    return (type)INLINE_SYSCALL1(sname, 5, arg1, arg2, arg3, arg4, arg5);\
 }
+#endif
Index: src/syscall-i386.h
===================================================================
RCS file: /usr/local/CVS/libaio/src/syscall-i386.h,v
retrieving revision 1.5
diff -u -p -r1.5 syscall-i386.h
--- src/syscall-i386.h	13 Oct 2004 18:10:27 -0000	1.5
+++ src/syscall-i386.h	26 Apr 2007 18:57:46 -0000
@@ -4,6 +4,9 @@
 #define __NR_io_submit		248
 #define __NR_io_cancel		249
 
+#if 0
+
+
 #define io_syscall1(type,fname,sname,type1,arg1)	\
 type fname(type1 arg1)					\
 {							\
@@ -70,3 +73,6 @@ __asm__ volatile ("movl %%ebx,%7\n"					
 	  "m" (tmp));							\
 return __res;								\
 }
+
+
+#endif
Index: src/syscall-ia64.h
===================================================================
RCS file: /usr/local/CVS/libaio/src/syscall-ia64.h,v
retrieving revision 1.8
diff -u -p -r1.8 syscall-ia64.h
--- src/syscall-ia64.h	1 Aug 2005 17:55:04 -0000	1.8
+++ src/syscall-ia64.h	26 Apr 2007 18:57:46 -0000
@@ -4,6 +4,8 @@
 #define __NR_io_submit		1241
 #define __NR_io_cancel		1242
 
+#if 0
+
 #define __ia64_raw_syscall(fname, sname) \
 	__asm__ (".text\n"						\
 		".globl " SYMSTR(fname) "\n"				\
@@ -43,3 +45,4 @@
 #define io_syscall5(type, fname, sname, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5)	\
 	extern type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5);			\
 	__ia64_raw_syscall(fname, sname);
+#endif
Index: src/syscall-ppc.h
===================================================================
RCS file: /usr/local/CVS/libaio/src/syscall-ppc.h,v
retrieving revision 1.4
diff -u -p -r1.4 syscall-ppc.h
--- src/syscall-ppc.h	13 Oct 2004 18:10:27 -0000	1.4
+++ src/syscall-ppc.h	26 Apr 2007 18:57:46 -0000
@@ -4,6 +4,7 @@
 #define __NR_io_submit		230
 #define __NR_io_cancel		231
 
+#if 0
 /* On powerpc a system call basically clobbers the same registers like a
  * function call, with the exception of LR (which is needed for the
  * "sc; bnslr" sequence) and CR (where only CR0.SO is clobbered to signal
@@ -92,3 +93,5 @@ type fname(type1 arg1, type2 arg2, type3
 {									\
 	__syscall_nr(5, type, sname, arg1, arg2, arg3, arg4, arg5);	\
 }
+
+#endif
Index: src/syscall-s390.h
===================================================================
RCS file: /usr/local/CVS/libaio/src/syscall-s390.h,v
retrieving revision 1.5
diff -u -p -r1.5 syscall-s390.h
--- src/syscall-s390.h	14 Oct 2004 15:48:53 -0000	1.5
+++ src/syscall-s390.h	26 Apr 2007 18:57:46 -0000
@@ -4,6 +4,8 @@
 #define __NR_io_submit		246
 #define __NR_io_cancel		247
 
+#if 0
+
 #define io_svc_clobber "1", "cc", "memory"
 
 #define io_syscall1(type,fname,sname,type1,arg1)		\
@@ -129,3 +131,4 @@ type fname(type1 arg1, type2 arg2, type3
 	__res = __svcres;					\
 	return (type) __res;					\
 }
+#endif
Index: src/syscall-x86_64.h
===================================================================
RCS file: /usr/local/CVS/libaio/src/syscall-x86_64.h,v
retrieving revision 1.5
diff -u -p -r1.5 syscall-x86_64.h
--- src/syscall-x86_64.h	13 Oct 2004 18:10:27 -0000	1.5
+++ src/syscall-x86_64.h	26 Apr 2007 18:57:46 -0000
@@ -4,6 +4,8 @@
 #define __NR_io_submit		209
 #define __NR_io_cancel		210
 
+#if 0
+
 #define __syscall_clobber "r11","rcx","memory" 
 #define __syscall "syscall"
 
@@ -61,3 +63,4 @@ __asm__ volatile ("movq %5,%%r10 ; movq 
 	__syscall_clobber,"r8","r10" );					\
 return __res;								\
 }
+#endif
Index: src/syscall.h
===================================================================
RCS file: /usr/local/CVS/libaio/src/syscall.h,v
retrieving revision 1.12
diff -u -p -r1.12 syscall.h
--- src/syscall.h	1 Apr 2005 20:31:32 -0000	1.12
+++ src/syscall.h	26 Apr 2007 18:57:46 -0000
@@ -1,5 +1,6 @@
 #include <sys/syscall.h>
 #include <unistd.h>
+#include <sys/errno.h>
 
 #define _SYMSTR(str)	#str
 #define SYMSTR(str)	_SYMSTR(str)
@@ -9,6 +10,46 @@
 
 #define DEFSYMVER(compat_sym, orig_sym, ver_sym)	\
 	__asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym));
+
+
+/* io_* calls return negative errno and do not set errno */
+#define NEG_ERRNO(x)	(x == -1 ? -errno : x)
+
+#define io_syscall1(type,fname,sname,type1,arg1)	\
+type fname(type1 arg1)					\
+{							\
+	long _res = syscall(__NR_##sname, arg1);	\
+	return NEG_ERRNO(_res);				\
+}
+
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)	\
+type fname(type1 arg1,type2 arg2)				\
+{								\
+	long _res = syscall(__NR_##sname, arg1, arg2);		\
+	return NEG_ERRNO(_res);					\
+}
+
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)	\
+type fname(type1 arg1,type2 arg2,type3 arg3)				\
+{									\
+	long _res = syscall(__NR_##sname, arg1, arg2, arg3);		\
+	return NEG_ERRNO(_res);						\
+}
+
+#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 = syscall(__NR_##sname, arg1, arg2, arg3, arg4);	\
+	return NEG_ERRNO(_res);						\
+}
+
+#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 = syscall(__NR_##sname, arg1, arg2, arg3, arg4, arg5); \
+	return NEG_ERRNO(_res);						\
+}
 
 #if defined(__i386__)
 #include "syscall-i386.h"


Index: libaio.spec
===================================================================
RCS file: /cvs/dist/rpms/libaio/devel/libaio.spec,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -u -r1.23 -r1.23.2.1
--- libaio.spec	17 Jul 2006 13:07:32 -0000	1.23
+++ libaio.spec	27 Apr 2007 13:40:52 -0000	1.23.2.1
@@ -1,10 +1,11 @@
 Name: libaio
 Version: 0.3.106
-Release: 3.2
+Release: 3.3
 Summary: Linux-native asynchronous I/O access library
 License: LGPL
 Group:  System Environment/Libraries
 Source: %{name}-%{version}.tar.gz
+Patch1: libaio-0.3.106-convert-to-syscall2.patch
 BuildRoot: %{_tmppath}/%{name}-root
 # Fix ExclusiveArch as we implement this functionality on more architectures
 ExclusiveArch: i386 x86_64 ia64 s390 s390x ppc ppc64 ppc64pseries ppc64iseries alpha alphaev6
@@ -29,6 +30,7 @@
 %prep
 %setup -a 0
 mv %{name}-%{version} compat-%{name}-%{version}
+%patch1 -p0 -b .syscall2
 
 %build
 # A library with a soname of 1.0.0 was inadvertantly released.  This
@@ -70,6 +72,9 @@
 %attr(0644,root,root) %{_libdir}/libaio.a
 
 %changelog
+* Fri Apr 27 2007 Jeff Moyer <jmoyer redhat com> - 0.3.106-3.3
+- remove system call assembler and replace with syscall(2)
+
 * Mon Jul 17 2006 Jeff Moyer <jmoyer redhat com> - 0.3.106-3.2
 - rebuild
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]