aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/s390
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2015-11-12 14:01:36 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-08-24 14:58:35 -0300
commitebd6f0076a83bb25a9853773fbfbcff00b4c9a32 (patch)
tree07b02599002f24fd7fa37e1ddfa332f6a236ec99 /sysdeps/unix/sysv/linux/s390
parent8aa48656bb00074f3f422d805f15d07d786970ba (diff)
downloadglibc-ebd6f0076a83bb25a9853773fbfbcff00b4c9a32.zip
glibc-ebd6f0076a83bb25a9853773fbfbcff00b4c9a32.tar.gz
glibc-ebd6f0076a83bb25a9853773fbfbcff00b4c9a32.tar.bz2
Remove cancellation support for syscall generation
This patch removes the cancellation mark from the auto-generation syscall script. Now all the cancellable syscalls are done throught C code using the SYSCALL_CANCEL macro. It simplifies the assembly required to each architecture port, since the SYSCALL_CANCEL uses the already defined INLINE_SYSCALL macros, and allows a more straigh fix on cancellation machanism (since no more specific assembly fixes will be required). Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.A Also with build-many-glibc.py with remaning touched architectures. * sysdeps/unix/make-syscalls.sh: Remove cancellable tagging for syscall definitions. * sysdeps/unix/syscall-template.S (SYSCALL_CANCELLABLE): Remove definition. * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (__local_enable_asynccancel): Likewise. [IS_IN (libpthread)] (__local_disable_asynccancel): Likewise. [IS_IN (libc)] (__local_enable_asynccancel): Likewise. [IS_IN (libc)] (__local_enable_asynccancel): Likewise. [IS_IN (librt)] (__local_disable_asynccancel): Likewise. [IS_IN (librt)] (__local_disable_asynccancel): Likewise. (CENABLE): Likewise. (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (PSEUDO): Remove defintion. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Remove file. * sysdeps/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h: New file. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Remove file. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h: New file. * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h115
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h117
2 files changed, 14 insertions, 218 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
index b1e80bc..459b742 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
@@ -18,122 +18,19 @@
#include <sysdep.h>
#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
+#include <nptl/pthreadP.h>
#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
-L(pseudo_cancel): \
- cfi_startproc; \
- STM_##args \
- stm %r12,%r15,48(%r15); \
- cfi_offset (%r15, -36); \
- cfi_offset (%r14, -40); \
- cfi_offset (%r13, -44); \
- cfi_offset (%r12, -48); \
- lr %r14,%r15; \
- ahi %r15,-96; \
- cfi_adjust_cfa_offset (96); \
- st %r14,0(%r15); \
- basr %r13,0; \
-0: l %r1,1f-0b(%r13); \
- bas %r14,0(%r1,%r13); \
- lr %r0,%r2; \
- LM_##args \
- .if SYS_ify (syscall_name) < 256; \
- svc SYS_ify (syscall_name); \
- .else; \
- lhi %r1,SYS_ify (syscall_name); \
- svc 0; \
- .endif; \
- LR7_##args \
- l %r1,2f-0b(%r13); \
- lr %r12,%r2; \
- lr %r2,%r0; \
- bas %r14,0(%r1,%r13); \
- lr %r2,%r12; \
- lm %r12,%r15,48+96(%r15); \
- cfi_endproc; \
- j L(pseudo_check); \
-1: .long CENABLE-0b; \
-2: .long CDISABLE-0b; \
-ENTRY(name) \
- SINGLE_THREAD_P(%r1) \
- jne L(pseudo_cancel); \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- DO_CALL(syscall_name, args); \
-L(pseudo_check): \
- lhi %r4,-4095; \
- clr %r2,%r4; \
- jnl SYSCALL_ERROR_LABEL; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
-L(pseudo_end):
-
-# if IS_IN (libpthread)
-# define CENABLE __pthread_enable_asynccancel
-# define CDISABLE __pthread_disable_asynccancel
-# elif IS_IN (libc)
-# define CENABLE __libc_enable_asynccancel
-# define CDISABLE __libc_disable_asynccancel
-# elif IS_IN (librt)
-# define CENABLE __librt_enable_asynccancel
-# define CDISABLE __librt_disable_asynccancel
-# else
-# error Unsupported library
-# endif
-
-#define STM_0 /* Nothing */
-#define STM_1 st %r2,8(%r15);
-#define STM_2 stm %r2,%r3,8(%r15);
-#define STM_3 stm %r2,%r4,8(%r15);
-#define STM_4 stm %r2,%r5,8(%r15);
-#define STM_5 stm %r2,%r5,8(%r15);
-#define STM_6 stm %r2,%r7,8(%r15);
-
-#define LM_0 /* Nothing */
-#define LM_1 l %r2,8+96(%r15);
-#define LM_2 lm %r2,%r3,8+96(%r15);
-#define LM_3 lm %r2,%r4,8+96(%r15);
-#define LM_4 lm %r2,%r5,8+96(%r15);
-#define LM_5 lm %r2,%r5,8+96(%r15);
-#define LM_6 lm %r2,%r5,8+96(%r15); \
- cfi_offset (%r7, -68); \
- l %r7,96+96(%r15);
+# define SINGLE_THREAD_P \
+ __glibc_likely (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0)
-#define LR7_0 /* Nothing */
-#define LR7_1 /* Nothing */
-#define LR7_2 /* Nothing */
-#define LR7_3 /* Nothing */
-#define LR7_4 /* Nothing */
-#define LR7_5 /* Nothing */
-#define LR7_6 l %r7,28+96(%r15); \
- cfi_restore (%r7);
-
-# ifndef __ASSEMBLER__
-# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-# else
-# define SINGLE_THREAD_P(reg) \
- ear reg,%a0; \
- icm reg,15,MULTIPLE_THREADS_OFFSET(reg);
-# endif
-
-#elif !defined __ASSEMBLER__
+#else
# define SINGLE_THREAD_P (1)
# define NO_CANCELLATION 1
#endif
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
+#define RTLD_SINGLE_THREAD_P \
+ __glibc_likely (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
index 9b2c546..99adad1 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
@@ -18,135 +18,34 @@
#include <sysdep.h>
#include <tls.h>
-#ifndef __ASSEMBLER__
-# include <nptl/pthreadP.h>
-#endif
+#include <nptl/pthreadP.h>
#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
-# undef PSEUDO
-# define PSEUDO(name, syscall_name, args) \
- .text; \
-L(pseudo_cancel): \
- cfi_startproc; \
- STM_##args \
- stmg %r13,%r15,104(%r15); \
- cfi_offset (%r15,-40); \
- cfi_offset (%r14,-48); \
- cfi_offset (%r13,-56); \
- lgr %r14,%r15; \
- aghi %r15,-160; \
- cfi_adjust_cfa_offset (160); \
- stg %r14,0(%r15); \
- brasl %r14,CENABLE; \
- lgr %r0,%r2; \
- LM_##args \
- .if SYS_ify (syscall_name) < 256; \
- svc SYS_ify (syscall_name); \
- .else; \
- lghi %r1,SYS_ify (syscall_name); \
- svc 0; \
- .endif; \
- LR7_##args \
- lgr %r13,%r2; \
- lgr %r2,%r0; \
- brasl %r14,CDISABLE; \
- lgr %r2,%r13; \
- lmg %r13,%r15,104+160(%r15); \
- cfi_endproc; \
- j L(pseudo_check); \
-ENTRY(name) \
- SINGLE_THREAD_P \
- jne L(pseudo_cancel); \
-.type __##syscall_name##_nocancel,@function; \
-.globl __##syscall_name##_nocancel; \
-__##syscall_name##_nocancel: \
- DO_CALL(syscall_name, args); \
-L(pseudo_check): \
- lghi %r4,-4095; \
- clgr %r2,%r4; \
- jgnl SYSCALL_ERROR_LABEL; \
-.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
-L(pseudo_end):
-
# if IS_IN (libpthread)
-# define CENABLE __pthread_enable_asynccancel
-# define CDISABLE __pthread_disable_asynccancel
# define __local_multiple_threads __pthread_multiple_threads
# elif IS_IN (libc)
-# define CENABLE __libc_enable_asynccancel
-# define CDISABLE __libc_disable_asynccancel
# define __local_multiple_threads __libc_multiple_threads
-# elif IS_IN (librt)
-# define CENABLE __librt_enable_asynccancel
-# define CDISABLE __librt_disable_asynccancel
-# else
-# error Unsupported library
# endif
-#define STM_0 /* Nothing */
-#define STM_1 stg %r2,16(%r15);
-#define STM_2 stmg %r2,%r3,16(%r15);
-#define STM_3 stmg %r2,%r4,16(%r15);
-#define STM_4 stmg %r2,%r5,16(%r15);
-#define STM_5 stmg %r2,%r5,16(%r15);
-#define STM_6 stmg %r2,%r7,16(%r15);
-
-#define LM_0 /* Nothing */
-#define LM_1 lg %r2,16+160(%r15);
-#define LM_2 lmg %r2,%r3,16+160(%r15);
-#define LM_3 lmg %r2,%r4,16+160(%r15);
-#define LM_4 lmg %r2,%r5,16+160(%r15);
-#define LM_5 lmg %r2,%r5,16+160(%r15);
-#define LM_6 lmg %r2,%r5,16+160(%r15); \
- cfi_offset (%r7, -104); \
- lg %r7,160+160(%r15);
-
-#define LR7_0 /* Nothing */
-#define LR7_1 /* Nothing */
-#define LR7_2 /* Nothing */
-#define LR7_3 /* Nothing */
-#define LR7_4 /* Nothing */
-#define LR7_5 /* Nothing */
-#define LR7_6 lg %r7,56+160(%r15); \
- cfi_restore (%r7);
-
# if IS_IN (libpthread) || IS_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 \
- larl %r1,__local_multiple_threads; \
- icm %r0,15,0(%r1);
-# endif
+# define SINGLE_THREAD_P \
+ __glibc_likely (__local_multiple_threads == 0)
# 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
+# define SINGLE_THREAD_P \
+ __glibc_likely (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0)
# endif
-#elif !defined __ASSEMBLER__
+#else
# define SINGLE_THREAD_P (1)
# define NO_CANCELLATION 1
#endif
-#ifndef __ASSEMBLER__
-# define RTLD_SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
-#endif
+#define RTLD_SINGLE_THREAD_P \
+ __glibc_likely (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0)