Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197834
b: refs/heads/master
c: 424c32f
h: refs/heads/master
v: v3
  • Loading branch information
Glauber Costa authored and Avi Kivity committed May 19, 2010
1 parent c51a77d commit 8637885
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b69e8caef5b190af48c525f6d715e7b7728a77f6
refs/heads/master: 424c32f1aa3112632a657d45698c8e7666668f78
3 changes: 2 additions & 1 deletion trunk/arch/x86/include/asm/pvclock-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ struct pvclock_vcpu_time_info {
u64 system_time;
u32 tsc_to_system_mul;
s8 tsc_shift;
u8 pad[3];
u8 flags;
u8 pad[2];
} __attribute__((__packed__)); /* 32 bytes */

struct pvclock_wall_clock {
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/pvclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/* some helper functions for xen and kvm pv clock sources */
cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src);
void pvclock_set_flags(u8 flags);
unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src);
void pvclock_read_wallclock(struct pvclock_wall_clock *wall,
struct pvclock_vcpu_time_info *vcpu,
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/x86/kernel/pvclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ struct pvclock_shadow_time {
u32 tsc_to_nsec_mul;
int tsc_shift;
u32 version;
u8 flags;
};

static u8 valid_flags __read_mostly = 0;

void pvclock_set_flags(u8 flags)
{
valid_flags = flags;
}

/*
* Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
* yielding a 64-bit result.
Expand Down Expand Up @@ -91,6 +99,7 @@ static unsigned pvclock_get_time_values(struct pvclock_shadow_time *dst,
dst->system_timestamp = src->system_time;
dst->tsc_to_nsec_mul = src->tsc_to_system_mul;
dst->tsc_shift = src->tsc_shift;
dst->flags = src->flags;
rmb(); /* test version after fetching data */
} while ((src->version & 1) || (dst->version != src->version));

Expand Down

0 comments on commit 8637885

Please sign in to comment.