From patchwork Fri Dec 1 15:00:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 120344 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1255947qgn; Fri, 1 Dec 2017 07:07:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMank4XmTXR1o5BTaH+ROrQ4v6C8yWnHz+Ex8W2ZsTUGYmZbk3PktETEDGqWQNbCIC6WS/fw X-Received: by 10.55.26.160 with SMTP id l32mr8339565qkh.281.1512140842700; Fri, 01 Dec 2017 07:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512140842; cv=none; d=google.com; s=arc-20160816; b=LUDz/swPgP9hDB1ok3IplfmuWcEd81TV4cREQJA+3tAcEap4TaR0+i6kSFyoCYu5wJ HA9i3g3E5Th0pQoZHaGgj4EoIq0EFLJsTuohsBgwawIT6ky8UuFJr7TBDZ5etvB7AA/Z FGCozqait85TLv+62bEEYwSPq3iouFIv2sZRV05mwNoKvIX3bohJDH9d9D8D3j78ruoa OfYWur0wj5ipNlBRunwFJc7kgLQBKnOYuEIGd2/GjFIFyfR2VSyYosjbm7bH+ottq3mG owQcNy+rLJs8Ur3qwPtimOy7tr3XYWUjbP6rrBTP6jES0ZAZJZehQW+dXi6OE+BMOJ1z B4Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=tf8mp1RdOLF4AATb/02DxOEW3Ewtpez7j+Jyjfp3DrM=; b=YYjVra/8jYijSjsbyAs4XCw74+j/yAtlvynwOlCpv+7hZ1+gr6qUkEx18Ouh4aGTiP sYk9qVtF46Uj6Edliy86rFcYJqXZk1pqcLx+PFQ+YDq8bUBNU13LVRNCB1A0iv5CvTgj se59wvmmh7NYrLk1IbKoxZvZyNF2lv0rWRGi6AjroV7NPCOzbMiPzcziLyCB/aqA7/ku s+RZH8LYiw/H7inwUjTdVbLqZx/d1zyOPcu5DOPBpf3otwobCGvv95y1muPvS1BpcBod 9uSRhCNFULgMZ9HjG8aJOlkr6VwYB/mRlAn/RGQBrN87zqJ4Ut1eIQwuupxO7rSBuodM V/4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id v14si5146765qkl.389.2017.12.01.07.07.22; Fri, 01 Dec 2017 07:07:22 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 6048C60983; Fri, 1 Dec 2017 15:07:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id B6BE2609A6; Fri, 1 Dec 2017 15:01:04 +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 6A65260970; Fri, 1 Dec 2017 15:00:27 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id F2CDE60977 for ; Fri, 1 Dec 2017 15:00:20 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 7DA865102320 for ; Fri, 1 Dec 2017 18:00:19 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QeoKMZKoJ4-0JkKABdl; Fri, 01 Dec 2017 18:00:19 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id I6qrBsStkX-0IeiLRqj; Fri, 01 Dec 2017 18:00:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 1 Dec 2017 18:00:03 +0300 Message-Id: <1512140407-13534-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512140407-13534-1-git-send-email-odpbot@yandex.ru> References: <1512140407-13534-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 318 Subject: [lng-odp] [PATCH API-NEXT v1 8/12] linux-gen: event: implement type multi X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Simple implementation of the new event type multi function. Signed-off-by: Petri Savolainen --- /** Email created from pull request 318 (psavol:next-multi-apis) ** https://github.com/Linaro/odp/pull/318 ** Patch: https://github.com/Linaro/odp/pull/318.patch ** Base sha: bdb7cbf620ada8682c89b5ae5a97cb84f16c0ed0 ** Merge commit sha: aee2bcc574d2a8efdfcecc3b8e681ce391119798 **/ platform/linux-generic/odp_event.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index 2b0a7cddc..1c4ab5c1b 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -37,6 +37,22 @@ odp_event_type_t odp_event_types(odp_event_t event, return _odp_buffer_event_type(buf); } +int odp_event_type_multi(const odp_event_t event[], int num, + odp_event_type_t *type_out) +{ + int i; + odp_event_type_t type = odp_event_type(event[0]); + + for (i = 1; i < num; i++) { + if (odp_event_type(event[i]) != type) + break; + } + + *type_out = type; + + return i; +} + void odp_event_free(odp_event_t event) { switch (odp_event_type(event)) {