From patchwork Thu Oct 26 17:14:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 117249 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1014866qgn; Thu, 26 Oct 2017 10:14:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+T5rqc6yCC/NCxQdvkanJgcQt3Nhg3ylpZWV5FlW41S6Jhvnihoj3w0uZ2ZJuQ9UzDCfILc X-Received: by 10.98.218.83 with SMTP id w19mr6014010pfl.287.1509038090088; Thu, 26 Oct 2017 10:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509038090; cv=none; d=google.com; s=arc-20160816; b=RZ6x9girSKU8xnxYQHWD64yETKs8/D6MH8IZUvqgyg3MszQpO2fd3qGp6sKNsmVCEl ag8FsIoFoLRmRaCjn0Iczq6Tw3oKW447mu2cs4z1oILIL0ExKwV/NAGYKm6uliw7t+tC Kk9GUkuGD7fswljVNd4pifksGF3aIU1smrfldmiE3mZb+Vy5BrzIMvtXu70Yh1SZc5E/ lfue8S9fJ5ZDZbaSsfQqk5t5pXOrP5kJAHSu4NrowvzzKOkZ0z9l18/oOFoT70gqUqO9 HF+2w49DQCZwPQpMfooBgs827iZy9DUUBQ/keU4pa1nDPD3v+ao6jIACzW6O34YIFGoD 22sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=x0cYc7Glkh+8wo6TuBj0bSAK5SkMvNeNLSwjT6CqsjQ=; b=bQBPFltXjUiAvzJsHMiiEkCcY1FHX3c1FS8kcRr0DjMDArZlpYYgqU0YR+42tcONx1 qVie7la/VMEps4Axw1hIIrsnnuKHQm8fSv2yKIZRk1YGp5mYyiCm074x3q3qBbNa1J3Y TRU8U4syg1YtbB8ZHUnoyMTAnILaqEMmBgAVsMPdYC8BE+V4eYg/uBaE8xQOi/mqOlyQ cnW5dqPKZ/EnPVADidHBTuFdZ9M44kCb/DIda5hqwWF7bTejCHDa2jn51jH49V9+ld/0 fz9QZp3+AiqAIoKSUyyRVZ6ODorX/tXeeXqLSr90JI3fZO6UmKjheW1kMWsFz2Fo0SSG 6Vtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=CUl8cQm5; spf=pass (google.com: domain of libc-alpha-return-86395-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86395-patch=linaro.org@sourceware.org; dmarc=fail (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 q75si3933293pfj.449.2017.10.26.10.14.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 10:14:50 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86395-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=CUl8cQm5; spf=pass (google.com: domain of libc-alpha-return-86395-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86395-patch=linaro.org@sourceware.org; dmarc=fail (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=mr1DyhiT48jxF4FEVkpYWFRv1SbRFH1FcUTr3HVb7T1s6NLgCQ63D O3rAKO12Npx/WWcZ0h8XQ+xtoSVoTeqFfzkMk0AGfrKOTRk5UmumNO4XsVPmiZvK Ffn4ymoJivAqNFuon8U7D6R+Fgf05WjAOb0HSoyOHR1NqBpmeK7hkM= 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=FKQoyjVV5mdF/t6Kjq7Y6/NMkTI=; b=CUl8cQm5pPJOzeUeEY+TeWKoUK8k AETMtbeO2SVFCRPocCRNogK/7uVRFEqv0zORSRyT4EiFqRnYKutqA1wFI2HwSwNe jo23FlZJxpQYOOxfd7SPVifogP6hVymg+ST4/cVe1P7Xh0IJrliLFLC4I6vI2D+/ fNHst2AGiH301sc= Received: (qmail 2204 invoked by alias); 26 Oct 2017 17:14:39 -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 1779 invoked by uid 89); 26 Oct 2017 17:14:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:209.85.216.195, H*RU:209.85.216.195 X-HELO: mail-qt0-f195.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=x0cYc7Glkh+8wo6TuBj0bSAK5SkMvNeNLSwjT6CqsjQ=; b=Nlf0U3OwqKTR88mU61Okd0HGelXp3/RBn90DpvaTDpvekSMgdIGO3onHAXOkSZrObj ak3caBiOhr4jASwt2rh+dMDCsgHrRoubT9AibeH3ErhzWJSEaDw67bo9X0RO4Ng19XW0 rvDacm19shP16m7VuK+tVUYA5XFUrcdKSehUN0StDmgMOI9b1oniGe5Bbes2cxstqai+ Lu/YBg7LRGYImkJykELTpxrCa0AcT7fjZP0SVw7059qC3GrwcfA4+Mw+olMVric25gRU /XhmXv/NwOSMnU+k54wcGx7btnNWhqxnzeBOFDD8oWvgRzZp278QYf29eL7Byrfmx3i1 BD3w== X-Gm-Message-State: AMCzsaVRxd14uCESAVCP4knM7w9mjR8QjkyrW2zAy1nb+2W6Vak1Q98E tbRN74uUBrTKOKX5h8LRt2xR02FwE60= X-Received: by 10.200.35.42 with SMTP id a39mr38125413qta.9.1509038073931; Thu, 26 Oct 2017 10:14:33 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 1/3] nptl: Add tests for internal pthread_mutex_t offsets Date: Thu, 26 Oct 2017 15:14:25 -0200 Message-Id: <1509038067-18532-1-git-send-email-adhemerval.zanella@linaro.org> Changes from previous version: - Move _Static_asserts tests from external tests to library build time. --- This patch adds a new build test to check for internal fields offsets for user visible internal field. Although currently the only field which is statically initialized to a non zero value is pthread_mutex_t.__data.__kind value, the tests also check the offset of __kind, __spins, __elision (if supported), and __list internal member. A internal header (pthread-offset.h) is added to each major ABI with the reference value. Checked on x86_64-linux-gnu and with a build check for all affected ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf, hppa-linux-gnu, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu, mips64-linux-gnu, mips64-n32-linux-gnu, mips-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu, s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu, sparc64-linux-gnu, sparcv9-linux-gnu, tilegx-linux-gnu, tilegx-linux-gnu-x32, tilepro-linux-gnu, x86_64-linux-gnu, and x86_64-linux-x32). Signed-off-by: Adhemerval Zanella * nptl/pthreadP.h (ASSERT_PTHREAD_STRING, ASSERT_PTHREAD_INTERNAL_OFFSET): New macro. * nptl/pthread_mutex_init.c (__pthread_mutex_init): Add build time checks for internal pthread_mutex_t offsets. * sysdeps/aarch64/nptl/pthread-offsets.h (__PTHREAD_MUTEX_NUSERS_OFFSET, __PTHREAD_MUTEX_KIND_OFFSET, __PTHREAD_MUTEX_SPINS_OFFSET, __PTHREAD_MUTEX_ELISION_OFFSET, __PTHREAD_MUTEX_LIST_OFFSET): New macro. * sysdeps/alpha/nptl/pthread-offsets.h: Likewise. * sysdeps/arm/nptl/pthread-offsets.h: Likewise. * sysdeps/hppa/nptl/pthread-offsets.h: Likewise. * sysdeps/i386/nptl/pthread-offsets.h: Likewise. * sysdeps/ia64/nptl/pthread-offsets.h: Likewise. * sysdeps/m68k/nptl/pthread-offsets.h: Likewise. * sysdeps/microblaze/nptl/pthread-offsets.h: Likewise. * sysdeps/mips/nptl/pthread-offsets.h: Likewise. * sysdeps/nios2/nptl/pthread-offsets.h: Likewise. * sysdeps/powerpc/nptl/pthread-offsets.h: Likewise. * sysdeps/s390/nptl/pthread-offsets.h: Likewise. * sysdeps/sh/nptl/pthread-offsets.h: Likewise. * sysdeps/sparc/nptl/pthread-offsets.h: Likewise. * sysdeps/tile/nptl/pthread-offsets.h: Likewise. * sysdeps/x86_64/nptl/pthread-offsets.h: Likewise. --- ChangeLog | 26 ++++++++++++++++++++++++++ nptl/pthreadP.h | 6 ++++++ nptl/pthread_mutex_init.c | 13 +++++++++++++ sysdeps/aarch64/nptl/pthread-offsets.h | 5 +++++ sysdeps/alpha/nptl/pthread-offsets.h | 5 +++++ sysdeps/arm/nptl/pthread-offsets.h | 5 +++++ sysdeps/hppa/nptl/pthread-offsets.h | 5 +++++ sysdeps/i386/nptl/pthread-offsets.h | 5 +++++ sysdeps/ia64/nptl/pthread-offsets.h | 5 +++++ sysdeps/m68k/nptl/pthread-offsets.h | 5 +++++ sysdeps/microblaze/nptl/pthread-offsets.h | 5 +++++ sysdeps/mips/nptl/pthread-offsets.h | 13 +++++++++++++ sysdeps/nios2/nptl/pthread-offsets.h | 5 +++++ sysdeps/powerpc/nptl/pthread-offsets.h | 15 +++++++++++++++ sysdeps/s390/nptl/pthread-offsets.h | 15 +++++++++++++++ sysdeps/sh/nptl/pthread-offsets.h | 5 +++++ sysdeps/sparc/nptl/pthread-offsets.h | 15 +++++++++++++++ sysdeps/tile/nptl/pthread-offsets.h | 15 +++++++++++++++ sysdeps/x86_64/nptl/pthread-offsets.h | 5 +++++ 19 files changed, 173 insertions(+) create mode 100644 sysdeps/aarch64/nptl/pthread-offsets.h create mode 100644 sysdeps/alpha/nptl/pthread-offsets.h create mode 100644 sysdeps/arm/nptl/pthread-offsets.h create mode 100644 sysdeps/hppa/nptl/pthread-offsets.h create mode 100644 sysdeps/i386/nptl/pthread-offsets.h create mode 100644 sysdeps/ia64/nptl/pthread-offsets.h create mode 100644 sysdeps/m68k/nptl/pthread-offsets.h create mode 100644 sysdeps/microblaze/nptl/pthread-offsets.h create mode 100644 sysdeps/mips/nptl/pthread-offsets.h create mode 100644 sysdeps/nios2/nptl/pthread-offsets.h create mode 100644 sysdeps/powerpc/nptl/pthread-offsets.h create mode 100644 sysdeps/s390/nptl/pthread-offsets.h create mode 100644 sysdeps/sh/nptl/pthread-offsets.h create mode 100644 sysdeps/sparc/nptl/pthread-offsets.h create mode 100644 sysdeps/tile/nptl/pthread-offsets.h create mode 100644 sysdeps/x86_64/nptl/pthread-offsets.h -- 2.7.4 diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index dbf46b0..444bbd9 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -639,4 +639,10 @@ check_stacksize_attr (size_t st) return EINVAL; } +#define ASSERT_PTHREAD_STRING(x) __STRING (x) +#define ASSERT_PTHREAD_INTERNAL_OFFSET(__type, __member, __offset) \ + _Static_assert (offsetof (__type, __member) == __offset, \ + "offset of " #__member " field of " #__type " != " \ + ASSERT_PTHREAD_STRING (__offset)) + #endif /* pthreadP.h */ diff --git a/nptl/pthread_mutex_init.c b/nptl/pthread_mutex_init.c index 6f2fc80..e1f911b 100644 --- a/nptl/pthread_mutex_init.c +++ b/nptl/pthread_mutex_init.c @@ -23,6 +23,7 @@ #include #include "pthreadP.h" #include +#include #include @@ -58,6 +59,18 @@ __pthread_mutex_init (pthread_mutex_t *mutex, const struct pthread_mutexattr *imutexattr; assert (sizeof (pthread_mutex_t) <= __SIZEOF_PTHREAD_MUTEX_T); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__nusers, + __PTHREAD_MUTEX_NUSERS_OFFSET); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__kind, + __PTHREAD_MUTEX_KIND_OFFSET); + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__spins, + __PTHREAD_MUTEX_SPINS_OFFSET); +#if __PTHREAD_MUTEX_LOCK_ELISION + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__elision, + __PTHREAD_MUTEX_ELISION_OFFSET); +#endif + ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_mutex_t, __data.__list, + __PTHREAD_MUTEX_LIST_OFFSET); imutexattr = ((const struct pthread_mutexattr *) mutexattr ?: &default_mutexattr); diff --git a/sysdeps/aarch64/nptl/pthread-offsets.h b/sysdeps/aarch64/nptl/pthread-offsets.h new file mode 100644 index 0000000..16c6b0d --- /dev/null +++ b/sysdeps/aarch64/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +#define __PTHREAD_MUTEX_KIND_OFFSET 16 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 24 diff --git a/sysdeps/alpha/nptl/pthread-offsets.h b/sysdeps/alpha/nptl/pthread-offsets.h new file mode 100644 index 0000000..16c6b0d --- /dev/null +++ b/sysdeps/alpha/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +#define __PTHREAD_MUTEX_KIND_OFFSET 16 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 24 diff --git a/sysdeps/arm/nptl/pthread-offsets.h b/sysdeps/arm/nptl/pthread-offsets.h new file mode 100644 index 0000000..9617354 --- /dev/null +++ b/sysdeps/arm/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 20 diff --git a/sysdeps/hppa/nptl/pthread-offsets.h b/sysdeps/hppa/nptl/pthread-offsets.h new file mode 100644 index 0000000..8ae01b9 --- /dev/null +++ b/sysdeps/hppa/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 32 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 36 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 36 diff --git a/sysdeps/i386/nptl/pthread-offsets.h b/sysdeps/i386/nptl/pthread-offsets.h new file mode 100644 index 0000000..9617354 --- /dev/null +++ b/sysdeps/i386/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 20 diff --git a/sysdeps/ia64/nptl/pthread-offsets.h b/sysdeps/ia64/nptl/pthread-offsets.h new file mode 100644 index 0000000..16c6b0d --- /dev/null +++ b/sysdeps/ia64/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +#define __PTHREAD_MUTEX_KIND_OFFSET 16 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 24 diff --git a/sysdeps/m68k/nptl/pthread-offsets.h b/sysdeps/m68k/nptl/pthread-offsets.h new file mode 100644 index 0000000..9617354 --- /dev/null +++ b/sysdeps/m68k/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 20 diff --git a/sysdeps/microblaze/nptl/pthread-offsets.h b/sysdeps/microblaze/nptl/pthread-offsets.h new file mode 100644 index 0000000..9617354 --- /dev/null +++ b/sysdeps/microblaze/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 20 diff --git a/sysdeps/mips/nptl/pthread-offsets.h b/sysdeps/mips/nptl/pthread-offsets.h new file mode 100644 index 0000000..0ac3eda --- /dev/null +++ b/sysdeps/mips/nptl/pthread-offsets.h @@ -0,0 +1,13 @@ +#if _MIPS_SIM == _ABI64 +# define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +# define __PTHREAD_MUTEX_KIND_OFFSET 16 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 24 +#else +# define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +# define __PTHREAD_MUTEX_KIND_OFFSET 12 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 20 +#endif diff --git a/sysdeps/nios2/nptl/pthread-offsets.h b/sysdeps/nios2/nptl/pthread-offsets.h new file mode 100644 index 0000000..9617354 --- /dev/null +++ b/sysdeps/nios2/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 20 diff --git a/sysdeps/powerpc/nptl/pthread-offsets.h b/sysdeps/powerpc/nptl/pthread-offsets.h new file mode 100644 index 0000000..bdda1f1 --- /dev/null +++ b/sysdeps/powerpc/nptl/pthread-offsets.h @@ -0,0 +1,15 @@ +#include + +#if __WORDSIZE == 64 +# define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +# define __PTHREAD_MUTEX_KIND_OFFSET 16 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 24 +#else +# define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +# define __PTHREAD_MUTEX_KIND_OFFSET 12 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 20 +#endif diff --git a/sysdeps/s390/nptl/pthread-offsets.h b/sysdeps/s390/nptl/pthread-offsets.h new file mode 100644 index 0000000..bdda1f1 --- /dev/null +++ b/sysdeps/s390/nptl/pthread-offsets.h @@ -0,0 +1,15 @@ +#include + +#if __WORDSIZE == 64 +# define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +# define __PTHREAD_MUTEX_KIND_OFFSET 16 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 24 +#else +# define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +# define __PTHREAD_MUTEX_KIND_OFFSET 12 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 20 +#endif diff --git a/sysdeps/sh/nptl/pthread-offsets.h b/sysdeps/sh/nptl/pthread-offsets.h new file mode 100644 index 0000000..9617354 --- /dev/null +++ b/sysdeps/sh/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 20 diff --git a/sysdeps/sparc/nptl/pthread-offsets.h b/sysdeps/sparc/nptl/pthread-offsets.h new file mode 100644 index 0000000..bdda1f1 --- /dev/null +++ b/sysdeps/sparc/nptl/pthread-offsets.h @@ -0,0 +1,15 @@ +#include + +#if __WORDSIZE == 64 +# define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +# define __PTHREAD_MUTEX_KIND_OFFSET 16 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 24 +#else +# define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +# define __PTHREAD_MUTEX_KIND_OFFSET 12 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 20 +#endif diff --git a/sysdeps/tile/nptl/pthread-offsets.h b/sysdeps/tile/nptl/pthread-offsets.h new file mode 100644 index 0000000..bdda1f1 --- /dev/null +++ b/sysdeps/tile/nptl/pthread-offsets.h @@ -0,0 +1,15 @@ +#include + +#if __WORDSIZE == 64 +# define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +# define __PTHREAD_MUTEX_KIND_OFFSET 16 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 24 +#else +# define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +# define __PTHREAD_MUTEX_KIND_OFFSET 12 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# define __PTHREAD_MUTEX_ELISION_OFFSET 22 +# define __PTHREAD_MUTEX_LIST_OFFSET 20 +#endif diff --git a/sysdeps/x86_64/nptl/pthread-offsets.h b/sysdeps/x86_64/nptl/pthread-offsets.h new file mode 100644 index 0000000..16c6b0d --- /dev/null +++ b/sysdeps/x86_64/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +#define __PTHREAD_MUTEX_KIND_OFFSET 16 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 24