[oe-commits] Phil Staub : libaio: Fix MIPS system call interface

git at git.openembedded.org git at git.openembedded.org
Fri Feb 1 15:55:26 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: 0d8f50c33e5ff71dc17121b5c293718a8ad602bd
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=0d8f50c33e5ff71dc17121b5c293718a8ad602bd

Author: Phil Staub <Phil.Staub at windriver.com>
Date:   Thu Jan 31 08:35:25 2013 -0800

libaio: Fix MIPS system call interface

The io_syscallX wrappers in syscall-mips.h discard error return status
by overwriting the value returned in v0 from the system call with -1.

Modify this behavior by returning the negative of the return value on
error (as identified by a3 != 0). This convention is consistent with
the behavior observed in syscall-ppc.h.

For a description of the MIPS system call interface, see:

http://www.linux-mips.org/wiki/Syscall

Signed-off-by: Phil Staub <Phil.Staub at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 .../libaio/libaio_fix_for_mips_syscalls.patch      |   62 ++++++++++++++++++++
 meta/recipes-extended/libaio/libaio_0.3.109.bb     |    3 +-
 2 files changed, 64 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch b/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
new file mode 100644
index 0000000..022276a
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
@@ -0,0 +1,62 @@
+Upstream status: Inappropriate [embedded specific]
+
+Signed-off-by: Phil Staub <Phil.Staub at windriver.com>
+
+Index: libaio-0.3.109/src/syscall-mips.h
+===================================================================
+--- libaio-0.3.109.orig/src/syscall-mips.h
++++ libaio-0.3.109/src/syscall-mips.h
+@@ -76,7 +76,7 @@ type fname(atype a) \
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #define io_syscall2(type,fname,sname,atype,a,btype,b) \
+@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
+@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
+@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #if (_MIPS_SIM == _MIPS_SIM_ABI32)
+@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
+@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
diff --git a/meta/recipes-extended/libaio/libaio_0.3.109.bb b/meta/recipes-extended/libaio/libaio_0.3.109.bb
index afe9adf..978f5f5 100644
--- a/meta/recipes-extended/libaio/libaio_0.3.109.bb
+++ b/meta/recipes-extended/libaio/libaio_0.3.109.bb
@@ -5,7 +5,7 @@ HOMEPAGE = "http://lse.sourceforge.net/io/aio.html"
 LICENSE = "LGPLv2.1+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
 
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \
            file://00_arches.patch \
@@ -14,6 +14,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \
            file://libaio_fix_for_x32.patch \
            file://libaio-generic.patch \
            file://libaio-aarch64.patch \
+           file://libaio_fix_for_mips_syscalls.patch \
 "
 
 SRC_URI[md5sum] = "435a5b16ca6198eaf01155263d855756"





More information about the Openembedded-commits mailing list