From patchwork Tue Mar 10 15:31:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 45590 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2DB8F214BF for ; Tue, 10 Mar 2015 15:32:23 +0000 (UTC) Received: by wesu56 with SMTP id u56sf2052822wes.2 for ; Tue, 10 Mar 2015 08:32:22 -0700 (PDT) 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:cc: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=7qSGEgPRCkpR8OUaBPM+aFidlyfekPlyrHTy3QCMGCU=; b=TccimsRFf2t+jY//msCuzwenysAZ+HHsyBq92EAbAnC0g1ODv0+ceiJkjtO42lLrcy NtN3JC4ja+SJD5uL/OmQi3G0EJ0dNnYRUcwg5MZdpLFrcUarOTR0gcq+akOIjh+V5N8T hLTwrglOGEyk6UisM/jcg4eRReAz62zLNLM+EuR40NVBxjuknrct1/8ZRdcc4Vr1uYg7 XtwXDDQxBAe+HUs0gvTSAl02xuzz/g2cTtbgz+ALHytvrQKYr//e/MiIKsquPWE9oLqD 8x5wqtjTd9eJVHZB7TOoBGIQOFP2wZ+nLXOcLJhOEzJmQIbOeBjurGaEDHxD8kmqsXOG NfLg== X-Gm-Message-State: ALoCoQkSAUvaBufwZpbCbp/LQTuXghKE4i1aBiOfQAbDMfVUdpLdNGvNSTn/PHbwFiN7sqSRKQzG X-Received: by 10.180.80.132 with SMTP id r4mr1454841wix.4.1426001542511; Tue, 10 Mar 2015 08:32:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.116 with SMTP id jv20ls41193lab.34.gmail; Tue, 10 Mar 2015 08:32:22 -0700 (PDT) X-Received: by 10.152.5.170 with SMTP id t10mr30750485lat.43.1426001542197; Tue, 10 Mar 2015 08:32:22 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id cj9si491956lbd.155.2015.03.10.08.32.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 08:32:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbiw7 with SMTP id w7so2564774lbi.7 for ; Tue, 10 Mar 2015 08:32:22 -0700 (PDT) X-Received: by 10.112.64.193 with SMTP id q1mr31016515lbs.88.1426001542094; Tue, 10 Mar 2015 08:32:22 -0700 (PDT) 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 h5csp2206910lbj; Tue, 10 Mar 2015 08:32:21 -0700 (PDT) X-Received: by 10.141.23.208 with SMTP id z199mr43269322qhd.27.1426001540887; Tue, 10 Mar 2015 08:32:20 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id c65si769354qge.65.2015.03.10.08.32.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Mar 2015 08:32:20 -0700 (PDT) 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 1YVM8m-0003wJ-O0; Tue, 10 Mar 2015 15:32:16 +0000 Received: from mail-lb0-f182.google.com ([209.85.217.182]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YVM86-0003pH-8j for lng-odp@lists.linaro.org; Tue, 10 Mar 2015 15:31:34 +0000 Received: by lbvp9 with SMTP id p9so2552818lbv.8 for ; Tue, 10 Mar 2015 08:31:28 -0700 (PDT) X-Received: by 10.152.178.197 with SMTP id da5mr31754783lac.56.1426001488717; Tue, 10 Mar 2015 08:31:28 -0700 (PDT) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id a2sm106609lbm.32.2015.03.10.08.31.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 08:31:28 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Tue, 10 Mar 2015 17:31:07 +0200 Message-Id: <1426001473-14618-10-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426001473-14618-1-git-send-email-taras.kondratiuk@linaro.org> References: <1426001473-14618-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Cc: Taras Kondratiuk Subject: [lng-odp] [KEYSTONE2 PATCH 09/15] linux-ks2: event: add headers 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: taras.kondratiuk@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.173 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: Taras Kondratiuk Signed-off-by: Taras Kondratiuk --- platform/linux-keystone2/Makefile.am | 4 +- platform/linux-keystone2/include/odp/event.h | 67 ++++++++++++++++++++++ .../linux-keystone2/include/odp/plat/event_types.h | 44 ++++++++++++++ 3 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 platform/linux-keystone2/include/odp/event.h create mode 100644 platform/linux-keystone2/include/odp/plat/event_types.h diff --git a/platform/linux-keystone2/Makefile.am b/platform/linux-keystone2/Makefile.am index 296062b..69dd247 100644 --- a/platform/linux-keystone2/Makefile.am +++ b/platform/linux-keystone2/Makefile.am @@ -25,6 +25,7 @@ odpinclude_HEADERS = \ $(srcdir)/include/odp/buffer.h \ $(srcdir)/include/odp/buffer_pool.h \ $(srcdir)/include/odp/crypto.h \ + $(srcdir)/include/odp/event.h \ $(srcdir)/include/odp/packet_io.h \ $(srcdir)/include/odp/packet.h \ $(linux_generic_srcdir)/include/odp/align.h \ @@ -37,7 +38,6 @@ odpinclude_HEADERS = \ $(linux_generic_srcdir)/include/odp/cpumask.h \ $(linux_generic_srcdir)/include/odp/debug.h \ $(linux_generic_srcdir)/include/odp/errno.h \ - $(linux_generic_srcdir)/include/odp/event.h \ $(linux_generic_srcdir)/include/odp/hints.h \ $(linux_generic_srcdir)/include/odp/init.h \ $(linux_generic_srcdir)/include/odp/random.h \ @@ -60,6 +60,7 @@ odpplatincludedir = $(includedir)/odp/plat odpplatinclude_HEADERS = \ $(srcdir)/include/odp/plat/align.h \ $(srcdir)/include/odp/plat/debug.h \ + $(srcdir)/include/odp/plat/event_types.h \ $(srcdir)/include/odp/plat/mcsdk_tune.h \ $(srcdir)/include/odp/plat/osal.h \ $(srcdir)/include/odp/plat/state.h \ @@ -70,7 +71,6 @@ odpplatinclude_HEADERS = \ $(linux_generic_srcdir)/include/odp/plat/classification_types.h \ $(linux_generic_srcdir)/include/odp/plat/cpumask_types.h \ $(linux_generic_srcdir)/include/odp/plat/crypto_types.h \ - $(linux_generic_srcdir)/include/odp/plat/event_types.h \ $(linux_generic_srcdir)/include/odp/plat/packet_types.h \ $(linux_generic_srcdir)/include/odp/plat/packet_io_types.h \ $(linux_generic_srcdir)/include/odp/plat/pool_types.h \ diff --git a/platform/linux-keystone2/include/odp/event.h b/platform/linux-keystone2/include/odp/event.h new file mode 100644 index 0000000..1233e92 --- /dev/null +++ b/platform/linux-keystone2/include/odp/event.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP event + */ + +#ifndef ODP_EVENT_H_ +#define ODP_EVENT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** + * @internal Convert ODP event to CPPI descriptor + * + * @param ev Event handle + * + * @return CPPI descriptor + */ +static inline Cppi_HostDesc *_odp_ev_to_cppi_desc(odp_event_t ev) +{ + return (Cppi_HostDesc *)(uintptr_t)ev; +} + +/** + * @internal Convert CPPI descriptor to ODP event + * + * @param desc CPPI descriptor pointer + * + * @return ODP event handle + */ +static inline odp_event_t _cppi_desc_to_odp_ev(Cppi_HostDesc *desc) +{ + return (odp_event_t)desc; +} + +/** @ingroup odp_event + * @{ + */ + +static inline int odp_event_type(odp_event_t ev) +{ + Cppi_HostDesc *desc = _odp_ev_to_cppi_desc(ev); + return _cppi_desc_pkt_type(desc); +} + +/** + * @} + */ + +#include + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-keystone2/include/odp/plat/event_types.h b/platform/linux-keystone2/include/odp/plat/event_types.h new file mode 100644 index 0000000..b14456a --- /dev/null +++ b/platform/linux-keystone2/include/odp/plat/event_types.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP event types + */ + +#ifndef ODP_PLAT_EVENT_TYPES_H_ +#define ODP_PLAT_EVENT_TYPES_H_ + +#include +#include + +/** @defgroup odp_event ODP EVENT + * Operations on an event. + * @{ + */ + +typedef odp_handle_t odp_event_t; + +#define ODP_EVENT_INVALID ((odp_event_t)0) + +#define ODP_EVENT_BUFFER 1 +#define ODP_EVENT_PACKET 2 +#define ODP_EVENT_TIMEOUT 3 +#define ODP_EVENT_CRYPTO_COMPL 4 + +/** Get printable format of odp_event_t */ +static inline uint64_t odp_event_to_u64(odp_event_t hdl) +{ + return _odp_pri(hdl); +} + +/** + * @} + */ + +#endif