From owner-svn-src-all@freebsd.org Fri May 27 07:05:31 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 573DAB4B600; Fri, 27 May 2016 07:05:31 +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 0CEAB11CF; Fri, 27 May 2016 07:05:30 +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 u4R75U8p042226; Fri, 27 May 2016 07:05:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4R75UVi042225; Fri, 27 May 2016 07:05:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605270705.u4R75UVi042225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 27 May 2016 07:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300832 - 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: Fri, 27 May 2016 07:05:31 -0000 Author: sephe Date: Fri May 27 07:05:30 2016 New Revision: 300832 URL: https://svnweb.freebsd.org/changeset/base/300832 Log: hyperv: Clean up Hyper-V timecounter a bit. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6569 Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 06:55:05 2016 (r300831) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri May 27 07:05:30 2016 (r300832) @@ -74,22 +74,29 @@ struct hypercall_ctx { struct hyperv_dma hc_dma; }; -static struct hypercall_ctx hypercall_context; - -static u_int hv_get_timecount(struct timecounter *tc); +static u_int hyperv_get_timecount(struct timecounter *tc); -u_int hyperv_features; -u_int hyperv_recommends; +u_int hyperv_features; +u_int hyperv_recommends; static u_int hyperv_pm_features; static u_int hyperv_features3; -static struct timecounter hv_timecounter = { - hv_get_timecount, 0, ~0u, HV_NANOSECONDS_PER_SEC/100, "Hyper-V", HV_NANOSECONDS_PER_SEC/100 +static struct timecounter hyperv_timecounter = { + .tc_get_timecount = hyperv_get_timecount, + .tc_poll_pps = NULL, + .tc_counter_mask = 0xffffffff, + .tc_frequency = HV_NANOSECONDS_PER_SEC/100, + .tc_name = "Hyper-V", + .tc_quality = 2000, + .tc_flags = 0, + .tc_priv = NULL }; +static struct hypercall_ctx hypercall_context; + static u_int -hv_get_timecount(struct timecounter *tc) +hyperv_get_timecount(struct timecounter *tc __unused) { return rdmsr(MSR_HV_TIME_REF_COUNT); } @@ -304,8 +311,8 @@ hyperv_init(void *dummy __unused) wrmsr(MSR_HV_GUEST_OS_ID, MSR_HV_GUESTID_FREEBSD); if (hyperv_features & CPUID_HV_MSR_TIME_REFCNT) { - /* Register virtual timecount */ - tc_init(&hv_timecounter); + /* Register Hyper-V timecounter */ + tc_init(&hyperv_timecounter); } } SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init,