From nobody Tue Nov 19 15:28:43 2024 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 4Xt7gc0C15z5f7ky; Tue, 19 Nov 2024 15:28:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xt7gb3r2Pz4CQ8; Tue, 19 Nov 2024 15:28:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732030123; 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=bm0Sw+iEb3Ow8+PKRvbYWYdK6NH+ZRxUOPa2rG+Rumg=; b=hvk2RWKbrxU/ch6uTVvrwelaIU1gxBdDQ4iUO2bBmCh1Zim70xbPHD/g0tP7tMryxRWhGq RBzGeSQdUtAVnWJbguipCODChDRVczyWc02y3Uu/Ieji/wbfYp4Rzf+bdpVRJOc4dXtYON MTDbjQy0UEud+dm97/SBO16fuDBc87PS5XeJa8LIaapL+/R7wXkHvL9KEcgJkKIqKfz9fi NioqyWa9hakcl9BDjXf2BwMeIZWhBs9lhSbZmS9mRhJ3+jrajEmU0riIwOQlbfcRtUCZG/ Mmj4YXaJp2piTlu85Gc3NCfON2Bs12Ucplkxj1wsR8bLO4/hcQ4bsSODAy6FEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732030123; 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=bm0Sw+iEb3Ow8+PKRvbYWYdK6NH+ZRxUOPa2rG+Rumg=; b=yCvgQhUJAl6lbZHLw0v3ePJ3AofQLBTeVwQ6B3xLOPVmhsX7xfhPHExpW32qK8mahkkL6o WxYEhcfkAJTuhXEZuR45IIzqk0oOTB/BgetFJ6//f26XBMCG79EovnrzP3qAUjTngmTlZZ 0r521zbGVRb57NkKnHY8dMh5uotM39dgeqrtsyoqPJGTrCzOAu8/kMZ7JXyYkzlUDK9et9 Nnu9dQ4FQl5JP6NkOMgZxGgHFIWH+r04ECHp7UGtNEfFSE/UgLAifwsTu8yFaPlcLNJdna vjpVB5AWD7FRBUpErE37EkUbnfQ8oslS1FDBYdFHUkzWlU0HpygZW4p1htPKgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732030123; a=rsa-sha256; cv=none; b=ZVvBaUBzngWK/+alBuGEWyvJ+VC71YsMC4ujLXJdFmFJ1krlcE/76WkGKmvSFORlKfdL/C /vOpq8jbVD9mzV0nL30zbYcRrzUKS+gJYZ4rgJXUhkxD9sAv+lB8GO4p9qNEVEivWyshXH m6JqfwvJunejlvNgPlAGBEnI7MkMc4DVs3aADIgs80RAkD3TwHUm+cExQfFZ8VyfehsIvo 4KzIssjGfggXrA6yn0NiTFdYLb2YVN1AS6NRj0KW4x3zC8SQjLWEXl61KYTWWDgR1YW9mG A9P4MfU+29HfwXtBvkBQuUdQPsKkM3D6m09CbPbX0Nojc5fb3te6bhOQYTvLMA== 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 4Xt7gb3S8gzFhZ; Tue, 19 Nov 2024 15:28:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AJFShPH041305; Tue, 19 Nov 2024 15:28:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AJFShhJ041302; Tue, 19 Nov 2024 15:28:43 GMT (envelope-from git) Date: Tue, 19 Nov 2024 15:28:43 GMT Message-Id: <202411191528.4AJFShhJ041302@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: fa2091d7571f - main - atomic(9): Remove fcmpset-based fallback for atomic_testand(clear|set) 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: fa2091d7571ffbae82dfc828f554745f283adeb0 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fa2091d7571ffbae82dfc828f554745f283adeb0 commit fa2091d7571ffbae82dfc828f554745f283adeb0 Author: John Baldwin AuthorDate: 2024-11-19 15:23:15 +0000 Commit: John Baldwin CommitDate: 2024-11-19 15:23:15 +0000 atomic(9): Remove fcmpset-based fallback for atomic_testand(clear|set) All architectures implement a MD version Reviewed by: kib Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D47629 --- sys/arm/include/atomic.h | 4 --- sys/powerpc/include/atomic.h | 6 ----- sys/sys/_atomic_subword.h | 64 -------------------------------------------- 3 files changed, 74 deletions(-) diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index c9232a4f97ef..1fef40aea2e8 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -892,8 +892,6 @@ atomic_testandclear_long(volatile u_long *p, u_int v) return (atomic_testandclear_32((volatile uint32_t *)p, v)); } -#define atomic_testandclear_long atomic_testandclear_long - static __inline int atomic_testandclear_64(volatile uint64_t *p, u_int v) @@ -952,7 +950,6 @@ atomic_testandset_long(volatile u_long *p, u_int v) return (atomic_testandset_32((volatile uint32_t *)p, v)); } -#define atomic_testandset_long atomic_testandset_long static __inline int atomic_testandset_acq_long(volatile u_long *p, u_int v) @@ -963,7 +960,6 @@ atomic_testandset_acq_long(volatile u_long *p, u_int v) dmb(); return (ret); } -#define atomic_testandset_acq_long atomic_testandset_acq_long static __inline int atomic_testandset_64(volatile uint64_t *p, u_int v) diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h index 77ee5d8c6d46..47fd9ce30fd6 100644 --- a/sys/powerpc/include/atomic.h +++ b/sys/powerpc/include/atomic.h @@ -1093,12 +1093,6 @@ atomic_testandset_acq_long(volatile u_long *p, u_int v) return (a); } -#define atomic_testandclear_int atomic_testandclear_int -#define atomic_testandset_int atomic_testandset_int -#define atomic_testandclear_long atomic_testandclear_long -#define atomic_testandset_long atomic_testandset_long -#define atomic_testandset_acq_long atomic_testandset_acq_long - static __inline void atomic_thread_fence_acq(void) { diff --git a/sys/sys/_atomic_subword.h b/sys/sys/_atomic_subword.h index dc1b2f23e731..dad23383f642 100644 --- a/sys/sys/_atomic_subword.h +++ b/sys/sys/_atomic_subword.h @@ -205,68 +205,4 @@ atomic_load_acq_16(volatile uint16_t *p) #undef _ATOMIC_BYTE_SHIFT #undef _ATOMIC_HWORD_SHIFT -/* - * Provide generic testandset_long implementation based on fcmpset long - * primitive. It may not be ideal for any given arch, so machine/atomic.h - * should define the macro atomic_testandset_long to override with an - * MD-specific version. - * - * (Organizationally, this isn't really subword atomics. But atomic_common is - * included too early in machine/atomic.h, so it isn't a good place for derived - * primitives like this.) - */ -#ifndef atomic_testandset_acq_long -static __inline int -atomic_testandset_acq_long(volatile u_long *p, u_int v) -{ - u_long bit, old; - bool ret; - - bit = (1ul << (v % (sizeof(*p) * NBBY))); - - old = atomic_load_acq_long(p); - ret = false; - while (!ret && (old & bit) == 0) - ret = atomic_fcmpset_acq_long(p, &old, old | bit); - - return (!ret); -} -#endif - -#ifndef atomic_testandset_long -static __inline int -atomic_testandset_long(volatile u_long *p, u_int v) -{ - u_long bit, old; - bool ret; - - bit = (1ul << (v % (sizeof(*p) * NBBY))); - - old = atomic_load_long(p); - ret = false; - while (!ret && (old & bit) == 0) - ret = atomic_fcmpset_long(p, &old, old | bit); - - return (!ret); -} -#endif - -#ifndef atomic_testandclear_long -static __inline int -atomic_testandclear_long(volatile u_long *p, u_int v) -{ - u_long bit, old; - bool ret; - - bit = (1ul << (v % (sizeof(*p) * NBBY))); - - old = atomic_load_long(p); - ret = false; - while (!ret && (old & bit) != 0) - ret = atomic_fcmpset_long(p, &old, old & ~bit); - - return (ret); -} -#endif - #endif /* _SYS__ATOMIC_SUBWORD_H_ */