timekeeping; Use ktime based data for ktime_get_update_offsets_tick()
No need to juggle with timespecs. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:
parent
a37c0aad60
commit
48064f5f67
@ -1636,22 +1636,22 @@ ktime_t ktime_get_update_offsets_tick(ktime_t *offs_real, ktime_t *offs_boot,
|
|||||||
ktime_t *offs_tai)
|
ktime_t *offs_tai)
|
||||||
{
|
{
|
||||||
struct timekeeper *tk = &tk_core.timekeeper;
|
struct timekeeper *tk = &tk_core.timekeeper;
|
||||||
struct timespec64 ts;
|
|
||||||
ktime_t now;
|
|
||||||
unsigned int seq;
|
unsigned int seq;
|
||||||
|
ktime_t base;
|
||||||
|
u64 nsecs;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
seq = read_seqcount_begin(&tk_core.seq);
|
seq = read_seqcount_begin(&tk_core.seq);
|
||||||
|
|
||||||
ts = tk_xtime(tk);
|
base = tk->base_mono;
|
||||||
|
nsecs = tk->xtime_nsec >> tk->shift;
|
||||||
|
|
||||||
*offs_real = tk->offs_real;
|
*offs_real = tk->offs_real;
|
||||||
*offs_boot = tk->offs_boot;
|
*offs_boot = tk->offs_boot;
|
||||||
*offs_tai = tk->offs_tai;
|
*offs_tai = tk->offs_tai;
|
||||||
} while (read_seqcount_retry(&tk_core.seq, seq));
|
} while (read_seqcount_retry(&tk_core.seq, seq));
|
||||||
|
|
||||||
now = ktime_set(ts.tv_sec, ts.tv_nsec);
|
return ktime_add_ns(base, nsecs);
|
||||||
now = ktime_sub(now, *offs_real);
|
|
||||||
return now;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_HIGH_RES_TIMERS
|
#ifdef CONFIG_HIGH_RES_TIMERS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user