diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-28 05:28:52 +0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-28 05:29:08 +0400 |
commit | 2697902be89d7f38e9736dfe946cd0e5d4f47b80 (patch) | |
tree | c1588307560a7a4ecd05bc3d1eff8a36bf3b4fe3 /arch/x86/kernel/pvclock.c | |
parent | dce2db0a35197e2f4421245079f19ab753e97348 (diff) | |
download | linux-2697902be89d7f38e9736dfe946cd0e5d4f47b80.tar.xz |
x86: pvclock: introduce helper to read flags
Acked-by: Glauber Costa <glommer@parallels.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kernel/pvclock.c')
-rw-r--r-- | arch/x86/kernel/pvclock.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index a7d90910c61a..c8fb043a8695 100644 --- a/arch/x86/kernel/pvclock.c +++ b/arch/x86/kernel/pvclock.c @@ -45,6 +45,19 @@ void pvclock_resume(void) atomic64_set(&last_value, 0); } +u8 pvclock_read_flags(struct pvclock_vcpu_time_info *src) +{ + unsigned version; + cycle_t ret; + u8 flags; + + do { + version = __pvclock_read_cycles(src, &ret, &flags); + } while ((src->version & 1) || version != src->version); + + return flags & valid_flags; +} + cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) { unsigned version; |