From patchwork Fri Jun 5 11:53:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 49564 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 D2F392154F for ; Fri, 5 Jun 2015 11:56:12 +0000 (UTC) Received: by wibut5 with SMTP id ut5sf4398569wib.0 for ; Fri, 05 Jun 2015 04:56:12 -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: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=/1se+NNqPlKAoNXEDy9IBLK9q7kgwNgaICFLkMQsf/U=; b=QxNdOha/a9Jgfc9UeOzygFq34xaOB8zGAdnHzYQKIkXYf27qhFQ/f+C/viy4JbYbeT YoglZ8ZodIiuyRMBnMBlxS7WyUT9s3V0HarsWUWug2bhWr+DFYjA45X8BW23TiJlkLrd NWNjCOUdEWYB9+97DzM1TdZpT206OYyKpRDmLzeHMFj40XIDm0JEm6ikQ7HHYlplqy+V WcH0hqo2Mwg+1mSswX2p8pO30F+fmoiFlCNvrx3V2/6pPwLE6Hc5HcRPcaRU1MKGl6gr dFr9cRdn0q7a1WrUNJkGlBP0iMmXx5u1pRwHxieBDVp/Et4Wa/+uJ1B0CGBcYeVwb85K 4V8Q== X-Gm-Message-State: ALoCoQlECaI3SQrFAJ2rYwRqtArnNAYbDVxsHZHFWNjzwrTW0Jx90ybOg7CYqfM/3bW6ESIC5sNJ X-Received: by 10.112.42.236 with SMTP id r12mr2961916lbl.2.1433505372153; Fri, 05 Jun 2015 04:56:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.230 with SMTP id y6ls388315lae.20.gmail; Fri, 05 Jun 2015 04:56:12 -0700 (PDT) X-Received: by 10.152.121.99 with SMTP id lj3mr902589lab.37.1433505372010; Fri, 05 Jun 2015 04:56:12 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id b1si4627843laf.78.2015.06.05.04.56.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 04:56:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcue7 with SMTP id ue7so44536489lbc.0 for ; Fri, 05 Jun 2015 04:56:11 -0700 (PDT) X-Received: by 10.152.29.161 with SMTP id l1mr3021724lah.76.1433505371915; Fri, 05 Jun 2015 04:56:11 -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 hn6csp1368835lbb; Fri, 5 Jun 2015 04:56:11 -0700 (PDT) X-Received: by 10.55.26.86 with SMTP id a83mr5751150qka.83.1433505370337; Fri, 05 Jun 2015 04:56:10 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 23si7251340qhy.21.2015.06.05.04.56.06; Fri, 05 Jun 2015 04:56:10 -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 B08C061FF0; Fri, 5 Jun 2015 11:56:06 +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 3002E62032; Fri, 5 Jun 2015 11:54:45 +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 4B2A561FF0; Fri, 5 Jun 2015 11:54:40 +0000 (UTC) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by lists.linaro.org (Postfix) with ESMTPS id 9107F61F88 for ; Fri, 5 Jun 2015 11:54:18 +0000 (UTC) Received: by wgbgq6 with SMTP id gq6so54933590wgb.3 for ; Fri, 05 Jun 2015 04:54:17 -0700 (PDT) X-Received: by 10.180.13.5 with SMTP id d5mr47002012wic.65.1433505257811; Fri, 05 Jun 2015 04:54:17 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id b20sm10268741wjb.46.2015.06.05.04.54.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 04:54:17 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 5 Jun 2015 12:53:47 +0100 Message-Id: <1433505231-28843-6-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433505231-28843-1-git-send-email-zoltan.kiss@linaro.org> References: <1433505231-28843-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v2 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.175 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 17f4f43..e93dfca 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -6,8 +6,12 @@ #include #include +#include +#include +#include #include #include +#include int odp_event_type(odp_event_t event) { @@ -17,3 +21,23 @@ int odp_event_type(odp_event_t event) return _odp_buffer_type(buf); } + +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)); + } +}