Module Name:    src
Committed By:   jruoho
Date:           Tue Feb 22 17:16:04 UTC 2011

Modified Files:
        src/sys/dev/acpi: acpi_cpu_cstate.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/acpi/acpi_cpu_cstate.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/dev/acpi/acpi_cpu_cstate.c
diff -u src/sys/dev/acpi/acpi_cpu_cstate.c:1.41 src/sys/dev/acpi/acpi_cpu_cstate.c:1.42
--- src/sys/dev/acpi/acpi_cpu_cstate.c:1.41	Tue Feb 22 16:39:05 2011
+++ src/sys/dev/acpi/acpi_cpu_cstate.c	Tue Feb 22 17:16:04 2011
@@ -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 <jruoho...@iki.fi>
@@ -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;
 }
 

Reply via email to