summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/mips/sysdep.h
diff options
context:
space:
mode:
authorAlexander Gordeev <lasaine@lvk.cs.msu.su>2010-10-07 18:54:24 +0400
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-10-27 21:23:15 +0200
commit9a4c8a3f2c753f4cee4bcbe23d28e23bbdb99e40 (patch)
tree922c568f71e40ff93afe1c8787365b4d63bb148e /libc/sysdeps/linux/mips/sysdep.h
parent162cfaea20d807f0ae329efe39292a9b22593b41 (diff)
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 <lasaine@lvk.cs.msu.su> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/mips/sysdep.h')
-rw-r--r--libc/sysdeps/linux/mips/sysdep.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/mips/sysdep.h b/libc/sysdeps/linux/mips/sysdep.h
index 0860c1a48..9de4f1ace 100644
--- a/libc/sysdeps/linux/mips/sysdep.h
+++ b/libc/sysdeps/linux/mips/sysdep.h
@@ -98,7 +98,8 @@
#ifdef __PIC__
#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; \
@@ -112,7 +113,8 @@ L(syse1):
#define PSEUDO(name, syscall_name, args) \
.set noreorder; \
.align 2; \
- 99: j __syscall_error; \
+ 99: move a0, v0; \
+ j __syscall_error; \
nop; \
ENTRY(name) \
.set noreorder; \