From owner-svn-src-all@freebsd.org Mon May 30 09:35:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00F01B5454D; Mon, 30 May 2016 09:35:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEAEF183E; Mon, 30 May 2016 09:35:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4U9ZbB0008034; Mon, 30 May 2016 09:35:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4U9ZbMj008033; Mon, 30 May 2016 09:35:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605300935.u4U9ZbMj008033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 30 May 2016 09:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300993 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2016 09:35:38 -0000 Author: sephe Date: Mon May 30 09:35:36 2016 New Revision: 300993 URL: https://svnweb.freebsd.org/changeset/base/300993 Log: hyperv/et: Device renaming; consistent w/ other Hyper-V utils While I'm here, prefix function names w/ vmbus, since unlike Hyper-V timecounter, Hyper-V event timer will not work w/o vmbus. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6598 Modified: head/sys/dev/hyperv/vmbus/hv_et.c Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 09:20:08 2016 (r300992) +++ head/sys/dev/hyperv/vmbus/hv_et.c Mon May 30 09:35:36 2016 (r300993) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #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 @@ __FBSDID("$FreeBSD$"); 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 @@ sbintime2tick(sbintime_t time) } 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 @@ vmbus_et_intr(struct trapframe *frame) } 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 @@ vmbus_et_config(void *arg __unused) } static int -hv_et_attach(device_t dev) +vmbus_et_attach(device_t dev) { /* TODO: use independent IDT vector */ @@ -151,7 +154,7 @@ hv_et_attach(device_t dev) 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 @@ hv_et_attach(device_t dev) } 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);