Index: head/sys/dev/hyperv/vmbus/hv_et.c =================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c +++ head/sys/dev/hyperv/vmbus/hv_et.c @@ -41,6 +41,8 @@ #include #include +#define VMBUS_ET_NAME "hvet" + #define MSR_HV_STIMER0_CFG_SINT \ ((((uint64_t)VMBUS_SINT_TIMER) << MSR_HV_STIMER_CFG_SINT_SHIFT) & \ MSR_HV_STIMER_CFG_SINT_MASK) @@ -58,7 +60,7 @@ static struct eventtimer vmbus_et; static __inline uint64_t -sbintime2tick(sbintime_t time) +hyperv_sbintime2count(sbintime_t time) { struct timespec val; @@ -68,12 +70,13 @@ } static int -hv_et_start(struct eventtimer *et, sbintime_t firsttime, sbintime_t periodtime) +vmbus_et_start(struct eventtimer *et __unused, sbintime_t first, + sbintime_t period __unused) { uint64_t current; current = rdmsr(MSR_HV_TIME_REF_COUNT); - current += sbintime2tick(firsttime); + current += hyperv_sbintime2count(first); wrmsr(MSR_HV_STIMER0_COUNT, current); return (0); @@ -97,18 +100,18 @@ } static void -hv_et_identify(driver_t *driver, device_t parent) +vmbus_et_identify(driver_t *driver, device_t parent) { if (device_get_unit(parent) != 0 || - device_find_child(parent, "hv_et", -1) != NULL || + device_find_child(parent, VMBUS_ET_NAME, -1) != NULL || (hyperv_features & CPUID_HV_ET_MASK) != CPUID_HV_ET_MASK) return; - device_add_child(parent, "hv_et", -1); + device_add_child(parent, VMBUS_ET_NAME, -1); } static int -hv_et_probe(device_t dev) +vmbus_et_probe(device_t dev) { device_set_desc(dev, "Hyper-V event timer"); @@ -141,7 +144,7 @@ } static int -hv_et_attach(device_t dev) +vmbus_et_attach(device_t dev) { /* TODO: use independent IDT vector */ @@ -151,7 +154,7 @@ vmbus_et.et_frequency = HYPERV_TIMER_FREQ; vmbus_et.et_min_period = (0x00000001ULL << 32) / HYPERV_TIMER_FREQ; vmbus_et.et_max_period = (0xfffffffeULL << 32) / HYPERV_TIMER_FREQ; - vmbus_et.et_start = hv_et_start; + vmbus_et.et_start = vmbus_et_start; /* * Delay a bit to make sure that MSR_HV_TIME_REF_COUNT will @@ -165,26 +168,26 @@ } static int -hv_et_detach(device_t dev) +vmbus_et_detach(device_t dev) { return (et_deregister(&vmbus_et)); } -static device_method_t hv_et_methods[] = { - DEVMETHOD(device_identify, hv_et_identify), - DEVMETHOD(device_probe, hv_et_probe), - DEVMETHOD(device_attach, hv_et_attach), - DEVMETHOD(device_detach, hv_et_detach), +static device_method_t vmbus_et_methods[] = { + DEVMETHOD(device_identify, vmbus_et_identify), + DEVMETHOD(device_probe, vmbus_et_probe), + DEVMETHOD(device_attach, vmbus_et_attach), + DEVMETHOD(device_detach, vmbus_et_detach), DEVMETHOD_END }; -static driver_t hv_et_driver = { - "hv_et", - hv_et_methods, +static driver_t vmbus_et_driver = { + VMBUS_ET_NAME, + vmbus_et_methods, 0 }; -static devclass_t hv_et_devclass; -DRIVER_MODULE(hv_et, vmbus, hv_et_driver, hv_et_devclass, NULL, 0); +static devclass_t vmbus_et_devclass; +DRIVER_MODULE(hv_et, vmbus, vmbus_et_driver, vmbus_et_devclass, NULL, NULL); MODULE_VERSION(hv_et, 1);