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 Run a xcall(9) to ensure that all CPUs are...



details:   https://anonhg.NetBSD.org/src/rev/661ccae739e0
branches:  trunk
changeset: 756829:661ccae739e0
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Aug 04 16:16:55 2010 +0000

description:
Run a xcall(9) to ensure that all CPUs are out from the ACPI idle-loop
before detachment.

diffstat:

 sys/arch/x86/acpi/acpi_cpu_md.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (53 lines):

diff -r 7047edd68a61 -r 661ccae739e0 sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c   Wed Aug 04 14:59:39 2010 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c   Wed Aug 04 16:16:55 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.3 2010/07/23 13:54:21 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.4 2010/08/04 16:16:55 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,11 +27,12 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.3 2010/07/23 13:54:21 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.4 2010/08/04 16:16:55 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
 #include <sys/kcore.h>
+#include <sys/xcall.h>
 
 #include <x86/cpu.h>
 #include <x86/cpuvar.h>
@@ -143,14 +144,13 @@
        x86_cpu_idle_set(acpicpu_cstate_idle, "acpi");
        x86_enable_intr();
 
-       DELAY(10000);
-
        return 0;
 }
 
 int
 acpicpu_md_idle_stop(void)
 {
+       uint64_t xc;
 
        KASSERT(native_idle != NULL);
        KASSERT(native_idle_text[0] != '\0');
@@ -159,7 +159,12 @@
        x86_cpu_idle_set(native_idle, native_idle_text);
        x86_enable_intr();
 
-       DELAY(10000);
+       /*
+        * Run a cross-call to ensure that all CPUs are
+        * out from the ACPI idle-loop before detachment.
+        */
+       xc = xc_broadcast(0, (xcfunc_t)nullop, NULL, NULL);
+       xc_wait(xc);
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index