From patchwork Wed Jul 1 17:06:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 50534 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 665D7214B3 for ; Wed, 1 Jul 2015 17:09:32 +0000 (UTC) Received: by wgfk9 with SMTP id k9sf14610747wgf.1 for ; Wed, 01 Jul 2015 10:09:31 -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: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=mhI5C9n/zy227VyiH41bRTHzogmb0bcG7YhV+R8r4Lw=; b=FXMnUunfsIaRJnBmBKPo1K8WK0UBeoD+RKCPrQLwMyB3+wgzCFFFUwXASASPVJgsxd Sxw7kuuf7wnxra/0gEXD3bQWDu9chpPdh4EK6X7sZV1TAVddGyj308AogIHQbNTl+Yy8 ja793NakhQ1Xfjw0bvZQnEv7hPJ5qVrP1adSbuSW8m0RNb7ryRQunRHZvhn+EK5Sa59p DDS0vSsQ2OXx8XwkLDyMbc/AjtOTM8ysYMIWpwFUBfce0g2QsftLpB0I2Gl5sxI0rw22 Fr+8UBtatB2NEDggNHTxzp/LkLJb/1FzPTJQDOqGPbhyMAFcpPUS7KsHpSUY5gds/VVU 7o3A== X-Gm-Message-State: ALoCoQmAawoK0UG8wdHQkq5OX618OSsurLpSY6IXf+d7U7Et3IQow+tHXH5KhLblx7bPSILroKLy X-Received: by 10.181.5.7 with SMTP id ci7mr2903764wid.1.1435770571636; Wed, 01 Jul 2015 10:09:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.36 with SMTP id g4ls243252lah.33.gmail; Wed, 01 Jul 2015 10:09:31 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr26879231lbb.56.1435770571466; Wed, 01 Jul 2015 10:09:31 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id cy4si2220589lac.57.2015.07.01.10.09.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jul 2015 10:09:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcui10 with SMTP id ui10so16865736lbc.0 for ; Wed, 01 Jul 2015 10:09:31 -0700 (PDT) X-Received: by 10.152.7.7 with SMTP id f7mr26551477laa.106.1435770571328; Wed, 01 Jul 2015 10:09:31 -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.108.230 with SMTP id hn6csp743510lbb; Wed, 1 Jul 2015 10:09:30 -0700 (PDT) X-Received: by 10.140.90.99 with SMTP id w90mr34888059qgd.57.1435770570033; Wed, 01 Jul 2015 10:09:30 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 192si2998720qhv.0.2015.07.01.10.09.27; Wed, 01 Jul 2015 10:09:30 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 3CB4261F44; Wed, 1 Jul 2015 17:09:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8A38561F64; Wed, 1 Jul 2015 17:07:27 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B0E1D61F67; Wed, 1 Jul 2015 17:07:23 +0000 (UTC) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by lists.linaro.org (Postfix) with ESMTPS id 751AE61F52 for ; Wed, 1 Jul 2015 17:06:41 +0000 (UTC) Received: by wgjx7 with SMTP id x7so42247940wgj.2 for ; Wed, 01 Jul 2015 10:06:40 -0700 (PDT) X-Received: by 10.194.90.171 with SMTP id bx11mr3214952wjb.129.1435770400638; Wed, 01 Jul 2015 10:06:40 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id fi6sm4335895wib.6.2015.07.01.10.06.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jul 2015 10:06:39 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 1 Jul 2015 18:06:15 +0100 Message-Id: <1435770379-30000-6-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435770379-30000-1-git-send-email-zoltan.kiss@linaro.org> References: <1435770379-30000-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Cc: Petri Savolainen Subject: [lng-odp] [API-NEXT PATCH v4 5/9] event: implement odp_event_free() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zoltan.kiss@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.171 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: Zoltan Kiss --- platform/linux-generic/odp_event.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index d9e86a9..c50103c 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -6,11 +6,35 @@ #include #include +#include +#include +#include #include #include #include +#include int odp_event_type(odp_event_t event) { return _odp_buffer_event_type(odp_buffer_from_event(event)); } + +void odp_event_free(odp_event_t event) +{ + switch (odp_event_type(event)) { + case ODP_EVENT_BUFFER: + odp_buffer_free(odp_buffer_from_event(event)); + break; + case ODP_EVENT_PACKET: + odp_packet_free(odp_packet_from_event(event)); + break; + case ODP_EVENT_TIMEOUT: + odp_timeout_free(odp_timeout_from_event(event)); + break; + case ODP_EVENT_CRYPTO_COMPL: + odp_crypto_compl_free(odp_crypto_compl_from_event(event)); + break; + default: + ODP_ABORT("Invalid event type: %d\n", odp_event_type(event)); + } +}