From 01f8eac224421f07f28f91cc05db7459ea433ea4 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 26 Mar 2014 13:48:00 -0500 Subject: Move __PTHREAD_SPINS definition to architecture specific header This patch moves the __PTHREAD_SPINS definition to arch specific header since pthread_mutex_t layout is also arch specific. This leads to no need to defining __PTHREAD_MUTEX_HAVE_ELISION and thus removing of the undefined compiler warning. --- ChangeLog | 32 ++++++++++++++++++++++ nptl/sysdeps/pthread/pthread.h | 9 ------ .../unix/sysv/linux/powerpc/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/s390/bits/pthreadtypes.h | 5 ++-- .../sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/sparc/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/x86/bits/pthreadtypes.h | 5 ++-- ports/ChangeLog.hppa | 5 ++++ .../unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h | 3 ++ .../sysv/linux/aarch64/nptl/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/arm/nptl/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h | 3 ++ .../sysv/linux/microblaze/nptl/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/mips/nptl/bits/pthreadtypes.h | 3 ++ .../unix/sysv/linux/tile/nptl/bits/pthreadtypes.h | 3 ++ 17 files changed, 79 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7e1c54c..ae8cab2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,37 @@ 2014-04-09 Adhemerval Zanella + * nptl/sysdeps/pthread/pthread.h (__PTHREAD_MUTEX_HAVE_ELISION): + Remove macro usage. + (__PTHREAD_SPINS): Move definition to ... + * nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h + (__PTHREAD_SPINS): ... here. + * nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * sysdeps/unix/sysv/linux/aarch64/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * sysdeps/unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * sysdeps/unix/sysv/linux/microblaze/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + * sysdeps/unix/sysv/linux/tile/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Likewise. + +2014-04-09 Adhemerval Zanella + * sysdeps/powerpc/powerpc32/power6x/fpu/Implies: New file. * sysdeps/powerpc/powerpc64/power6x/fpu/Implies: new file. * sysdeps/powerpc/powerpc64/power6x/multiarch/Implies: New file. diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index 1e0c5dc..40a3e21 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -82,15 +82,6 @@ enum #endif -/* Mutex initializers. */ -#if __PTHREAD_MUTEX_HAVE_ELISION == 1 /* 64bit layout. */ -#define __PTHREAD_SPINS 0, 0 -#elif __PTHREAD_MUTEX_HAVE_ELISION == 2 /* 32bit layout. */ -#define __PTHREAD_SPINS { 0, 0 } -#else -#define __PTHREAD_SPINS 0 -#endif - #ifdef __PTHREAD_MUTEX_HAVE_PREV # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, __PTHREAD_SPINS, { 0, 0 } } } diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h index 71bd3ae..eda3d1a 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h @@ -106,6 +106,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h index 23a1698..8264de0 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h @@ -20,8 +20,6 @@ #include -# define __PTHREAD_MUTEX_HAVE_ELISION 0 - #if __WORDSIZE == 64 # define __SIZEOF_PTHREAD_ATTR_T 56 # define __SIZEOF_PTHREAD_MUTEX_T 40 @@ -107,6 +105,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h index e42d94e..a177f28 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h @@ -77,6 +77,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h index be615b6..8c0340a 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h @@ -106,6 +106,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h index 28e5144..b4329f6 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h @@ -105,7 +105,8 @@ typedef union short __elision; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 -# define __PTHREAD_MUTEX_HAVE_ELISION 1 +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +# define __PTHREAD_SPINS 0, 0 #else unsigned int __nusers; __extension__ union @@ -116,7 +117,7 @@ typedef union short __elision; # define __spins d.__espins # define __elision d.__elision -# define __PTHREAD_MUTEX_HAVE_ELISION 2 +# define __PTHREAD_SPINS { 0, 0 } } d; __pthread_slist_t __list; }; diff --git a/ports/ChangeLog.hppa b/ports/ChangeLog.hppa index 4433ad5..39c7701 100644 --- a/ports/ChangeLog.hppa +++ b/ports/ChangeLog.hppa @@ -1,3 +1,8 @@ +2014-04-09 Adhemerval Zanella + + * ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h + (__PTHREAD_SPIN): Moved defintion from pthread.h. + 2014-03-18 Roland McGrath * sysdeps/hppa/dl-fptr.c: Include . diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h index deec4da..a79c195 100644 --- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/bits/pthreadtypes.h @@ -94,6 +94,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/aarch64/nptl/bits/pthreadtypes.h index f11eeab..1a44bb6 100644 --- a/sysdeps/unix/sysv/linux/aarch64/nptl/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/aarch64/nptl/bits/pthreadtypes.h @@ -74,6 +74,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h index 6f85eae..3dbe612 100644 --- a/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/alpha/nptl/bits/pthreadtypes.h @@ -73,6 +73,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h index 26edce5..64b9e09 100644 --- a/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/arm/nptl/bits/pthreadtypes.h @@ -77,6 +77,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/sysdeps/unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h index b77b80a..9468329 100644 --- a/sysdeps/unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/ia64/nptl/bits/pthreadtypes.h @@ -74,6 +74,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h index 283f240..1e1fed8 100644 --- a/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/m68k/nptl/bits/pthreadtypes.h @@ -77,6 +77,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/sysdeps/unix/sysv/linux/microblaze/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/microblaze/nptl/bits/pthreadtypes.h index ca053e3..9c7e620 100644 --- a/sysdeps/unix/sysv/linux/microblaze/nptl/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/microblaze/nptl/bits/pthreadtypes.h @@ -76,6 +76,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h index 9d9386b..cefd2b6 100644 --- a/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h @@ -106,6 +106,9 @@ typedef union long int __align; } pthread_mutex_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; diff --git a/sysdeps/unix/sysv/linux/tile/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/tile/nptl/bits/pthreadtypes.h index f469352..5ca3391 100644 --- a/sysdeps/unix/sysv/linux/tile/nptl/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/tile/nptl/bits/pthreadtypes.h @@ -112,6 +112,9 @@ typedef union int __align; } pthread_mutexattr_t; +/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +#define __PTHREAD_SPINS 0 + /* Data structure for conditional variable handling. The structure of the attribute type is not exposed on purpose. */ -- cgit v1.1