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 B7FB1220C1C3A for ; Thu, 30 Nov 2017 06:12:33 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id 9so13270539wme.4 for ; Thu, 30 Nov 2017 06:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yJ+HXUzZmSdtBY3j3OLP73B98I0pkr05qHskEzZmeEM=; b=iZ9JUhMVOHKbY5RmZlDB+54FWL4urUpQIV4NeEwC9PR++f2F82Tx0TJm+1G3GBycXc v0b5Nj8C9/vVeMiFAuB8HYipjAlIgAe/T8Sti+fmmGNCod3UYMfCGAJGsuPSWr/rbG0z 2gyfjkZHD1SFeEJ8Tmpg68g2zMgyk77IxMo5U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yJ+HXUzZmSdtBY3j3OLP73B98I0pkr05qHskEzZmeEM=; b=lYBklN6nILaJaraRj0ZS4wQ+NkTy/ia/BT+q2417bjCQG/vktKcq7JqpVZXKcWJ+0p 3k1EDzOrTlkiLNNBFYAvS14eGTs936Ij0ISJZgcXmkrDGNFW94gYru+BBFRQCAjEN29K CFpSXvEiWiy5HuRgiRK7A0Q1GD0FLxIZTZqDwPFOcyi3bjQO0Ui6TEsCNERYnteLvgan FxQdMIS8RtbUpCP+/h7wnK/WdcJ9Q4aPYrD6bqNt3jckr34/pvJfjVppemTsfeZH76px 5mrFXRl7bqkLm8Xaq0d931jg46sen1y+3vwNUZpaTxP0+eSnuex2adEWp60aTdU73Ghk rihg== X-Gm-Message-State: AJaThX7S9jglgNmmBxEDCHxFcoHP/up0wyhDjMTXYX/JstLZ+NHXblTJ jn6FfN6h+Lf+zt95jsuHTRVffg== X-Google-Smtp-Source: AGs4zMYmZs3fAGRtrpQPdWPK8aD7RUiQKQpS+D9JoBxvqeB2FwwoQLmgHfWipA8LmOjqjBfphhucsg== X-Received: by 10.28.238.135 with SMTP id j7mr787499wmi.140.1512051417793; Thu, 30 Nov 2017 06:16:57 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id k5sm5368343wmg.21.2017.11.30.06.16.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Nov 2017 06:16:56 -0800 (PST) Date: Thu, 30 Nov 2017 14:16:54 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" Message-ID: <20171130141654.o435ur6vilmhmwq4@bivouac.eciton.net> References: <20171130140709.16418-1-leif.lindholm@linaro.org> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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:12:34 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 30, 2017 at 02:09:33PM +0000, Ard Biesheuvel wrote: > 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? *Goes to grab coffee* v2 coming up. / Leif