From 86b7a03aa5b03e7874d87ee1da2bc18889d406ac Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 1 Jun 2011 23:50:54 +0200 Subject: [PATCH] kernel: Use cpu_vendor_id instead of strcmp(cpu_vendor, "..."). --- sys/dev/powermng/coretemp/coretemp.c | 3 ++- sys/emulation/linux/i386/linprocfs/linprocfs_misc.c | 5 ++--- sys/platform/pc64/acpica5/acpi_pstate_machdep.c | 5 +++-- sys/platform/pc64/apic/lapic.c | 3 ++- sys/platform/pc64/x86_64/mptable.c | 3 ++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/dev/powermng/coretemp/coretemp.c b/sys/dev/powermng/coretemp/coretemp.c index 7e02dc42e6..5c9e542674 100644 --- a/sys/dev/powermng/coretemp/coretemp.c +++ b/sys/dev/powermng/coretemp/coretemp.c @@ -44,6 +44,7 @@ #include #include +#include #include struct coretemp_softc { @@ -94,7 +95,7 @@ coretemp_identify(driver_t *driver, device_t parent) return; /* Check that CPUID is supported and the vendor is Intel.*/ - if (cpu_high == 0 || strcmp(cpu_vendor, "GenuineIntel")) + if (cpu_high == 0 || cpu_vendor_id != CPU_VENDOR_INTEL) return; /* * CPUID 0x06 returns 1 if the processor has on-die thermal diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c b/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c index 58f6a9cf48..229c654464 100644 --- a/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c +++ b/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c @@ -39,7 +39,6 @@ * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 * * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_misc.c,v 1.3.2.8 2001/06/25 19:46:47 pirzyk Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c,v 1.19 2008/05/10 17:24:05 dillon Exp $ */ #include @@ -245,9 +244,9 @@ linprocfs_docpuinfo(struct proc *curp, struct proc *p, struct pfsnode *pfs, ps += ksprintf(ps, "flags\t\t:"); - if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { + if (cpu_vendor_id == CPU_VENDOR_AMD && (class < 6)) { flags[16] = "fcmov"; - } else if (!strcmp(cpu_vendor, "CyrixInstead")) { + } else if (cpu_vendor_id == CPU_VENDOR_CYRIX) { flags[24] = "cxmmx"; } diff --git a/sys/platform/pc64/acpica5/acpi_pstate_machdep.c b/sys/platform/pc64/acpica5/acpi_pstate_machdep.c index e350d7222d..b9096674d5 100644 --- a/sys/platform/pc64/acpica5/acpi_pstate_machdep.c +++ b/sys/platform/pc64/acpica5/acpi_pstate_machdep.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "acpi.h" @@ -143,9 +144,9 @@ TUNABLE_INT("hw.acpi.cpu.pstate.strigent_check", &acpi_pst_stringent_check); const struct acpi_pst_md * acpi_pst_md_probe(void) { - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) + if (cpu_vendor_id == CPU_VENDOR_AMD) return acpi_pst_amd_probe(); - else if (strcmp(cpu_vendor, "GenuineIntel") == 0) + else if (cpu_vendor_id == CPU_VENDOR_INTEL) return acpi_pst_intel_probe(); return NULL; } diff --git a/sys/platform/pc64/apic/lapic.c b/sys/platform/pc64/apic/lapic.c index 5d6e07953a..4bff43b33a 100644 --- a/sys/platform/pc64/apic/lapic.c +++ b/sys/platform/pc64/apic/lapic.c @@ -40,6 +40,7 @@ #include #include +#include #include #include "apicvar.h" @@ -413,7 +414,7 @@ lapic_timer_fixup_handler(void *arg) if (started != NULL) *started = 0; - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + if (cpu_vendor_id == CPU_VENDOR_AMD) { /* * Detect the presence of C1E capability mostly on latest * dual-cores (or future) k8 family. This feature renders diff --git a/sys/platform/pc64/x86_64/mptable.c b/sys/platform/pc64/x86_64/mptable.c index eb9c7680db..679e2f13a0 100644 --- a/sys/platform/pc64/x86_64/mptable.c +++ b/sys/platform/pc64/x86_64/mptable.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -409,7 +410,7 @@ mptable_hyperthread_fixup(cpumask_t id_mask, int cpu_count) if (lcpus_max <= 1) return 0; - if (strcmp(cpu_vendor, "GenuineIntel") == 0) { + if (cpu_vendor_id == CPU_VENDOR_INTEL) { /* * INSTRUCTION SET REFERENCE, A-M (#253666) * Page 3-181, Table 3-20 -- 2.41.0