summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/vmbus/hyperv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/hyperv/vmbus/hyperv.c')
-rw-r--r--sys/dev/hyperv/vmbus/hyperv.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/hyperv/vmbus/hyperv.c b/sys/dev/hyperv/vmbus/hyperv.c
index 2df313b..144bff5 100644
--- a/sys/dev/hyperv/vmbus/hyperv.c
+++ b/sys/dev/hyperv/vmbus/hyperv.c
@@ -77,6 +77,8 @@ u_int hyperv_recommends;
static u_int hyperv_pm_features;
static u_int hyperv_features3;
+hyperv_tc64_t hyperv_tc64;
+
static struct timecounter hyperv_timecounter = {
.tc_get_timecount = hyperv_get_timecount,
.tc_poll_pps = NULL,
@@ -96,6 +98,13 @@ hyperv_get_timecount(struct timecounter *tc __unused)
return rdmsr(MSR_HV_TIME_REF_COUNT);
}
+static uint64_t
+hyperv_tc64_rdmsr(void)
+{
+
+ return (rdmsr(MSR_HV_TIME_REF_COUNT));
+}
+
uint64_t
hypercall_post_message(bus_addr_t msg_paddr)
{
@@ -232,6 +241,12 @@ hyperv_init(void *dummy __unused)
if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) {
/* Register Hyper-V timecounter */
tc_init(&hyperv_timecounter);
+
+ /*
+ * Install 64 bits timecounter method for other modules
+ * to use.
+ */
+ hyperv_tc64 = hyperv_tc64_rdmsr;
}
}
SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init,
OpenPOWER on IntegriCloud