005_arches_mips.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. diff -upNr a/src/syscall-mips.h b/src/syscall-mips.h
  6. --- a/src/syscall-mips.h 2012-09-13 11:46:35.652286733 +0200
  7. +++ b/src/syscall-mips.h 2012-09-13 16:09:17.964407909 +0200
  8. @@ -76,7 +76,7 @@ type fname(atype a) \
  9. \
  10. if (__a3 == 0) \
  11. return (type) __v0; \
  12. - return (type) -1; \
  13. + return (type) 0 - __v0; \
  14. }
  15. #define io_syscall2(type,fname,sname,atype,a,btype,b) \
  16. @@ -100,7 +100,7 @@ type fname(atype a, btype b) \
  17. \
  18. if (__a3 == 0) \
  19. return (type) __v0; \
  20. - return (type) -1; \
  21. + return (type) 0 - __v0; \
  22. }
  23. #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
  24. @@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
  25. \
  26. if (__a3 == 0) \
  27. return (type) __v0; \
  28. - return (type) -1; \
  29. + return (type) 0 - __v0; \
  30. }
  31. #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
  32. @@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
  33. \
  34. if (__a3 == 0) \
  35. return (type) __v0; \
  36. - return (type) -1; \
  37. + return (type) 0 - __v0; \
  38. }
  39. #if (_MIPS_SIM == _MIPS_SIM_ABI32)
  40. @@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
  41. \
  42. if (__a3 == 0) \
  43. return (type) __v0; \
  44. - return (type) -1; \
  45. + return (type) 0 - __v0; \
  46. }
  47. #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
  48. @@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
  49. \
  50. if (__a3 == 0) \
  51. return (type) __v0; \
  52. - return (type) -1; \
  53. + return (type) 0 - __v0; \
  54. }
  55. #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */