From patchwork Thu Oct 19 21:00:05 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: 116437 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp933185qgn; Thu, 19 Oct 2017 14:01:17 -0700 (PDT) X-Received: by 10.99.95.201 with SMTP id t192mr2340286pgb.398.1508446877186; Thu, 19 Oct 2017 14:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508446877; cv=none; d=google.com; s=arc-20160816; b=Ww+IpWLQ1MngyJs3bhWWV19gAqS6Hxl5CDOVhLfIt0/jM42MRpgcxdJvkD08miIS05 8rsbnyjuccOQQ9UUl2hvABkZKe9dzhqc897YLWJvq+jhdUETvq7PnUMem+nse7mFfncg NDFUs90Qsz0t1WQKFtQ0HPw/3K/vkqJX99icUv47tezWMuhOvnKJhhoZgKKrh9tOBeq0 YtYdAnv6//MBzyLDuRd8ct4LEDJ+aGWCcenIuO+4roWEthRsm6nWAEuitXw8HWAFnwwM 6Wm8UlyH2nZSAiiPZMC5QF29c1lUR6XTDTCoAstybJH4+3HzYFO2TO6amNXAEF+0y/pt iQpQ== 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=7CrXA2lJ7VuA1a+rsUVuXdLtMfCM/vzpTXFkwkBZPG8=; b=05oUyw5MKB89UTDJkeBaIcciftTMHkNy5t/IoGkYzV5uGH1vpfIU10VRsZop5Sq6L7 aiUKxtNNgMd83rzmsBZBYN4YoldCNEA9g/s08JPRTc5UFqhhfsKg63zB2s8fqFISF1TW 6vby0q3k5miM3U7wSOPt1j8rE94z7Wg2F1mtqGpQaEqnV1wpzKdiyLlL2sDdTQIg4hWQ uWUCxi1/JuOGVL7eejI6qC5ZBzMyYhMnQE3UosWkzMbFD9JTjUcV+Nhs2YFpqegfO4tf GKudQMCaW+/Wr65cnqIKgd4yEsIOvqq6sHlZa0+L9ey/IzTHuIRkqOXA3ujd0QIWPWqp nYfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=A90G3ZaA; spf=pass (google.com: domain of libc-alpha-return-86152-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86152-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 m6si8315256pff.205.2017.10.19.14.01.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 14:01:17 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-86152-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=A90G3ZaA; spf=pass (google.com: domain of libc-alpha-return-86152-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-86152-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=jxVbGlVQoNpd1Td+w6hNrPIdEtK/G/RnC0C9cGL2zoNUgQMe2iNEs dv1LK6qPXl+8z76iZ+31mzdC0XCsUlTJYpl1x0lh9zI5xFDHCFxulb2Eh43D8JN8 erqAzylxGAVPnj0vWia2PA001GlHO8YE+dH8CzTjjgt5GXEALhlzbQ= 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=Tu+TZvxaX6yYlOXYdzYkZuwY/5k=; b=A90G3ZaAf2YNjdS4XY+YbR9OQRcj CXRUs/C2rctPtTVPbbZRd8Ux063zcJRJ7vG+/KuEZK1PihYa/AjMvvmVYy4HewP7 SMXD1T006Gu43rKUeyu3ByeOF+8im9CvcXyJHGR4qBdJ44gzVOl4jjQrJ2XACeSS 95YDvMNlstGwAXk= Received: (qmail 92437 invoked by alias); 19 Oct 2017 21:00:42 -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 91109 invoked by uid 89); 19 Oct 2017 21:00:28 -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= X-HELO: mail-qt0-f194.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=7CrXA2lJ7VuA1a+rsUVuXdLtMfCM/vzpTXFkwkBZPG8=; b=T+Fw3kY5wC8Wny5oLFf97xBDaQqbYriaMdInn19ORxrrHup6Kshlw5cS1HOmKbe6as KNP1nOjWO7jgsTZBV0U1UMbp2OkgWtT7dOuzBY+F4ML9mH12MZaTeI78wbqT8mU6fW/W OwNjv9lGqsLNPcf0+fzxVraru1N7eXex94xTfdwP12klynROXEJkktOrU1DUAzsp5Egv 4yOWGt4RveLZWtrBqd9h+UQ9iP2g/uBQ1Zz16P8piFHJeTTnImcM88wLqL30+pgbSLDs B163TL+a2ZRvgii8sELhRlu+67ogELA+g93AWmkGx2D37lVqaltT5MCDUbUXJm7gLyH7 5mSQ== X-Gm-Message-State: AMCzsaVDfbRxWVYMIP7vZNHzZlGY2aTuqx4lP/4g5TAtDupsloffoKiz aspSx06aGSz8yp9t4XS8UMEeRHm/owQ= X-Google-Smtp-Source: ABhQp+TiRhKNR9hSwIoAN7vb9DOHQe2MGRd00hECyyBfH0EwThQdPv8vCCNRpD6H9qEtSgi8egYrJw== X-Received: by 10.200.48.151 with SMTP id v23mr3803947qta.97.1508446817665; Thu, 19 Oct 2017 14:00:17 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/3] nptl: Add tests for internal pthread_mutex_t offsets Date: Thu, 19 Oct 2017 19:00:05 -0200 Message-Id: <1508446807-21704-1-git-send-email-adhemerval.zanella@linaro.org> This patch adds a new build test to check for internal fields offsets uses on pthread_mutex_t static initialization macros (PTHREAD_MUTEX_INITIALIZER, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP, and PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP). Currently the only field which is statically initialized to a non zero value is pthread_mutex_t.__data.__kind value, however the test also check the offset of __kind, __spins, __elision (if support), 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). * nptl/Makefile (tests-internal): Add tst-offsets. * nptl/tst-offsets.c: New file. * sysdeps/aarch64/nptl/pthread-offsets.h: Likewise. * 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 | 21 ++++++++++++ nptl/Makefile | 2 +- nptl/tst-offsets.c | 54 +++++++++++++++++++++++++++++++ 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, 204 insertions(+), 1 deletion(-) create mode 100644 nptl/tst-offsets.c 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/Makefile b/nptl/Makefile index d819349..7492b06 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -304,7 +304,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ tst-thread_local1 tst-mutex-errorcheck tst-robust10 \ tst-robust-fork tst-create-detached tst-memstream -tests-internal := tst-typesizes \ +tests-internal := tst-typesizes tst-offsets \ tst-rwlock19 tst-rwlock20 \ tst-sem11 tst-sem12 tst-sem13 \ tst-barrier5 tst-signal7 tst-mutex8 tst-mutex8-static \ diff --git a/nptl/tst-offsets.c b/nptl/tst-offsets.c new file mode 100644 index 0000000..0df1155 --- /dev/null +++ b/nptl/tst-offsets.c @@ -0,0 +1,54 @@ +/* Check pthread internal offsets. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + +#include + +#define STR_HELPER(x) #x +#define STR(x) STR_HELPER(x) + +static int +do_test (void) +{ +#define TEST_OFFSET(type, member, offset) \ + _Static_assert (offsetof (type, member) == offset, \ + "offset of " #member " field of " #type " != " \ + STR (offset)) + + /* Check if internal fields in pthread_mutex_t used by static initializers + have the expected offset. */ + TEST_OFFSET (pthread_mutex_t, __data.__nusers, + __PTHREAD_MUTEX_NUSERS_OFFSET); + TEST_OFFSET (pthread_mutex_t, __data.__kind, + __PTHREAD_MUTEX_KIND_OFFSET); + TEST_OFFSET (pthread_mutex_t, __data.__spins, + __PTHREAD_MUTEX_SPINS_OFFSET); +#if __PTHREAD_MUTEX_LOCK_ELISION + TEST_OFFSET (pthread_mutex_t, __data.__elision, + __PTHREAD_MUTEX_ELISION_OFFSET); +#endif + TEST_OFFSET (pthread_mutex_t, __data.__list, + __PTHREAD_MUTEX_LIST_OFFSET); + + return 0; +} + +#include 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