mips: Fix libaio system call interface
PATCH 1/1 mips: Fix libaio 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
--- .../libaio/libaio_fix_for_mips_syscall.patch | 57 ++++++++++++++++++++ meta/recipes-extended/libaio/libaio_0.3.109.bb | 6 ++- 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patch
meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patch new file +57 -0
@@ -0,0 +1,57 @@ +diff -urp libaio-0.3.109.orig/src/syscall-mips.h libaio-0.3.109/src/syscall-mips.h +--- libaio-0.3.109.orig/src/syscall-mips.h 2013-01-23 20:17:55.750897706 -0800 ++++ libaio-0.3.109/src/syscall-mips.h 2013-01-23 13:13:34.143660455 -0800 +@@ -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) */
meta/recipes-extended/libaio/libaio_0.3.109.bb +4 -2
@@ -5,13 +5,15 @@ 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 \ file://toolchain.patch \ file://destdir.patch \ - file://libaio_fix_for_x32.patch" + file://libaio_fix_for_x32.patch \ + file://libaio_fix_for_mips_syscall.patch \ +" SRC_URI[md5sum] = "435a5b16ca6198eaf01155263d855756" SRC_URI[sha256sum] = "bf4a457253cbaab215aea75cb6e18dc8d95bbd507e9920661ff9bdd288c8778d"
Signature · 1 line
1.7.7.6
Quoted 90 lines · Phil Staub
The
io_syscallXwrappers insyscall-mips.hdiscard 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 <[email protected]>--- .../libaio/libaio_fix_for_mips_syscall.patch | 57 ++++++++++++++++++++ meta/recipes-extended/libaio/libaio_0.3.109.bb | 6 ++- 2 files changed, 61 insertions(+), 2 deletions(-)create mode 100644
meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patchmeta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patch new file +57
-0@@ -0,0 +1,57 @@ +diff -urp libaio-0.3.109.orig/src/syscall-mips.h libaio-0.3.109/src/syscall-mips.h +--- libaio-0.3.109.orig/src/syscall-mips.h 2013-01-23 20:17:55.750897706 -0800 ++++ libaio-0.3.109/src/syscall-mips.h 2013-01-23 13:13:34.143660455 -0800 +@@ -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) */meta/recipes-extended/libaio/libaio_0.3.109.bb +0
-1@@ -5,13 +5,15 @@ HOMEPAGE = "http://lse.sourceforge.net/io/aio.html" LICENSE = "LGPLv2.1+" LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499" -PR = "r1"
meta/recipes-extended/libaio/libaio_0.3.109.bb HOMEPAGE = "http://lse.sourceforge.net/io/aio.html" · line 16
Quoted 10 lines
meta/recipes-extended/libaio/libaio_0.3.109.bb +4
-1+PR = "r2" SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \ file://00_arches.patch \ file://toolchain.patch \ file://destdir.patch \ - file://libaio_fix_for_x32.patch" + file://libaio_fix_for_x32.patch \ + file://libaio_fix_for_mips_syscall.patch \ +"
This needs to be rebased to Master.
Sau!
Quoted 4 lines
meta/recipes-extended/libaio/libaio_0.3.109.bb +0
-0SRC_URI[md5sum] = "435a5b16ca6198eaf01155263d855756" SRC_URI[sha256sum] = "bf4a457253cbaab215aea75cb6e18dc8d95bbd507e9920661ff9bdd288c8778d"
Quoted 104 lines · Saul Wold
Quoted 103 lines · Phil Staub
The
io_syscallXwrappers insyscall-mips.hdiscard 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 <[email protected]>--- .../libaio/libaio_fix_for_mips_syscall.patch | 57 ++++++++++++++++++++ meta/recipes-extended/libaio/libaio_0.3.109.bb | 6 ++- 2 files changed, 61 insertions(+), 2 deletions(-)create mode 100644
meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patchdiff --git
a/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patchb/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patchnew file mode 100644
index 0000000..0408865
---/dev/null
+++b/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patch(quoted diff) +1
-0@@ -0,0 +1,57 @@ +diff -urp libaio-0.3.109.orig/src/syscall-mips.h
libaio-0.3.109/src/syscall-mips.h
+---libaio-0.3.109.orig/src/syscall-mips.h2013-01-23
20:17:55.750897706 -0800
++++libaio-0.3.109/src/syscall-mips.h2013-01-23
13:13:34.143660455 -0800
+@@ -76,7 +76,7 @@ type fname(atype a) \meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscall.patch new file +53
-0+ \ + 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) */meta/recipes-extended/libaio/libaio_0.3.109.bb +0
-0@@ -5,13 +5,15 @@ HOMEPAGE = "http://lse.sourceforge.net/io/aio.html" LICENSE = "LGPLv2.1+" LIC_FILES_CHKSUM ="file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
meta/recipes-extended/libaio/libaio_0.3.109.bb +1
-1-PR = "r1" +PR = "r2"
Quoted 10 lines
meta/recipes-extended/libaio/libaio_0.3.109.bb HOMEPAGE = "http://lse.sourceforge.net/io/aio.html" · line 16
Quoted 8 lines
SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \ file://00_arches.patch \ file://toolchain.patch \ file://destdir.patch \meta/recipes-extended/libaio/libaio_0.3.109.bb +3
-1- file://libaio_fix_for_x32.patch" + file://libaio_fix_for_x32.patch \ + file://libaio_fix_for_mips_syscall.patch \ +"This needs to be rebased to Master.
OK. Thanks.
Phil
Quoted 10 lines
Sau!
Quoted 5 lines
SRC_URI[md5sum] = "
435a5b16ca6198eaf01155263d855756" SRC_URI[sha256sum] =
"bf4a457253cbaab215aea75cb6e18dc8d95bbd507e9920661ff9bdd288c8778d"
Signature · 2 lines
Phil Staub, Senior Member of Technical Staff, Wind River Direct: 702.290.0470 Fax: 702.982.0085