Module Name: src
Committed By: jruoho
Date: Fri Feb 25 16:54:36 UTC 2011
Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c
Log Message:
Also declare support for APERF/MPERF during the BIOS _PDC/_OSC query.
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/x86/acpi/acpi_cpu_md.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.43 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.44
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.43 Fri Feb 25 12:08:35 2011
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c Fri Feb 25 16:54:36 2011
@@ -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 <[email protected]>
@@ -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;
}