public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] nptl: add missing pthread-offsets.h
@ 2020-02-05 17:53 Andreas Schwab
  2020-02-05 18:10 ` Adhemerval Zanella
  2020-02-06 18:46 ` Florian Weimer
  0 siblings, 2 replies; 10+ messages in thread
From: Andreas Schwab @ 2020-02-05 17:53 UTC (permalink / raw)
  To: libc-alpha

All architectures using their own definition of struct
__pthread_rwlock_arch_t need to provide their own pthread-offsets.h.
---
 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
-- 
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."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-05 17:53 [PATCH] nptl: add missing pthread-offsets.h Andreas Schwab
@ 2020-02-05 18:10 ` Adhemerval Zanella
  2020-02-06 11:56   ` Andreas Schwab
  2020-02-06 18:46 ` Florian Weimer
  1 sibling, 1 reply; 10+ messages in thread
From: Adhemerval Zanella @ 2020-02-05 18:10 UTC (permalink / raw)
  To: libc-alpha



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
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-05 18:10 ` Adhemerval Zanella
@ 2020-02-06 11:56   ` Andreas Schwab
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2020-02-06 11:56 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Feb 05 2020, Adhemerval Zanella wrote:

> 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.

There is a big overlap between archs having their own struct_mutex.h and
struct_rwlock.h, so there doesn't appear to be much benefit for that.

Andreas.

-- 
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."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-05 17:53 [PATCH] nptl: add missing pthread-offsets.h Andreas Schwab
  2020-02-05 18:10 ` Adhemerval Zanella
@ 2020-02-06 18:46 ` Florian Weimer
  2020-02-07 12:47   ` Adhemerval Zanella
  2020-02-10  9:56   ` Andreas Schwab
  1 sibling, 2 replies; 10+ messages in thread
From: Florian Weimer @ 2020-02-06 18:46 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

* Andreas Schwab:

> All architectures using their own definition of struct
> __pthread_rwlock_arch_t need to provide their own pthread-offsets.h.

What's the context for this change?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-06 18:46 ` Florian Weimer
@ 2020-02-07 12:47   ` Adhemerval Zanella
  2020-02-07 19:58     ` Florian Weimer
  2020-02-10  9:56   ` Andreas Schwab
  1 sibling, 1 reply; 10+ messages in thread
From: Adhemerval Zanella @ 2020-02-07 12:47 UTC (permalink / raw)
  To: libc-alpha



On 06/02/2020 15:45, Florian Weimer wrote:
> * Andreas Schwab:
> 
>> All architectures using their own definition of struct
>> __pthread_rwlock_arch_t need to provide their own pthread-offsets.h.
> 
> What's the context for this change?
> 

My understanding is tying the __PTHREAD_RWLOCK_FLAGS_OFFSET definition
to a arch-specific file if the architecture overrides the generic
__pthread_rwlock_arch_t definition.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-07 12:47   ` Adhemerval Zanella
@ 2020-02-07 19:58     ` Florian Weimer
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Weimer @ 2020-02-07 19:58 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

* Adhemerval Zanella:

> On 06/02/2020 15:45, Florian Weimer wrote:
>> * Andreas Schwab:
>> 
>>> All architectures using their own definition of struct
>>> __pthread_rwlock_arch_t need to provide their own pthread-offsets.h.
>> 
>> What's the context for this change?
>> 
>
> My understanding is tying the __PTHREAD_RWLOCK_FLAGS_OFFSET definition
> to a arch-specific file if the architecture overrides the generic
> __pthread_rwlock_arch_t definition.

Okay, then let me ask differently: Why hasn't this discrepancy shown
up in testing so far?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-06 18:46 ` Florian Weimer
  2020-02-07 12:47   ` Adhemerval Zanella
@ 2020-02-10  9:56   ` Andreas Schwab
  2020-02-10  9:58     ` Florian Weimer
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2020-02-10  9:56 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Feb 06 2020, Florian Weimer wrote:

> * Andreas Schwab:
>
>> All architectures using their own definition of struct
>> __pthread_rwlock_arch_t need to provide their own pthread-offsets.h.
>
> What's the context for this change?

<mvmpneskjhw.fsf@suse.de>

Andreas.

-- 
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."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-10  9:56   ` Andreas Schwab
@ 2020-02-10  9:58     ` Florian Weimer
  2020-02-10 10:53       ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2020-02-10  9:58 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

* Andreas Schwab:

> On Feb 06 2020, Florian Weimer wrote:
>
>> * Andreas Schwab:
>>
>>> All architectures using their own definition of struct
>>> __pthread_rwlock_arch_t need to provide their own pthread-offsets.h.
>>
>> What's the context for this change?
>
> <mvmpneskjhw.fsf@suse.de>

Which is:

From: Andreas Schwab <schwab@suse.de>
Subject: [PATCH] nptl: update default pthread-offsets.h
To: libc-alpha@sourceware.org
Date: Wed, 05 Feb 2020 18:54:19 +0100

I still don't understand why these discrepancies have not resulted in
test failures.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-10  9:58     ` Florian Weimer
@ 2020-02-10 10:53       ` Andreas Schwab
  2020-02-10 11:09         ` Florian Weimer
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2020-02-10 10:53 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Feb 10 2020, Florian Weimer wrote:

> * Andreas Schwab:
>
>> On Feb 06 2020, Florian Weimer wrote:
>>
>>> * Andreas Schwab:
>>>
>>>> All architectures using their own definition of struct
>>>> __pthread_rwlock_arch_t need to provide their own pthread-offsets.h.
>>>
>>> What's the context for this change?
>>
>> <mvmpneskjhw.fsf@suse.de>
>
> Which is:
>
> From: Andreas Schwab <schwab@suse.de>
> Subject: [PATCH] nptl: update default pthread-offsets.h
> To: libc-alpha@sourceware.org
> Date: Wed, 05 Feb 2020 18:54:19 +0100
>
> I still don't understand why these discrepancies have not resulted in
> test failures.

They do with that patch.

Andreas.

-- 
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."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] nptl: add missing pthread-offsets.h
  2020-02-10 10:53       ` Andreas Schwab
@ 2020-02-10 11:09         ` Florian Weimer
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Weimer @ 2020-02-10 11:09 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

* Andreas Schwab:

> On Feb 10 2020, Florian Weimer wrote:
>
>> * Andreas Schwab:
>>
>>> On Feb 06 2020, Florian Weimer wrote:
>>>
>>>> * Andreas Schwab:
>>>>
>>>>> All architectures using their own definition of struct
>>>>> __pthread_rwlock_arch_t need to provide their own pthread-offsets.h.
>>>>
>>>> What's the context for this change?
>>>
>>> <mvmpneskjhw.fsf@suse.de>
>>
>> Which is:
>>
>> From: Andreas Schwab <schwab@suse.de>
>> Subject: [PATCH] nptl: update default pthread-offsets.h
>> To: libc-alpha@sourceware.org
>> Date: Wed, 05 Feb 2020 18:54:19 +0100
>>
>> I still don't understand why these discrepancies have not resulted in
>> test failures.
>
> They do with that patch.

Ahh, okay then.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-10 11:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 17:53 [PATCH] nptl: add missing pthread-offsets.h Andreas Schwab
2020-02-05 18:10 ` Adhemerval Zanella
2020-02-06 11:56   ` Andreas Schwab
2020-02-06 18:46 ` Florian Weimer
2020-02-07 12:47   ` Adhemerval Zanella
2020-02-07 19:58     ` Florian Weimer
2020-02-10  9:56   ` Andreas Schwab
2020-02-10  9:58     ` Florian Weimer
2020-02-10 10:53       ` Andreas Schwab
2020-02-10 11:09         ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).