summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/vmbus/hyperv.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-23 06:28:41 -0300
committerRenato Botelho <renato@netgate.com>2017-02-23 06:28:41 -0300
commit82ceeb2ea625cd9bff60f2863b9a0830f55b7905 (patch)
tree263ca9347bf664a4489743f9302e699ce14de1df /sys/dev/hyperv/vmbus/hyperv.c
parent4a05f5440acda223e6a0ec5157bc32ecc0f09ff9 (diff)
parentd20dd8b36e7a565be7bfbb22aade51c8ffd753e9 (diff)
downloadFreeBSD-src-devel.zip
FreeBSD-src-devel.tar.gz
Merge remote-tracking branch 'origin/stable/10' into develdevel
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