Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Yet another small fix to the C-state parsing. A...



details:   https://anonhg.NetBSD.org/src/rev/cb92475b759d
branches:  trunk
changeset: 762536:cb92475b759d
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Feb 22 17:16:04 2011 +0000

description:
Yet another small fix to the C-state parsing. As can be seen from the _CST
object noted in the revision 1.40, there is only one C-state on the machine,
yet the BIOS define its type as C2. Thus, instead of relying on the BIOS
data, sequentially count the parsed C-states.

diffstat:

 sys/dev/acpi/acpi_cpu_cstate.c |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (51 lines):

diff -r 0455fe073226 -r cb92475b759d sys/dev/acpi/acpi_cpu_cstate.c
--- a/sys/dev/acpi/acpi_cpu_cstate.c    Tue Feb 22 17:15:55 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_cstate.c    Tue Feb 22 17:16:04 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.41 2011/02/22 16:39:05 jmcneill Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.42 2011/02/22 17:16:04 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.41 2011/02/22 16:39:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.42 2011/02/22 17:16:04 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -331,6 +331,7 @@
        struct acpicpu_reg *reg;
        ACPI_STATUS rv = AE_OK;
        ACPI_OBJECT *obj;
+       static int i = 1;
        uint32_t type;
 
        (void)memset(&state, 0, sizeof(*cs));
@@ -469,17 +470,19 @@
                goto out;
        }
 
-       cs[type].cs_addr = state.cs_addr;
-       cs[type].cs_power = state.cs_power;
-       cs[type].cs_flags = state.cs_flags;
-       cs[type].cs_method = state.cs_method;
-       cs[type].cs_latency = state.cs_latency;
+       cs[i].cs_addr = state.cs_addr;
+       cs[i].cs_power = state.cs_power;
+       cs[i].cs_flags = state.cs_flags;
+       cs[i].cs_method = state.cs_method;
+       cs[i].cs_latency = state.cs_latency;
 
 out:
        if (ACPI_FAILURE(rv))
                aprint_error_dev(sc->sc_dev, "failed to add "
                    "C-state: %s\n", AcpiFormatException(rv));
 
+       i++;
+
        return rv;
 }
 



Home | Main Index | Thread Index | Old Index