aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorSepherosa Ziehau <sephe@FreeBSD.org>2016-12-19 07:40:45 +0000
committerSepherosa Ziehau <sephe@FreeBSD.org>2016-12-19 07:40:45 +0000
commitfff5be0be3de457714cbe05854bc76ee0aff08a0 (patch)
tree114904e805c073b49ecebb24ec75ddc29d0d0640 /sys/dev
parentd8303c114b429b409aaa1849d26e5aec89d1620a (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c b/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
index abf0372bb31e..cb815bb163c5 100644
--- a/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
+++ b/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/timetc.h>
+#include <sys/vdso.h>
#include <machine/cpufunc.h>
#include <machine/cputypes.h>
@@ -52,18 +53,20 @@ struct hyperv_reftsc_ctx {
struct hyperv_dma tsc_ref_dma;
};
+static uint32_t hyperv_tsc_vdso_timehands(
+ struct vdso_timehands *,
+ struct timecounter *);
+
static d_open_t hyperv_tsc_open;
static d_mmap_t hyperv_tsc_mmap;
static struct timecounter hyperv_tsc_timecounter = {
.tc_get_timecount = NULL, /* based on CPU vendor. */
- .tc_poll_pps = NULL,
.tc_counter_mask = 0xffffffff,
.tc_frequency = HYPERV_TIMER_FREQ,
.tc_name = "Hyper-V-TSC",
.tc_quality = 3000,
- .tc_flags = 0,
- .tc_priv = NULL
+ .tc_fill_vdso_timehands = hyperv_tsc_vdso_timehands,
};
static struct cdevsw hyperv_tsc_cdevsw = {
@@ -117,6 +120,18 @@ hyperv_tsc_mmap(struct cdev *dev __unused, vm_ooffset_t offset,
return (0);
}
+static uint32_t
+hyperv_tsc_vdso_timehands(struct vdso_timehands *vdso_th,
+ struct timecounter *tc __unused)
+{
+
+ vdso_th->th_algo = VDSO_TH_ALGO_X86_HVTSC;
+ vdso_th->th_x86_shift = 0;
+ vdso_th->th_x86_hpet_idx = 0;
+ bzero(vdso_th->th_res, sizeof(vdso_th->th_res));
+ return (1);
+}
+
#define HYPERV_TSC_TIMECOUNT(fence) \
static u_int \
hyperv_tsc_timecount_##fence(struct timecounter *tc) \