From patchwork Thu Feb 9 11:53:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 93692 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp207895qgi; Thu, 9 Feb 2017 03:54:16 -0800 (PST) X-Received: by 10.55.214.152 with SMTP id p24mr2271742qkl.223.1486641256695; Thu, 09 Feb 2017 03:54:16 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b197si7796472qkc.251.2017.02.09.03.54.16; Thu, 09 Feb 2017 03:54:16 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id F1AD4634CE; Thu, 9 Feb 2017 11:54:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 879D762C7E; Thu, 9 Feb 2017 11:54:06 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id EE83362EB2; Thu, 9 Feb 2017 11:53:59 +0000 (UTC) Received: from mail-ot0-f170.google.com (mail-ot0-f170.google.com [74.125.82.170]) by lists.linaro.org (Postfix) with ESMTPS id E0E7660EC2 for ; Thu, 9 Feb 2017 11:53:57 +0000 (UTC) Received: by mail-ot0-f170.google.com with SMTP id f9so977173otd.1 for ; Thu, 09 Feb 2017 03:53:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KttKsZ9Hsts/JcA6Z1WB6RtqYFg+HHm95rWqJj3qk+8=; b=NDESLTDaI1rUqAYqKndXm0JjTvwjtkfZlnIq7rAsz/sJ0+C/VObjeTaJ76q606ZMCF C1a+KM/eUCWzA8gkjglJaDHOCmnNWx6X8Xi+Ty8L44OkB6SWZVWSjpCp68TlBJUA+5+7 vP3aGxY77QHw3WasJlovOabEhCjC9GyecF9UZR028ktXQZVUSoZhoLhO8UU1oJnSJPzn 2EHGcb0F0tFHuKNf8mKl5lz0SstRx48bbJp4odvW0mqATgtuaC9lCSrD+gFBJjv84NHh TL+4sQxUHrvTMbA3HvAZcN0dcz3jIGD69TKcSv1O1k9IAVRnYFOWmkI+Y7uZ4xMwdZWW 0HTA== X-Gm-Message-State: AMke39mrTYGoWiHDNAGa5qUi+SP+MjVxEOwtvpCbYExL+ezsiObklVp/dNsMItOaabbkI0Ul9q8= X-Received: by 10.157.27.70 with SMTP id l64mr1329621otl.92.1486641237235; Thu, 09 Feb 2017 03:53:57 -0800 (PST) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id t53sm5767383otd.6.2017.02.09.03.53.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 03:53:56 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 9 Feb 2017 05:53:48 -0600 Message-Id: <20170209115352.16271-2-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce In-Reply-To: <20170209115352.16271-1-bill.fischofer@linaro.org> References: <20170209115352.16271-1-bill.fischofer@linaro.org> Cc: Petri Savolainen Subject: [lng-odp] [API-NEXT PATCHv3 1/5] linux-gen: inline: rename _STATIC to _ODP_INLINE X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen This define is visible to applications through API headers. Use _ODP prefix to avoid name space collision. Also "inline" describes better the purpose of the macro than "static". Signed-off-by: Petri Savolainen Signed-off-by: Bill Fischofer --- .../include/odp/api/plat/atomic_inlines.h | 114 +++++++++++---------- .../include/odp/api/plat/byteorder_inlines.h | 24 ++--- .../include/odp/api/plat/static_inline.h.in | 8 +- .../include/odp/api/plat/std_clib_inlines.h | 6 +- .../include/odp/api/plat/sync_inlines.h | 6 +- 5 files changed, 82 insertions(+), 76 deletions(-) -- 2.11.0.295.gd7dffce diff --git a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h index 4471f2ec..03b2884f 100644 --- a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h @@ -13,63 +13,65 @@ #ifndef _ODP_PLAT_ATOMIC_INLINES_H_ #define _ODP_PLAT_ATOMIC_INLINES_H_ -_STATIC void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val) { __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom) +_ODP_INLINE uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom) { return __atomic_load_n(&atom->v, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val) { __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom, + uint32_t val) { return __atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_add_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_add_u32(odp_atomic_u32_t *atom, uint32_t val) { (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_fetch_sub_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE uint32_t odp_atomic_fetch_sub_u32(odp_atomic_u32_t *atom, + uint32_t val) { return __atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_sub_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_sub_u32(odp_atomic_u32_t *atom, uint32_t val) { (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_fetch_inc_u32(odp_atomic_u32_t *atom) +_ODP_INLINE uint32_t odp_atomic_fetch_inc_u32(odp_atomic_u32_t *atom) { return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_inc_u32(odp_atomic_u32_t *atom) +_ODP_INLINE void odp_atomic_inc_u32(odp_atomic_u32_t *atom) { (void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_fetch_dec_u32(odp_atomic_u32_t *atom) +_ODP_INLINE uint32_t odp_atomic_fetch_dec_u32(odp_atomic_u32_t *atom) { return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_dec_u32(odp_atomic_u32_t *atom) +_ODP_INLINE void odp_atomic_dec_u32(odp_atomic_u32_t *atom) { (void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED); } -_STATIC int odp_atomic_cas_u32(odp_atomic_u32_t *atom, uint32_t *old_val, - uint32_t new_val) +_ODP_INLINE int odp_atomic_cas_u32(odp_atomic_u32_t *atom, uint32_t *old_val, + uint32_t new_val) { return __atomic_compare_exchange_n(&atom->v, old_val, new_val, 0 /* strong */, @@ -77,12 +79,13 @@ _STATIC int odp_atomic_cas_u32(odp_atomic_u32_t *atom, uint32_t *old_val, __ATOMIC_RELAXED); } -_STATIC uint32_t odp_atomic_xchg_u32(odp_atomic_u32_t *atom, uint32_t new_val) +_ODP_INLINE uint32_t odp_atomic_xchg_u32(odp_atomic_u32_t *atom, + uint32_t new_val) { return __atomic_exchange_n(&atom->v, new_val, __ATOMIC_RELAXED); } -_STATIC void odp_atomic_max_u32(odp_atomic_u32_t *atom, uint32_t new_max) +_ODP_INLINE void odp_atomic_max_u32(odp_atomic_u32_t *atom, uint32_t new_max) { uint32_t old_val; @@ -94,7 +97,7 @@ _STATIC void odp_atomic_max_u32(odp_atomic_u32_t *atom, uint32_t new_max) } } -_STATIC void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min) +_ODP_INLINE void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min) { uint32_t old_val; @@ -106,7 +109,7 @@ _STATIC void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min) } } -_STATIC void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val) { atom->v = val; #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 @@ -114,7 +117,7 @@ _STATIC void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom) +_ODP_INLINE uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, (void)0); @@ -123,7 +126,7 @@ _STATIC uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom) #endif } -_STATIC void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v = val); @@ -132,7 +135,8 @@ _STATIC void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom, + uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v += val); @@ -141,7 +145,7 @@ _STATIC uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v += val); @@ -150,7 +154,8 @@ _STATIC void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom, + uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v -= val); @@ -159,7 +164,7 @@ _STATIC uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v -= val); @@ -168,7 +173,7 @@ _STATIC void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom) +_ODP_INLINE uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v++); @@ -177,7 +182,7 @@ _STATIC uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom) #endif } -_STATIC void odp_atomic_inc_u64(odp_atomic_u64_t *atom) +_ODP_INLINE void odp_atomic_inc_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v++); @@ -186,7 +191,7 @@ _STATIC void odp_atomic_inc_u64(odp_atomic_u64_t *atom) #endif } -_STATIC uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom) +_ODP_INLINE uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v--); @@ -195,7 +200,7 @@ _STATIC uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom) #endif } -_STATIC void odp_atomic_dec_u64(odp_atomic_u64_t *atom) +_ODP_INLINE void odp_atomic_dec_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v--); @@ -204,8 +209,8 @@ _STATIC void odp_atomic_dec_u64(odp_atomic_u64_t *atom) #endif } -_STATIC int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val, - uint64_t new_val) +_ODP_INLINE int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val, + uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 int ret; @@ -219,7 +224,8 @@ _STATIC int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val, #endif } -_STATIC uint64_t odp_atomic_xchg_u64(odp_atomic_u64_t *atom, uint64_t new_val) +_ODP_INLINE uint64_t odp_atomic_xchg_u64(odp_atomic_u64_t *atom, + uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, atom->v = new_val); @@ -228,7 +234,7 @@ _STATIC uint64_t odp_atomic_xchg_u64(odp_atomic_u64_t *atom, uint64_t new_val) #endif } -_STATIC void odp_atomic_max_u64(odp_atomic_u64_t *atom, uint64_t new_max) +_ODP_INLINE void odp_atomic_max_u64(odp_atomic_u64_t *atom, uint64_t new_max) { uint64_t old_val; @@ -240,7 +246,7 @@ _STATIC void odp_atomic_max_u64(odp_atomic_u64_t *atom, uint64_t new_max) } } -_STATIC void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min) +_ODP_INLINE void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min) { uint64_t old_val; @@ -252,28 +258,28 @@ _STATIC void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min) } } -_STATIC uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom) +_ODP_INLINE uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom) { return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE); } -_STATIC void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom, uint32_t val) { __atomic_store_n(&atom->v, val, __ATOMIC_RELEASE); } -_STATIC void odp_atomic_add_rel_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_add_rel_u32(odp_atomic_u32_t *atom, uint32_t val) { (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELEASE); } -_STATIC void odp_atomic_sub_rel_u32(odp_atomic_u32_t *atom, uint32_t val) +_ODP_INLINE void odp_atomic_sub_rel_u32(odp_atomic_u32_t *atom, uint32_t val) { (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELEASE); } -_STATIC int odp_atomic_cas_acq_u32(odp_atomic_u32_t *atom, - uint32_t *old_val, uint32_t new_val) +_ODP_INLINE int odp_atomic_cas_acq_u32(odp_atomic_u32_t *atom, + uint32_t *old_val, uint32_t new_val) { return __atomic_compare_exchange_n(&atom->v, old_val, new_val, 0 /* strong */, @@ -281,8 +287,8 @@ _STATIC int odp_atomic_cas_acq_u32(odp_atomic_u32_t *atom, __ATOMIC_RELAXED); } -_STATIC int odp_atomic_cas_rel_u32(odp_atomic_u32_t *atom, - uint32_t *old_val, uint32_t new_val) +_ODP_INLINE int odp_atomic_cas_rel_u32(odp_atomic_u32_t *atom, + uint32_t *old_val, uint32_t new_val) { return __atomic_compare_exchange_n(&atom->v, old_val, new_val, 0 /* strong */, @@ -290,9 +296,9 @@ _STATIC int odp_atomic_cas_rel_u32(odp_atomic_u32_t *atom, __ATOMIC_RELAXED); } -_STATIC int odp_atomic_cas_acq_rel_u32(odp_atomic_u32_t *atom, - uint32_t *old_val, - uint32_t new_val) +_ODP_INLINE int odp_atomic_cas_acq_rel_u32(odp_atomic_u32_t *atom, + uint32_t *old_val, + uint32_t new_val) { return __atomic_compare_exchange_n(&atom->v, old_val, new_val, 0 /* strong */, @@ -300,7 +306,7 @@ _STATIC int odp_atomic_cas_acq_rel_u32(odp_atomic_u32_t *atom, __ATOMIC_RELAXED); } -_STATIC uint64_t odp_atomic_load_acq_u64(odp_atomic_u64_t *atom) +_ODP_INLINE uint64_t odp_atomic_load_acq_u64(odp_atomic_u64_t *atom) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 return ATOMIC_OP(atom, (void)0); @@ -309,7 +315,7 @@ _STATIC uint64_t odp_atomic_load_acq_u64(odp_atomic_u64_t *atom) #endif } -_STATIC void odp_atomic_store_rel_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_store_rel_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v = val); @@ -318,7 +324,7 @@ _STATIC void odp_atomic_store_rel_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC void odp_atomic_add_rel_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_add_rel_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v += val); @@ -327,7 +333,7 @@ _STATIC void odp_atomic_add_rel_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC void odp_atomic_sub_rel_u64(odp_atomic_u64_t *atom, uint64_t val) +_ODP_INLINE void odp_atomic_sub_rel_u64(odp_atomic_u64_t *atom, uint64_t val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 (void)ATOMIC_OP(atom, atom->v -= val); @@ -336,8 +342,8 @@ _STATIC void odp_atomic_sub_rel_u64(odp_atomic_u64_t *atom, uint64_t val) #endif } -_STATIC int odp_atomic_cas_acq_u64(odp_atomic_u64_t *atom, - uint64_t *old_val, uint64_t new_val) +_ODP_INLINE int odp_atomic_cas_acq_u64(odp_atomic_u64_t *atom, + uint64_t *old_val, uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 int ret; @@ -351,8 +357,8 @@ _STATIC int odp_atomic_cas_acq_u64(odp_atomic_u64_t *atom, #endif } -_STATIC int odp_atomic_cas_rel_u64(odp_atomic_u64_t *atom, - uint64_t *old_val, uint64_t new_val) +_ODP_INLINE int odp_atomic_cas_rel_u64(odp_atomic_u64_t *atom, + uint64_t *old_val, uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 int ret; @@ -366,9 +372,9 @@ _STATIC int odp_atomic_cas_rel_u64(odp_atomic_u64_t *atom, #endif } -_STATIC int odp_atomic_cas_acq_rel_u64(odp_atomic_u64_t *atom, - uint64_t *old_val, - uint64_t new_val) +_ODP_INLINE int odp_atomic_cas_acq_rel_u64(odp_atomic_u64_t *atom, + uint64_t *old_val, + uint64_t new_val) { #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 int ret; diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h index c91a3b18..e7818904 100644 --- a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h @@ -21,7 +21,7 @@ extern "C" { * @{ */ -_STATIC uint16_t odp_be_to_cpu_16(odp_u16be_t be16) +_ODP_INLINE uint16_t odp_be_to_cpu_16(odp_u16be_t be16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __odp_builtin_bswap16((__odp_force uint16_t)be16); @@ -30,7 +30,7 @@ _STATIC uint16_t odp_be_to_cpu_16(odp_u16be_t be16) #endif } -_STATIC uint32_t odp_be_to_cpu_32(odp_u32be_t be32) +_ODP_INLINE uint32_t odp_be_to_cpu_32(odp_u32be_t be32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __builtin_bswap32((__odp_force uint32_t)be32); @@ -39,7 +39,7 @@ _STATIC uint32_t odp_be_to_cpu_32(odp_u32be_t be32) #endif } -_STATIC uint64_t odp_be_to_cpu_64(odp_u64be_t be64) +_ODP_INLINE uint64_t odp_be_to_cpu_64(odp_u64be_t be64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __builtin_bswap64((__odp_force uint64_t)be64); @@ -48,7 +48,7 @@ _STATIC uint64_t odp_be_to_cpu_64(odp_u64be_t be64) #endif } -_STATIC odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) +_ODP_INLINE odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u16be_t)__odp_builtin_bswap16(cpu16); @@ -57,7 +57,7 @@ _STATIC odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) #endif } -_STATIC odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) +_ODP_INLINE odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u32be_t)__builtin_bswap32(cpu32); @@ -66,7 +66,7 @@ _STATIC odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) #endif } -_STATIC odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) +_ODP_INLINE odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u64be_t)__builtin_bswap64(cpu64); @@ -75,7 +75,7 @@ _STATIC odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) #endif } -_STATIC uint16_t odp_le_to_cpu_16(odp_u16le_t le16) +_ODP_INLINE uint16_t odp_le_to_cpu_16(odp_u16le_t le16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint16_t)le16; @@ -84,7 +84,7 @@ _STATIC uint16_t odp_le_to_cpu_16(odp_u16le_t le16) #endif } -_STATIC uint32_t odp_le_to_cpu_32(odp_u32le_t le32) +_ODP_INLINE uint32_t odp_le_to_cpu_32(odp_u32le_t le32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint32_t)le32; @@ -93,7 +93,7 @@ _STATIC uint32_t odp_le_to_cpu_32(odp_u32le_t le32) #endif } -_STATIC uint64_t odp_le_to_cpu_64(odp_u64le_t le64) +_ODP_INLINE uint64_t odp_le_to_cpu_64(odp_u64le_t le64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint64_t)le64; @@ -102,7 +102,7 @@ _STATIC uint64_t odp_le_to_cpu_64(odp_u64le_t le64) #endif } -_STATIC odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) +_ODP_INLINE odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u16le_t)cpu16; @@ -111,7 +111,7 @@ _STATIC odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) #endif } -_STATIC odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) +_ODP_INLINE odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u32le_t)cpu32; @@ -120,7 +120,7 @@ _STATIC odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) #endif } -_STATIC odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64) +_ODP_INLINE odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u64le_t)cpu64; diff --git a/platform/linux-generic/include/odp/api/plat/static_inline.h.in b/platform/linux-generic/include/odp/api/plat/static_inline.h.in index 4562a225..3cf00434 100644 --- a/platform/linux-generic/include/odp/api/plat/static_inline.h.in +++ b/platform/linux-generic/include/odp/api/plat/static_inline.h.in @@ -25,15 +25,15 @@ extern "C" { /** * @internal - * @def _STATIC - * Control conditional static inline expansions for ABI compatibility + * @def _ODP_INLINE + * Define a function as inlined or not inlined (for ABI compatibility) */ #if @ODP_ABI_COMPAT@ #define ODP_ABI_COMPAT 1 -#define _STATIC +#define _ODP_INLINE #else #define ODP_ABI_COMPAT 0 -#define _STATIC static inline +#define _ODP_INLINE static inline #endif #ifdef __cplusplus diff --git a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h index 2e833e41..8f505d07 100644 --- a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h @@ -14,17 +14,17 @@ extern "C" { #include #include -_STATIC void *odp_memcpy(void *dst, const void *src, size_t num) +_ODP_INLINE void *odp_memcpy(void *dst, const void *src, size_t num) { return memcpy(dst, src, num); } -_STATIC void *odp_memset(void *ptr, int value, size_t num) +_ODP_INLINE void *odp_memset(void *ptr, int value, size_t num) { return memset(ptr, value, num); } -_STATIC int odp_memcmp(const void *ptr1, const void *ptr2, size_t num) +_ODP_INLINE int odp_memcmp(const void *ptr1, const void *ptr2, size_t num) { return memcmp(ptr1, ptr2, num); } diff --git a/platform/linux-generic/include/odp/api/plat/sync_inlines.h b/platform/linux-generic/include/odp/api/plat/sync_inlines.h index 245c7502..76eb6810 100644 --- a/platform/linux-generic/include/odp/api/plat/sync_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/sync_inlines.h @@ -21,17 +21,17 @@ extern "C" { * @{ */ -_STATIC void odp_mb_release(void) +_ODP_INLINE void odp_mb_release(void) { __atomic_thread_fence(__ATOMIC_RELEASE); } -_STATIC void odp_mb_acquire(void) +_ODP_INLINE void odp_mb_acquire(void) { __atomic_thread_fence(__ATOMIC_ACQUIRE); } -_STATIC void odp_mb_full(void) +_ODP_INLINE void odp_mb_full(void) { __atomic_thread_fence(__ATOMIC_SEQ_CST); }