618-mips64_fix_syscall_error.patch 896 B

123456789101112131415161718192021222324252627282930313233343536
  1. --- a/libc/sysdeps/linux/mips/sysdep.h
  2. +++ b/libc/sysdeps/linux/mips/sysdep.h
  3. @@ -96,7 +96,8 @@
  4. backwards into the previous fn. */
  5. #ifdef __PIC__
  6. -#define PSEUDO(name, syscall_name, args) \
  7. +# if _MIPS_SIM == _ABIO32
  8. +# define PSEUDO(name, syscall_name, args) \
  9. .align 2; \
  10. 99: move a0, v0; \
  11. la t9,__syscall_error; \
  12. @@ -109,6 +110,23 @@
  13. .set reorder; \
  14. bne a3, zero, 99b; \
  15. L(syse1):
  16. +# else
  17. +# define PSEUDO(name, syscall_name, args) \
  18. + .align 2; \
  19. + 99: \
  20. + .set noat; \
  21. + .cpsetup t9, $1, name; \
  22. + .set at; \
  23. + move a0, v0; \
  24. + dla t9,__syscall_error; \
  25. + .cpreturn; \
  26. + jr t9; \
  27. + ENTRY(name) \
  28. + li v0, SYS_ify(syscall_name); \
  29. + syscall; \
  30. + bne a3, zero, 99b; \
  31. +L(syse1):
  32. +# endif
  33. #else
  34. #define PSEUDO(name, syscall_name, args) \
  35. .set noreorder; \