return (shadow.version == src->version);
}
+static inline int wc_values_up_to_date(void)
+{
+ shared_info_t *s= HYPERVISOR_shared_info;
+
+ return (shadow_ts_version == s->wc_version);
+}
/*
* Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
int gettimeofday(struct timeval *tv, void *tz)
{
uint64_t nsec = monotonic_clock();
+
+ if (!wc_values_up_to_date())
+ update_wallclock();
+
nsec += shadow_ts.tv_nsec;
-
-
+
tv->tv_sec = shadow_ts.tv_sec;
tv->tv_sec += NSEC_TO_SEC(nsec);
tv->tv_usec = NSEC_TO_USEC(nsec % 1000000000UL);
*/
static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign)
{
- get_time_values_from_xen();
- update_wallclock();
}