From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 7F512220C1C4C for ; Thu, 30 Nov 2017 06:02:49 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id n138so2278685wmg.2 for ; Thu, 30 Nov 2017 06:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=f2nGIL17w8+ncsJynlEeOrwBrpnliR7+rIOWZ+rjXNw=; b=PFB0tU9ivcY1WtXr82JmAYiMX3/kD+Us+68Rwr2Bf5T3KudUlpnWKuO31EPWplsk+t T+RQuTuyySuL4UMOYWFUO9qWiO/CT9KIIJ0ZojM7lLkzcVmjqSAxh5dcQbbu3T1FqZ+Q SSHlxCeqrxMGtejC1GMvLMkkS95+Sk8zorTrg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=f2nGIL17w8+ncsJynlEeOrwBrpnliR7+rIOWZ+rjXNw=; b=LFtfaZT0nRzGXxN22tzMmCB21sMYsMBYxM10Jr1t7MoXFogE6nSL9KXRp3Wk6/lSuj yN3XvJqSUdXLWp3Is3j36PFxBuc93DcgK4aEGE7F3HmMrITLjaRasquH5GtXMaUyQtut bibl2FQ8GzHnUC2bKxZAMOn1qDoChmdWENG6rRDf+hv3JOJoMAFjPMTMQo2YX02xp/t7 q9/rbKEoibaegCeL9brLDeI+eDE882bbVh72EJDcVi27fpO8qbE+8QlBS3EbXzSwRRPs 5mg2c0z4zq8lcHfohlmVbqvQPqz4tPZq1K7J9cY+STx6Bm/Ota5uwOQXB1gViXMTooAJ jiFw== X-Gm-Message-State: AJaThX5HgqKf7e9ATYg5TObiRRsfxriKsjwerP6QMXsWWLNxYDBFzTKR cK5h3LCE8AFtCwxHDx8oI3KL3mUVYMQ= X-Google-Smtp-Source: AGs4zMZ6zw3RR+WMbi6E9fTMjwHHDzfkYwPFfml6EQyshu2UjnUvX8oah49lCtfa5YkJqq9UJMhnMQ== X-Received: by 10.28.19.1 with SMTP id 1mr1920632wmt.20.1512050831961; Thu, 30 Nov 2017 06:07:11 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id 90sm8023952wrp.93.2017.11.30.06.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 06:07:10 -0800 (PST) From: Leif Lindholm To: edk2-devel@lists.01.org Cc: ard.biesheuvel@linaro.org Date: Thu, 30 Nov 2017 14:07:08 +0000 Message-Id: <20171130140709.16418-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [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:02:49 -0000 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); +} -- 2.11.0