Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2872308rwd; Mon, 22 May 2023 05:44:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6aZ1J/nsFC6sSnA4phfAZzr5u7UbUr38Aq3oQcRMe7FyMU/KIMUspiXWU0Y7oL+w08bFas X-Received: by 2002:a05:6a20:b70a:b0:101:1951:d491 with SMTP id fg10-20020a056a20b70a00b001011951d491mr8515719pzb.6.1684759474187; Mon, 22 May 2023 05:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684759474; cv=none; d=google.com; s=arc-20160816; b=MD87ci57TxI5TNimfAwQxiujbVG17kSqBPBgNKoxBp3r4bE3eiMTh0NiH2cewadA/V sd2mRjW4XKE8Iub1Ibp3F9OABmKIpDGOKgDKwpuQrauZjNPViAj/JP3YimIUTlHeIScb 6UxFWNayEHRgsUOBEHnEB14UocmUen0N3IByaeLGEtAHNLQ7G39G7CvlvvKkDG5wcYCy 41vsNbBEo3qVArlk1t+fBM1Fw2xLKyeOphC/3mP9FjpiKE982rXLWnWjdylV5stD4+KS FkRH0i2cslAcZtqt66ZH7CW/wu3wdxARBcyq1WeotNwYcxOPpbx6LW7cMc9K1sGpLA+P Jj1g== 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=Xm27TMXG6esWkyHOHYr9F8jKFSxCQJYy9Sje7/ErZZA=; b=W+Y+IckjX5um3UHWOgZrGzjMNSjjPfB3KTOvTBSynliyrlvbKE5oChodPhuXVENtZ9 yWbfqUxkFsEk7o521to5ft2kTmBt+dseVDaff0V5dSt73GPTT/QJXniF4GGGfOFP+GPB s5xDCLtCot4nufN/8+k2A0l6Z3KC7kZ/ilMkroPz4nHutlyI3sf05f71DmnXTFlhhMsY 5wNntUPAQ4NmyDXAmuipyURWoiOLO+IXyq+qlfZwdnZryVECvQNdt8+oZVDXAdNbMXVI +4Ul3MxYvEIwcVrQpw52gNcOLPB8+fB0js3h4O9bjC7ZSqh0E7BFBqS4vct1LcyBz9wI ltSA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u196-20020a6379cd000000b00518c878b1dbsi4575403pgc.356.2023.05.22.05.44.19; Mon, 22 May 2023 05:44:34 -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 S234088AbjEVM16 (ORCPT + 99 others); Mon, 22 May 2023 08:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233955AbjEVM05 (ORCPT ); Mon, 22 May 2023 08:26:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ADB55186; Mon, 22 May 2023 05:25:07 -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 57F381570; Mon, 22 May 2023 05:25:42 -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 AD1B63F59C; Mon, 22 May 2023 05:24:55 -0700 (PDT) From: Mark Rutland 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 08/26] locking/atomic: m68k: add preprocessor symbols Date: Mon, 22 May 2023 13:24:11 +0100 Message-Id: <20230522122429.1915021-9-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: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Boqun Feng Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Will Deacon --- 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 -- 2.30.2