Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/utilities/vmbus_timesync.c
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | if ((tsflags & VMBUS_ICMSG_TS_FLAG_SYNC) && !vmbus_ts_ignore_sync) { | ||||
if (bootverbose) { | if (bootverbose) { | ||||
device_printf(sc->ic_dev, "apply sync request, " | device_printf(sc->ic_dev, "apply sync request, " | ||||
"hv: %ju, vm: %ju\n", | "hv: %ju, vm: %ju\n", | ||||
(uintmax_t)hv_ns, (uintmax_t)vm_ns); | (uintmax_t)hv_ns, (uintmax_t)vm_ns); | ||||
} | } | ||||
hv_ts.tv_sec = hv_ns / NANOSEC; | hv_ts.tv_sec = hv_ns / NANOSEC; | ||||
hv_ts.tv_nsec = hv_ns % NANOSEC; | hv_ts.tv_nsec = hv_ns % NANOSEC; | ||||
kern_clock_settime(curthread, CLOCK_REALTIME, &hv_ts); | kern_clock_settime(curthread, CLOCK_REALTIME, &hv_ts, NULL); | ||||
/* Done! */ | /* Done! */ | ||||
return; | return; | ||||
} | } | ||||
if ((tsflags & VMBUS_ICMSG_TS_FLAG_SAMPLE) && | if ((tsflags & VMBUS_ICMSG_TS_FLAG_SAMPLE) && | ||||
vmbus_ts_sample_thresh >= 0) { | vmbus_ts_sample_thresh >= 0) { | ||||
int64_t diff; | int64_t diff; | ||||
Show All 15 Lines | if (diff > vmbus_ts_sample_thresh) { | ||||
if (bootverbose) { | if (bootverbose) { | ||||
device_printf(sc->ic_dev, | device_printf(sc->ic_dev, | ||||
"apply sample request, hv: %ju, vm: %ju\n", | "apply sample request, hv: %ju, vm: %ju\n", | ||||
(uintmax_t)hv_ns, (uintmax_t)vm_ns); | (uintmax_t)hv_ns, (uintmax_t)vm_ns); | ||||
} | } | ||||
hv_ts.tv_sec = hv_ns / NANOSEC; | hv_ts.tv_sec = hv_ns / NANOSEC; | ||||
hv_ts.tv_nsec = hv_ns % NANOSEC; | hv_ts.tv_nsec = hv_ns % NANOSEC; | ||||
kern_clock_settime(curthread, CLOCK_REALTIME, &hv_ts); | kern_clock_settime(curthread, CLOCK_REALTIME, &hv_ts, | ||||
NULL); | |||||
} | } | ||||
/* Done */ | /* Done */ | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
vmbus_timesync_cb(struct vmbus_channel *chan, void *xsc) | vmbus_timesync_cb(struct vmbus_channel *chan, void *xsc) | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |