From patchwork Fri Nov 24 13:00:05 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: 119578 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp2133838edl; Fri, 24 Nov 2017 05:01:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMa8czmIi//HeWz88ndJ0hls/maRGbTOeKkmvuRPIQbqjUlgx94NsI9xr/TlpMImjtpOo6PT X-Received: by 10.55.212.201 with SMTP id s70mr44647766qks.157.1511528476191; Fri, 24 Nov 2017 05:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511528476; cv=none; d=google.com; s=arc-20160816; b=MuSD2CqWvN0iJfIpKFaB3bUR8UrjIfG6sZTla65LY7HDhyqB/vya/9PisPOS4ZNoBh aE3rouXYklL68tZrRc7ssilvbw9eiVtogHo7DdSY8Ld7MEJ1vQKfs6HoLkYdh/c+ZWDC bJuUVf7coL+Q9y58lpvApBYSWM5hcpnUUng4EcUx8rjTefvbQtHD4Cm7JrpZPH0zaNFY 3l/CUAl7JfDtzWGFxmE8+hAscPb/acK6f54XcwEBjPfxFK47LZ+FgykJqKCPlBGOmnIy JnrG8qv9KCyRLNr7u5+KXoKNjilDsJHKKyCnfye5ZTfqI13h5N4scdK7e4p/yU8NilpR TzvQ== 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=aovs6HiPzGo8qzR64cT8VRRQPCsPqcdDOoH73UM2Tjo=; b=wH673SnqNWGJpXSeeviYpRsP3d8g1DAee8f5IkjXpw7YzUxCg8uL1Swk7gEOtriixY vbb33nDrMYnd2nm5fo4pqzFTC2PNj2DbSDAHSC8h87Iky60iXqu/oCyNBl2MV+UkxUPU WG+l64XP9n79lTqtY/Rc5iVsuCX5wMbeO6xqXkZTf5njlhXAbNiEDj92F5j0xAMqQ13q pzWFI/UVAaHeNa1xC4FyR9rnRNkmx1b8IuZ1d8uegBHTpicTfHGKT9nU1iMTVsiWbAfy z6w54JFrRSkibox9ZC6PBpt+Z2/Epr/TXN3oD+T3pg5tCt07Zb/flmz4Hz+Utj9ibnM+ XE/w== 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 s34si695765qtj.94.2017.11.24.05.01.15; Fri, 24 Nov 2017 05:01:16 -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 A7C1760890; Fri, 24 Nov 2017 13:01:15 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 3C61D60830; Fri, 24 Nov 2017 13:00:30 +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 6F19660816; Fri, 24 Nov 2017 13:00:16 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 905F460726 for ; Fri, 24 Nov 2017 13:00:10 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 191144302356 for ; Fri, 24 Nov 2017 16:00:09 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0bCBBhVLI9-09ViGGRD; Fri, 24 Nov 2017 16:00:09 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id N2PeGhXtlr-08o8GG4s; Fri, 24 Nov 2017 16:00:08 +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, 24 Nov 2017 16:00:05 +0300 Message-Id: <1511528406-25262-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511528406-25262-1-git-send-email-odpbot@yandex.ru> References: <1511528406-25262-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 310 Subject: [lng-odp] [PATCH API-NEXT v1 2/3] linux-gen: time: implement odp_time_diff_ns 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 Implemented the new diff in nsec function. Signed-off-by: Petri Savolainen --- /** Email created from pull request 310 (psavol:next-time-convert) ** https://github.com/Linaro/odp/pull/310 ** Patch: https://github.com/Linaro/odp/pull/310.patch ** Base sha: b95e7d08043ba45d12635c5afaa3fbf3a07ecc90 ** Merge commit sha: 7700d0dab4af4db47973c2a88e5a6d6765bf979e **/ platform/linux-generic/odp_time.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index 0df4682c3..04fedf5fa 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -228,6 +228,15 @@ odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1) return time; } +uint64_t odp_time_diff_ns(odp_time_t t2, odp_time_t t1) +{ + odp_time_t time; + + time.u64 = t2.u64 - t1.u64; + + return time_to_ns(time); +} + uint64_t odp_time_to_ns(odp_time_t time) { return time_to_ns(time);