From patchwork Mon Oct 23 11:10:50 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: 116722 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4558084qgn; Mon, 23 Oct 2017 04:59:23 -0700 (PDT) X-Received: by 10.200.50.45 with SMTP id x42mr18994332qta.114.1508759963354; Mon, 23 Oct 2017 04:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508759963; cv=none; d=google.com; s=arc-20160816; b=Lqej9e9bNevMcwSeQbIWJSyQmKXmCI9I2L79yeQZ+cn5mQKbHS6WTCH0Bw6NXklsL6 qtnR8bD3sC7B4WybMDfwc3iHjzHUzAH10eHfTazOx6KM+FGlpK4GRZljH8NnpIRdGvSQ wpdzgE6OiX/4Oc6hOrQJlJk+igXHfOZBCTzKsX89PsDhPNRst7+dzBWlnC7JkkOE+qLy vVqvpowXxMeUSFi17fQpXkF+phx27QK6m2TipXDJed2SGEtL6WbC9CaZbEKR793SmzfY Q4snCkieBS8SS0U7uuoP8ZS1VeAsDupk8FKSSSV1SBo5NhwSVRiqYhRnvK1LC7895SRT rCCA== 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=zz/94r/PZjNErBjLdqhkTfgF/oM40LCFm9QsxZpYTjk=; b=RWeqRQHDBuzsA6QmzveE7d5GZPNVV4JE937PeThlN02BBr9V+4m9AjfFKfgMoUOz4t nio/hF5Fe+DAqVLA/HN9UfQ+DT+QjbXw/p9T593bblrA4+1zxesOJ18z1G3lUdn2L6MV 7jt5VR4s7faI7zmMXNxsHiVbQLRGgRq8bIW2G9ceAbXbffcb5osEBnwsvv0NeC81zWw/ QS4AHwgkL30RnAlTG1kyXVdqIqDkHP4nqW9Kq1DW2YMuyCNcNi46yuqxBq7vAuyfhNq3 p2YGNkF05CVTnIhLBjiiQiA4icuGSeCBaUYRUmxJBtfZjXVsaCU0ZyDKF5pduE+gpY2v l/VQ== 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 s27si5939350qtb.370.2017.10.23.04.59.23; Mon, 23 Oct 2017 04:59:23 -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 04A3E62978; Mon, 23 Oct 2017 11:59:23 +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 ACB90628FA; Mon, 23 Oct 2017 11:15:55 +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 BAD5A628F7; Mon, 23 Oct 2017 11:15:26 +0000 (UTC) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by lists.linaro.org (Postfix) with ESMTPS id 21A70618EC for ; Mon, 23 Oct 2017 11:11:33 +0000 (UTC) Received: by mail-lf0-f68.google.com with SMTP id a16so19649263lfk.0 for ; Mon, 23 Oct 2017 04:11:33 -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=zz/94r/PZjNErBjLdqhkTfgF/oM40LCFm9QsxZpYTjk=; b=TTsytySUNt/ab8w86nHZaPlooP+JvgdYv/2VZNV9pNjpxusx3StARGlnLKY6GG04s8 +VNU+Fh/Abao9WGvIAKNKDpMEoj9/1hyfOaKLPt8kPauDG1t5250LFn1yYplgtHuiZ6C mk/1Tuyl+/W5CugPRYj2OPwyopevJ91bdK8EgE39nzja9aRCrM4SOGCkBp8yrX04Qpjg Rn65uN72Iq3lueQx/tKBGdmxnIBYFi0wBfcKwhZDACN5rkF+7sNhsupNA8WUj1kOwccC IrimIzFeBLC4EGOWavDMbVR8soFrUd6HXwwgJWS8ZY4AALnuLmqp2RZFTJZqFcPxA21/ AmeA== X-Gm-Message-State: AMCzsaV1vq7ykXFPZU5KNJ2y8Nk/JtZa49RG6ZXCpKWPxQgd42R/AiSe kjlo9MbmsK11FGybzke7V3MwQHnUuA/7kg== X-Google-Smtp-Source: ABhQp+TCNz8SeXexarqy+cS2LLLGQAGdVXThIpcKywtUxlVIydMsMyNxjFjoCYEMXxV2kAxc9ci8xQ== X-Received: by 10.25.22.28 with SMTP id m28mr4431738lfi.185.1508757091679; Mon, 23 Oct 2017 04:11:31 -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.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 04:11:31 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Mon, 23 Oct 2017 14:10:50 +0300 Message-Id: <20171023111057.6328-23-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 22/29] linux-gen, include: switch ticketlock.h to api+abi 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" Signed-off-by: Dmitry Eremin-Solenikov --- include/Makefile.am | 1 + .../include => include}/odp/api/ticketlock.h | 11 +++-------- platform/linux-generic/Makefile.am | 7 +++---- .../odp/api/abi/ticketlock.h} | 21 ++++++++++++++++----- .../include/odp/api/plat/ticketlock_inlines.h | 20 -------------------- platform/linux-generic/odp_queue_scalable.c | 1 + platform/linux-generic/odp_ticketlock.c | 4 +++- 7 files changed, 27 insertions(+), 38 deletions(-) rename {platform/linux-generic/include => include}/odp/api/ticketlock.h (54%) rename platform/linux-generic/{include/odp/api/plat/ticketlock_types.h => include-abi/odp/api/abi/ticketlock.h} (52%) -- 2.14.2 diff --git a/include/Makefile.am b/include/Makefile.am index 4a9c3efe674a..617aa4a6e67a 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -27,6 +27,7 @@ odpapiinclude_HEADERS = \ odp/api/sync.h \ odp/api/thread.h \ odp/api/thrmask.h \ + odp/api/ticketlock.h \ odp/api/time.h \ odp/api/timer.h \ odp/api/traffic_mngr.h \ diff --git a/platform/linux-generic/include/odp/api/ticketlock.h b/include/odp/api/ticketlock.h similarity index 54% rename from platform/linux-generic/include/odp/api/ticketlock.h rename to include/odp/api/ticketlock.h index ca12cc37cf9f..d875c0e34e76 100644 --- a/platform/linux-generic/include/odp/api/ticketlock.h +++ b/include/odp/api/ticketlock.h @@ -10,19 +10,14 @@ * ODP ticketlock */ -#ifndef ODP_PLAT_TICKETLOCK_H_ -#define ODP_PLAT_TICKETLOCK_H_ +#ifndef ODP_API_TICKETLOCK_H_ +#define ODP_API_TICKETLOCK_H_ #ifdef __cplusplus extern "C" { #endif -#include - -#include -#if ODP_ABI_COMPAT == 0 -#include -#endif +#include #include diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 69ccd8e0b978..3aee7ce6340e 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -37,8 +37,7 @@ odpapiinclude_HEADERS = \ include/odp/api/packet_io_stats.h \ include/odp/api/random.h \ include/odp/api/support.h \ - include/odp/api/system_info.h \ - include/odp/api/ticketlock.h + include/odp/api/system_info.h odpapiplatincludedir= $(includedir)/odp/api/plat odpapiplatinclude_HEADERS = \ @@ -53,8 +52,7 @@ odpapiplatinclude_HEADERS = \ include/odp/api/plat/strong_types.h \ include/odp/api/plat/sync_inlines.h \ include/odp/api/plat/ticketlock_inlines.h \ - include/odp/api/plat/ticketlock_inlines_api.h \ - include/odp/api/plat/ticketlock_types.h + include/odp/api/plat/ticketlock_inlines_api.h nodist_odpapiplatinclude_HEADERS = \ include/odp/api/plat/static_inline.h @@ -87,6 +85,7 @@ odpapiabiarchinclude_HEADERS = \ include-abi/odp/api/abi/sync.h \ include-abi/odp/api/abi/thread.h \ include-abi/odp/api/abi/thrmask.h \ + include-abi/odp/api/abi/ticketlock.h \ include-abi/odp/api/abi/time.h \ include-abi/odp/api/abi/timer.h \ include-abi/odp/api/abi/traffic_mngr.h \ diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_types.h b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h similarity index 52% rename from platform/linux-generic/include/odp/api/plat/ticketlock_types.h rename to platform/linux-generic/include-abi/odp/api/abi/ticketlock.h index 81d479d61a61..958184be6907 100644 --- a/platform/linux-generic/include/odp/api/plat/ticketlock_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h @@ -11,8 +11,8 @@ * ODP ticketlock */ -#ifndef ODP_TICKETLOCK_TYPES_H_ -#define ODP_TICKETLOCK_TYPES_H_ +#ifndef ODP_API_ABI_TICKETLOCK_H_ +#define ODP_API_ABI_TICKETLOCK_H_ #ifdef __cplusplus extern "C" { @@ -20,13 +20,24 @@ extern "C" { #include +/** @ingroup odp_locks + * @{ + */ + /** @internal */ -struct odp_ticketlock_s { +typedef struct odp_ticketlock_s { odp_atomic_u32_t next_ticket; /**< Next ticket */ odp_atomic_u32_t cur_ticket; /**< Current ticket */ -}; +} odp_ticketlock_t; + +/* Include inlined versions of API functions */ +#include +#include +#include -typedef struct odp_ticketlock_s odp_ticketlock_t; +/** + * @} + */ #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h index ecbea7c4d611..185d77de015f 100644 --- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h @@ -14,10 +14,6 @@ #define _ODP_PLAT_TICKETLOCK_INLINES_H_ #include -#include -#include - -#include /** @internal * Acquire ticket lock. @@ -111,20 +107,4 @@ static inline int _odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock) odp_atomic_load_u32(&ticketlock->next_ticket); } -/* Include inlined versions of API functions */ -#include -#if ODP_ABI_COMPAT == 0 - -/** @ingroup odp_locks - * @{ - */ - -#include - -/** - * @} - */ - -#endif - #endif diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index 07201ce7b5f7..09413e80314e 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/platform/linux-generic/odp_ticketlock.c b/platform/linux-generic/odp_ticketlock.c index 0c94f8ae2fa3..59431620f203 100644 --- a/platform/linux-generic/odp_ticketlock.c +++ b/platform/linux-generic/odp_ticketlock.c @@ -6,8 +6,9 @@ #include "config.h" +#include + #include -#include void odp_ticketlock_init(odp_ticketlock_t *ticketlock) { @@ -16,6 +17,7 @@ void odp_ticketlock_init(odp_ticketlock_t *ticketlock) } /* Include non-inlined versions of API functions */ +#include #if ODP_ABI_COMPAT == 1 #include #endif