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 Fix bug pointed out by njoly@.



details:   https://anonhg.NetBSD.org/src/rev/8e4dcc2f9680
branches:  trunk
changeset: 766463:8e4dcc2f9680
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Thu Jun 23 08:10:35 2011 +0000

description:
Fix bug pointed out by njoly@.

diffstat:

 sys/arch/x86/acpi/acpi_cpu_md.c |  32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diffs (57 lines):

diff -r 5b29793300ad -r 8e4dcc2f9680 sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c   Thu Jun 23 07:58:19 2011 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c   Thu Jun 23 08:10:35 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.62 2011/06/22 08:49:54 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.63 2011/06/23 08:10:35 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.62 2011/06/22 08:49:54 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.63 2011/06/23 08:10:35 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -433,21 +433,27 @@
 {
        uint64_t xc, val;
 
-       /*
-        * Make sure EST is enabled.
-        */
-       if ((sc->sc_flags & ACPICPU_FLAG_P_FFH) != 0) {
+       switch (cpu_vendor) {
+
+       case CPUVENDOR_IDT:
+       case CPUVENDOR_INTEL:
 
-               val = rdmsr(MSR_MISC_ENABLE);
+               /*
+                * Make sure EST is enabled.
+                */
+               if ((sc->sc_flags & ACPICPU_FLAG_P_FFH) != 0) {
 
-               if ((val & MSR_MISC_ENABLE_EST) == 0) {
-
-                       val |= MSR_MISC_ENABLE_EST;
-                       wrmsr(MSR_MISC_ENABLE, val);
                        val = rdmsr(MSR_MISC_ENABLE);
 
-                       if ((val & MSR_MISC_ENABLE_EST) == 0)
-                               return ENOTTY;
+                       if ((val & MSR_MISC_ENABLE_EST) == 0) {
+
+                               val |= MSR_MISC_ENABLE_EST;
+                               wrmsr(MSR_MISC_ENABLE, val);
+                               val = rdmsr(MSR_MISC_ENABLE);
+
+                               if ((val & MSR_MISC_ENABLE_EST) == 0)
+                                       return ENOTTY;
+                       }
                }
        }
 



Home | Main Index | Thread Index | Old Index