From patchwork Fri Jul 15 10:46:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corneliu ZUZU X-Patchwork-Id: 9231659 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 135ED60865 for ; Fri, 15 Jul 2016 10:48:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 050B01FF15 for ; Fri, 15 Jul 2016 10:48:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED9162819A; Fri, 15 Jul 2016 10:48:57 +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 9E02728324 for ; Fri, 15 Jul 2016 10:48:57 +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 1bO0dZ-0003l4-Pa; Fri, 15 Jul 2016 10:46:29 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bO0dY-0003kh-99 for xen-devel@lists.xen.org; Fri, 15 Jul 2016 10:46:28 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id FA/82-23871-30FB8875; Fri, 15 Jul 2016 10:46:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRWlGSWpSXmKPExsUSfTxjoS7T/o5 wg1OtJhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8b6CyuZC7ZxVzxqk2hgvMjZxcjJISTgIfHv fTd7FyMXkL2WUeL83KUsEM5JRonHE26ww1Q9mL0Lqmo1o8TxlglMIAk2AW2Jc4fugdkiAtIS1 z5fZgSxmQVCJab+fcACYgsLxEpMu/8XLM4ioCrR19MMVs8r4CrxaGEX0FAODgkBOYkFF9JBTE 4BN4lnvVoQa10lFj+fDTZFQiBH4u7KpVDVUhL/W5Ugwk0sEoc7ZCBsGYlHE2+yTWAUWsDIsIp Rozi1qCy1SNfISC+pKDM9oyQ3MTNH19DAWC83tbg4MT01JzGpWC85P3cTIzAE6xkYGHcwTj3h d4hRkoNJSZR3Y0pHuBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3rK9QDnBotT01Iq0zBxgNMCkJ Th4lER4d+4BSvMWFyTmFmemQ6ROMSpKifO6gvQJgCQySvPg2mAReIlRVkqYl5GBgUGIpyC1KD ezBFX+FaM4B6OSMG8eyBSezLwSuOmvgBYzAS22Nm8HWVySiJCSamCsWbG7rlvf7xrPNWdH41d vt8q6z7t59viFkGnuxVqPi1SuSc4qNLhXZfGg80c809bt4mXrCycVmTiHLn/LPrXixutHk0UF NkgIbf/Vwl77MPP5pUmNM7TOffx0XeL7vCSdf4LuJuw6i3a75J9QKZwtc3ThD1u+mW162YKfK 3W/qdjs+TCFf84PJZbijERDLeai4kQAs8LcJrsCAAA= X-Env-Sender: czuzu@bitdefender.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1468579586!50091196!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 14339 invoked from network); 15 Jul 2016 10:46:26 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-10.tower-31.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 15 Jul 2016 10:46:26 -0000 Received: (qmail 23512 invoked from network); 15 Jul 2016 13:46:25 +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:46:25 +0300 Received: from smtp02.buh.bitdefender.net (unknown [10.17.80.76]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id CBE407FC06 for ; Fri, 15 Jul 2016 13:46:22 +0300 (EEST) Received: (qmail 21397 invoked from network); 15 Jul 2016 13:46:22 +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:46:22 +0300 From: Corneliu ZUZU To: xen-devel@lists.xen.org Date: Fri, 15 Jul 2016 13:46:00 +0300 Message-Id: <1468579560-20027-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.000009, 0.001904)], BW: [Enabled, t: (0.000007)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.002262), Flags: 85D2ED72; NN_NO_CONTENT_TYPE; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.009316)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.032554), Hit: No, Details: v2.3.10; Id: 2m1ghhv.1anh256ed.cljd], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v5 6/7] asm-arm/atomic.h: atomic_{inc, dec}_return: macros to inline functions 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 Turn atomic_inc_return and atomic_dec_return atomic.h macros to inline functions. Signed-off-by: Corneliu ZUZU Reviewed-by: Stefano Stabellini --- Changed since v4: * README.LinuxPrimitives not updated anymore --- xen/include/asm-arm/atomic.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h index 91f05c8..f060c5a 100644 --- a/xen/include/asm-arm/atomic.h +++ b/xen/include/asm-arm/atomic.h @@ -130,9 +130,6 @@ static inline void _atomic_set(atomic_t *v, int i) # error "unknown ARM variant" #endif -#define atomic_inc_return(v) (atomic_add_return(1, v)) -#define atomic_dec_return(v) (atomic_sub_return(1, v)) - static inline int atomic_sub_and_test(int i, atomic_t *v) { return atomic_sub_return(i, v) == 0; @@ -143,6 +140,11 @@ static inline void atomic_inc(atomic_t *v) atomic_add(1, v); } +static inline int atomic_inc_return(atomic_t *v) +{ + return atomic_add_return(1, v); +} + static inline int atomic_inc_and_test(atomic_t *v) { return atomic_add_return(1, v) == 0; @@ -153,6 +155,11 @@ static inline void atomic_dec(atomic_t *v) atomic_sub(1, v); } +static inline int atomic_dec_return(atomic_t *v) +{ + return atomic_sub_return(1, v); +} + static inline int atomic_dec_and_test(atomic_t *v) { return atomic_sub_return(1, v) == 0;