Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 x86_reset: If the FADT defines a reset regi...



details:   https://anonhg.NetBSD.org/src/rev/c7e2a040f890
branches:  trunk
changeset: 767828:c7e2a040f890
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jul 31 22:43:01 2011 +0000

description:
x86_reset: If the FADT defines a reset register and ACPI was active, try
to use it to reset the system before attempting any other methods

diffstat:

 sys/arch/x86/x86/x86_machdep.c |  21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r 1be8020ceeac -r c7e2a040f890 sys/arch/x86/x86/x86_machdep.c
--- a/sys/arch/x86/x86/x86_machdep.c    Sun Jul 31 22:04:07 2011 +0000
+++ b/sys/arch/x86/x86/x86_machdep.c    Sun Jul 31 22:43:01 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_machdep.c,v 1.51 2011/06/12 03:35:50 rmind Exp $   */
+/*     $NetBSD: x86_machdep.c,v 1.52 2011/07/31 22:43:01 jmcneill Exp $        */
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.51 2011/06/12 03:35:50 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.52 2011/07/31 22:43:01 jmcneill Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -67,6 +67,11 @@
 
 #include <uvm/uvm_extern.h>
 
+#include "acpica.h"
+#if NACPICA > 0
+#include <dev/acpi/acpivar.h>
+#endif
+
 void (*x86_cpu_idle)(void);
 static bool x86_cpu_idle_ipi;
 static char x86_cpu_idle_text[16];
@@ -894,6 +899,18 @@
 x86_reset(void)
 {
        uint8_t b;
+
+#if NACPICA > 0
+       /*
+        * If ACPI is active, try to reset using the reset register
+        * defined in the FADT.
+        */
+       if (acpi_active) {
+               if (AcpiReset() != AE_NOT_EXIST)
+                       delay(500000); /* wait 0.5 sec to see if that did it */
+       }
+#endif
+
        /*
         * The keyboard controller has 4 random output pins, one of which is
         * connected to the RESET pin on the CPU in many PCs.  We tell the



Home | Main Index | Thread Index | Old Index