From nobody Fri Apr 29 20:55:07 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6C9821994947; Fri, 29 Apr 2022 20:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kql9m0KL9z3FFB; Fri, 29 Apr 2022 20:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651265708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXA89i5hmhn4l96JUXi/iddmXgBXGoIgF7TFA5pPT1I=; b=W41t9f4RVp2pcKsqMHVkxFKTrqEYSflyKgjHZ69erK1KggahCt6ro+gCIjQag84J/ZPCEB dfHOlTJ7mxbFbyMIXDoUsMJxSdgKoyLe393bcYqCvtLVE3IKPGLhL9yshz7IsgAxWAej62 UAbt+BU4KCMdxYD6B6NBBM+R5SiWm2I8PhMkAsrBQoR5uxsdiAlUjbEzvILK5lSTE7vBa+ UyjqBZ4734EKQ/DaLDEdInHpuxk7dgZ85w10n2gnP3nGaalo9LGuQ6wJ0qBDnJmy+lPo2c fvjHAbmag8OVMzHfDzeIBjEp9qysGa+NsCePkLBFNqJB0cMY/HoWWyqinYHTFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB6B3143C5; Fri, 29 Apr 2022 20:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23TKt7H9055236; Fri, 29 Apr 2022 20:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23TKt7hD055235; Fri, 29 Apr 2022 20:55:07 GMT (envelope-from git) Date: Fri, 29 Apr 2022 20:55:07 GMT Message-Id: <202204292055.23TKt7hD055235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: efc500573f3e - stable/13 - libthr: Remove the DTV_OFFSET macro. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: efc500573f3e0ace5606de90b59291e865208980 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651265708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXA89i5hmhn4l96JUXi/iddmXgBXGoIgF7TFA5pPT1I=; b=spCWOaNh/NH/O/ssAUf28JH05yHUKjfm3E2SNKxDLAVUl/ktis2FJNNfhQThnGdgKMI9+H knzhda30LrL4DiM1cJHajU/ocHMAQ3d8EJnYpgquDd7X+Olw5PPmbzTCZO+YYU6TrxBXyH bJpqGB3DZY3Ikuoje6burUSvJ5R3I11DEo+EZf2Dja13lsyQQDZJw+DQFZuZ9Ni8phlmzt zArwssz2EOTfwSEHvt7VzVR/dM7jJluGlZh6UuEjr8jeAdq7mPzuoWXeI5r5LkkQEcXBKM 8YdBLz1Vw50mkxmulFRjQfR+2m01N1YaC0u/i2bAQDtv5+AxndXJBpTIBmjd4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651265708; a=rsa-sha256; cv=none; b=OF9TnGzrTZ9zXrzEDKzzttp+4yVUnndOB3lqhHeFNLCtnnc1eusNYGPqyafw8UD9zqtJQW OpiOq6dqasTtmL4L+JzmHnSmb/abHZAv2SjHWUrWEy675lml8LiSJavCnaN0cXUopmu8j2 LrvO2vtuTpa3UPu4ZVk9NOtV1ZS6Dg6iaUusd/kpZVpfxrf+/P0IV4tJD3acmRDDtCPm8t 78NhItTgm0JAttjqwpFM0m9rRa/mas6gA7Cu1QlN0G5CzrH1pikmuGOHu6BkO/w6YmD8Hm q6B1HckveTepy8fVBwZZjEFDwwG4EMHUMbsFvmjAooQDJCe43/n750A81hfojA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=efc500573f3e0ace5606de90b59291e865208980 commit efc500573f3e0ace5606de90b59291e865208980 Author: John Baldwin AuthorDate: 2021-12-09 21:15:38 +0000 Commit: John Baldwin CommitDate: 2022-04-29 20:50:04 +0000 libthr: Remove the DTV_OFFSET macro. This macro is confusing as it is not related to the similarly named TLS_DTV_OFFSET. Instead, replace its one use with the desired expression which is the same on all platforms. Reviewed by: kib, emaste, jrtc27 Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33345 (cherry picked from commit 5d8176337e691d3ca3fa7d519bc3eaacf6d9faee) --- lib/libthr/arch/aarch64/include/pthread_md.h | 2 -- lib/libthr/arch/amd64/include/pthread_md.h | 2 -- lib/libthr/arch/arm/include/pthread_md.h | 2 -- lib/libthr/arch/i386/include/pthread_md.h | 2 -- lib/libthr/arch/mips/include/pthread_md.h | 2 -- lib/libthr/arch/powerpc/include/pthread_md.h | 2 -- lib/libthr/arch/riscv/include/pthread_md.h | 2 -- lib/libthr/thread/thr_symbols.c | 2 +- 8 files changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/libthr/arch/aarch64/include/pthread_md.h b/lib/libthr/arch/aarch64/include/pthread_md.h index d14bce244f8f..3209a2cbe7e2 100644 --- a/lib/libthr/arch/aarch64/include/pthread_md.h +++ b/lib/libthr/arch/aarch64/include/pthread_md.h @@ -38,10 +38,8 @@ #include #include -#include #define CPU_SPINWAIT -#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) /* * Variant I tcb. The structure layout is fixed, don't blindly diff --git a/lib/libthr/arch/amd64/include/pthread_md.h b/lib/libthr/arch/amd64/include/pthread_md.h index 1d393d9cbbed..b3367e85ee65 100644 --- a/lib/libthr/arch/amd64/include/pthread_md.h +++ b/lib/libthr/arch/amd64/include/pthread_md.h @@ -41,8 +41,6 @@ #define CPU_SPINWAIT __asm __volatile("pause") -#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) - /* * Variant II tcb, first two members are required by rtld, * %fs points to the structure. diff --git a/lib/libthr/arch/arm/include/pthread_md.h b/lib/libthr/arch/arm/include/pthread_md.h index 55d93d0853bc..d1fce8551b2e 100644 --- a/lib/libthr/arch/arm/include/pthread_md.h +++ b/lib/libthr/arch/arm/include/pthread_md.h @@ -36,10 +36,8 @@ #include #include -#include #define CPU_SPINWAIT -#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) /* * Variant I tcb. The structure layout is fixed, don't blindly diff --git a/lib/libthr/arch/i386/include/pthread_md.h b/lib/libthr/arch/i386/include/pthread_md.h index 7de8aa56203e..48374480d207 100644 --- a/lib/libthr/arch/i386/include/pthread_md.h +++ b/lib/libthr/arch/i386/include/pthread_md.h @@ -41,8 +41,6 @@ #define CPU_SPINWAIT __asm __volatile("pause") -#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) - /* * Variant II tcb, first two members are required by rtld, * %gs points to the structure. diff --git a/lib/libthr/arch/mips/include/pthread_md.h b/lib/libthr/arch/mips/include/pthread_md.h index 20b0e7065595..2a29e6717abe 100644 --- a/lib/libthr/arch/mips/include/pthread_md.h +++ b/lib/libthr/arch/mips/include/pthread_md.h @@ -38,10 +38,8 @@ #include #include #include -#include #define CPU_SPINWAIT -#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) /* * Variant I tcb. The structure layout is fixed, don't blindly diff --git a/lib/libthr/arch/powerpc/include/pthread_md.h b/lib/libthr/arch/powerpc/include/pthread_md.h index 0ed44058a7a7..3fcf8c3245da 100644 --- a/lib/libthr/arch/powerpc/include/pthread_md.h +++ b/lib/libthr/arch/powerpc/include/pthread_md.h @@ -35,12 +35,10 @@ #ifndef _PTHREAD_MD_H_ #define _PTHREAD_MD_H_ -#include #include #define CPU_SPINWAIT -#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) #ifdef __powerpc64__ #define TP_OFFSET 0x7010 #else diff --git a/lib/libthr/arch/riscv/include/pthread_md.h b/lib/libthr/arch/riscv/include/pthread_md.h index 55d9b7260fd2..1cdc8a12be95 100644 --- a/lib/libthr/arch/riscv/include/pthread_md.h +++ b/lib/libthr/arch/riscv/include/pthread_md.h @@ -42,10 +42,8 @@ #define _PTHREAD_MD_H_ #include -#include #define CPU_SPINWAIT -#define DTV_OFFSET offsetof(struct tcb, tcb_dtv) #define TP_OFFSET sizeof(struct tcb) /* diff --git a/lib/libthr/thread/thr_symbols.c b/lib/libthr/thread/thr_symbols.c index cee263c56826..71737392c62f 100644 --- a/lib/libthr/thread/thr_symbols.c +++ b/lib/libthr/thread/thr_symbols.c @@ -55,7 +55,7 @@ int _thread_size_key = sizeof(struct pthread_key); int _thread_off_key_allocated = offsetof(struct pthread_key, allocated); int _thread_off_key_destructor = offsetof(struct pthread_key, destructor); int _thread_max_keys = PTHREAD_KEYS_MAX; -int _thread_off_dtv = DTV_OFFSET; +int _thread_off_dtv = offsetof(struct tcb, tcb_dtv); int _thread_off_state = offsetof(struct pthread, state); int _thread_state_running = PS_RUNNING; int _thread_state_zoombie = PS_DEAD;