nptl: update default pthread-offsets.h

Message ID mvmpneskjhw.fsf@suse.de
State New
Headers show
Series
  • nptl: update default pthread-offsets.h
Related show

Commit Message

Andreas Schwab Feb. 5, 2020, 5:54 p.m.
Remove unused definitions, and correct __PTHREAD_RWLOCK_FLAGS_OFFSET for
__WORDSIZE == 64.
---
 sysdeps/nptl/pthread-offsets.h | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

-- 
2.25.0


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Comments

Adhemerval Zanella Feb. 5, 2020, 6:17 p.m. | #1
On 05/02/2020 14:54, Andreas Schwab wrote:
> Remove unused definitions, and correct __PTHREAD_RWLOCK_FLAGS_OFFSET for

> __WORDSIZE == 64.


LGTM, thanks for catching it.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>


> ---

>  sysdeps/nptl/pthread-offsets.h | 22 ++++++----------------

>  1 file changed, 6 insertions(+), 16 deletions(-)

> 

> diff --git a/sysdeps/nptl/pthread-offsets.h b/sysdeps/nptl/pthread-offsets.h

> index a399608aa1..3d9c51783d 100644

> --- a/sysdeps/nptl/pthread-offsets.h

> +++ b/sysdeps/nptl/pthread-offsets.h

> @@ -1,26 +1,16 @@

>  #include <bits/wordsize.h>

>  

>  /* These values are based on internal generic types from

> -   mutex-internal.h and rwlock-internal.h.  */

> +   bits/struct_mutex.h and bits/struct_rwlock.h.  */

>  

>  #if __WORDSIZE == 64

> -# define __PTHREAD_MUTEX_NUSERS_OFFSET          12

> -# define __PTHREAD_MUTEX_KIND_OFFSET            16

> -# define __PTHREAD_MUTEX_SPINS_OFFSET           20

> -# define __PTHREAD_MUTEX_LIST_OFFSET            24

> +# define __PTHREAD_MUTEX_KIND_OFFSET		16

>  #else

> -# define __PTHREAD_MUTEX_NUSERS_OFFSET          16

> -# define __PTHREAD_MUTEX_KIND_OFFSET            12

> -# define __PTHREAD_MUTEX_SPINS_OFFSET           20

> -# define __PTHREAD_MUTEX_LIST_OFFSET            20

> +# define __PTHREAD_MUTEX_KIND_OFFSET		12

>  #endif

>  

> -#if __WORDSIZE == 64

> -# define __PTHREAD_RWLOCK_FLAGS_OFFSET          48

> +#if __BYTE_ORDER == __BIG_ENDIAN

> +# define __PTHREAD_RWLOCK_FLAGS_OFFSET		27

>  #else

> -# if __BYTE_ORDER == __BIG_ENDIAN

> -#  define __PTHREAD_RWLOCK_FLAGS_OFFSET         27

> -# else

> -#  define __PTHREAD_RWLOCK_FLAGS_OFFSET         24

> -# endif

> +# define __PTHREAD_RWLOCK_FLAGS_OFFSET		24

>  #endif

>

Patch

diff --git a/sysdeps/nptl/pthread-offsets.h b/sysdeps/nptl/pthread-offsets.h
index a399608aa1..3d9c51783d 100644
--- a/sysdeps/nptl/pthread-offsets.h
+++ b/sysdeps/nptl/pthread-offsets.h
@@ -1,26 +1,16 @@ 
 #include <bits/wordsize.h>
 
 /* These values are based on internal generic types from
-   mutex-internal.h and rwlock-internal.h.  */
+   bits/struct_mutex.h and bits/struct_rwlock.h.  */
 
 #if __WORDSIZE == 64
-# define __PTHREAD_MUTEX_NUSERS_OFFSET          12
-# define __PTHREAD_MUTEX_KIND_OFFSET            16
-# define __PTHREAD_MUTEX_SPINS_OFFSET           20
-# define __PTHREAD_MUTEX_LIST_OFFSET            24
+# define __PTHREAD_MUTEX_KIND_OFFSET		16
 #else
-# define __PTHREAD_MUTEX_NUSERS_OFFSET          16
-# define __PTHREAD_MUTEX_KIND_OFFSET            12
-# define __PTHREAD_MUTEX_SPINS_OFFSET           20
-# define __PTHREAD_MUTEX_LIST_OFFSET            20
+# define __PTHREAD_MUTEX_KIND_OFFSET		12
 #endif
 
-#if __WORDSIZE == 64
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET          48
+#if __BYTE_ORDER == __BIG_ENDIAN
+# define __PTHREAD_RWLOCK_FLAGS_OFFSET		27
 #else
-# if __BYTE_ORDER == __BIG_ENDIAN
-#  define __PTHREAD_RWLOCK_FLAGS_OFFSET         27
-# else
-#  define __PTHREAD_RWLOCK_FLAGS_OFFSET         24
-# endif
+# define __PTHREAD_RWLOCK_FLAGS_OFFSET		24
 #endif