Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/acpi Also declare support for APERF/MPERF durin...



details:   https://anonhg.NetBSD.org/src/rev/cdd3636416bc
branches:  trunk
changeset: 762683:cdd3636416bc
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Fri Feb 25 16:54:36 2011 +0000

description:
Also declare support for APERF/MPERF during the BIOS _PDC/_OSC query.

diffstat:

 sys/arch/x86/acpi/acpi_cpu_md.c |  20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diffs (62 lines):

diff -r 8f50210cbb95 -r cdd3636416bc sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c   Fri Feb 25 16:01:41 2011 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c   Fri Feb 25 16:54:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.43 2011/02/25 12:08:35 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.44 2011/02/25 16:54:36 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.43 2011/02/25 12:08:35 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.44 2011/02/25 16:54:36 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -122,6 +122,7 @@
 acpicpu_md_cap(void)
 {
        struct cpu_info *ci = curcpu();
+       uint32_t regs[4];
        uint32_t val = 0;
 
        if (cpu_vendor != CPUVENDOR_IDT &&
@@ -149,6 +150,17 @@
        if ((ci->ci_feat_val[0] & CPUID_ACPI) != 0)
                val |= ACPICPU_PDC_T_FFH;
 
+       /*
+        * Declare support for APERF and MPERF.
+        */
+       if (cpuid_level >= 0x06) {
+
+               x86_cpuid(0x00000006, regs);
+
+               if ((regs[2] & CPUID_DSPM_HWF) != 0)
+                       val |= ACPICPU_PDC_P_HW;
+       }
+
        return val;
 }
 
@@ -212,7 +224,7 @@
                 */
                if (cpuid_level >= 0x06) {
 
-                       x86_cpuid(0x06, regs);
+                       x86_cpuid(0x00000006, regs);
 
                        if ((regs[2] & CPUID_DSPM_HWF) != 0)
                                val |= ACPICPU_FLAG_P_HW;
@@ -300,7 +312,7 @@
 
                                x86_cpuid(0x00000006, regs);
 
-                               if ((regs[2] & __BIT(0)) != 0)
+                               if ((regs[2] & CPUID_DSPM_HWF) != 0)
                                        val |= ACPICPU_FLAG_P_HW;
                        }
 



Home | Main Index | Thread Index | Old Index