svn commit: branches/uClibc-nptl/libc/sysdeps/linux/mips

sjhill at uclibc.org sjhill at uclibc.org
Thu Jul 12 00:59:00 UTC 2007


Author: sjhill
Date: 2007-07-11 17:59:00 -0700 (Wed, 11 Jul 2007)
New Revision: 19069

Log:
Fix broken syscall() function since the original patch did not work.


Modified:
   branches/uClibc-nptl/libc/sysdeps/linux/mips/syscall.S


Changeset:
Modified: branches/uClibc-nptl/libc/sysdeps/linux/mips/syscall.S
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/mips/syscall.S	2007-07-12 00:58:41 UTC (rev 19068)
+++ branches/uClibc-nptl/libc/sysdeps/linux/mips/syscall.S	2007-07-12 00:59:00 UTC (rev 19069)
@@ -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, at 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 @@
 	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




More information about the uClibc-cvs mailing list