From patchwork Fri Nov 14 18:40:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 40856 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6F3AD240ED for ; Fri, 14 Nov 2014 18:41:09 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf10703864lam.4 for ; Fri, 14 Nov 2014 10:41:08 -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=UNPmZe01+Ntj/tuP7tbTw0P+twNCkpjb81lQsz4AyFk=; b=a2fWRdIkHoM6CKk8qPWNKH7KO7wWYId1jlrZibByIiOJ5qKhjpcim5Ji3B6pfntKL8 pnTWpaxGdkkMEuxKsDsjrY4TdB6MlBhBuhb8ezYrtEK1B2fiGgyccS7mmWXBwCVTLN9h RvT0MtVl7iAEOShaX6ZLLzwGB0cbg1Yr1IKlywi7C4SUc3wZUxEj+GdoYkyVZBUHIeD/ DkUJfC9d9FUxNe6Qpm1g4I1WHezb7EQEfRsJ+2F4Hjub/pgqvtCWOD+Vov+D2DspICla QBff4qHeHaahs5SC2uR9/1/uVEcml7557xj9kbekQJcu/VnUPkeh1k9gFkheN7nxC4MA 74RQ== X-Gm-Message-State: ALoCoQnS+Qt9sJ0iWqVU8Vs1S5LTpZJKM+Z5+g4dW1S6ynHm+yDo8sLu3jCtjn4Z1cv2MUwyWZUG X-Received: by 10.112.154.194 with SMTP id vq2mr4811570lbb.10.1415990468364; Fri, 14 Nov 2014 10:41:08 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.71 with SMTP id t7ls431513lae.11.gmail; Fri, 14 Nov 2014 10:41:08 -0800 (PST) X-Received: by 10.112.166.101 with SMTP id zf5mr10080286lbb.42.1415990467979; Fri, 14 Nov 2014 10:41:07 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id wh3si42441209lbb.118.2014.11.14.10.41.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Nov 2014 10:41:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id gd6so15162065lab.20 for ; Fri, 14 Nov 2014 10:41:07 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr9730009lal.29.1415990467835; Fri, 14 Nov 2014 10:41:07 -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 ew9csp815014lbc; Fri, 14 Nov 2014 10:41:06 -0800 (PST) X-Received: by 10.224.69.202 with SMTP id a10mr12688810qaj.62.1415990466062; Fri, 14 Nov 2014 10:41:06 -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 z32si52389345qge.13.2014.11.14.10.41.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 14 Nov 2014 10:41:06 -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 1XpLns-0005kF-4v; Fri, 14 Nov 2014 18:41:04 +0000 Received: from mail-oi0-f50.google.com ([209.85.218.50]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XpLnj-0005jl-C5 for lng-odp@lists.linaro.org; Fri, 14 Nov 2014 18:40:55 +0000 Received: by mail-oi0-f50.google.com with SMTP id a141so4211567oig.37 for ; Fri, 14 Nov 2014 10:40:50 -0800 (PST) X-Received: by 10.60.134.20 with SMTP id pg20mr9159356oeb.36.1415990450113; Fri, 14 Nov 2014 10:40:50 -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 d88sm430869oic.26.2014.11.14.10.40.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Nov 2014 10:40:49 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Fri, 14 Nov 2014 12:40:35 -0600 Message-Id: <1415990436-10926-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415990436-10926-1-git-send-email-bill.fischofer@linaro.org> References: <1415990436-10926-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH] Factor ODP typedefs 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.215.47 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 +- platform/linux-generic/include/api/odp_packet.h | 30 ----------- platform/linux-generic/include/api/odp_packet_io.h | 12 +---- platform/linux-generic/include/api/odp_typedefs.h | 63 ++++++++++++++++++++++ 6 files changed, 67 insertions(+), 53 deletions(-) create mode 100644 platform/linux-generic/include/api/odp_typedefs.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 0153a22..cb3cfc4 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_typedefs.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..7e7c95e 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..170cd32 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_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..4d4e636 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 * diff --git a/platform/linux-generic/include/api/odp_typedefs.h b/platform/linux-generic/include/api/odp_typedefs.h new file mode 100644 index 0000000..af74980 --- /dev/null +++ b/platform/linux-generic/include/api/odp_typedefs.h @@ -0,0 +1,63 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * @par ODP implementation typedefs + * This file contains all of the implementation-defined typedefs for + * ODP abstract types. 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. + */ + +#ifndef ODP_TYPEDEFS_H_ +#define ODP_TYPEDEFS_H_ + +/** 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) /**< Invalid buffer */ + +/** 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