From patchwork Sat Jan 31 20:50:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 44098 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A1E2B2359E for ; Sat, 31 Jan 2015 20:51:28 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf8601387wiv.2 for ; Sat, 31 Jan 2015 12:51:28 -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=gPFCmgK4YzBK3OLy9H3Yh9oOBGihU9SEDiWrwDOX1NI=; b=bchjNlE97Jbd/XK1F9sMa3z78wh/4haBybHYq9Q6vSbCO1Kj0VYSQxIcw+1c7pFvk5 7irP94DAZkkAcHKo/UiN6cnIcGQe+h39enpKjpjjSueR0VzBqPosQICDla8pG+A0bs7N uUqiWSKpzJUkE711ZltbAs6RmMCOCpw7w5iHvQRukCkCzhHu/EfBtNnL9ED1evSHr1Al kIol6AqC19IAChRBeOQtXB/bmNz+GGoLAP46S9QGRvm8nR0zQrdpfVkNAqCjeFEbdL0J XgTBr+I2YVS8JhzQKLbwCtIygb3+VssjYu9CIAiEKXGlgFjDmekdyl0yJlEQjc8Urx/O 3F5w== X-Gm-Message-State: ALoCoQk94KEjGtFgLg10x7M9p/BFvkXjaN6+JE/Jf68PO392PijamSwtAIdk06kjJ9nBb7h6jGvJ X-Received: by 10.180.80.7 with SMTP id n7mr383057wix.0.1422737487966; Sat, 31 Jan 2015 12:51:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.136 with SMTP id k8ls537844lak.21.gmail; Sat, 31 Jan 2015 12:51:27 -0800 (PST) X-Received: by 10.112.125.41 with SMTP id mn9mr12303047lbb.80.1422737487803; Sat, 31 Jan 2015 12:51:27 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id yd10si13058303lbb.131.2015.01.31.12.51.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 31 Jan 2015 12:51:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id ms9so30592990lab.1 for ; Sat, 31 Jan 2015 12:51:27 -0800 (PST) X-Received: by 10.152.5.226 with SMTP id v2mr12432055lav.34.1422737487386; Sat, 31 Jan 2015 12:51:27 -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 h5csp450304lbj; Sat, 31 Jan 2015 12:51:26 -0800 (PST) X-Received: by 10.224.19.137 with SMTP id a9mr26047036qab.83.1422737486160; Sat, 31 Jan 2015 12:51:26 -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 48si19168719qgn.122.2015.01.31.12.51.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 31 Jan 2015 12:51:26 -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 1YHf0k-0000vj-SB; Sat, 31 Jan 2015 20:51:22 +0000 Received: from mail-oi0-f49.google.com ([209.85.218.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YHf0T-0000u0-SO for lng-odp@lists.linaro.org; Sat, 31 Jan 2015 20:51:05 +0000 Received: by mail-oi0-f49.google.com with SMTP id a3so39303997oib.8 for ; Sat, 31 Jan 2015 12:51:00 -0800 (PST) X-Received: by 10.202.73.141 with SMTP id w135mr7232883oia.37.1422737460662; Sat, 31 Jan 2015 12:51:00 -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 uv10sm7202439obc.27.2015.01.31.12.50.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 31 Jan 2015 12:51:00 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sat, 31 Jan 2015 14:50:44 -0600 Message-Id: <1422737449-11540-5-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422737449-11540-1-git-send-email-bill.fischofer@linaro.org> References: <1422737449-11540-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 4/9] linux-generic: events: 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.215.42 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 --- include/odp/api/event.h | 12 ++++++++++++ platform/linux-generic/include/odp/plat/event_types.h | 14 ++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/odp/api/event.h b/include/odp/api/event.h index 50c031a..6b60b83 100644 --- a/include/odp/api/event.h +++ b/include/odp/api/event.h @@ -69,6 +69,18 @@ extern "C" { */ int odp_event_type(odp_event_t event); +/** + * Get printable value for an odp_event_t + * + * @param hdl odp_event_t handle to be printed + * @return uint64_t value that can be used to print/display this + * handle + * + * @note This routine is intended to be used for diagnostic purposes + * to enable applications to generate a printable value that represents + * an odp_event_t handle. + */ +uint64_t odp_event_t_print(odp_event_t hdl); /** * @} diff --git a/platform/linux-generic/include/odp/plat/event_types.h b/platform/linux-generic/include/odp/plat/event_types.h index 4a0756b..84d8e08 100644 --- a/platform/linux-generic/include/odp/plat/event_types.h +++ b/platform/linux-generic/include/odp/plat/event_types.h @@ -18,17 +18,17 @@ extern "C" { #endif - -#include +#include +#include /** @defgroup odp_event ODP EVENT * Operations on an event. * @{ */ -typedef odp_buffer_t odp_event_t; +typedef odp_handle_t odp_event_t; -#define ODP_EVENT_INVALID ODP_BUFFER_INVALID +#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff) #define ODP_EVENT_TYPE_INVALID (-1) #define ODP_EVENT_BUFFER 1 @@ -36,6 +36,12 @@ typedef odp_buffer_t odp_event_t; #define ODP_EVENT_TIMEOUT 3 #define ODP_EVENT_CRYPTO_COMPL 4 +/** Get printable format of odp_event_t */ +static inline uint64_t odp_event_t_print(odp_event_t hdl) +{ + return _odp_pri(hdl); +} + /** * @} */