From owner-p4-projects@FreeBSD.ORG Sat Apr 5 02:44:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9E7A137B404; Sat, 5 Apr 2003 02:44:56 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5283037B401 for ; Sat, 5 Apr 2003 02:44:56 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D28B043F75 for ; Sat, 5 Apr 2003 02:44:55 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h35Ait0U047767 for ; Sat, 5 Apr 2003 02:44:55 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h35AitT4047764 for perforce@freebsd.org; Sat, 5 Apr 2003 02:44:55 -0800 (PST) Date: Sat, 5 Apr 2003 02:44:55 -0800 (PST) Message-Id: <200304051044.h35AitT4047764@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28214 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2003 10:44:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=28214 Change 28214 by peter@peter_overcee on 2003/04/05 02:44:16 hack for x86-64 Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/tsc.c#2 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/tsc.c#2 (text+ko) ==== @@ -41,7 +41,7 @@ uint64_t tsc_freq; int tsc_is_broken; -u_int tsc_present; +u_int tsc_present = 1; static unsigned tsc_get_timecount(struct timecounter *tc); @@ -58,14 +58,6 @@ { u_int64_t tscval[2]; - if (cpu_feature & CPUID_TSC) - tsc_present = 1; - else - tsc_present = 0; - - if (!tsc_present) - return; - if (bootverbose) printf("Calibrating TSC clock ... "); @@ -75,35 +67,9 @@ tsc_freq = tscval[1] - tscval[0]; if (bootverbose) - printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq); + printf("TSC clock: %lu Hz\n", tsc_freq); -#if defined(SMP) && !defined(SMP_TSC) - /* - * We can not use the TSC in SMP mode, until we figure out a - * cheap (impossible), reliable and precise (yeah right!) way - * to synchronize the TSCs of all the CPUs. - * Modern SMP hardware has the ACPI timer and we use that. - */ - return; -#endif - - /* - * We can not use the TSC if we support APM. Precise timekeeping - * on an APM'ed machine is at best a fools pursuit, since - * any and all of the time spent in various SMM code can't - * be reliably accounted for. Reading the RTC is your only - * source of reliable time info. The i8254 looses too of course - * but we need to have some kind of time... - * We don't know at this point whether APM is going to be used - * or not, nor when it might be activated. Play it safe. - */ - if (power_pm_get_type() == POWER_PM_TYPE_APM) { - if (bootverbose) - printf("TSC timecounter disabled: APM enabled.\n"); - return; - } - - if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { + if (tsc_freq != 0 && !tsc_is_broken) { tsc_timecounter.tc_frequency = tsc_freq; tc_init(&tsc_timecounter); } @@ -128,7 +94,7 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_QUAD | CTLFLAG_RW, +SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_LONG | CTLFLAG_RW, 0, sizeof(u_int), sysctl_machdep_tsc_freq, "IU", ""); static unsigned