From patchwork Fri Oct 27 12:50:06 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: 117346 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp772857qgn; Fri, 27 Oct 2017 06:27:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+R0oCFL49FvT3RVoqS8P6lYU4O5NlCXIWK2aZVE9JzHV6ZJKJCtD0X+NdoippQrztQ62UiO X-Received: by 10.36.17.130 with SMTP id 124mr615164itf.81.1509110872776; Fri, 27 Oct 2017 06:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509110872; cv=none; d=google.com; s=arc-20160816; b=uCGoteNvOmiQjQLNqFTAHEd5gLfJHva0BYhLEvekbxs1CPHdSe7LtMbbq+/XL5z8NP jqRqwKfC6kf4PzCSQvCJ1Uyd4+M5YWwGjX2dIkh/4VWAIk4BDFvIgRQS6CY/3shyKsGi rBWr/p+kE692QJUdvWm/5ASGZsSuZsqfnvm89k+pmYwiI1opT/bm2Egr1Rcgkk0AOFyD h3rnaQ24upW+6DMgqS/UqIclUGYwvX+akrDPw9XNKsY4Qiq2mLfF3Z2YtFM44PCHvYBI W5tPpor8FTQdxVbThjC55PDRyv35QMoLX3BkNEekQN34UOFFEkgiTuf1lkzROD7XkFC6 rOlw== 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=ohOhD95z1sI3/soq/HcRrqH0w7BYJo5nLKnr/B7dMljEpaGz516hzbFbo3t4Bh4ePk 4zAgOQaW4W6QcwC3e+5EJ/xJsb11hd8GLhYCSKdWS4jZdQzriwn4x9+U3HwxKu5F84JD SZWse9hN5gf3G9LjZqqyavri+68Vx7KyzaScHtpQsmZFv8BQJ7/3tT9QZgixdJ2ZP07t CqXqgK0fz4Z+LGqKK1KeieVc/BZmmwOeEf+ib8IZriYENscZZC9YriSxT3ZhTzeMbTOP dLQ0wTzOA/ge1CyY5OudnTDzCNdiLWc5HlLIsIgW3zhBEC9BqXt0gpVCTOrEu1vrWc1M RINw== 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 m133si1277254itb.99.2017.10.27.06.27.52; Fri, 27 Oct 2017 06:27:52 -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 4F70462971; Fri, 27 Oct 2017 13:27:52 +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 D1AFE629B1; Fri, 27 Oct 2017 12:54:42 +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 4758362994; Fri, 27 Oct 2017 12:53:58 +0000 (UTC) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by lists.linaro.org (Postfix) with ESMTPS id 45F1D62967 for ; Fri, 27 Oct 2017 12:50:48 +0000 (UTC) Received: by mail-lf0-f67.google.com with SMTP id a132so7299581lfa.7 for ; Fri, 27 Oct 2017 05:50:48 -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=XXwBE5gaSg1oqpPsof80dOQR55pJqvOoAxSFlbUwwOMp+BYRhXB/Buiom91IMVGhYk eYoJ2w/Wym9I6co71wkzRk3m6/73uN9n3sn3SqRhSjXIiy5RruIeOdY1nKCwy6aWnd82 0qiw97hEDsZGrCWeLJ4wTMozScVtSEM9drVAjbSLym0cDU7P8+1TZhjLTyBD0hjQD8DA cx6uVBKHSqotMgZ5scpPf6cjFZGoOfYcDCQF79FSevQB/43Dp740FjeziYRFjIMLbdBA gD21HIsjTJc4VPzhULNCkWiSZ4I69e/WAbgFvK8+TuTN+v5icH/BfgZQfI65ITW8Eun2 ix1A== X-Gm-Message-State: AMCzsaXXbaJULDw7Qu9/qJEpwgXHR6onU+W3CrF/F1xyR2jDMcOxlTKM whpv2UIPMpraTaX7zEVU3vBfnaL9zuGvvw== X-Received: by 10.46.31.10 with SMTP id f10mr154119ljf.153.1509108646664; Fri, 27 Oct 2017 05:50:46 -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.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 05:50:46 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Fri, 27 Oct 2017 15:50:06 +0300 Message-Id: <20171027125014.27313-23-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 22/30] 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