You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

237 lines
8.9 KiB

commit 01f8eac224421f07f28f91cc05db7459ea433ea4
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date: Wed Mar 26 13:48:00 2014 -0500
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.
Conflicts:
nptl/sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h
(Textual conflict due to glibc-rh841653-3.patch.)
sysdeps/unix/sysv/linux/microblaze/nptl/bits/pthreadtypes.h
(No microblaze port in our tree; file removed manually.)
In addition, nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
was adjusted for the separate HTM backport in glibc-rh731835-0.patch.
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index 1242a9c1fd12ed3e..82994942710f3b02 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 1a8f45aa5286f919..64752ef8f9199f73 100644
--- a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
@@ -95,7 +95,6 @@ typedef union
__pthread_list_t __list;
# define __PTHREAD_MUTEX_HAVE_PREV 1
# define __PTHREAD_SPINS 0, 0
-# define __PTHREAD_MUTEX_HAVE_ELISION 1
#else
unsigned int __nusers;
__extension__ union
@@ -107,7 +106,6 @@ typedef union
# define __spins __elision_data.__espins
# define __elision __elision_data.__elision
# define __PTHREAD_SPINS { 0, 0 }
-# define __PTHREAD_MUTEX_HAVE_ELISION 2
} __elision_data;
__pthread_slist_t __list;
};
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
index 2f80fa9b69826d8b..dc4ee2ed55f10854 100644
--- a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
@@ -105,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 ce8bd713b4adc3ce..3b73352389c1ed5b 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 cc95367a61158a91..52722b8890b5b356 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 2704fd8b75eef76b..9d0f304223929ca5 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 __elision_data.__espins
# define __elision __elision_data.__elision
-# define __PTHREAD_MUTEX_HAVE_ELISION 2
+# define __PTHREAD_SPINS { 0, 0 }
} __elision_data;
__pthread_slist_t __list;
};
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 caa9f37999dde798..bd8d41493609dcdf 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 eed8365c37b20953..ca71ccc5379941e5 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 98479495a884da2b..fe1afc32049c70e5 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 5e4402088c2a5be1..0e3334fd29723b6a 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 5b30713069a439d7..5bf9ff4f77c1b574 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 7bcec6a011dd6183..af9c0de441e44ede 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/mips/nptl/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/mips/nptl/bits/pthreadtypes.h
index 2fda0d30cd909d67..e133abc9afbe60b2 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 ac51e3b93c84c63b..4a92dd2a279fa90d 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. */