Message ID | 20230605070124.3741859-9-mark.rutland@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2499872vqr; Mon, 5 Jun 2023 00:09:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5o5yW/PF6yCVjb9qLrpHo30qniSirwtszy459aYp8Ap0EJy9Q7W6UUrVhDCQPKo5TtFtRx X-Received: by 2002:a17:90a:cb97:b0:255:67e3:98a with SMTP id a23-20020a17090acb9700b0025567e3098amr6542425pju.11.1685948940503; Mon, 05 Jun 2023 00:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685948940; cv=none; d=google.com; s=arc-20160816; b=G8+W0dz3kUPheZY8ivqiia5Sgu/cXGDcqpavBbASFZgjw3x1KXttc7DdAgmWmptQ7R 1Q/uvGI15njUQ5bNoeC2ywj4pjpa8z87Uy71Cov4WKBIliooEapOf7RRSUC4ievXErhh vYIuVPuZ+rMAkf7AnpsehcbUZUJeVFkzOWm0ZpeQvlENq2dFh2P5wJcnCjHOwJZ1tuNG 6RLLiBgZ5cwmzpOgMrk52pQdTolpeMJdzC34zgYeFX3nx7hBNXfPw2R8MU+8zYI21oOY f+7/5DObW1AcJceqcO0r6NngGxUqCqKr8VLkYmuK9CHsDNCw4lir1DjDH/+Gn8h2y50k AYIA== 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=z75EPH70oqMFcvvlSJhGvw+/IIp/F47XAUq8/CH75ko=; b=gV43cYOa5R+0iU6RCH/ryRdswhZbekGr9T05kUfHiK6GKM889sEtQEwx8SljulgEhY uvC7cmNBMK8WRBRzxaoarJTMNc1C4r5XxJ/rLWkZ+sqjIgoF3bhAKkbv2bLaYAz8oayC BGjtod8w/J/TDUjzAiCPLfNZTSK8u6DikOisz/dgg1YnH//fu2BuBHUCjxaRaY+sAwsc KupPcCjmIu0lMlGTzjnRcO9RUD2725y7LjtG6o9Oo5YQkUWOb9wmzbkBUtRtxIDakthY TABvzrtl0AeW+fqh74ghZ0ADc7cN33LfxBFHxL5AsHdsrqD/OwGSlBBmNPAnsvu9Zv5L t7NQ== 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 cm3-20020a17090afa0300b00246973aef88si6833184pjb.29.2023.06.05.00.08.46; Mon, 05 Jun 2023 00:09:00 -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 S230396AbjFEHCd (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Mon, 5 Jun 2023 03:02:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbjFEHCK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 5 Jun 2023 03:02:10 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8BF2D1B7; Mon, 5 Jun 2023 00:01:53 -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 C9CE2152B; Mon, 5 Jun 2023 00:02:38 -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 853733F793; Mon, 5 Jun 2023 00:01:51 -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@armlinux.org.uk, linux-doc@vger.kernel.org, mark.rutland@arm.com, mchehab@kernel.org, paulmck@kernel.org, peterz@infradead.org, rdunlap@infradead.org, sstabellini@kernel.org, will@kernel.org Subject: [PATCH v2 08/27] locking/atomic: m68k: add preprocessor symbols Date: Mon, 5 Jun 2023 08:01:05 +0100 Message-Id: <20230605070124.3741859-9-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230605070124.3741859-1-mark.rutland@arm.com> References: <20230605070124.3741859-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?1767845596402287196?= X-GMAIL-MSGID: =?utf-8?q?1767845596402287196?= |
Series |
locking/atomic: restructuring + kerneldoc
|
|
Commit Message
Mark Rutland
June 5, 2023, 7:01 a.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/m68k. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Kees Cook <keescook@chromium.org> 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/m68k/include/asm/atomic.h | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/arch/m68k/include/asm/atomic.h b/arch/m68k/include/asm/atomic.h index 190a032f19be7..4bfbc25f6ecf4 100644 --- a/arch/m68k/include/asm/atomic.h +++ b/arch/m68k/include/asm/atomic.h @@ -106,6 +106,11 @@ static inline int arch_atomic_fetch_##op(int i, atomic_t * v) \ ATOMIC_OPS(add, +=, add) ATOMIC_OPS(sub, -=, 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, c_op, asm_op) \ ATOMIC_OP(op, c_op, asm_op) \ @@ -115,6 +120,10 @@ ATOMIC_OPS(and, &=, and) ATOMIC_OPS(or, |=, or) ATOMIC_OPS(xor, ^=, eor) +#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