svn commit: r187594 - in head/sys: compat/linprocfs i386/cpufreq
Jung-uk Kim
jkim at FreeBSD.org
Thu Jan 22 09:06:45 PST 2009
Author: jkim
Date: Thu Jan 22 17:06:33 2009
New Revision: 187594
URL: http://svn.freebsd.org/changeset/base/187594
Log:
Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id for i386
and hide i386-specific code under #ifdef.
Modified:
head/sys/compat/linprocfs/linprocfs.c
head/sys/i386/cpufreq/smist.c
Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c Thu Jan 22 15:52:13 2009 (r187593)
+++ head/sys/compat/linprocfs/linprocfs.c Thu Jan 22 17:06:33 2009 (r187594)
@@ -276,11 +276,17 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
sbuf_cat(sb, "flags\t\t:");
- if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) {
- flags[16] = "fcmov";
- } else if (!strcmp(cpu_vendor, "CyrixInstead")) {
+#ifdef __i386__
+ switch (cpu_vendor_id) {
+ case CPU_VENDOR_AMD:
+ if (class < 6)
+ flags[16] = "fcmov";
+ break;
+ case CPU_VENDOR_CYRIX:
flags[24] = "cxmmx";
+ break;
}
+#endif
for (i = 0; i < 32; i++)
if (cpu_feature & (1 << i))
Modified: head/sys/i386/cpufreq/smist.c
==============================================================================
--- head/sys/i386/cpufreq/smist.c Thu Jan 22 15:52:13 2009 (r187593)
+++ head/sys/i386/cpufreq/smist.c Thu Jan 22 17:06:33 2009 (r187594)
@@ -285,7 +285,7 @@ smist_identify(driver_t *driver, device_
return;
/* Check for a supported processor */
- if (strcmp(cpu_vendor, "GenuineIntel") != 0)
+ if (cpu_vendor_id != CPU_VENDOR_INTEL)
return;
switch (cpu_id & 0xff0) {
case 0x680: /* Pentium III [coppermine] */
More information about the svn-src-all
mailing list