From e853ea00f30f9f8e9bbcc4e58505f2b0a0479590 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 16 Dec 2004 16:49:39 +0000 Subject: Update. 2004-12-16 Jakub Jelinek * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__clone): Add support for NPTL where the PID is stored at userlevel and needs to be reset when CLONE_THREAD is not used. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (SYSCALL_ERROR_HANDLER): If RTLD_PRIVATE_ERRNO, use rtld_errno instead of errno. * sysdeps/unix/sysv/linux/sparc/sparc64/socket.S: Include sysdep-cancel.h instead of sysdep.h. Handle cancellation. * sysdeps/sparc/sparc64/fpu/libm-test-ulps: Regenerate. * sysdeps/ieee754/ldbl-128/e_expl.c: Include stdlib.h. --- sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 20 +++++++++++++- sysdeps/unix/sysv/linux/sparc/sparc64/socket.S | 36 +++++++++++++++++++++++--- sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h | 4 +-- 3 files changed, 54 insertions(+), 6 deletions(-) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S index 5bebe35628..66cdbf3ca7 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S @@ -1,4 +1,5 @@ -/* Copyright (C) 1996, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@tamu.edu). @@ -22,6 +23,10 @@ #include #include +#include + +#define CLONE_VM 0x00000100 +#define CLONE_THREAD 0x00010000 /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, pid_t *ptid, void *tls, pid_t *ctid); */ @@ -69,6 +74,19 @@ __clone: .type __thread_start,@function __thread_start: +#ifdef RESET_PID + sethi %hi(CLONE_THREAD), %l0 + andcc %i2, %l0, %g0 + bne 1f + andcc %i2, CLONE_VM, %g0 + bne,a 2f + mov -1,%o0 + set __NR_getpid,%g1 + ta 0x10 +2: st %o0,[%g7 + PID] + st %o0,[%g7 + TID] +1: +#endif call %i0 mov %i3,%o0 call _exit,0 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S index 750c1258ed..575416ff3f 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Miguel de Icaza , 1997. @@ -17,7 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include +#include #include #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, STACK_BIAS + 128, %o1 /* arg 2: parameter block */ LOADSYSCALL(socketcall) ta 0x6d @@ -73,6 +78,31 @@ ENTRY (__socket) retl nop +#if defined NEED_CANCELLATION && defined CENABLE +.Lsocket_cancel: + cfi_startproc + save %sp, -160, %sp + cfi_def_cfa_register (%fp) + cfi_window_save + cfi_register (%o7, %i7) + CENABLE + nop + mov %o0, %l0 + add %sp, 160 + STACK_BIAS + 128, %o1 + mov P(SOCKOP_,socket), %o0 + LOADSYSCALL(socketcall) + ta 0x6d + + bcs,pn %xcc, __syscall_error_handler2 + mov %o0, %l1 + CDISABLE + mov %l0, %o0 + jmpl %i7 + 8, %g0 + restore %g0, %l1, %o0 + cfi_endproc + SYSCALL_ERROR_HANDLER2 +#endif + SYSCALL_ERROR_HANDLER END (__socket) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h index 37a68aaeba..3c6492aeca 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2000, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson , 1997. @@ -85,7 +85,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \ call __sparc64.get_pic.l7; \ add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \ - ldx [%l7 + errno], %l0; \ + ldx [%l7 + rtld_errno], %l0; \ st %i0, [%l0]; \ jmpl %i7+8, %g0; \ restore %g0, -1, %o0; \ -- cgit v1.2.3