svn commit: r185343 - in head/sys: amd64/amd64 i386/i386
Jung-uk Kim
jkim at FreeBSD.org
Wed Nov 26 11:29:34 PST 2008
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
More information about the svn-src-all
mailing list