From mboxrd@z Thu Jan 1 00:00:00 1970 From: Denis Plotnikov Subject: [PATCH v2 08/11] timekeeper: add a couple of the core timekeeper reading helpers Date: Fri, 21 Jul 2017 18:45:15 +0300 Message-ID: <1500651918-14156-9-git-send-email-dplotnikov@virtuozzo.com> References: <1500651918-14156-1-git-send-email-dplotnikov@virtuozzo.com> Cc: pbonzini@redhat.com, den@virtuozzo.com, rkagan@virtuozzo.com To: kvm@vger.kernel.org, rkrcmar@redhat.com Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:14505 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754387AbdGUPpf (ORCPT ); Fri, 21 Jul 2017 11:45:35 -0400 In-Reply-To: <1500651918-14156-1-git-send-email-dplotnikov@virtuozzo.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Denis Plotnikov --- include/linux/timekeeping.h | 3 +++ kernel/time/timekeeping.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index edffe82..092bf5f 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -372,3 +372,6 @@ extern int update_persistent_clock64(struct timespec64 now); #endif + +extern const seqcount_t *get_tk_seq(void); +extern int get_tk_mono_clock_mode(void); diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 1cef214..3f35e52 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -2381,3 +2381,18 @@ void xtime_update(unsigned long ticks) write_sequnlock(&jiffies_lock); update_wall_time(); } + +/* + * Helpers forthe core timekeeper reading + */ +const seqcount_t *get_tk_seq(void) +{ + return &tk_core.seq; +} +EXPORT_SYMBOL(get_tk_seq); + +int get_tk_mono_clock_mode(void) +{ + return tk_core.timekeeper.tkr_mono.clock->archdata.vclock_mode; +} +EXPORT_SYMBOL(get_tk_mono_clock_mode); -- 2.7.4