From patchwork Fri Oct 27 12:50:09 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: 117354 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp776093qgn; Fri, 27 Oct 2017 06:31:06 -0700 (PDT) X-Google-Smtp-Source: ABhQp+ToQDBxIUMSII3zDRdiuAzZTYd+VtJqUIYWphEhKy6XKEwtBLVT/3/igpXZIi8cxOv9NNTD X-Received: by 10.55.174.129 with SMTP id x123mr762207qke.61.1509111066665; Fri, 27 Oct 2017 06:31:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509111066; cv=none; d=google.com; s=arc-20160816; b=P/kqDsCSZE6ouwcKKj+sI5WYE7/pXLlyo2VozzcXttDTsaIop+zkaXAvUoSE8dYRi8 ltN/AiuZn12USKGtjUuvCpvldwijd7gg6wzS9ztD0NSuTaIJcT4dLDBiLwmY0LFL+Sq7 K79sg1gdvk4B9Vdasb8STuUlVrav20Nvvf48hWGxy9ik2EsWYAOVVF3sXugf4YrfY5xL tyWj8x2sB18JDRWHtCaho0BagZgzLx/WHHNZJFdGaPzOjyoPsClQNMi8brcqrsIPlfu1 Q25r6yKXRdeMTWhty3V2Cec1xhmNNMiPntuIcAbIbVZ5210/rDkh4WUUOK0YrkR99PYY rMtQ== 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=GEV1oMcJc1Wa3Q7ZEOXK0jxbZJC3E7K5aHRVMwKRUD46cUm/M+aDqGwi6mnd+sz7Y0 eUHfCibI0S5ws+apxfWFb+xxFtOfstPISCaVk1YkiP9x5LpGLk8D1Nt9V8kHfUgqAuuW j4eSI44R34ewLq8Ktr+zAy6hNlDH4lR8tAa/ti1yafTUTTNngXasRk8D+TbuNMecIe1z nps6HF+mxXC7CSCLDxzn3ntkQ8QquwqVQGEBgxG6Qa+0amJcjWJMVpwfSY0dFdv3F9gZ H+q3G35fOpNsalYIlw4R4WmYDGrAxoB25yisr/r4Gv0QwzrMEDswIm+/XYk4AlefUXkK eSAA== 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 r26si1955936qki.149.2017.10.27.06.31.06; Fri, 27 Oct 2017 06:31:06 -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 548216298D; Fri, 27 Oct 2017 13:31:06 +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 539E4629C3; Fri, 27 Oct 2017 12:55:30 +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 7B26B60A35; Fri, 27 Oct 2017 12:54:59 +0000 (UTC) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by lists.linaro.org (Postfix) with ESMTPS id 4D49960D3C for ; Fri, 27 Oct 2017 12:50:52 +0000 (UTC) Received: by mail-lf0-f66.google.com with SMTP id w21so7314878lfc.6 for ; Fri, 27 Oct 2017 05:50:52 -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=BuYE7gEYCGTgRemRicDWmo/Tchh8wYI3BptxUBKAEUsyXKZWEP4B+EDAP33XKe3wAV 5Zsh1Ov4ITYGpzzdkTXlWX0CV9XDGAIXAd6Mis6xEBFKRKtBTI41AzchLH3YdySgczbv gNQ2wxiM60+CdJo4HdbJ2j0SLt0294Djh4E1nD04gifr/SjIJ8aBWTGe7RJreWfjMotp WawLmQUYwFrIWeNzElsW5XPixTe53xIj8Tv5FrjlLmBPyhhPYCTNPpDK/FJK2WcOoVPD xUCOLO4eLMNYJokXgS2LtooNXyjKxPOiy1sjKBU+wLEjm/LvtUw7A6ZyXjnFRbxCkHUH 5o8w== X-Gm-Message-State: AMCzsaUPH1B6AeUX4YM1U1rZ4niNxUFZrI9yM3xJ9spdQldByYweT/Ij L7OmvL/le1grse92FCvnwan+JJHoBeHwyQ== X-Received: by 10.46.48.6 with SMTP id w6mr197481ljw.16.1509108650425; Fri, 27 Oct 2017 05:50:50 -0700 (PDT) Received: from rhovanion.lumag.spb.ru ([94.25.228.222]) by smtp.gmail.com with ESMTPSA id l194sm1584690lfl.11.2017.10.27.05.50.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 05:50:49 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 15:50:09 +0300 Message-Id: <20171027125014.27313-26-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171027125014.27313-1-dmitry.ereminsolenikov@linaro.org> References: <20171027125014.27313-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH v10 25/30] 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