Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5248949rwd; Mon, 5 Jun 2023 00:12:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4g49pV0ajSYcgRsy+laetI4PL2ibwd+SmmSWQU94cr04JPyoMlsIcPVmprME+k0CQxr3ZD X-Received: by 2002:a05:6a21:33a0:b0:111:366:ee9f with SMTP id yy32-20020a056a2133a000b001110366ee9fmr6632651pzb.48.1685949143997; Mon, 05 Jun 2023 00:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685949143; cv=none; d=google.com; s=arc-20160816; b=pQrXBo7zs/JUXV0K7hk8Tnq3TXC/998/2XHPagqMTd3rcwnjuf/hLBvPaio3eiCWUD +0VO3Y2uM1i4/VFHODbwLky54bawEjK2kpNn+fWB42ojcC3pyIFj8Sh+iEF+wZoUOx29 7zTcX5iRGNmo67pBHBNx3tV54D8SGkOHwK7Q1QIBOWPmnJ9pSxIZqHjDZZ6O4so8eiwS wtSpV+mAucIHsNuv5uCORgqSRt6DCCwDIQ2caXPEDwHPysQ1AkWxR8poVF9XB26kAC81 7IiioapezHwNX3oxp1uoAK439s36bSMv2xk/T5sU/Y59tD6RgQ7cTQF3hitahUDDV4XX EXhw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 20-20020a631854000000b0053f2524532csi4988397pgy.310.2023.06.05.00.12.11; Mon, 05 Jun 2023 00:12:23 -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 S230393AbjFEHCd (ORCPT + 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 ); 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 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: 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 Reviewed-by: Kees Cook 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