about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sparc/sparc32
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/sparc/sparc32')
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S30
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h4
2 files changed, 29 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
index 7bc734e38a..94b46e1849 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
 
@@ -17,7 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <socketcall.h>
 
 #define P(a, b) P2(a, b)
@@ -63,7 +63,12 @@ ENTRY (__socket)
 #endif
 #endif
 
-	mov P(SOCKOP_,socket), %o0	/* arg 1: socket subfunction */
+#if defined NEED_CANCELLATION && defined CENABLE
+	SINGLE_THREAD_P
+	cmp %g1, 0
+	bne .Lsocket_cancel
+#endif
+	 mov P(SOCKOP_,socket), %o0	/* arg 1: socket subfunction */
 	add %sp, 68, %o1		/* arg 2: parameter block */
 	LOADSYSCALL(socketcall)
 	t 0x10
@@ -72,6 +77,25 @@ ENTRY (__socket)
 	retl
 	 nop
 
+#if defined NEED_CANCELLATION && defined CENABLE
+.Lsocket_cancel:
+	save %sp, -96, %sp
+	CENABLE
+	 nop
+	mov %o0, %l0
+	add %sp, 68 + 96, %o1
+	mov P(SOCKOP_,socket), %o0
+	LOADSYSCALL(socketcall)
+	t 0x10
+	bcs __syscall_error_handler2
+	 mov %o0, %l1
+	CDISABLE
+	 mov %l0, %o0
+	jmpl %i7 + 8, %g0
+	 restore %g0, %l1, %o0
+	SYSCALL_ERROR_HANDLER2
+#endif
+
 	SYSCALL_ERROR_HANDLER
 
 END (__socket)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index e362894e17..7bf63b9c54 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
 
@@ -131,7 +131,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler)			\
 	" sub	%%g0, %%o0, %%o0;"					\
 	"1:"
 
-#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g7",		\
+#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6",		\
 	"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",			\
 	"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",		\
 	"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",		\