From patchwork Mon Oct 23 11:10:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 116725 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4564556qgn; Mon, 23 Oct 2017 05:04:25 -0700 (PDT) X-Received: by 10.200.35.42 with SMTP id a39mr19846715qta.9.1508760265524; Mon, 23 Oct 2017 05:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508760265; cv=none; d=google.com; s=arc-20160816; b=XRqSydbLq2dilnYWPkhWWMZ21gody/27Yk6RW1fIx2iYten2AYiHoguu0Xoy+IS9DT yMJoxHglc0505DUpGN0WjZu04kWAnd4kFoxRuFJQAnJ8hS8NiO0Y60nlJzqUSp9JEosh avuW8Zc3I+/BRu5yejcjjPdTJeF6Fcw+AXnyyojBIzLq0Lg2a0i/tla0tYeeJHIjTkdj XJKurJ9/+kEqLO8/RHiannsy+v2h5YH/cLhFl/Qzc+BmyGcrVIVbBn9pgnqDIaleks2r K8Gver3cJ8k1PyyAWryLOi50qpncqfpw97WggFUxDOW57Kfv7Bf9kLCar52pPu5OZegk RY0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=J67IA9Rwafm458dcLqY7a4tKx5BXYYE+Ns2Tcb2/oMw=; b=T2W/fx2lcLjA2afnA4ZaiCOO1CYurpeYVMLsHxESa+fLTVcYt5sxROsLvDBZF3j6JF 7SXBdruKC3XlgjXlabcaaWlyzM7jt5QO30O7yt8woyBghidtflgN1zNqTffLKePNn5O2 W/7ShwdnA1ysb54xRSZuegguw0NxKh4DFcwqFCq2L2ZXIZ+BKvZGNv+WkT/LiUYjmqfz TAnUvi3ZeU1Tn2rE34PzZkyHer99MS0kTWb4gdf9+kS4KMye0k7CtMM8kdnMo+Y+1kLJ kHYC8oliuYSjGkQRFWTgAg3s6uL8DQdr1h3H9Gaf41pvQwAdZplZjNmWjdznaJ8KQtnK y8KQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id u52si934802qth.12.2017.10.23.05.04.25; Mon, 23 Oct 2017 05:04:25 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 38C1162914; Mon, 23 Oct 2017 12:04:25 +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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, 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 6C10C62916; Mon, 23 Oct 2017 11:16:37 +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 9845862916; Mon, 23 Oct 2017 11:16:32 +0000 (UTC) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by lists.linaro.org (Postfix) with ESMTPS id 9A9E26229A for ; Mon, 23 Oct 2017 11:11:40 +0000 (UTC) Received: by mail-lf0-f65.google.com with SMTP id 90so19651114lfs.13 for ; Mon, 23 Oct 2017 04:11:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=J67IA9Rwafm458dcLqY7a4tKx5BXYYE+Ns2Tcb2/oMw=; b=uLbbV/jTgzAKIpjKQwC9QVaMaWqIyX3TAtMCYg4pX4Bb66UucCHy0+8lEGL/I4+u2J ZjUKQh/BAOGeDLai9LGx9/TERFJF40GSrkgtSkBZ7HvfI1MW4QfLIhO4uhdu5VkSjRJ0 psTGiwC0YY6dWFMGI3SorR+Bbgm8c2Ze6GRN5sQZwV9FKakpnwZQtJVyhKlKeh/klAQO WNXaYuuoRKA7x74+FLALdn6ZK3iHaFSpkmCzj/w3oHX1pC7TwVQ4+5t0FU1GiUrMzom/ 1mwILV6WG2seaNXegmYmPbY7G0XkG3TUzEsuiboRs3Kg6g1XIyHgiyNRWmrizyuAChu4 bqEg== X-Gm-Message-State: AMCzsaWG2GYXH8I64pQxu5auINwEuFPBx93YxUUldPeCL1kXR3UezIjg h1tctMTUAcdjw7TI3ZddZ0ipXFppcG/2jg== X-Google-Smtp-Source: ABhQp+Q30GPxPxMRqjEJUj9okgA3jK99kimLDLP1X9bq5eA2ip71xLLA4egRUEqGtIAULC+Cs8d3Jg== X-Received: by 10.46.81.90 with SMTP id b26mr4911236lje.98.1508757099165; Mon, 23 Oct 2017 04:11:39 -0700 (PDT) Received: from rhovanion.lumag.spb.ru ([94.25.228.135]) by smtp.gmail.com with ESMTPSA id i66sm1854643lji.51.2017.10.23.04.11.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 04:11:38 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 14:10:53 +0300 Message-Id: <20171023111057.6328-26-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171023111057.6328-1-dmitry.ereminsolenikov@linaro.org> References: <20171023111057.6328-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH 25/29] linux-gen: move several files under ODP_ABI_COMPAT condition 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" Several files consist only (or mostly) of functions compiled only if ODP is compiled in ABI compatibility mode. Instead of having an ifdef inside, guard them with if ODP_ABI_COMPAT condition in Makefile.am Signed-off-by: Dmitry Eremin-Solenikov --- platform/linux-generic/Makefile.am | 13 +++++++++---- .../include/odp/api/plat/ticketlock_inlines_api.h | 6 ++++++ platform/linux-generic/odp_atomic.c | 4 ---- platform/linux-generic/odp_atomic_api.c | 13 +++++++++++++ platform/linux-generic/odp_byteorder.c | 6 +++--- platform/linux-generic/odp_std_clib.c | 6 +++--- platform/linux-generic/odp_sync.c | 6 +++--- platform/linux-generic/odp_ticketlock.c | 10 +--------- 8 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 platform/linux-generic/odp_atomic_api.c -- 2.14.2 diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index f2454ac51fff..078d154f8f15 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -167,7 +167,6 @@ __LIB__libodp_linux_la_SOURCES = \ odp_barrier.c \ odp_bitmap.c \ odp_buffer.c \ - odp_byteorder.c \ odp_chksum.c \ odp_classification.c \ odp_cpu.c \ @@ -215,12 +214,9 @@ __LIB__libodp_linux_la_SOURCES = \ odp_sorted_list.c \ odp_spinlock.c \ odp_spinlock_recursive.c \ - odp_std_clib.c \ - odp_sync.c \ odp_system_info.c \ odp_thread.c \ odp_thrmask.c \ - odp_ticketlock.c \ odp_time.c \ odp_timer.c \ odp_timer_wheel.c \ @@ -233,6 +229,15 @@ __LIB__libodp_linux_la_SOURCES = \ drv_shm.c \ drv_spinlock.c +if ODP_ABI_COMPAT +__LIB__libodp_linux_la_SOURCES += \ + odp_atomic_api.c \ + odp_byteorder.c \ + odp_std_clib.c \ + odp_sync.c \ + odp_ticketlock.c +endif + if ARCH_IS_ARM __LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \ arch/default/odp_cpu_cycles.c \ diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h index 5efe696ff734..4f8509569228 100644 --- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h +++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h @@ -33,4 +33,10 @@ _ODP_INLINE int odp_ticketlock_is_locked(odp_ticketlock_t *lock) return _odp_ticketlock_is_locked(lock); } +_ODP_INLINE void odp_ticketlock_init(odp_ticketlock_t *ticketlock) +{ + odp_atomic_init_u32(&ticketlock->next_ticket, 0); + odp_atomic_init_u32(&ticketlock->cur_ticket, 0); +} + #endif diff --git a/platform/linux-generic/odp_atomic.c b/platform/linux-generic/odp_atomic.c index 1d76caf2b82f..8c46bb5bb11f 100644 --- a/platform/linux-generic/odp_atomic.c +++ b/platform/linux-generic/odp_atomic.c @@ -7,10 +7,6 @@ #include "config.h" #include -#include -#if ODP_ABI_COMPAT == 1 -#include -#endif int odp_atomic_lock_free_u64(odp_atomic_op_t *atomic_op) { diff --git a/platform/linux-generic/odp_atomic_api.c b/platform/linux-generic/odp_atomic_api.c new file mode 100644 index 000000000000..a1aabb07c692 --- /dev/null +++ b/platform/linux-generic/odp_atomic_api.c @@ -0,0 +1,13 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "config.h" + +#include + +/* Include non-inlined versions of API functions */ +#define _ODP_INLINE +#include diff --git a/platform/linux-generic/odp_byteorder.c b/platform/linux-generic/odp_byteorder.c index faf1c5904bb4..ff0b74b233cf 100644 --- a/platform/linux-generic/odp_byteorder.c +++ b/platform/linux-generic/odp_byteorder.c @@ -7,7 +7,7 @@ #include "config.h" #include -#include -#if ODP_ABI_COMPAT == 1 + +/* Include non-inlined versions of API functions */ +#define _ODP_INLINE #include -#endif diff --git a/platform/linux-generic/odp_std_clib.c b/platform/linux-generic/odp_std_clib.c index 38406b86b3c4..b267ea654ee2 100644 --- a/platform/linux-generic/odp_std_clib.c +++ b/platform/linux-generic/odp_std_clib.c @@ -7,7 +7,7 @@ #include "config.h" #include -#include -#if ODP_ABI_COMPAT == 1 + +/* Include non-inlined versions of API functions */ +#define _ODP_INLINE #include -#endif diff --git a/platform/linux-generic/odp_sync.c b/platform/linux-generic/odp_sync.c index a9d2bbe24369..b9e85593bbbf 100644 --- a/platform/linux-generic/odp_sync.c +++ b/platform/linux-generic/odp_sync.c @@ -7,7 +7,7 @@ #include "config.h" #include -#include -#if ODP_ABI_COMPAT == 1 + +/* Include non-inlined versions of API functions */ +#define _ODP_INLINE #include -#endif diff --git a/platform/linux-generic/odp_ticketlock.c b/platform/linux-generic/odp_ticketlock.c index 59431620f203..63381f44b456 100644 --- a/platform/linux-generic/odp_ticketlock.c +++ b/platform/linux-generic/odp_ticketlock.c @@ -10,14 +10,6 @@ #include -void odp_ticketlock_init(odp_ticketlock_t *ticketlock) -{ - odp_atomic_init_u32(&ticketlock->next_ticket, 0); - odp_atomic_init_u32(&ticketlock->cur_ticket, 0); -} - /* Include non-inlined versions of API functions */ -#include -#if ODP_ABI_COMPAT == 1 +#define _ODP_INLINE #include -#endif