public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH 1/2] Omap35xxPkg: add GetTimeInNanoSecond implementation
Date: Thu, 30 Nov 2017 14:09:33 +0000	[thread overview]
Message-ID: <CAKv+Gu9JQG5rxDk0JqyYx944-ab8NLHSENavoHdT5Mm2Nj6QRA@mail.gmail.com> (raw)
In-Reply-To: <20171130140709.16418-1-leif.lindholm@linaro.org>

On 30 November 2017 at 14:07, Leif Lindholm <leif.lindholm@linaro.org> 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 <leif.lindholm@linaro.org>
> ---
>  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
>


  parent reply	other threads:[~2017-11-30 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 14:07 [PATCH 1/2] Omap35xxPkg: add GetTimeInNanoSecond implementation Leif Lindholm
2017-11-30 14:07 ` [PATCH 2/2] BeagleBoardPkg: add CapsuleLib resolution Leif Lindholm
2017-11-30 14:09   ` Ard Biesheuvel
2017-11-30 14:09 ` Ard Biesheuvel [this message]
2017-11-30 14:16   ` [PATCH 1/2] Omap35xxPkg: add GetTimeInNanoSecond implementation Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKv+Gu9JQG5rxDk0JqyYx944-ab8NLHSENavoHdT5Mm2Nj6QRA@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox