Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Nov 2008 19:29:33 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185343 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <200811261929.mAQJTXVM064242@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Wed Nov 26 19:29:33 2008
New Revision: 185343
URL: http://svn.freebsd.org/changeset/base/185343

Log:
  Use newly introduced cpu_vendor_id to make invariant TSC detection more
  clearer and merge r185295 to amd64.

Modified:
  head/sys/amd64/amd64/identcpu.c
  head/sys/i386/i386/identcpu.c

Modified: head/sys/amd64/amd64/identcpu.c
==============================================================================
--- head/sys/amd64/amd64/identcpu.c	Wed Nov 26 19:27:51 2008	(r185342)
+++ head/sys/amd64/amd64/identcpu.c	Wed Nov 26 19:29:33 2008	(r185343)
@@ -360,14 +360,20 @@ printcpuinfo(void)
 			 * If this CPU supports P-state invariant TSC then
 			 * mention the capability.
 			 */
-			if (!tsc_is_invariant &&
-			    (cpu_vendor_id == CPU_VENDOR_AMD &&
-			    ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 ||
-			    AMD64_CPU_FAMILY(cpu_id) >= 0x10 ||
-			    cpu_id == 0x60fb2))) {
-				tsc_is_invariant = 1;
-				printf("\n  TSC: P-state invariant");
+			switch (cpu_vendor_id) {
+			case CPU_VENDOR_AMD:
+				if ((amd_pminfo & AMDPM_TSC_INVARIANT) ||
+				    AMD64_CPU_FAMILY(cpu_id) >= 0x10 ||
+				    cpu_id == 0x60fb2)
+					tsc_is_invariant = 1;
+				break;
+			case CPU_VENDOR_INTEL:
+				if (amd_pminfo & AMDPM_TSC_INVARIANT)
+					tsc_is_invariant = 1;
+				break;
 			}
+			if (tsc_is_invariant)
+				printf("\n  TSC: P-state invariant");
 
 			/*
 			 * If this CPU supports HTT or CMP then mention the

Modified: head/sys/i386/i386/identcpu.c
==============================================================================
--- head/sys/i386/i386/identcpu.c	Wed Nov 26 19:27:51 2008	(r185342)
+++ head/sys/i386/i386/identcpu.c	Wed Nov 26 19:29:33 2008	(r185343)
@@ -864,15 +864,20 @@ printcpuinfo(void)
 			 * If this CPU supports P-state invariant TSC then
 			 * mention the capability.
 			 */
-			if (!tsc_is_invariant &&
-			    ((cpu_vendor_id == CPU_VENDOR_AMD ||
-			    cpu_vendor_id == CPU_VENDOR_INTEL) &&
-			    ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 ||
-			    I386_CPU_FAMILY(cpu_id) >= 0x10 ||
-			    cpu_id == 0x60fb2))) {
-				tsc_is_invariant = 1;
-				printf("\n  TSC: P-state invariant");
+			switch (cpu_vendor_id) {
+			case CPU_VENDOR_AMD:
+				if ((amd_pminfo & AMDPM_TSC_INVARIANT) ||
+				    I386_CPU_FAMILY(cpu_id) >= 0x10 ||
+				    cpu_id == 0x60fb2)
+					tsc_is_invariant = 1;
+				break;
+			case CPU_VENDOR_INTEL:
+				if (amd_pminfo & AMDPM_TSC_INVARIANT)
+					tsc_is_invariant = 1;
+				break;
 			}
+			if (tsc_is_invariant)
+				printf("\n  TSC: P-state invariant");
 
 			/*
 			 * If this CPU supports HTT or CMP then mention the



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811261929.mAQJTXVM064242>