From patchwork Fri Jul 15 10:41:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corneliu ZUZU X-Patchwork-Id: 9231647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5FDF060865 for ; Fri, 15 Jul 2016 10:44:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50F112819A for ; Fri, 15 Jul 2016 10:44:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45E9B2832C; Fri, 15 Jul 2016 10:44:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9ECCF2819A for ; Fri, 15 Jul 2016 10:44:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bO0Z4-0002vP-SG; Fri, 15 Jul 2016 10:41:50 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bO0Z3-0002vA-6Q for xen-devel@lists.xen.org; Fri, 15 Jul 2016 10:41:49 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id B5/7F-18304-CEDB8875; Fri, 15 Jul 2016 10:41:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRWlGSWpSXmKPExsUSfTxjoe7rvR3 hBo++Wlos+biYxYHR4+ju30wBjFGsmXlJ+RUJrBmn/hUU7FGu6Hzj2MDYK9/FyMkhJOAh8e3O RsYuRi4gey2jxKznN5ghnJOMEqd+7GCBqbr87RALRGI1o8S2xV3MIAk2AW2Jc4fuMYHYIgLSE tc+X2YEsZkFQiWm/n0A1iws4COxdu01sHoWAVWJNXOfs4LYvAKuEu0X1gP1cnBICMhJLLiQDm JyCrhJPOvVgljrKrH4+WywKRICORJ3Vy5lh6iWkvjfqgRyjYTAUhaJxw9msEHUyEg8mniTbQK j0AJGhlWMGsWpRWWpRbqGxnpJRZnpGSW5iZk5uoYGxnq5qcXFiempOYlJxXrJ+bmbGIEhyAAE Oxi3bfc8xCjJwaQkyrsxpSNciC8pP6UyI7E4I76oNCe1+BCjDAeHkgTv6T1AOcGi1PTUirTMH GA0wKQlOHiURHh3gqR5iwsSc4sz0yFSpxgVpcR5b4AkBEASGaV5cG2wCLzEKCslzMsIdIgQT0 FqUW5mCar8K0ZxDkYlYd5vIFN4MvNK4Ka/AlrMBLTY2rwdZHFJIkJKqoFRmmf6QqOJMbleUrE dxuf2TZh38fISxZhLkz573w9zbCncIaufV113TCR03aIQ2w3+UzkN7AMkvFgipy+/dv6Q1NkQ lQb56a/lTnKkM5w5EbA05l7ZHMn7DGGfw9XcvO5xTvcWnr2X8d/yM3d2T1vDLRYx736N+x4lu +t8rjUn1todS7X287+vxFKckWioxVxUnAgAvrPMXLsCAAA= X-Env-Sender: czuzu@bitdefender.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1468579307!47629486!1 X-Originating-IP: [91.199.104.161] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10948 invoked from network); 15 Jul 2016 10:41:47 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-5.tower-31.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 15 Jul 2016 10:41:47 -0000 Received: (qmail 23305 invoked from network); 15 Jul 2016 13:41:47 +0300 Received: from unknown (HELO mx-sr.buh.bitdefender.com) (10.17.80.103) by mx01.bbu.dsd.mx.bitdefender.com with AES256-GCM-SHA384 encrypted SMTP; 15 Jul 2016 13:41:47 +0300 Received: from smtp02.buh.bitdefender.net (unknown [10.17.80.76]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id 021D77FC07 for ; Fri, 15 Jul 2016 13:41:44 +0300 (EEST) Received: (qmail 21198 invoked from network); 15 Jul 2016 13:41:43 +0300 Received: from unknown (HELO czuzu-dev-vm.clj.bitdefender.biz) (czuzu@bitdefender.com@91.199.104.243) by smtp02.buh.bitdefender.net with SMTP; 15 Jul 2016 13:41:43 +0300 From: Corneliu ZUZU To: xen-devel@lists.xen.org Date: Fri, 15 Jul 2016 13:41:39 +0300 Message-Id: <1468579299-19731-1-git-send-email-czuzu@bitdefender.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1468579290-19685-1-git-send-email-czuzu@bitdefender.com> References: <1468579290-19685-1-git-send-email-czuzu@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp02.buh.bitdefender.net, sigver: 7.66331 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.911, Dats: 426567, Stamp: 3], Multi: [Enabled, t: (0.000010, 0.004933)], BW: [Enabled, t: (0.000008,0.000001)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.003789), Flags: 85D2ED72; NN_NO_CONTENT_TYPE; NN_LEGIT_SUMM_400_WORDS; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.010818)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.014318), Hit: No, Details: v2.3.10; Id: 2m1ghm1.1an9ci7f8.p1mk], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v5 1/7] asm-arm/atomic.h: fix arm32|arm64 macros duplication X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. Signed-off-by: Corneliu ZUZU Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- Changed since v4: * remove paragraph(s) from README.LinuxPrimitives file * no empty line additions --- xen/arch/arm/README.LinuxPrimitives | 8 ++++++++ xen/include/asm-arm/arm32/atomic.h | 13 ------------- xen/include/asm-arm/arm64/atomic.h | 13 ------------- xen/include/asm-arm/atomic.h | 13 +++++++++++++ 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/xen/arch/arm/README.LinuxPrimitives b/xen/arch/arm/README.LinuxPrimitives index 3115f51..028e872 100644 --- a/xen/arch/arm/README.LinuxPrimitives +++ b/xen/arch/arm/README.LinuxPrimitives @@ -23,6 +23,10 @@ atomics: last sync @ v3.16-rc6 (last commit: 8715466b6027) linux/arch/arm64/include/asm/atomic.h xen/include/asm-arm/arm64/atomic.h +The following functions were taken from Linux: + atomic_add(), atomic_add_return(), atomic_sub(), atomic_sub_return(), + atomic_cmpxchg(), __atomic_add_unless() + --------------------------------------------------------------------- mem*: last sync @ v3.16-rc6 (last commit: d875c9b37240) @@ -91,6 +95,10 @@ atomics: last sync @ v3.16-rc6 (last commit: 030d0178bdbd) linux/arch/arm/include/asm/atomic.h xen/include/asm-arm/arm32/atomic.h +The following functions were taken from Linux: + atomic_add(), atomic_add_return(), atomic_sub(), atomic_sub_return(), + atomic_cmpxchg(), __atomic_add_unless() + --------------------------------------------------------------------- mem*: last sync @ v3.16-rc6 (last commit: d98b90ea22b0) diff --git a/xen/include/asm-arm/arm32/atomic.h b/xen/include/asm-arm/arm32/atomic.h index 7ec712f..c03eb68 100644 --- a/xen/include/asm-arm/arm32/atomic.h +++ b/xen/include/asm-arm/arm32/atomic.h @@ -147,19 +147,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) return oldval; } -#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) - -#define atomic_inc(v) atomic_add(1, v) -#define atomic_dec(v) atomic_sub(1, v) - -#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0) -#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0) -#define atomic_inc_return(v) (atomic_add_return(1, v)) -#define atomic_dec_return(v) (atomic_sub_return(1, v)) -#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) - -#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0) - #endif /* __ARCH_ARM_ARM32_ATOMIC__ */ /* * Local variables: diff --git a/xen/include/asm-arm/arm64/atomic.h b/xen/include/asm-arm/arm64/atomic.h index b49219e..bce38d4 100644 --- a/xen/include/asm-arm/arm64/atomic.h +++ b/xen/include/asm-arm/arm64/atomic.h @@ -113,8 +113,6 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) return oldval; } -#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) - static inline int __atomic_add_unless(atomic_t *v, int a, int u) { int c, old; @@ -125,17 +123,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) return c; } -#define atomic_inc(v) atomic_add(1, v) -#define atomic_dec(v) atomic_sub(1, v) - -#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0) -#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0) -#define atomic_inc_return(v) (atomic_add_return(1, v)) -#define atomic_dec_return(v) (atomic_sub_return(1, v)) -#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) - -#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0) - #endif /* * Local variables: diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h index 29ab265..18cb2e1 100644 --- a/xen/include/asm-arm/atomic.h +++ b/xen/include/asm-arm/atomic.h @@ -138,6 +138,19 @@ static inline void _atomic_set(atomic_t *v, int i) # error "unknown ARM variant" #endif +#define atomic_inc(v) atomic_add(1, v) +#define atomic_dec(v) atomic_sub(1, v) + +#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0) +#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0) +#define atomic_inc_return(v) (atomic_add_return(1, v)) +#define atomic_dec_return(v) (atomic_sub_return(1, v)) +#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) + +#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0) + +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) + #endif /* __ARCH_ARM_ATOMIC__ */ /* * Local variables: