From nobody Tue Nov 19 15:28:42 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 4Xt7gZ5GBgz5f83t; Tue, 19 Nov 2024 15:28:42 +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 4Xt7gZ3Wy1z4BqD; Tue, 19 Nov 2024 15:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732030122; 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=xdyh9Bq3BhzyWEcBnFTlGoTlzuE9g1H8ZSJGP1EwDrw=; b=bs87a2+q3g1Q9Bl6KLZq3Se8UXWuTrgWpTfrHecmfTM3rR3VdUyBdPgGDeEp/gnkaxDfl+ jAyrvYmA24MFkvkqKKjP/Xpab1CgnPzrsxN1LgvM9AIl+BW8HouRGTxHVoSPcGmpsUNDwu 04TrRrSzmEQBiAbwQ7RdEOsj62VlZ2oZL+h7GftTqQFzpB2qkcs+J/MRE8ue9wC0ilVuRB SxMQCanZ4dy9s5uaHOkPTH9d2uV5bq7WcVjlI7DtvYTvMOOsGuXi0hm/KAC0tbMBE/vVqX 5DgwoRSWPD4hl+dnSUTGlKLBuvWE00H5BpTgfZSWFFqzNn/pcbCwsSxOeYs12g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732030122; 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=xdyh9Bq3BhzyWEcBnFTlGoTlzuE9g1H8ZSJGP1EwDrw=; b=RdhNDTU9yGt2g91x1UzK6VJMJy6CUYo9q3LgQUngD6YfnsS1GsCqc8hjYHyfj5L4LcQ+Of jK+0VGrPN3SCcfIhGZg6l32M1wh8QZYJ2h2/t9+T4ozRvEhGxwEo6P8znspcWl4b20BDhy k1eFU0PTVKHbZyVQnb/kzA0qNVdGSAVY55zDtjrotGQHomqrpNkP/yWkavwjKPzor6XpVF T9bcwkpn/FpBupwOyXel0UYIQ8JfkP/PGRPd4Unk7NqVAx68ZCsRuwCxosDWVAo4zpeU9h w3GQl02X++9yKWAM2F3L54QqaQ3lb4Oyf/PnFFe5wtEIp4+3QBFZHtXSWEU88A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732030122; a=rsa-sha256; cv=none; b=u49zT4QQfSRd9FVsz0qA2ihDj/JbaiMSPPq8ykTAL026QZ0WEQky76dNLrZxnLjmJ+Awbc 7D/5qbbo5C4PyVbCRhjS9naaLbQxMa5yTdgHg8HTPOs0M6vSaawwNqN+OUOxBHkzZ9Jie2 RFTBjTtWvlj1VNoaTiADSrJykIqgn7oXezaT7eB/k7YlcVJ587sSonjbwTTHDWJrHDEo2H d3jHnMBWUjdrVPYJ8uJBW0y05diJRaP+wWMFVO0z4Zjx83ts1qbllNECADqI1DldG9I+LF tniK5+M7GXq29KRNb2xVo5BpuSHE/pnxA0C1LfoDHNODmvlbu573LT8787S+mg== 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 4Xt7gZ2mygzFhY; Tue, 19 Nov 2024 15:28:42 +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 4AJFSgr3041257; Tue, 19 Nov 2024 15:28:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AJFSgHa041254; Tue, 19 Nov 2024 15:28:42 GMT (envelope-from git) Date: Tue, 19 Nov 2024 15:28:42 GMT Message-Id: <202411191528.4AJFSgHa041254@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: 987c5a194418 - main - arm: Implement atomic_testandset_acq_long as a simple wrapper 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: 987c5a1944183cf82884fdb96b0432bd810aa8b9 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=987c5a1944183cf82884fdb96b0432bd810aa8b9 commit 987c5a1944183cf82884fdb96b0432bd810aa8b9 Author: John Baldwin AuthorDate: 2024-11-19 15:22:50 +0000 Commit: John Baldwin CommitDate: 2024-11-19 15:22:50 +0000 arm: Implement atomic_testandset_acq_long as a simple wrapper Use a memory barrier after calling the existing atomic_testandset_long rather than using the fcmpset-based fallback version from . Reviewed by: kib Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D47628 --- sys/arm/include/atomic.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index cd6f5cf90d8a..c9232a4f97ef 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -954,6 +954,17 @@ atomic_testandset_long(volatile u_long *p, u_int v) } #define atomic_testandset_long atomic_testandset_long +static __inline int +atomic_testandset_acq_long(volatile u_long *p, u_int v) +{ + int ret; + + ret = atomic_testandset_32((volatile uint32_t *)p, 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) { @@ -1098,7 +1109,6 @@ atomic_thread_fence_seq_cst(void) * For: * - atomic_load_acq_8 * - atomic_load_acq_16 - * - atomic_testandset_acq_long */ #include