From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::243; helo=mail-it0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 150F0220C1C3C for ; Thu, 30 Nov 2017 06:20:00 -0800 (PST) Received: by mail-it0-x243.google.com with SMTP id u62so8494336ita.2 for ; Thu, 30 Nov 2017 06:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bsh2ruKj+Y1vcmi/VSvL2kciFUc2IMLnLABD53vPpW0=; b=BA4hbNGL5PboqAq2GHcZRFR8zkDIwyAsTYHdCvaktBBgQCnOdka5e3ilmC7OUIGpSI bP7hPH33YxSBjsuFr2xf9dCilAk1ZaxmYOnTC8xmTTlZ1lsZWdyATadgz8gAF977Ky8d BTwsTWj/iU4N0CnwK6w1tIlwecUwDm1NWKtBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bsh2ruKj+Y1vcmi/VSvL2kciFUc2IMLnLABD53vPpW0=; b=O1ri8DfwSPFUhpu1OK0GEUzLCJZCDDGbEDjcJn58R+/ynp2NCXv0NOuGqi6DsZAcZ3 ZrX24pjLEsfueegEC06v99JU7Y0u5+QaRR9bSWuCbR8kCTS8qR3wMH5f6Alerfpe8IV8 HSEKud/lLAx72r4M4elrzKJTyZe1gExYLAwXKiCLYY1w8q8g5aLBh5f1rYDGP8BngRUy n2CADIfbDEA2o9ICKQ0yLOphQMuRGris2iBH0CwIDu/2bQItu73FynndpGJnud3uvsDz ycW7urOnSv/uJROEpmFYB4/AemwNEZMlL4IfNzdP0KRAzZA+wb/FsPzUKRoqFNr2mD+1 OkOA== X-Gm-Message-State: AJaThX69YfKGHqqEVccFfxd1T8VqI6mB2bA4RLVi7g6yJIU+0i9l2g0H yC8aExSQLKB7oWWCQZHJQx9zOMG3JIQs2sGc/a997Q== X-Google-Smtp-Source: AGs4zMbYxDp0xfKzR2eSqlehhPiGC76rBgy76654lBwwSyMfdawitCvh7ZgaAmQihYG9ANTYBmI3t4lDTfM/BsiBt9Q= X-Received: by 10.36.78.212 with SMTP id r203mr3320994ita.58.1512051864891; Thu, 30 Nov 2017 06:24:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.16 with HTTP; Thu, 30 Nov 2017 06:24:24 -0800 (PST) In-Reply-To: <20171130142257.28140-1-leif.lindholm@linaro.org> References: <20171130142257.28140-1-leif.lindholm@linaro.org> From: Ard Biesheuvel Date: Thu, 30 Nov 2017 14:24:24 +0000 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" Subject: Re: [PATCH v2] Omap35xxPkg: add GetTimeInNanoSecond implementation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Nov 2017 14:20:00 -0000 Content-Type: text/plain; charset="UTF-8" On 30 November 2017 at 14:22, Leif Lindholm wrote: > Commit a63be426f8e3 ("ArmPlatformPkg: Store initial timer value") caused > BeagleBoard to stop building, due to Omap35xxTimerLib lacking an > implementation of GetTimeInNanoSecond (). So add one. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Leif Lindholm > --- > Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c b/Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c > index 652c47b6f6..a6f79ddd57 100644 > --- a/Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c > +++ b/Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c > @@ -131,3 +131,27 @@ GetPerformanceCounterProperties ( > > return PcdGet64(PcdEmbeddedPerformanceCounterFrequencyInHz); > } > + > +/** > + Converts elapsed ticks of performance counter to time in nanoseconds. > + > + This function converts the elapsed ticks of running performance counter to > + time value in unit of nanoseconds. > + > + @param Ticks The number of elapsed ticks of running performance counter. > + > + @return The elapsed time in nanoseconds. > + > +**/ > +UINT64 > +EFIAPI > +GetTimeInNanoSecond ( > + IN UINT64 Ticks > + ) > +{ > + UINT32 Period; > + > + Period = PcdGet32 (PcdEmbeddedPerformanceCounterPeriodInNanoseconds); > + > + return (Ticks * Period); > +} > -- > 2.11.0 > Reviewed-by: Ard Biesheuvel