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 86643220C1C5B for ; Thu, 30 Nov 2017 06:05:09 -0800 (PST) Received: by mail-it0-x243.google.com with SMTP id z6so8394130iti.4 for ; Thu, 30 Nov 2017 06:09:34 -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=mSGSdRRIH+FBzJ/DfdrkSLM0Sz13hfKDlEoNeEbjJzs=; b=EN3QUaAT5AUWk3+HHHLEMpyA2KD0Bbdx8IXM1s7/wG278WJk4DAH/djRzsKAYPD/1I UAeiyUv+W9EUYMefFSR1fCA1z50fwTKKTnd3E7XYQO5SO4tUO31Ywf/AdjlPrz0p1btU MKbhIbb+FHJ9+kSqR0PM0EzkKi+W31DBhjbCo= 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=mSGSdRRIH+FBzJ/DfdrkSLM0Sz13hfKDlEoNeEbjJzs=; b=NenvWHs4VRJb6Vxa1k/S22rPKpL0mjdTjzsyP9N6oYsXa52N0Bv5fWry0WoHsh/ImF DMOXKEDJgPGALBlIZTPZ7BsoeqpfBGZ8oIyL+1m1k8rAxfMbbhFHbYcwYPwtRIJe3Rwx NfK4NY3rmhmrnI7guU/omqfdkZYPo8AF+ydX8eNldqaFHwbmN5auuMD9I8zDWwDRd/+L 0oel5yLGBrMjNp8+1XD9NFykSfaVAOUqS26/i3Ov0nFDeNVCfmAXAWpEsscvAQPjRg3s 3/5rc2HfC+74K/K8BV+vOOxbTWNEmLtpi9FVuZwwUyPOKq50yHRhAdldlRFoTpcVukuA JaAg== X-Gm-Message-State: AJaThX5+lcK2KPHYj2u/rhMuYlL31h0ZkVNUjiV8xOAiM5IwPhAQ3yun wUxCbW9CCTiCa8uojN4VT5EZhcO2PMxGc3OY+Z7y8d5x X-Google-Smtp-Source: AGs4zMbEbl6hL1il7fEHmup/K646XCzOoqopfjwuUpP0zxfOQtwfX55aOPFS0rU6PqQaf/1ZNsHQUII6N8mqHApls54= X-Received: by 10.36.78.212 with SMTP id r203mr3254111ita.58.1512050974131; Thu, 30 Nov 2017 06:09:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.16 with HTTP; Thu, 30 Nov 2017 06:09:33 -0800 (PST) In-Reply-To: <20171130140709.16418-1-leif.lindholm@linaro.org> References: <20171130140709.16418-1-leif.lindholm@linaro.org> From: Ard Biesheuvel Date: Thu, 30 Nov 2017 14:09:33 +0000 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" Subject: Re: [PATCH 1/2] 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:05:09 -0000 Content-Type: text/plain; charset="UTF-8" On 30 November 2017 at 14:07, 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..33b314922b 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 (GetPerformanceCounter () * Period); Shouldn't this use 'Ticks' anywhere? > +} > -- > 2.11.0 >