Message ID | 20230522122429.1915021-14-mark.rutland@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1411029vqo; Mon, 22 May 2023 05:30:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6W8pBs3CCfSDDpXkYfcGiTGIDGDt64U9eI+MRYwUoNnwg+H0DJdX6LuysfbFyTPVJD74Aw X-Received: by 2002:a17:90a:db16:b0:250:1b4c:d861 with SMTP id g22-20020a17090adb1600b002501b4cd861mr11666985pjv.13.1684758648428; Mon, 22 May 2023 05:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684758648; cv=none; d=google.com; s=arc-20160816; b=T5AFHWft6DUdgUNn3zX5YiI6Aocqz6TB9n79j2bBG9tpGUfUXBxhUYVmKovovXhYUJ 2AihXncrKp9WQqy3Oj0KcVFQi2wk+iun2dUregWQs4ZfO/kSCF4U1aqnuSftD05qVrNV r61oqXfMD2wz8/Sr2zliQSFfHRQduT0ee0SqViut1uBoFsE1QDdrLDsgMIY96yIgMIqj slO5ER5xaFMjRCSVSUP+c2VEoLz5hY2a2FTh/OzBe84hlnrmk4SrmkiM5q8e8y3GAjdc x8OHs+QNT8+p14+IMT/7JlBU95JkWhjgg6a1rGJirk+rVPtR5qMmU949SWmjnGTyHBBf YiRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=uysVNB3f55HIvLNeR4VK9LwWHBg8Brt1uwUjSQXotmA=; b=G+IXn9+tZvMwSj2fBFZ9xqdCIyXwTCjk87WJwZ5H2OxsRJBmHCKgOBRtAG5XWrgHSh QmJbLjS/AQqDIee4YD9qRIFVPTFWdGjMVM6FiVtn6sk96fXPiZHdICHgMiQaGCTCAGRf QQm1lqXZSQY4KCVi92g6BhoWisqXhE400EwKo4n+Lc1eAVtQ2lNqinxAOkCFS6O6S/nM N1HTLdO6ZIPXwhK+KL68pRuyi5Ynx5/dxgxT/lZKEVYJA1vTsCyXo7JNojUAEX2oIvOH dhnqGoDnjP7+vJnC9vJLG+6OURdppMFVKREzSBT6r82bNldWXE9g2K5ydUA34AB+myeq k+Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s2-20020a17090ad48200b002537bd7454dsi4540943pju.101.2023.05.22.05.30.31; Mon, 22 May 2023 05:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234101AbjEVM2L (ORCPT <rfc822;cscallsign@gmail.com> + 99 others); Mon, 22 May 2023 08:28:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234002AbjEVM07 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 22 May 2023 08:26:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 13DF2185; Mon, 22 May 2023 05:25:15 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E2F6A1480; Mon, 22 May 2023 05:25:54 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 43C0E3F59C; Mon, 22 May 2023 05:25:08 -0700 (PDT) From: Mark Rutland <mark.rutland@arm.com> To: linux-kernel@vger.kernel.org Cc: akiyks@gmail.com, boqun.feng@gmail.com, corbet@lwn.net, keescook@chromium.org, linux-arch@vger.kernel.org, linux@armlinux.org.uk, linux-doc@vger.kernel.org, mark.rutland@arm.com, paulmck@kernel.org, peterz@infradead.org, sstabellini@kernel.org, will@kernel.org Subject: [PATCH 13/26] locking/atomic: xtensa: add preprocessor symbols Date: Mon, 22 May 2023 13:24:16 +0100 Message-Id: <20230522122429.1915021-14-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230522122429.1915021-1-mark.rutland@arm.com> References: <20230522122429.1915021-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766597484502394737?= X-GMAIL-MSGID: =?utf-8?q?1766597484502394737?= |
Series |
locking/atomic: restructuring + kerneldoc
|
|
Commit Message
Mark Rutland
May 22, 2023, 12:24 p.m. UTC
Some atomics can be implemented in several different ways, e.g.
FULL/ACQUIRE/RELEASE ordered atomics can be implemented in terms of
RELAXED atomics, and ACQUIRE/RELEASE/RELAXED can be implemented in terms
of FULL ordered atomics. Other atomics are optional, and don't exist in
some configurations (e.g. not all architectures implement the 128-bit
cmpxchg ops).
Subsequent patches will require that architectures define a preprocessor
symbol for any atomic (or ordering variant) which is optional. This will
make the fallback ifdeffery more robust, and simplify future changes.
Add the required definitions to arch/xtensa.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
---
arch/xtensa/include/asm/atomic.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h index 1d323a864002c..7308b7f777d79 100644 --- a/arch/xtensa/include/asm/atomic.h +++ b/arch/xtensa/include/asm/atomic.h @@ -245,6 +245,11 @@ static inline int arch_atomic_fetch_##op(int i, atomic_t * v) \ ATOMIC_OPS(add) ATOMIC_OPS(sub) +#define arch_atomic_add_return arch_atomic_add_return +#define arch_atomic_sub_return arch_atomic_sub_return +#define arch_atomic_fetch_add arch_atomic_fetch_add +#define arch_atomic_fetch_sub arch_atomic_fetch_sub + #undef ATOMIC_OPS #define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op) @@ -252,6 +257,10 @@ ATOMIC_OPS(and) ATOMIC_OPS(or) ATOMIC_OPS(xor) +#define arch_atomic_fetch_and arch_atomic_fetch_and +#define arch_atomic_fetch_or arch_atomic_fetch_or +#define arch_atomic_fetch_xor arch_atomic_fetch_xor + #undef ATOMIC_OPS #undef ATOMIC_FETCH_OP #undef ATOMIC_OP_RETURN