Message ID | 20221222114635.1251934-14-andrzej.hajda@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp278907wrn; Thu, 22 Dec 2022 03:52:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXsG8NjWnYJ7yB7/zFUmNmaLuw3pbX9rsPck15X8K16H4gWxGvaOCHJT9yV1TXcyQndZ2lsf X-Received: by 2002:a17:906:2d4a:b0:845:2b64:16f3 with SMTP id e10-20020a1709062d4a00b008452b6416f3mr1278991eji.22.1671709965858; Thu, 22 Dec 2022 03:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671709965; cv=none; d=google.com; s=arc-20160816; b=bdlE6yub5ig5KUFDdrvJ6TOKhpylvXxPtlySexJNDuK0Ms1oAYNpMPGZ/6RzPSplW0 mF69cqunqOSyp11OdOyGF60WjpI8RVpCErjsvJ+FLckm3ai1BIMePr8c7NFAnDAd1HY5 Kh1SIYqSjRyr2cZH7opd8apkr+ehfsME5bWxaabXJmwtqdRqMDtIEdk2EulPCpW9jjCo tzJIBVv1c2JoZzrOGovBSD7iQCoXHOfNZrS7tC+HWYJ7N89xmfmA4E8JiwZxYhyagUd+ +bHHtCQK7Dy/RFwU58rwpjKOnlqscOM0HIVPXieAGvc1Wxz8uAzo67mxMyhIHZdk4N2T lBpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2QPKqDJmTO+g/dTJ7uBFoJhDTgqCPz9M8xQmkekieiw=; b=PBbRMVfJWC3gZYlzVnwhiH/nkcZO7D7DUgi90QNskVwLDr5jtcRl6OHNcKrSEWwMIU xZgJUxYkFy/6T/jZABevA20DhOgY/jxtO10BIXqLWPyZVwQ3qTlSIGI4I7duV3YVV/Uw ZwR+JpsYBWWu7mjhLmfiUZOS20l3jkKp386fOoPyqAGBTzvhZ0A0isxsxcegLmyes3cf 7JnNrzIaqZgZ3xN+8QOSsZH3+lKysH8D+XA6Zh0GJ/77V41ktQlsXxaJvM2ws2TG6KjF nKThriXNbqmNYAXO9SUm2NVbZOxmNjcz9QBPj1Csao/Qhx6u+xLl3sbQzKXHSm6QUW6y dUkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CzYKR3D+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xf9-20020a17090731c900b007c4fd0f9b38si279201ejb.715.2022.12.22.03.52.22; Thu, 22 Dec 2022 03:52:45 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=CzYKR3D+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235693AbiLVLv1 (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Thu, 22 Dec 2022 06:51:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235327AbiLVLuE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Dec 2022 06:50:04 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ED0B29377; Thu, 22 Dec 2022 03:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671709723; x=1703245723; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F9SleecBAnyNkNrMFTTvSCZSu7ImUGAg65gwiv6wE30=; b=CzYKR3D+9/RLl79ipyyrMi5/N4RTi5YKQhyXHLMs5NMgiHq4TgWc1I+R MT4CnPSkiDw4ku4qf5EhCFlZjxHZk5hUtbWbu3cckHAxtDITjP+w3YGtB Nl5FzQP5Rh6663yEHqjj1W4U9p1cu2EiJTdDsz8NnwHgFSEwX5z7r/M9l Gh8K1HYwmjQ8BnJQhCZraJ9MZYqW9slveaFhOL2E8Oa/+s9cYGfU7XkBC sajSpRNnX/C4X+rcg7zgILoQ9CKh1Rmld3sR4axpN2u8qVokY9P/77/J6 VGB6nEOI1kly+grzwNJr+c1ViIY3OsiwYeaYeT8BCwIS/01G32EHaGd7z g==; X-IronPort-AV: E=McAfee;i="6500,9779,10568"; a="318804801" X-IronPort-AV: E=Sophos;i="5.96,265,1665471600"; d="scan'208";a="318804801" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 03:48:42 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10568"; a="629504822" X-IronPort-AV: E=Sophos;i="5.96,265,1665471600"; d="scan'208";a="629504822" Received: from lab-ah.igk.intel.com ([10.91.215.196]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 03:48:36 -0800 From: Andrzej Hajda <andrzej.hajda@intel.com> To: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Andrzej Hajda <andrzej.hajda@intel.com>, Arnd Bergmann <arnd@arndb.de>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Andrew Morton <akpm@linux-foundation.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Peter Zijlstra <peterz@infradead.org>, Boqun Feng <boqun.feng@gmail.com>, Mark Rutland <mark.rutland@arm.com> Subject: [PATCH 13/19] arch/riscv: rename internal name __xchg to __arch_xchg Date: Thu, 22 Dec 2022 12:46:29 +0100 Message-Id: <20221222114635.1251934-14-andrzej.hajda@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221222114635.1251934-1-andrzej.hajda@intel.com> References: <20221222114635.1251934-1-andrzej.hajda@intel.com> MIME-Version: 1.0 Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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?1752914949536897568?= X-GMAIL-MSGID: =?utf-8?q?1752914949536897568?= |
Series |
Introduce __xchg, non-atomic xchg
|
|
Commit Message
Andrzej Hajda
Dec. 22, 2022, 11:46 a.m. UTC
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
arch/riscv/include/asm/atomic.h | 2 +-
arch/riscv/include/asm/cmpxchg.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
Comments
On Thu, 22 Dec 2022 03:46:29 PST (-0800), andrzej.hajda@intel.com wrote: > __xchg will be used for non-atomic xchg macro. > > Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com> > --- > arch/riscv/include/asm/atomic.h | 2 +- > arch/riscv/include/asm/cmpxchg.h | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h > index 0dfe9d857a762b..bba472928b5393 100644 > --- a/arch/riscv/include/asm/atomic.h > +++ b/arch/riscv/include/asm/atomic.h > @@ -261,7 +261,7 @@ c_t arch_atomic##prefix##_xchg_release(atomic##prefix##_t *v, c_t n) \ > static __always_inline \ > c_t arch_atomic##prefix##_xchg(atomic##prefix##_t *v, c_t n) \ > { \ > - return __xchg(&(v->counter), n, size); \ > + return __arch_xchg(&(v->counter), n, size); \ > } \ > static __always_inline \ > c_t arch_atomic##prefix##_cmpxchg_relaxed(atomic##prefix##_t *v, \ > diff --git a/arch/riscv/include/asm/cmpxchg.h b/arch/riscv/include/asm/cmpxchg.h > index 12debce235e52d..2f4726d3cfcc25 100644 > --- a/arch/riscv/include/asm/cmpxchg.h > +++ b/arch/riscv/include/asm/cmpxchg.h > @@ -114,7 +114,7 @@ > _x_, sizeof(*(ptr))); \ > }) > > -#define __xchg(ptr, new, size) \ > +#define __arch_xchg(ptr, new, size) \ > ({ \ > __typeof__(ptr) __ptr = (ptr); \ > __typeof__(new) __new = (new); \ > @@ -143,7 +143,7 @@ > #define arch_xchg(ptr, x) \ > ({ \ > __typeof__(*(ptr)) _x_ = (x); \ > - (__typeof__(*(ptr))) __xchg((ptr), _x_, sizeof(*(ptr))); \ > + (__typeof__(*(ptr))) __arch_xchg((ptr), _x_, sizeof(*(ptr))); \ > }) > > #define xchg32(ptr, x) \ Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Thanks!
On Thu, 22 Dec 2022 03:46:29 PST (-0800), andrzej.hajda@intel.com wrote: > __xchg will be used for non-atomic xchg macro. > > Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com> > --- > arch/riscv/include/asm/atomic.h | 2 +- > arch/riscv/include/asm/cmpxchg.h | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h > index 0dfe9d857a762b..bba472928b5393 100644 > --- a/arch/riscv/include/asm/atomic.h > +++ b/arch/riscv/include/asm/atomic.h > @@ -261,7 +261,7 @@ c_t arch_atomic##prefix##_xchg_release(atomic##prefix##_t *v, c_t n) \ > static __always_inline \ > c_t arch_atomic##prefix##_xchg(atomic##prefix##_t *v, c_t n) \ > { \ > - return __xchg(&(v->counter), n, size); \ > + return __arch_xchg(&(v->counter), n, size); \ > } \ > static __always_inline \ > c_t arch_atomic##prefix##_cmpxchg_relaxed(atomic##prefix##_t *v, \ > diff --git a/arch/riscv/include/asm/cmpxchg.h b/arch/riscv/include/asm/cmpxchg.h > index 12debce235e52d..2f4726d3cfcc25 100644 > --- a/arch/riscv/include/asm/cmpxchg.h > +++ b/arch/riscv/include/asm/cmpxchg.h > @@ -114,7 +114,7 @@ > _x_, sizeof(*(ptr))); \ > }) > > -#define __xchg(ptr, new, size) \ > +#define __arch_xchg(ptr, new, size) \ > ({ \ > __typeof__(ptr) __ptr = (ptr); \ > __typeof__(new) __new = (new); \ > @@ -143,7 +143,7 @@ > #define arch_xchg(ptr, x) \ > ({ \ > __typeof__(*(ptr)) _x_ = (x); \ > - (__typeof__(*(ptr))) __xchg((ptr), _x_, sizeof(*(ptr))); \ > + (__typeof__(*(ptr))) __arch_xchg((ptr), _x_, sizeof(*(ptr))); \ > }) > > #define xchg32(ptr, x) \ Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h index 0dfe9d857a762b..bba472928b5393 100644 --- a/arch/riscv/include/asm/atomic.h +++ b/arch/riscv/include/asm/atomic.h @@ -261,7 +261,7 @@ c_t arch_atomic##prefix##_xchg_release(atomic##prefix##_t *v, c_t n) \ static __always_inline \ c_t arch_atomic##prefix##_xchg(atomic##prefix##_t *v, c_t n) \ { \ - return __xchg(&(v->counter), n, size); \ + return __arch_xchg(&(v->counter), n, size); \ } \ static __always_inline \ c_t arch_atomic##prefix##_cmpxchg_relaxed(atomic##prefix##_t *v, \ diff --git a/arch/riscv/include/asm/cmpxchg.h b/arch/riscv/include/asm/cmpxchg.h index 12debce235e52d..2f4726d3cfcc25 100644 --- a/arch/riscv/include/asm/cmpxchg.h +++ b/arch/riscv/include/asm/cmpxchg.h @@ -114,7 +114,7 @@ _x_, sizeof(*(ptr))); \ }) -#define __xchg(ptr, new, size) \ +#define __arch_xchg(ptr, new, size) \ ({ \ __typeof__(ptr) __ptr = (ptr); \ __typeof__(new) __new = (new); \ @@ -143,7 +143,7 @@ #define arch_xchg(ptr, x) \ ({ \ __typeof__(*(ptr)) _x_ = (x); \ - (__typeof__(*(ptr))) __xchg((ptr), _x_, sizeof(*(ptr))); \ + (__typeof__(*(ptr))) __arch_xchg((ptr), _x_, sizeof(*(ptr))); \ }) #define xchg32(ptr, x) \