From patchwork Sat Jan 31 16:14:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 44085 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EEE1C2359E for ; Sat, 31 Jan 2015 16:15:05 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf7770628wid.3 for ; Sat, 31 Jan 2015 08:15:05 -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=UTGvjxs/P7De3GFkLuZcme/B+ExJzZhs5u0ok9YKZSspdilsuSMdguzNHZSs9C3ae1 AmLw/enkCnO7KQgBHGRXlwCpS04Sb3d2aakpWJOuiLrCziEr5HmcvgayC8Su0bKHQaku wKEuZfgFYAmILyN2i5HBTx194CIVGTw0/hhjv1EkMuMDXB5Zjo60JgLwHe07qP4irnX2 /8DO+YH3RJWO0QSAWkElx/h2lWjYoTH+ioqCXOvFHuiRvCbL9C+mbM4wt85U5kbBues7 DjpH9FMHFnI3cbjhBuuwlel6Sz7LKRzYKHjj1ICi4JSk8BaBCBp3mQCLfF8z25QbS4wm AGVA== X-Gm-Message-State: ALoCoQmPUSIWTV3Uo1zH78IHvbXW9qtBW9KFjjlwbQZX8d0enTFlAnsJ59k9r5/MBWHGhho3+nCt X-Received: by 10.180.81.131 with SMTP id a3mr280729wiy.1.1422720905279; Sat, 31 Jan 2015 08:15:05 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.49 with SMTP id o17ls542256laa.24.gmail; Sat, 31 Jan 2015 08:15:05 -0800 (PST) X-Received: by 10.152.234.230 with SMTP id uh6mr11103837lac.97.1422720904989; Sat, 31 Jan 2015 08:15:04 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id a4si12637062lbb.73.2015.01.31.08.15.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 31 Jan 2015 08:15:04 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gd6so29488958lab.4 for ; Sat, 31 Jan 2015 08:15:04 -0800 (PST) X-Received: by 10.152.3.70 with SMTP id a6mr11519281laa.71.1422720904904; Sat, 31 Jan 2015 08:15:04 -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 h5csp351922lbj; Sat, 31 Jan 2015 08:15:04 -0800 (PST) X-Received: by 10.140.34.67 with SMTP id k61mr22552524qgk.95.1422720903643; Sat, 31 Jan 2015 08:15:03 -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 32si18347957qgt.46.2015.01.31.08.15.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 31 Jan 2015 08:15:03 -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 1YHahI-000579-DT; Sat, 31 Jan 2015 16:15:00 +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 1YHah2-00055g-8O for lng-odp@lists.linaro.org; Sat, 31 Jan 2015 16:14:44 +0000 Received: by mail-oi0-f51.google.com with SMTP id x69so38922394oia.10 for ; Sat, 31 Jan 2015 08:14:38 -0800 (PST) X-Received: by 10.202.178.131 with SMTP id b125mr6653296oif.80.1422720878924; Sat, 31 Jan 2015 08:14:38 -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 ur1sm6921411obc.3.2015.01.31.08.14.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 31 Jan 2015 08:14:38 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sat, 31 Jan 2015 10:14:21 -0600 Message-Id: <1422720866-22194-5-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422720866-22194-1-git-send-email-bill.fischofer@linaro.org> References: <1422720866-22194-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 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.45 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); +} + /** * @} */