From patchwork Thu Nov 30 14:22:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 120207 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp729975qgn; Thu, 30 Nov 2017 06:23:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMbrC0paIxrbpZc9P7VkCijljHbqksYFQgj2loQ14P6J2yigHvS6xHYemx3zJ21IwJSYSvKV X-Received: by 10.98.103.93 with SMTP id b90mr6894433pfc.134.1512051783752; Thu, 30 Nov 2017 06:23:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512051783; cv=none; d=google.com; s=arc-20160816; b=TsjCAXBQheKKGCjceK8ms1M/KSqM5pM2kMcY+18T/MZg8B3K3bkIVk8AvI0dKjr7+m If3slzCteDCobCGheWYOwI9sJQVsMH8grm0TWyHsqBksOMENzlm6KB1VrXcaQte87bkZ 6TtsthVlwRUkjCRP0zHEaaNi7GKVgvrJFNviQIXFuK0Xrx00HyHw57khDFN7NY5LV8LQ RRuHbx5x7HtEvAIRieFl+VHXNTL0icH1JpDztqZ1AViBAvJHzxXlJSV2fa56R8S7PHta uqR0esEUgZ13bh+KkgEY29Wvfkykb08rKZSUnmb/P/nl2+mPIj3zMF+TVqcMjzUE2dB1 NT6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=q/6pxDHjp4ZjSL7a1i8S1UDpvpnOUXt3bz2uiHF1DqI=; b=PRawmDy7cyKwojvuF3i7yjUfFKnC7ZYwZmZGz/KSPCFyoL+hcrL4eDBKYSz3F35Tvk 08mfWjZgC5+jIPKY/eS4Sru/yfiD/v0nG5PEVWN2TOAro9EEI0rmsVRL1sCjioGToA6O SFuRl5+bwZlrqcxdyI3Wtt1nMGxcLJohyI6X5nO9AejTxRaLnryvkQXmwW4b8MA0v96U uhTIfl4W94t5CXnrjwWoaWut4+S5yFUgijt4q+ddTSX4sd/PJ4MB+I0RxkPI+AuO6xBq D41zpVJvUsGEl61lIBMPNdP/1BN0RDeMiW9ILrPuaPjz1A5NvzMwG2ICig1Zd+mpx88L 2cvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=i4/89IcQ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id 71si3228033plf.612.2017.11.30.06.23.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 06:23:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=i4/89IcQ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C2F1F220C1C4C; Thu, 30 Nov 2017 06:18:37 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (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 0F0E6220C1C3C for ; Thu, 30 Nov 2017 06:18:35 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id 64so12678908wme.3 for ; Thu, 30 Nov 2017 06:23:01 -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=xXM33O6oOz8BEPM5hhGQFTT9YrF4Iuq/LT/UKT64eX4=; b=i4/89IcQBTgCxplk+E4CeKbudhlUZD23s5WMBg3AM1cITljtBtFZ4NOjgR+GXiCH7K rVEePPvmvSGLYL4MHKRn7ci0ffgxCY+pBxv+syOiEnaeIoFEWC20qMsYFMA5JM9diDLP SQzJTowejQuzbcppwi7aXBWdHIl16AKElQjcY= 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=xXM33O6oOz8BEPM5hhGQFTT9YrF4Iuq/LT/UKT64eX4=; b=RA6F1Fhh279NTZTQZbVe1g7nob+SpaNM10b88V8LuJChJUFDc8JVWDIXPfhrLFJJZX i1bwyS58OhQXZRt77Qiad9O9ZdXjDs0wF7DqJi/dxK0p4VdftfoJ7ACxkVjTnzsWOljZ OBD60NKuUslg/ucgQdI14CQ/AyDDT/GwLEd5FB5vIYpl67mxlpf+nYs1rqMNoEn6P+Tb eJTH6DVgVYN0jqjWK6Etj3pjKY6U5V6Lk3WLe6npu5RpXg2ndsA2JF/pjZuZ1DonXu1+ 7CWupxgLdxVMT6/pk0MWE/X5Zh4PL+x6odOQpN+8SyaksTCBvFrBAXXbDvZWW35XWUGk bGQg== X-Gm-Message-State: AJaThX5IU2fBk2tS+h5dDUD2+Q1jviboA8AzHEw0vY1gdz3SOGbk6iiK +zm33+9VULoCxjpU6RyiyFnP96kuAZQ= X-Received: by 10.28.73.196 with SMTP id w187mr728964wma.17.1512051779490; Thu, 30 Nov 2017 06:22:59 -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 138sm5309937wmf.21.2017.11.30.06.22.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 06:22:58 -0800 (PST) From: Leif Lindholm To: edk2-devel@lists.01.org Date: Thu, 30 Nov 2017 14:22:57 +0000 Message-Id: <20171130142257.28140-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [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: , Cc: ard.biesheuvel@linaro.org MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Ard Biesheuvel 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); +}