From 9a4c8a3f2c753f4cee4bcbe23d28e23bbdb99e40 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Thu, 7 Oct 2010 18:54:24 +0400 Subject: mips: fix errno setting after syscall If there was an error during syscall then after it's completion a3 register holds a non-zero value and v0 holds an actual error code which should be saved in errno. This can be achieved by calling __syscall_error with the value from v0 as a parameter. So this value should be stored in a0, but the appropriate assembly instructions are missing. Fixed this now by adding "move a0, v0". I think it was once fixed by 58c5f8ba4cdf62342d05a546d15404cbbb3c4e07 but then something went wrong. Again... Signed-off-by: Alexander Gordeev Signed-off-by: Bernhard Reutner-Fischer --- libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libpthread/linuxthreads') diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h index 1fff78239..b2c0dfe89 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h @@ -28,7 +28,8 @@ # undef PSEUDO # define PSEUDO(name, syscall_name, args) \ .align 2; \ - 99: la t9,__syscall_error; \ + 99: move a0, v0; \ + la t9,__syscall_error; \ jr t9; \ ENTRY (name) \ .set noreorder; \ -- cgit v1.2.3