[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdRxpSYJE17bjGvRAjCq5vjf23L=HT5oA6OhPSCzJJ0FA@mail.gmail.com>
Date: Mon, 18 Jun 2018 11:42:30 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: pasha.tatashin@...cle.com
Cc: steven.sistare@...cle.com, daniel.m.jordan@...cle.com,
linux@...linux.org.uk, schwidefsky@...ibm.com,
heiko.carstens@...ibm.com, john.stultz@...aro.org,
sboyd@...eaurora.org, x86@...nel.org, linux-kernel@...r.kernel.org,
mingo@...hat.com, tglx@...utronix.de, hpa@...or.com,
douly.fnst@...fujitsu.com, peterz@...radead.org, prarit@...hat.com,
feng.tang@...el.com, pmladek@...e.com, gnomes@...rguk.ukuu.org.uk
Subject: Re: [PATCH v10 3/7] x86/time: read_boot_clock64() implementation
On Fri, Jun 15, 2018 at 8:48 PM Pavel Tatashin
<pasha.tatashin@...cle.com> wrote:
>
> read_boot_clock64() returns time of when system was started. Now, that
> early boot clock is going to be available on x86 it is possible to
> implement x86 specific version of read_boot_clock64() that takes advantage
> of this new feature.
> +void __init read_boot_clock64(struct timespec64 *now, struct timespec64 *ts)
> +{
> + u64 ns_boot = sched_clock_cpu(smp_processor_id());
> + bool valid_clock;
> + u64 ns_now;
> +
> + ns_now = timespec64_to_ns(now);
> + valid_clock = ns_boot && timespec64_valid_strict(now) &&
> + (ns_now > ns_boot);
> +
> + if (!valid_clock)
> + *ts = (struct timespec64){0, 0};
> + else
> + *ts = ns_to_timespec64(ns_now - ns_boot);
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists