From patchwork Wed Nov 6 17:49:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 178747 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp947418ilf; Wed, 6 Nov 2019 09:50:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxgQ/vLBYBUBVM7lWB4Nu62SdUTGeQXI7BnANe8Zja1Or2OyhqgEFrscN8BpyzKkC1UzOsm X-Received: by 2002:a50:f30c:: with SMTP id p12mr4037110edm.208.1573062634223; Wed, 06 Nov 2019 09:50:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573062634; cv=none; d=google.com; s=arc-20160816; b=OkNWTd2EE6IF5Suru2BBhz9t6YqvBElUXbrVZMmUWME+tdk3IXxepqi4aMKXhDE/bN 11WgznvLQUCfka/hXgn2gwQtbyOp1846HHpzHtU9iFX2TnxLTApW2zXE68M2zl97eeJG jiZ0gcMu+h0KweqnslpGTH7kvHiZrddCiO3uIooHxlF6Csd6h8UXFl6Xd97yvXo9jXGm Pzq1Ykr0U5GerlSSh39zsx17Oiil6lAQxmtDecCz/3ADXZsEBVCMn+mVIYlNgkgEGvN4 Zs4H4+4+xj4Od+DbJeZPY3bjgZxGYlRXpiecT0syCRSxqF4zzlos9O5vJeHn3S48IE1f sm5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-subscribe:list-unsubscribe :list-id:precedence:mailing-list:dkim-signature:domainkey-signature; bh=YS94iSfpgd4NgVpKKuLkCCgIhOw30a53GRNU7cq85aQ=; b=zBDNCwQw0OqTfmyK4m8tgZKB5odZ0ETU+oyrsa/CoKkTjDZh3ZFqtN5kBOiXGi7n5o 7c9Q63IPJmT0NYLEoZz2FkqSiPRmhb5BlP0siYeQs65ngi9qPjzgYnwLJDQmUUEjgskm Dnw5M4KNYpSBBzWDt8qKzyjSk23M65ipTR44N3e/t20tQUHoyH51PBxVt2xF4EE+cPNB PXYegPxpm2qI/3DFOEFi5FGDR7I+XzOOrg9ais6DPPuN36cfdDt1cu1u2cuipMnfhh0Z s/j4UxOeHTql7SOB4LlijkXykiIbtq3Lw+6niBC7dT+j8zFKnyXF+8tdYazjDj9/QMrw CR+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=r49AbfJg; dkim=pass header.i=@linaro.org header.s=google header.b=w4sQkpe1; spf=pass (google.com: domain of libc-alpha-return-106710-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106710-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id h6si12848983eda.258.2019.11.06.09.50.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2019 09:50:34 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-106710-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=r49AbfJg; dkim=pass header.i=@linaro.org header.s=google header.b=w4sQkpe1; spf=pass (google.com: domain of libc-alpha-return-106710-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106710-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=P03gXhhep0lYrYv5WSoJEf8gCPybc9rcgnceUlPebhrc4Z5qMMf5t mHFppOePKYAD1n4aQtd20s4yTIdgh5bz2av6AW2ZjcbR5q98MWWuH9c8hCHxmRDc GlVsI78SIfNcFbr7ARLIWukWvVMmMCSOx4S98EmuSjTYGp9uKGHNm4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=SWQoeusLcwlI3cExoAcNss6hIH4=; b=r49AbfJgxzQZItGrBjxCfFrykaRi UF5untKDVfGWqooMriZXwnlxvCBKide4j7dbv+55sFvpIxw/5bAvcXDjJFNdsC1w bZPte3EVtTczwQjIfwZA17eNO6t5O4BQBOzZwXYOreks8Obg6JO0Z18oUgUZACwg sgV9JjfKZqgoINE= Received: (qmail 52788 invoked by alias); 6 Nov 2019 17:50:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 52765 invoked by uid 89); 6 Nov 2019 17:50:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=string.h, UD:string.h, stringh X-HELO: mail-qt1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=YS94iSfpgd4NgVpKKuLkCCgIhOw30a53GRNU7cq85aQ=; b=w4sQkpe13w7AuQcDPyF+uGoRQwXuIQ6QMh1Mv6ldz8LLYk2Ld8fD/bdk+Sm8yvvq/Q xUE4+Grs71DRC7d1c9+SQwLClXJS6wHa1C7qrw68kNlOS08xdDEK2UABMUmGOXyVUXNw Drcwp9eOlM99v38txO7lWx3y+PjM75N3W3bdLm/qLuYosjF3xx+bPKoeOqVfsQvsTaoS 5VkSENN3Cwg1FHQUCx8AKE7B+u1onSxlAsCtv9FqT8oI7HLjy0kNzqRIQY9692QnzSaX m4wAMslLO2MTwG8+LBTIY46oajor9snZFz6NrCezOhLiDTROBs6DNzFzI5p5v1ks9LZi GXDw== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/7] nptl: Add tests for internal pthread_rwlock_t offsets Date: Wed, 6 Nov 2019 14:49:55 -0300 Message-Id: <20191106175001.12182-1-adhemerval.zanella@linaro.org> This patch new build tests to check for internal fields offsets for internal pthread_rwlock_t definition. Althoug the '__data.__flags' field layout should be preserved due static initializators, the patch also adds tests for the futexes that may be used in a shared memory (although using different libc version in such scenario is not really supported). Checked with a build against all affected ABIs. --- nptl/pthread_rwlock_init.c | 16 ++++++++++++++++ sysdeps/aarch64/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/alpha/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/arm/nptl/pthread-offsets.h | 13 +++++++++++++ sysdeps/csky/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/hppa/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/i386/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/ia64/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/m68k/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/microblaze/nptl/pthread-offsets.h | 13 +++++++++++++ sysdeps/mips/nptl/pthread-offsets.h | 23 +++++++++++++++++++++++ sysdeps/nios2/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/powerpc/nptl/pthread-offsets.h | 18 ++++++++++++++++++ sysdeps/riscv/nptl/pthread-offsets.h | 8 ++++++++ sysdeps/s390/nptl/pthread-offsets.h | 18 ++++++++++++++++++ sysdeps/sh/nptl/pthread-offsets.h | 13 +++++++++++++ sysdeps/sparc/nptl/pthread-offsets.h | 18 ++++++++++++++++++ sysdeps/x86_64/nptl/pthread-offsets.h | 12 ++++++++++++ 18 files changed, 216 insertions(+) -- 2.17.1 diff --git a/nptl/pthread_rwlock_init.c b/nptl/pthread_rwlock_init.c index 04f0d40ed8..a485cb81be 100644 --- a/nptl/pthread_rwlock_init.c +++ b/nptl/pthread_rwlock_init.c @@ -18,6 +18,7 @@ #include "pthreadP.h" #include +#include static const struct pthread_rwlockattr default_rwlockattr = @@ -34,6 +35,21 @@ __pthread_rwlock_init (pthread_rwlock_t *rwlock, { ASSERT_TYPE_SIZE (pthread_rwlock_t, __SIZEOF_PTHREAD_RWLOCK_T); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_rwlock_t, __data.__readers, + __PTHREAD_RWLOCK_READERS_OFFSET); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_rwlock_t, __data.__writers, + __PTHREAD_RWLOCK_WRITERS_OFFSET); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_rwlock_t, __data.__wrphase_futex, + __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_rwlock_t, __data.__writers_futex, + __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_rwlock_t, __data.__cur_writer, + __PTHREAD_RWLOCK_CUR_WRITER_OFFSET); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_rwlock_t, __data.__shared, + __PTHREAD_RWLOCK_SHARED_OFFSET); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_rwlock_t, __data.__flags, + __PTHREAD_RWLOCK_FLAGS_OFFSET); + const struct pthread_rwlockattr *iattr; iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_rwlockattr; diff --git a/sysdeps/aarch64/nptl/pthread-offsets.h b/sysdeps/aarch64/nptl/pthread-offsets.h index 16c6b0d9fd..679cec5de7 100644 --- a/sysdeps/aarch64/nptl/pthread-offsets.h +++ b/sysdeps/aarch64/nptl/pthread-offsets.h @@ -3,3 +3,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 24 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 diff --git a/sysdeps/alpha/nptl/pthread-offsets.h b/sysdeps/alpha/nptl/pthread-offsets.h index 16c6b0d9fd..679cec5de7 100644 --- a/sysdeps/alpha/nptl/pthread-offsets.h +++ b/sysdeps/alpha/nptl/pthread-offsets.h @@ -3,3 +3,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 24 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 diff --git a/sysdeps/arm/nptl/pthread-offsets.h b/sysdeps/arm/nptl/pthread-offsets.h index 9617354dc7..cc2a939222 100644 --- a/sysdeps/arm/nptl/pthread-offsets.h +++ b/sysdeps/arm/nptl/pthread-offsets.h @@ -3,3 +3,16 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 20 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +#if __BYTE_ORDER == __BIG_ENDIAN +# define __PTHREAD_RWLOCK_SHARED_OFFSET 26 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 +#else +# define __PTHREAD_RWLOCK_SHARED_OFFSET 25 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 +#endif diff --git a/sysdeps/csky/nptl/pthread-offsets.h b/sysdeps/csky/nptl/pthread-offsets.h index 9617354dc7..a0eea7a6d3 100644 --- a/sysdeps/csky/nptl/pthread-offsets.h +++ b/sysdeps/csky/nptl/pthread-offsets.h @@ -3,3 +3,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 20 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 25 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 diff --git a/sysdeps/hppa/nptl/pthread-offsets.h b/sysdeps/hppa/nptl/pthread-offsets.h index 8ae01b9d95..f5d5b9e5f6 100644 --- a/sysdeps/hppa/nptl/pthread-offsets.h +++ b/sysdeps/hppa/nptl/pthread-offsets.h @@ -3,3 +3,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 36 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 36 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 16 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 20 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 24 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 28 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 40 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 50 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 51 diff --git a/sysdeps/i386/nptl/pthread-offsets.h b/sysdeps/i386/nptl/pthread-offsets.h index 9617354dc7..a0eea7a6d3 100644 --- a/sysdeps/i386/nptl/pthread-offsets.h +++ b/sysdeps/i386/nptl/pthread-offsets.h @@ -3,3 +3,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 20 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 25 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 diff --git a/sysdeps/ia64/nptl/pthread-offsets.h b/sysdeps/ia64/nptl/pthread-offsets.h index 16c6b0d9fd..679cec5de7 100644 --- a/sysdeps/ia64/nptl/pthread-offsets.h +++ b/sysdeps/ia64/nptl/pthread-offsets.h @@ -3,3 +3,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 24 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 diff --git a/sysdeps/m68k/nptl/pthread-offsets.h b/sysdeps/m68k/nptl/pthread-offsets.h index 9617354dc7..14d66ace9b 100644 --- a/sysdeps/m68k/nptl/pthread-offsets.h +++ b/sysdeps/m68k/nptl/pthread-offsets.h @@ -3,3 +3,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 20 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 26 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 diff --git a/sysdeps/microblaze/nptl/pthread-offsets.h b/sysdeps/microblaze/nptl/pthread-offsets.h index 9617354dc7..cc2a939222 100644 --- a/sysdeps/microblaze/nptl/pthread-offsets.h +++ b/sysdeps/microblaze/nptl/pthread-offsets.h @@ -3,3 +3,16 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 20 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +#if __BYTE_ORDER == __BIG_ENDIAN +# define __PTHREAD_RWLOCK_SHARED_OFFSET 26 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 +#else +# define __PTHREAD_RWLOCK_SHARED_OFFSET 25 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 +#endif diff --git a/sysdeps/mips/nptl/pthread-offsets.h b/sysdeps/mips/nptl/pthread-offsets.h index 0ac3eda3fb..cf96b8868e 100644 --- a/sysdeps/mips/nptl/pthread-offsets.h +++ b/sysdeps/mips/nptl/pthread-offsets.h @@ -11,3 +11,26 @@ # define __PTHREAD_MUTEX_ELISION_OFFSET 22 # define __PTHREAD_MUTEX_LIST_OFFSET 20 #endif + +#if _MIPS_SIM == _ABI64 +# define __PTHREAD_RWLOCK_READERS_OFFSET 0 +# define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +# define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +# define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +# define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +# define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 +#else +# define __PTHREAD_RWLOCK_READERS_OFFSET 0 +# define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +# define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +# define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +# define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +# if __BYTE_ORDER == __BIG_ENDIAN +# define __PTHREAD_RWLOCK_SHARED_OFFSET 26 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 +# else +# define __PTHREAD_RWLOCK_SHARED_OFFSET 25 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 +# endif +#endif diff --git a/sysdeps/nios2/nptl/pthread-offsets.h b/sysdeps/nios2/nptl/pthread-offsets.h index 9617354dc7..a0eea7a6d3 100644 --- a/sysdeps/nios2/nptl/pthread-offsets.h +++ b/sysdeps/nios2/nptl/pthread-offsets.h @@ -3,3 +3,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 20 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 25 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 diff --git a/sysdeps/powerpc/nptl/pthread-offsets.h b/sysdeps/powerpc/nptl/pthread-offsets.h index bdda1f197e..a9ce40d97f 100644 --- a/sysdeps/powerpc/nptl/pthread-offsets.h +++ b/sysdeps/powerpc/nptl/pthread-offsets.h @@ -13,3 +13,21 @@ # define __PTHREAD_MUTEX_ELISION_OFFSET 22 # define __PTHREAD_MUTEX_LIST_OFFSET 20 #endif + +#if __WORDSIZE == 64 +# define __PTHREAD_RWLOCK_READERS_OFFSET 0 +# define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +# define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +# define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +# define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +# define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 +#else +# define __PTHREAD_RWLOCK_READERS_OFFSET 0 +# define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +# define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +# define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +# define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +# define __PTHREAD_RWLOCK_SHARED_OFFSET 26 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 +#endif diff --git a/sysdeps/riscv/nptl/pthread-offsets.h b/sysdeps/riscv/nptl/pthread-offsets.h index f1640047a0..f93af00cfc 100644 --- a/sysdeps/riscv/nptl/pthread-offsets.h +++ b/sysdeps/riscv/nptl/pthread-offsets.h @@ -22,3 +22,11 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 24 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 diff --git a/sysdeps/s390/nptl/pthread-offsets.h b/sysdeps/s390/nptl/pthread-offsets.h index bdda1f197e..a9ce40d97f 100644 --- a/sysdeps/s390/nptl/pthread-offsets.h +++ b/sysdeps/s390/nptl/pthread-offsets.h @@ -13,3 +13,21 @@ # define __PTHREAD_MUTEX_ELISION_OFFSET 22 # define __PTHREAD_MUTEX_LIST_OFFSET 20 #endif + +#if __WORDSIZE == 64 +# define __PTHREAD_RWLOCK_READERS_OFFSET 0 +# define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +# define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +# define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +# define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +# define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 +#else +# define __PTHREAD_RWLOCK_READERS_OFFSET 0 +# define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +# define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +# define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +# define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +# define __PTHREAD_RWLOCK_SHARED_OFFSET 26 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 +#endif diff --git a/sysdeps/sh/nptl/pthread-offsets.h b/sysdeps/sh/nptl/pthread-offsets.h index 9617354dc7..cc2a939222 100644 --- a/sysdeps/sh/nptl/pthread-offsets.h +++ b/sysdeps/sh/nptl/pthread-offsets.h @@ -3,3 +3,16 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 20 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +#if __BYTE_ORDER == __BIG_ENDIAN +# define __PTHREAD_RWLOCK_SHARED_OFFSET 26 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 +#else +# define __PTHREAD_RWLOCK_SHARED_OFFSET 25 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 +#endif diff --git a/sysdeps/sparc/nptl/pthread-offsets.h b/sysdeps/sparc/nptl/pthread-offsets.h index bdda1f197e..a9ce40d97f 100644 --- a/sysdeps/sparc/nptl/pthread-offsets.h +++ b/sysdeps/sparc/nptl/pthread-offsets.h @@ -13,3 +13,21 @@ # define __PTHREAD_MUTEX_ELISION_OFFSET 22 # define __PTHREAD_MUTEX_LIST_OFFSET 20 #endif + +#if __WORDSIZE == 64 +# define __PTHREAD_RWLOCK_READERS_OFFSET 0 +# define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +# define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +# define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +# define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +# define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 +#else +# define __PTHREAD_RWLOCK_READERS_OFFSET 0 +# define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +# define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +# define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +# define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 28 +# define __PTHREAD_RWLOCK_SHARED_OFFSET 26 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 +#endif diff --git a/sysdeps/x86_64/nptl/pthread-offsets.h b/sysdeps/x86_64/nptl/pthread-offsets.h index 16c6b0d9fd..5c0cab0eda 100644 --- a/sysdeps/x86_64/nptl/pthread-offsets.h +++ b/sysdeps/x86_64/nptl/pthread-offsets.h @@ -3,3 +3,15 @@ #define __PTHREAD_MUTEX_SPINS_OFFSET 20 #define __PTHREAD_MUTEX_ELISION_OFFSET 22 #define __PTHREAD_MUTEX_LIST_OFFSET 24 + +#define __PTHREAD_RWLOCK_READERS_OFFSET 0 +#define __PTHREAD_RWLOCK_WRITERS_OFFSET 4 +#define __PTHREAD_RWLOCK_WRPHASE_FUTEX_OFFSET 8 +#define __PTHREAD_RWLOCK_WRITERS_FUTEX_OFFSET 12 +#define __PTHREAD_RWLOCK_CUR_WRITER_OFFSET 24 +#define __PTHREAD_RWLOCK_SHARED_OFFSET 28 +#ifdef __ILP32__ +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 40 +#else +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 +#endif