Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi ACPI enumerates cpus with 0..n.



details:   https://anonhg.NetBSD.org/src/rev/ae95cd6dd53a
branches:  trunk
changeset: 756534:ae95cd6dd53a
user:      cegger <cegger%NetBSD.org@localhost>
date:      Wed Jul 21 14:59:31 2010 +0000

description:
ACPI enumerates cpus with 0..n.
Fixes panic reported by Patrick Welche on current-users@
Fixes panic on my own HP Pavilion laptop

diffstat:

 sys/dev/acpi/acpi_cpu.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 4b209082138f -r ae95cd6dd53a sys/dev/acpi/acpi_cpu.c
--- a/sys/dev/acpi/acpi_cpu.c   Wed Jul 21 12:16:54 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu.c   Wed Jul 21 14:59:31 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.c,v 1.3 2010/07/19 00:59:32 christos Exp $ */
+/* $NetBSD: acpi_cpu.c,v 1.4 2010/07/21 14:59:31 cegger 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.c,v 1.3 2010/07/19 00:59:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.4 2010/07/21 14:59:31 cegger Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -271,10 +271,9 @@
        CPU_INFO_ITERATOR cii;
        struct cpu_info *ci;
 
-       KASSERT(id != 0);
        for (CPU_INFO_FOREACH(cii, ci)) {
-               if (id - 1 == ci->ci_cpuid)
-                       return id - 1;
+               if (id == ci->ci_cpuid)
+                       return id;
        }
 
        return 0xFFFFFF;



Home | Main Index | Thread Index | Old Index