Module Name: src
Committed By: jruoho
Date: Fri Aug 20 07:00:17 UTC 2010
Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c
Log Message:
Check if SpeedStep is enabled. If it is disabled, try to enable it.
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 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.19 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.20
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.19 Fri Aug 20 06:34:32 2010
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c Fri Aug 20 07:00:17 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.19 2010/08/20 06:34:32 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.20 2010/08/20 07:00:17 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <[email protected]>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.19 2010/08/20 06:34:32 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.20 2010/08/20 07:00:17 jruoho Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -254,6 +254,27 @@
int
acpicpu_md_pstate_start(void)
{
+ const uint64_t est = __BIT(16);
+ uint64_t val;
+
+ switch (cpu_vendor) {
+
+ case CPUVENDOR_IDT:
+ case CPUVENDOR_INTEL:
+
+ val = rdmsr(MSR_MISC_ENABLE);
+
+ if ((val & est) == 0) {
+
+ val |= est;
+
+ wrmsr(MSR_MISC_ENABLE, val);
+ val = rdmsr(MSR_MISC_ENABLE);
+
+ if ((val & est) == 0)
+ return ENOTTY;
+ }
+ }
return acpicpu_md_pstate_sysctl_init();
}