From patchwork Wed Nov 20 14:51:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1198213 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107218-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="x7eU0YK0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47J5K12045z9sPc for ; Thu, 21 Nov 2019 01:52:53 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=JujJ0DrCZ4SCLQn0yZLTd3hBa9KWY5I XWEJFJ7upAUghdbFpvk6w3uuoSIfZ1eYPJ2eFezHkiyD5OhG92ohEqQx/eoqhQ5A Yvy9KbYZk3/nmMEoMK5UM9Ubxz/bt7jtl0gSZKnY8CLuA2+cQc2UcvncHJUfvSKK 7tONWw0PaVTU= 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:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=epyZAgYHMySF1R2Iivt0UeKdsEo=; b=x7eU0 YK0JcMx4cwIHBxgF24iRhcdxn674bpCtAFXmfRpM2ls7BKg1AaJGX6jDFSj0AtQh CU6WkBzi56rtn2tQ5XezSwAlpvjfiSJVHMmkGAnzVAwGDeFdX+drc22bosKoMnOa fDCeW593yBLOzTHwmKBRkvMRwQpYhJF+ufzzzc= Received: (qmail 83317 invoked by alias); 20 Nov 2019 14:51:18 -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 83237 invoked by uid 89); 20 Nov 2019 14:51:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io X-Gerrit-PatchSet: 3 Date: Wed, 20 Nov 2019 09:51:00 -0500 From: "Adhemerval Zanella (Code Review)" To: libc-alpha@sourceware.org Cc: Florian Weimer Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v3] nptl: Add default pthread-offsets.h X-Gerrit-Change-Id: I7785a9581e651feb80d1413b9e03b5ac0452668a X-Gerrit-Change-Number: 521 X-Gerrit-ChangeURL: X-Gerrit-Commit: ab1b8d80ffb2b0bc3c2ea062169ebcd914f9ce06 In-Reply-To: References: Reply-To: adhemerval.zanella@linaro.org, fweimer@redhat.com, libc-alpha@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20191120145102.03BEA2816F@gnutoolchain-gerrit.osci.io> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/521 ...................................................................... nptl: Add default pthread-offsets.h This patch adds a default pthread-offsets.h based on default thread definitions from struct_mutex.h and struct_rwlock.h. The idea is to simplify new ports inclusion. Checked with a build on affected abis. Change-Id: I7785a9581e651feb80d1413b9e03b5ac0452668a --- D sysdeps/aarch64/nptl/pthread-offsets.h D sysdeps/alpha/nptl/pthread-offsets.h D sysdeps/arm/nptl/pthread-offsets.h D sysdeps/csky/nptl/pthread-offsets.h D sysdeps/ia64/nptl/pthread-offsets.h D sysdeps/m68k/nptl/pthread-offsets.h D sysdeps/microblaze/nptl/pthread-offsets.h D sysdeps/nios2/nptl/pthread-offsets.h A sysdeps/nptl/pthread-offsets.h D sysdeps/riscv/nptl/pthread-offsets.h D sysdeps/sh/nptl/pthread-offsets.h D sysdeps/sparc/nptl/pthread-offsets.h 12 files changed, 26 insertions(+), 74 deletions(-) diff --git a/sysdeps/aarch64/nptl/pthread-offsets.h b/sysdeps/aarch64/nptl/pthread-offsets.h deleted file mode 100644 index 7fe06e0..0000000 --- a/sysdeps/aarch64/nptl/pthread-offsets.h +++ /dev/null @@ -1,3 +0,0 @@ -#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 deleted file mode 100644 index 7fe06e0..0000000 --- a/sysdeps/alpha/nptl/pthread-offsets.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __PTHREAD_MUTEX_KIND_OFFSET 16 - -#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 diff --git a/sysdeps/arm/nptl/pthread-offsets.h b/sysdeps/arm/nptl/pthread-offsets.h deleted file mode 100644 index e9accba..0000000 --- a/sysdeps/arm/nptl/pthread-offsets.h +++ /dev/null @@ -1,7 +0,0 @@ -#define __PTHREAD_MUTEX_KIND_OFFSET 12 - -#if __BYTE_ORDER == __BIG_ENDIAN -# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 -#else -# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 -#endif diff --git a/sysdeps/csky/nptl/pthread-offsets.h b/sysdeps/csky/nptl/pthread-offsets.h deleted file mode 100644 index 7940d1f..0000000 --- a/sysdeps/csky/nptl/pthread-offsets.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __PTHREAD_MUTEX_KIND_OFFSET 12 - -#define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 diff --git a/sysdeps/ia64/nptl/pthread-offsets.h b/sysdeps/ia64/nptl/pthread-offsets.h deleted file mode 100644 index 7fe06e0..0000000 --- a/sysdeps/ia64/nptl/pthread-offsets.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __PTHREAD_MUTEX_KIND_OFFSET 16 - -#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 diff --git a/sysdeps/m68k/nptl/pthread-offsets.h b/sysdeps/m68k/nptl/pthread-offsets.h deleted file mode 100644 index 4d6696a..0000000 --- a/sysdeps/m68k/nptl/pthread-offsets.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __PTHREAD_MUTEX_KIND_OFFSET 12 - -#define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 diff --git a/sysdeps/microblaze/nptl/pthread-offsets.h b/sysdeps/microblaze/nptl/pthread-offsets.h deleted file mode 100644 index e9accba..0000000 --- a/sysdeps/microblaze/nptl/pthread-offsets.h +++ /dev/null @@ -1,7 +0,0 @@ -#define __PTHREAD_MUTEX_KIND_OFFSET 12 - -#if __BYTE_ORDER == __BIG_ENDIAN -# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 -#else -# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 -#endif diff --git a/sysdeps/nios2/nptl/pthread-offsets.h b/sysdeps/nios2/nptl/pthread-offsets.h deleted file mode 100644 index 7940d1f..0000000 --- a/sysdeps/nios2/nptl/pthread-offsets.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __PTHREAD_MUTEX_KIND_OFFSET 12 - -#define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 diff --git a/sysdeps/nptl/pthread-offsets.h b/sysdeps/nptl/pthread-offsets.h new file mode 100644 index 0000000..a399608 --- /dev/null +++ b/sysdeps/nptl/pthread-offsets.h @@ -0,0 +1,26 @@ +#include + +/* These values are based on internal generic types from + mutex-internal.h and rwlock-internal.h. */ + +#if __WORDSIZE == 64 +# define __PTHREAD_MUTEX_NUSERS_OFFSET 12 +# define __PTHREAD_MUTEX_KIND_OFFSET 16 +# define __PTHREAD_MUTEX_SPINS_OFFSET 20 +# 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_LIST_OFFSET 20 +#endif + +#if __WORDSIZE == 64 +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 +#else +# if __BYTE_ORDER == __BIG_ENDIAN +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 +# else +# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 +# endif +#endif diff --git a/sysdeps/riscv/nptl/pthread-offsets.h b/sysdeps/riscv/nptl/pthread-offsets.h deleted file mode 100644 index 4f14276..0000000 --- a/sysdeps/riscv/nptl/pthread-offsets.h +++ /dev/null @@ -1,22 +0,0 @@ -/* RISC-V pthread offsets - Copyright (C) 2017-2019 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 - . */ - -#define __PTHREAD_MUTEX_KIND_OFFSET 16 - -#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 diff --git a/sysdeps/sh/nptl/pthread-offsets.h b/sysdeps/sh/nptl/pthread-offsets.h deleted file mode 100644 index e9accba..0000000 --- a/sysdeps/sh/nptl/pthread-offsets.h +++ /dev/null @@ -1,7 +0,0 @@ -#define __PTHREAD_MUTEX_KIND_OFFSET 12 - -#if __BYTE_ORDER == __BIG_ENDIAN -# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 -#else -# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 -#endif diff --git a/sysdeps/sparc/nptl/pthread-offsets.h b/sysdeps/sparc/nptl/pthread-offsets.h deleted file mode 100644 index 9e21121..0000000 --- a/sysdeps/sparc/nptl/pthread-offsets.h +++ /dev/null @@ -1,13 +0,0 @@ -#include - -#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