From bbde852717f9db0b39190ab5774204522569239b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Jun 2003 08:58:31 +0000 Subject: Update. 2003-06-17 Ulrich Drepper * sysdeps/unix/sysv/linux/sleep.c: Use CANCELLATION_P if defined before returning because seconds==0. --- nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h | 7 ++++- nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h | 7 ++++- .../sysv/linux/powerpc/powerpc32/sysdep-cancel.h | 7 ++++- .../sysv/linux/powerpc/powerpc64/sysdep-cancel.h | 7 ++++- .../unix/sysv/linux/s390/s390-32/sysdep-cancel.h | 7 ++++- .../unix/sysv/linux/s390/s390-64/sysdep-cancel.h | 32 ++++++++++++++++++---- .../sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h | 24 ++++++++++++++-- 7 files changed, 78 insertions(+), 13 deletions(-) (limited to 'nptl/sysdeps/unix') diff --git a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h index e4df0ae2df..e932359327 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h @@ -342,9 +342,14 @@ # ifdef IS_IN_libpthread # define CENABLE call __pthread_enable_asynccancel; # define CDISABLE call __pthread_disable_asynccancel -# else +# elif !defined NOT_IN_libc # define CENABLE call __libc_enable_asynccancel; # define CDISABLE call __libc_disable_asynccancel +# elif defined IS_IN_librt +# define CENABLE call __librt_enable_asynccancel; +# define CDISABLE call __librt_disable_asynccancel +# else +# error Unsupported library # endif # define POPSTATE_0 \ pushl %eax; L(PUSHSTATE): movl %ecx, %eax; CDISABLE; popl %eax; L(POPSTATE): diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h index cf116a7885..00662e9d6b 100644 --- a/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h @@ -85,9 +85,14 @@ __syscall_error_##args: \ # ifdef IS_IN_libpthread # define CENABLE br.call.sptk.many b0 = __pthread_enable_asynccancel # define CDISABLE br.call.sptk.many b0 = __pthread_disable_asynccancel -# else +# elif !defined NOT_IN_libc # define CENABLE br.call.sptk.many b0 = __libc_enable_asynccancel # define CDISABLE br.call.sptk.many b0 = __libc_disable_asynccancel +# elif defined IS_IN_librt +# define CENABLE br.call.sptk.many b0 = __librt_enable_asynccancel +# define CDISABLE br.call.sptk.many b0 = __librt_disable_asynccancel +# else +# error Unsupported library # endif #define COPY_ARGS_0 /* Nothing */ diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h index 0f4401203a..7c669bfb3e 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h @@ -79,9 +79,14 @@ # ifdef IS_IN_libpthread # define CENABLE bl JUMPTARGET(__pthread_enable_asynccancel) # define CDISABLE bl JUMPTARGET(__pthread_disable_asynccancel) -# else +# elif !defined NOT_IN_libc # define CENABLE bl JUMPTARGET(__libc_enable_asynccancel) # define CDISABLE bl JUMPTARGET(__libc_disable_asynccancel) +# elif defined IS_IN_librt +# define CENABLE bl JUMPTARGET(__librt_enable_asynccancel) +# define CDISABLE bl JUMPTARGET(__librt_disable_asynccancel) +# else +# error Unsupported library # endif # ifndef __ASSEMBLER__ diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h index 09a612ee25..35adb1f39d 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h @@ -79,9 +79,14 @@ # ifdef IS_IN_libpthread # define CENABLE bl JUMPTARGET(__pthread_enable_asynccancel) # define CDISABLE bl JUMPTARGET(__pthread_disable_asynccancel) -# else +# elif !defined NOT_IN_libc # define CENABLE bl JUMPTARGET(__libc_enable_asynccancel) # define CDISABLE bl JUMPTARGET(__libc_disable_asynccancel) +# elif defined IS_IN_librt +# define CENABLE bl JUMPTARGET(__librt_enable_asynccancel) +# define CDISABLE bl JUMPTARGET(__librt_disable_asynccancel) +# else +# error Unsupported library # endif # ifndef __ASSEMBLER__ diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h index 613a5590db..80671df08a 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h @@ -62,9 +62,14 @@ L(pseudo_end): # ifdef IS_IN_libpthread # define CENABLE __pthread_enable_asynccancel # define CDISABLE __pthread_disable_asynccancel -# else +# elif !defined NOT_IN_libc # define CENABLE __libc_enable_asynccancel # define CDISABLE __libc_disable_asynccancel +# elif defined IS_IN_librt +# define CENABLE __librt_enable_asynccancel +# define CDISABLE __librt_disable_asynccancel +# else +# error Unsupported library # endif #define STM_0 /* Nothing */ diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h index 0c650bff23..f3722a0d8f 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h @@ -58,10 +58,15 @@ L(pseudo_end): # define CENABLE __pthread_enable_asynccancel # define CDISABLE __pthread_disable_asynccancel # define __local_multiple_threads __pthread_multiple_threads -# else +# elif !defined NOT_IN_libc # define CENABLE __libc_enable_asynccancel # define CDISABLE __libc_disable_asynccancel # define __local_multiple_threads __libc_multiple_threads +# elif defined IS_IN_librt +# define CENABLE __librt_enable_asynccancel +# define CDISABLE __librt_disable_asynccancel +# else +# error Unsupported library # endif #define STM_0 /* Nothing */ @@ -78,14 +83,31 @@ L(pseudo_end): #define LM_4 lmg %r2,%r5,16+160(%r15); #define LM_5 lmg %r2,%r5,16+160(%r15); -# ifndef __ASSEMBLER__ +# if defined IS_IN_libpthread || !defined NOT_IN_libc +# ifndef __ASSEMBLER__ extern int __local_multiple_threads attribute_hidden; -# define SINGLE_THREAD_P \ +# define SINGLE_THREAD_P \ __builtin_expect (__local_multiple_threads == 0, 1) -# else -# define SINGLE_THREAD_P \ +# else +# define SINGLE_THREAD_P \ larl %r1,__local_multiple_threads; \ icm %r0,15,0(%r1); +# endif + +# else + +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +# else +# define SINGLE_THREAD_P \ + ear %r1,%a0; \ + sllg %r1,%r1,32; \ + ear %r1,%a1; \ + icm %r1,15,MULTIPLE_THREADS_OFFSET(%r1); +# endif + # endif #elif !defined __ASSEMBLER__ diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h index 5e85376049..8081d72468 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h @@ -94,18 +94,36 @@ # define CENABLE call __pthread_enable_asynccancel; # define CDISABLE call __pthread_disable_asynccancel; # define __local_multiple_threads __pthread_multiple_threads -# else +# elif !defined NOT_IN_libc # define CENABLE call __libc_enable_asynccancel; # define CDISABLE call __libc_disable_asynccancel; # define __local_multiple_threads __libc_multiple_threads +# elif defined IS_IN_librt +# define CENABLE call __librt_enable_asynccancel; +# define CDISABLE call __librt_disable_asynccancel; +# else +# error Unsupported library # endif -# ifndef __ASSEMBLER__ +# if defined IS_IN_libpthread || !defined NOT_IN_libc +# ifndef __ASSEMBLER__ extern int __local_multiple_threads attribute_hidden; # define SINGLE_THREAD_P \ __builtin_expect (__local_multiple_threads == 0, 1) +# else +# define SINGLE_THREAD_P cmpl $0, __local_multiple_threads(%rip) +# endif + # else -# define SINGLE_THREAD_P cmpl $0, __local_multiple_threads(%rip) + +# ifndef __ASSEMBLER__ +# define SINGLE_THREAD_P \ + __builtin_expect (THREAD_GETMEM (THREAD_SELF, \ + header.multiple_threads) == 0, 1) +# else +# define SINGLE_THREAD_P cmpl $0, %fs:MULTIPLE_THREADS_OFFSET +# endif + # endif #elif !defined __ASSEMBLER__ -- cgit 1.4.1