This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] nptl: add missing pthread-offsets.h



On 05/02/2020 14:53, Andreas Schwab wrote:
> All architectures using their own definition of struct
> __pthread_rwlock_arch_t need to provide their own pthread-offsets.h.

I tried consolidate the definition on only one file, but it does
see to make sense.  

However, if the idea is to couple arch-specific internal pthread 
implementations with its associated internal offsets I think we 
should create one file for 
__pthread_rwlock_arch_t/__PTHREAD_RWLOCK_FLAGS_OFFSET and another
one for __pthread_mutex_s/__PTHREAD_MUTEX_KIND_OFFSET.

> ---
>  sysdeps/aarch64/nptl/pthread-offsets.h |  3 +++
>  sysdeps/alpha/nptl/pthread-offsets.h   |  3 +++
>  sysdeps/ia64/nptl/pthread-offsets.h    |  3 +++
>  sysdeps/riscv/nptl/pthread-offsets.h   |  3 +++
>  sysdeps/sparc/nptl/pthread-offsets.h   | 13 +++++++++++++
>  5 files changed, 25 insertions(+)
>  create mode 100644 sysdeps/aarch64/nptl/pthread-offsets.h
>  create mode 100644 sysdeps/alpha/nptl/pthread-offsets.h
>  create mode 100644 sysdeps/ia64/nptl/pthread-offsets.h
>  create mode 100644 sysdeps/riscv/nptl/pthread-offsets.h
>  create mode 100644 sysdeps/sparc/nptl/pthread-offsets.h
> 
> diff --git a/sysdeps/aarch64/nptl/pthread-offsets.h b/sysdeps/aarch64/nptl/pthread-offsets.h
> new file mode 100644
> index 0000000000..31f0587bec
> --- /dev/null
> +++ b/sysdeps/aarch64/nptl/pthread-offsets.h
> @@ -0,0 +1,3 @@
> +#define __PTHREAD_MUTEX_KIND_OFFSET		16
> +
> +#define __PTHREAD_RWLOCK_FLAGS_OFFSET		48
> diff --git a/sysdeps/alpha/nptl/pthread-offsets.h b/sysdeps/alpha/nptl/pthread-offsets.h
> new file mode 100644
> index 0000000000..31f0587bec
> --- /dev/null
> +++ b/sysdeps/alpha/nptl/pthread-offsets.h
> @@ -0,0 +1,3 @@
> +#define __PTHREAD_MUTEX_KIND_OFFSET		16
> +
> +#define __PTHREAD_RWLOCK_FLAGS_OFFSET		48
> diff --git a/sysdeps/ia64/nptl/pthread-offsets.h b/sysdeps/ia64/nptl/pthread-offsets.h
> new file mode 100644
> index 0000000000..31f0587bec
> --- /dev/null
> +++ b/sysdeps/ia64/nptl/pthread-offsets.h
> @@ -0,0 +1,3 @@
> +#define __PTHREAD_MUTEX_KIND_OFFSET		16
> +
> +#define __PTHREAD_RWLOCK_FLAGS_OFFSET		48
> diff --git a/sysdeps/riscv/nptl/pthread-offsets.h b/sysdeps/riscv/nptl/pthread-offsets.h
> new file mode 100644
> index 0000000000..31f0587bec
> --- /dev/null
> +++ b/sysdeps/riscv/nptl/pthread-offsets.h
> @@ -0,0 +1,3 @@
> +#define __PTHREAD_MUTEX_KIND_OFFSET		16
> +
> +#define __PTHREAD_RWLOCK_FLAGS_OFFSET		48
> diff --git a/sysdeps/sparc/nptl/pthread-offsets.h b/sysdeps/sparc/nptl/pthread-offsets.h
> new file mode 100644
> index 0000000000..ac50a5a7a6
> --- /dev/null
> +++ b/sysdeps/sparc/nptl/pthread-offsets.h
> @@ -0,0 +1,13 @@
> +#include <bits/wordsize.h>
> +
> +#if __WORDSIZE == 64
> +# define __PTHREAD_MUTEX_KIND_OFFSET		16
> +#else
> +# define __PTHREAD_MUTEX_KIND_OFFSET		12
> +#endif
> +
> +#if __WORDSIZE == 64
> +# define __PTHREAD_RWLOCK_FLAGS_OFFSET		48
> +#else
> +# define __PTHREAD_RWLOCK_FLAGS_OFFSET		27
> +#endif
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]