Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2876410rwd; Mon, 22 May 2023 05:48:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Uz5ym4pmq9Y5ocWQH2TUtc9jwmE/M2Z7e+HhCrM+9BDOWMERdOikULFTd5vBKsjoujF0O X-Received: by 2002:a17:902:e9d5:b0:1ac:8cd4:a82d with SMTP id 21-20020a170902e9d500b001ac8cd4a82dmr10441766plk.27.1684759708071; Mon, 22 May 2023 05:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684759708; cv=none; d=google.com; s=arc-20160816; b=YOO3crajNnJ94+ElYvZRBCM8sEYF+0P0bt7z1vxAcGIACZQUUhPduxOHnlZU9NDb04 9kTlwH5qvs9UQhBPNhw4xFlNTFtNIPF88FrOmbg+m4IB79p5KqtEjwaXgeP+NMTKIc1w OePPC9Sq42eUGXB52804Ayhf22oZ7Mj4LlXAX2m1wqwhodGbD/BK2niYeMR9qk/uK1bk SIlWd4VklJH0BhD/I3rYaMRE53UbD/dD5YbBL7vJWiWABMIM0tTuO+uQvzAxH2KdGq9z o9If7UqV0b7eQFoH+9RgRfgbmzdPtyfRQTsz1tGxX5MZkdqY6OsgneIDzh3U+THeSAyI qZag== 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=vVDNqp31U9XZsofkAh7PKfbJUrhSYNtUNjI6U7FkaHU=; b=O6IXL3h8bVGk2X/t2MOqun5nRwTZ/rd1riI+iYwI3QNbSRwjq5jD1Z5EKhcgsEfaX/ +nngFKKd1DVcYAewOcAgg/wDj1VjU3IyWD61i3h+0vKr4ElzrbOtKos+JpYkwEC19dR7 sSso81Ohl/R9ZTlAcmfmJexckfEjNApW5I6nQ+QR9tN5o664NgwAQasTJ2iaqaPJ+vwt s2UAghhlXZ8BGZ7N/7NL5GiMvQsMystt/UL2ZjmOBGmVHbEstuMxC9sBIiKwU3zSYIdM t/APh7Ra1tPRQPXFN1R0dtSBSaifodrEdiCriaiwoQIDbxGEFsPJ93y47Kp5zKPVg+hm 4gbQ== 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 je20-20020a170903265400b001a1eac2df75si313940plb.490.2023.05.22.05.48.15; Mon, 22 May 2023 05:48:28 -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 S233997AbjEVM1z (ORCPT + 99 others); Mon, 22 May 2023 08:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233862AbjEVM05 (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 AE864E5E; 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 05BF3153B; Mon, 22 May 2023 05:25:40 -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 5B8A03F59C; Mon, 22 May 2023 05:24:53 -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 07/26] locking/atomic: hexagon: add preprocessor symbols Date: Mon, 22 May 2023 13:24:10 +0100 Message-Id: <20230522122429.1915021-8-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/hexagon. Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Will Deacon --- arch/hexagon/include/asm/atomic.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h index ad6c111e9c10f..5c8440016c762 100644 --- a/arch/hexagon/include/asm/atomic.h +++ b/arch/hexagon/include/asm/atomic.h @@ -91,6 +91,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) @@ -98,6 +103,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 -- 2.30.2