Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Do not accidentally write zeros to (PSTATE_CNT ...



details:   https://anonhg.NetBSD.org/src/rev/8ba6ed1486c2
branches:  trunk
changeset: 757098:8ba6ed1486c2
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Aug 14 17:27:34 2010 +0000

description:
Do not accidentally write zeros to (PSTATE_CNT and CST_CNT) registers.

diffstat:

 sys/dev/acpi/acpi_cpu_cstate.c |  6 +++---
 sys/dev/acpi/acpi_cpu_pstate.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r c71205b116d9 -r 8ba6ed1486c2 sys/dev/acpi/acpi_cpu_cstate.c
--- a/sys/dev/acpi/acpi_cpu_cstate.c    Sat Aug 14 17:06:58 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_cstate.c    Sat Aug 14 17:27:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.26 2010/08/14 05:41:22 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.27 2010/08/14 17:27:34 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.26 2010/08/14 05:41:22 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.27 2010/08/14 17:27:34 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -511,7 +511,7 @@
        const uint8_t val = AcpiGbl_FADT.CstControl;
        const uint32_t addr = AcpiGbl_FADT.SmiCommand;
 
-       if (addr == 0)
+       if (addr == 0 || val == 0)
                return;
 
        (void)AcpiOsWritePort(addr, val, 8);
diff -r c71205b116d9 -r 8ba6ed1486c2 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c    Sat Aug 14 17:06:58 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c    Sat Aug 14 17:27:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.18 2010/08/14 05:41:22 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.19 2010/08/14 17:27:34 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.18 2010/08/14 05:41:22 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.19 2010/08/14 17:27:34 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
@@ -529,7 +529,7 @@
        const uint8_t val = AcpiGbl_FADT.PstateControl;
        const uint32_t addr = AcpiGbl_FADT.SmiCommand;
 
-       if (addr == 0)
+       if (addr == 0 || val == 0)
                return;
 
        (void)AcpiOsWritePort(addr, val, 8);



Home | Main Index | Thread Index | Old Index