From patchwork Fri Nov 14 02:18:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 40798 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 17382240ED for ; Fri, 14 Nov 2014 02:19:23 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf3376811lbj.0 for ; Thu, 13 Nov 2014 18:19:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=uHoZ9aYg4Qlc8ZrUw4JeLKnU08tRpZZMgQMVm6tjP8Q=; b=j4gXOrTPCc0/hLHk7FALCR8fSsbqgFs/6DuVyvfGR62WK4ffjQi0YKT1fTlF+nHDxX EOGkPYLsE2KAnBhY5agEuazwphkPzys6btHSAQls3hgj/euojGz4uzjjrTyAyxSVxt2L mfi7d0jiajTaLW4/CMyO8HHDQIeUwg94mpDr41AHi46xVSLMETLTIrZ799rT1PYCfJAo 3wORua1ppK+Wb8CeKCaBoxEFgae0Wb/n3gDwKpg+EH+5VQysvoN/Rz3RHSAeAJrVTkAk SPE4/7XotVpNo2QT4IiWOtgo10kbwSWml+Q+prMekrV85asKBJCbFQ753fkTij6VxMhQ ycAg== X-Gm-Message-State: ALoCoQn4tcYl6lu7Uw/dM6Wqj7BmADTSeD1NLBdKzY0qSa0hq8fsM7W8RY0zCAKF4djCFalzqYxZ X-Received: by 10.194.191.137 with SMTP id gy9mr10015923wjc.0.1415931561992; Thu, 13 Nov 2014 18:19:21 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.233 with SMTP id kt9ls139977lac.36.gmail; Thu, 13 Nov 2014 18:19:21 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr5699969laa.32.1415931561825; Thu, 13 Nov 2014 18:19:21 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id p7si40218688lbr.56.2014.11.13.18.19.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 18:19:21 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id 10so12263677lbg.35 for ; Thu, 13 Nov 2014 18:19:21 -0800 (PST) X-Received: by 10.152.88.46 with SMTP id bd14mr5700620lab.30.1415931561716; Thu, 13 Nov 2014 18:19:21 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp700346lbc; Thu, 13 Nov 2014 18:19:21 -0800 (PST) X-Received: by 10.229.104.3 with SMTP id m3mr7812749qco.0.1415931560452; Thu, 13 Nov 2014 18:19:20 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id d8si49206139qaq.40.2014.11.13.18.19.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 13 Nov 2014 18:19:20 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xp6Tm-0000oj-P4; Fri, 14 Nov 2014 02:19:18 +0000 Received: from mail-oi0-f51.google.com ([209.85.218.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xp6Td-0000lL-Sx for lng-odp@lists.linaro.org; Fri, 14 Nov 2014 02:19:09 +0000 Received: by mail-oi0-f51.google.com with SMTP id g201so11303740oib.24 for ; Thu, 13 Nov 2014 18:19:04 -0800 (PST) X-Received: by 10.60.52.177 with SMTP id u17mr5152404oeo.14.1415931544551; Thu, 13 Nov 2014 18:19:04 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id bu5sm11413709obd.2.2014.11.13.18.19.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 18:19:04 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 13 Nov 2014 20:18:45 -0600 Message-Id: <1415931525-18390-3-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415931525-18390-1-git-send-email-bill.fischofer@linaro.org> References: <1415931525-18390-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2] Factor ODP types into a common include file X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Bill Fischofer --- platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/api/odp_buffer.h | 9 +-- .../linux-generic/include/api/odp_buffer_pool.h | 5 +- .../linux-generic/include/api/odp_impl_types.h | 72 ++++++++++++++++++++++ platform/linux-generic/include/api/odp_packet.h | 30 --------- platform/linux-generic/include/api/odp_packet_io.h | 12 +--- 6 files changed, 76 insertions(+), 53 deletions(-) create mode 100644 platform/linux-generic/include/api/odp_impl_types.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 0153a22..66ba7fb 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -36,6 +36,7 @@ include_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/api/odp_ticketlock.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_time.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_timer.h \ + $(top_srcdir)/platform/linux-generic/include/api/odp_impl_types.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_version.h subdirheadersdir = $(includedir) diff --git a/platform/linux-generic/include/api/odp_buffer.h b/platform/linux-generic/include/api/odp_buffer.h index 289e0eb..141a16b 100644 --- a/platform/linux-generic/include/api/odp_buffer.h +++ b/platform/linux-generic/include/api/odp_buffer.h @@ -20,20 +20,13 @@ extern "C" { #include - +#include /** @defgroup odp_buffer ODP BUFFER * Operations on a buffer. * @{ */ -/** - * ODP buffer - */ -typedef uint32_t odp_buffer_t; - -#define ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */ - /** * Buffer start address diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h b/platform/linux-generic/include/api/odp_buffer_pool.h index d04abf0..c46044d 100644 --- a/platform/linux-generic/include/api/odp_buffer_pool.h +++ b/platform/linux-generic/include/api/odp_buffer_pool.h @@ -21,6 +21,7 @@ extern "C" { #include +#include #include /** @addtogroup odp_buffer @@ -34,10 +35,6 @@ extern "C" { /** Invalid buffer pool */ #define ODP_BUFFER_POOL_INVALID 0 -/** ODP buffer pool */ -typedef uint32_t odp_buffer_pool_t; - - /** * Create a buffer pool * diff --git a/platform/linux-generic/include/api/odp_impl_types.h b/platform/linux-generic/include/api/odp_impl_types.h new file mode 100644 index 0000000..f4deedb --- /dev/null +++ b/platform/linux-generic/include/api/odp_impl_types.h @@ -0,0 +1,72 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * ODP implementation types + * This file contains all of the implementation-defined types for ODP + * abstract definitions. Having this in one file means that other ODP + * API files are implementation-independent and avoids circular + * dependencies for files that refer to types managed by other + * components. Included here are typedefs and related typed constants + * that are referenced by other ODP API files. + */ + +#ifndef ODP_IMPL_TYPES_H_ +#define ODP_IMPL_TYPES_H_ + +/** @defgroup odp_types ODP TYPES + * Implementation definitions for ODP abstract types. + * @{ + */ + +/** ODP Buffer pool */ +typedef uint32_t odp_buffer_pool_t; + +/** ODP buffer */ +typedef uint32_t odp_buffer_t; + +/** Invalid buffer */ +#define ODP_BUFFER_INVALID (0xffffffff) + +/** ODP packet */ +typedef odp_buffer_t odp_packet_t; + +/** Invalid packet */ +#define ODP_PACKET_INVALID ODP_BUFFER_INVALID + +/** Invalid offset */ +#define ODP_PACKET_OFFSET_INVALID ((uint32_t)-1) + +/** ODP packet segment */ +typedef int odp_packet_seg_t; + +/** Invalid packet segment */ +#define ODP_PACKET_SEG_INVALID -1 + +/** ODP packet segment info */ +typedef struct odp_packet_seg_info_t { + void *addr; /**< Segment start address */ + size_t size; /**< Segment maximum data size */ + void *data; /**< Segment data address */ + size_t data_len; /**< Segment data length */ +} odp_packet_seg_info_t; + +/** ODP packet IO handle */ +typedef uint32_t odp_pktio_t; + +/** Invalid packet IO handle */ +#define ODP_PKTIO_INVALID 0 + +/** odp_pktio_t value to indicate any port */ +#define ODP_PKTIO_ANY ((odp_pktio_t)~0) + +/** + * @} + */ + +#endif diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h index 688e047..5298fa0 100644 --- a/platform/linux-generic/include/api/odp_packet.h +++ b/platform/linux-generic/include/api/odp_packet.h @@ -25,36 +25,6 @@ extern "C" { * @{ */ -/** - * ODP packet descriptor - */ -typedef odp_buffer_t odp_packet_t; - -/** Invalid packet */ -#define ODP_PACKET_INVALID ODP_BUFFER_INVALID - -/** Invalid offset */ -#define ODP_PACKET_OFFSET_INVALID ((uint32_t)-1) - - -/** - * ODP packet segment handle - */ -typedef int odp_packet_seg_t; - -/** Invalid packet segment */ -#define ODP_PACKET_SEG_INVALID -1 - -/** - * ODP packet segment info - */ -typedef struct odp_packet_seg_info_t { - void *addr; /**< Segment start address */ - size_t size; /**< Segment maximum data size */ - void *data; /**< Segment data address */ - size_t data_len; /**< Segment data length */ -} odp_packet_seg_info_t; - /** * Initialize the packet diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h index 360636d..45666aa 100644 --- a/platform/linux-generic/include/api/odp_packet_io.h +++ b/platform/linux-generic/include/api/odp_packet_io.h @@ -19,6 +19,7 @@ extern "C" { #endif #include +#include #include #include #include @@ -28,17 +29,6 @@ extern "C" { * @{ */ -/** ODP packet IO handle */ -typedef uint32_t odp_pktio_t; - -/** Invalid packet IO handle */ -#define ODP_PKTIO_INVALID 0 - -/** - * odp_pktio_t value to indicate any port - */ -#define ODP_PKTIO_ANY ((odp_pktio_t)~0) - /** * Open an ODP packet IO instance *