From patchwork Fri Jan 30 04:27:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 44014 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 0592B24128 for ; Fri, 30 Jan 2015 04:28:37 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf26742510lbj.0 for ; Thu, 29 Jan 2015 20:28:35 -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:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=sjZ7aZ32iasXpsKAVUtY6y78ig3bC+3hcU4T8ATveZ4=; b=Y3YLV2HVq+y0wMQISq0FU8V6M85IuhEhUFWuqCME59jb+0jWRAwrmpV9P0D42LP9vK iLyKvt/JvG9otNbd7muutb6SvR3DHh7RfNNE7cJtFNxnHvwpS0CHkkli9SHjYyiuV6vr 6LoPO8PMCWJDv1qIkpot5+kMxma6h7FNooZrkqS1j/n07FWeyGdi+I2q1oo0Ys7Ux3jt XTmalBTDpiw4DpVsveUXx/xGzsVRd00WtnCIk/iMefKRhRDJSJZ37jJUsp/JKgJ2GY9Q o2uOXVsVLIIGHSkyl6QqbaKW6CkwPx/Otk7Lnvhrcl/4vnsWd+DyEqni5hJ8clNs4Nq9 XTng== X-Gm-Message-State: ALoCoQnLmhgguJrrwmD/ZybLhq+XpdsZM9fyzWGRNalL5ZjGVHWUInu7fG9tpJPAHumI6vTO5iPX X-Received: by 10.112.168.104 with SMTP id zv8mr520700lbb.10.1422592115934; Thu, 29 Jan 2015 20:28:35 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.2 with SMTP id ku2ls348710lac.64.gmail; Thu, 29 Jan 2015 20:28:35 -0800 (PST) X-Received: by 10.112.204.233 with SMTP id lb9mr4551315lbc.43.1422592115722; Thu, 29 Jan 2015 20:28:35 -0800 (PST) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id np9si9302881lbb.0.2015.01.29.20.28.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 20:28:35 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id f15so34535150lbj.5 for ; Thu, 29 Jan 2015 20:28:35 -0800 (PST) X-Received: by 10.112.188.227 with SMTP id gd3mr4655434lbc.22.1422592115641; Thu, 29 Jan 2015 20:28:35 -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.35.133 with SMTP id h5csp159213lbj; Thu, 29 Jan 2015 20:28:34 -0800 (PST) X-Received: by 10.224.120.10 with SMTP id b10mr8827483qar.19.1422592114217; Thu, 29 Jan 2015 20:28:34 -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 4si12940324qgy.69.2015.01.29.20.28.32 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 20:28:34 -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 1YH3C3-0007Sw-22; Fri, 30 Jan 2015 04:28:31 +0000 Received: from mail-oi0-f48.google.com ([209.85.218.48]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YH3Bh-0007N8-87 for lng-odp@lists.linaro.org; Fri, 30 Jan 2015 04:28:09 +0000 Received: by mail-oi0-f48.google.com with SMTP id v63so33069223oia.7 for ; Thu, 29 Jan 2015 20:28:04 -0800 (PST) X-Received: by 10.202.72.208 with SMTP id v199mr2460373oia.122.1422592084003; Thu, 29 Jan 2015 20:28: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 x21sm4737369oix.24.2015.01.29.20.28.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 20:28:03 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 22:27:42 -0600 Message-Id: <1422592065-15875-7-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422592065-15875-1-git-send-email-bill.fischofer@linaro.org> References: <1422592065-15875-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [patch 6/9] linux-generic: packet: add strong typing support 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.174 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/include/odp/plat/packet_types.h | 12 ++++++------ platform/linux-generic/odp_packet.c | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/platform/linux-generic/include/odp/plat/packet_types.h b/platform/linux-generic/include/odp/plat/packet_types.h index 60d6443..f29d58a 100644 --- a/platform/linux-generic/include/odp/plat/packet_types.h +++ b/platform/linux-generic/include/odp/plat/packet_types.h @@ -18,23 +18,23 @@ extern "C" { #endif - -#include +#include +#include /** @addtogroup odp_packet ODP PACKET * Operations on a packet. * @{ */ -typedef odp_buffer_t odp_packet_t; +typedef odp_handle_t odp_packet_t; -#define ODP_PACKET_INVALID ODP_BUFFER_INVALID +#define ODP_PACKET_INVALID _odp_cast_scalar(odp_packet_t, 0xffffffff) #define ODP_PACKET_OFFSET_INVALID (0x0fffffff) -typedef odp_buffer_t odp_packet_seg_t; +typedef odp_handle_t odp_packet_seg_t; -#define ODP_PACKET_SEG_INVALID ODP_BUFFER_INVALID +#define ODP_PACKET_SEG_INVALID _odp_cast_scalar(odp_packet_seg_t, 0xffffffff) /** * @} diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index fbe375c..93af7de 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -193,10 +193,10 @@ void *odp_packet_offset(odp_packet_t pkt, uint32_t offset, uint32_t *len, if (addr != NULL && seg != NULL) { odp_buffer_bits_t seghandle; - seghandle.handle = pkt; + seghandle.handle = (odp_buffer_t)pkt; seghandle.seg = (pkt_hdr->headroom + offset) / pkt_hdr->buf_hdr.segsize; - *seg = seghandle.handle; + *seg = (odp_packet_seg_t)seghandle.handle; } return addr; @@ -325,9 +325,9 @@ odp_packet_seg_t odp_packet_last_seg(odp_packet_t pkt) odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); odp_buffer_bits_t seghandle; - seghandle.handle = pkt; + seghandle.handle = (odp_buffer_t)pkt; seghandle.seg = pkt_hdr->buf_hdr.segcount - 1; - return seghandle.handle; + return (odp_packet_seg_t)seghandle.handle; } odp_packet_seg_t odp_packet_next_seg(odp_packet_t pkt, odp_packet_seg_t seg)