summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2007-07-12 00:59:00 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2007-07-12 00:59:00 +0000
commit30d848c91d6a8256ac94aae6f7e594d462da6104 (patch)
tree353db32a97bf395239ca5aef876d1536b6bb3ba7 /libc
parent5e1c29a5652813619acffb85efbdbc10b9903de0 (diff)
downloaduClibc-alpine-30d848c91d6a8256ac94aae6f7e594d462da6104.tar.bz2
uClibc-alpine-30d848c91d6a8256ac94aae6f7e594d462da6104.tar.xz
Fix broken syscall() function since the original patch did not work.
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/mips/syscall.S16
1 files changed, 14 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/mips/syscall.S b/libc/sysdeps/linux/mips/syscall.S
index ce2f1292f..683529596 100644
--- a/libc/sysdeps/linux/mips/syscall.S
+++ b/libc/sysdeps/linux/mips/syscall.S
@@ -17,8 +17,8 @@
02111-1307 USA. */
#include <features.h>
-#include <asm/asm.h>
-#include <asm/regdef.h>
+#include <sys/asm.h>
+#include <sys/regdef.h>
#ifdef __PIC__
.option pic2
@@ -29,6 +29,8 @@
.type syscall,@function
.ent syscall
syscall:
+ .set noreorder
+ .cpload t9;
move v0, a0 /* Load system call number from first arg. */
move a0, a1 /* Move the next three args up a register. */
move a1, a2
@@ -55,11 +57,21 @@ syscall:
lw v0,7*4(sp) /* for system call restarts */
#endif
syscall /* Do the system call. */
+ bnez a3, 1f
#ifdef __mips64
daddiu sp,sp,16
#else
addiu sp,sp,32
#endif
j ra /* Return to caller. */
+1:
+ move a0,v0 /* Pass return val to C function. */
+
+#ifdef __PIC__
+ PTR_LA t9, __syscall_error
+ jr t9
+#else
+ j __syscall_error
+#endif
.end syscall
.size syscall,.-syscall