Source-Changes-HG archive

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

[src/trunk]: src/sys - Disable Interrput before execute AcpiEnterSleepState().



details:   https://anonhg.NetBSD.org/src/rev/33ae247633de
branches:  trunk
changeset: 534148:33ae247633de
user:      kanaoka <kanaoka%NetBSD.org@localhost>
date:      Thu Jul 18 12:05:11 2002 +0000

description:
- Disable Interrput before execute AcpiEnterSleepState().
 - Add acpi_md_OsDisableInterrupt() for this.

diffstat:

 sys/arch/i386/i386/acpi_machdep.c    |  12 ++++++++++--
 sys/arch/i386/include/acpi_machdep.h |   3 ++-
 sys/dev/acpi/acpi.c                  |   6 ++++--
 3 files changed, 16 insertions(+), 5 deletions(-)

diffs (88 lines):

diff -r 4a9f36a2d52c -r 33ae247633de sys/arch/i386/i386/acpi_machdep.c
--- a/sys/arch/i386/i386/acpi_machdep.c Thu Jul 18 11:59:06 2002 +0000
+++ b/sys/arch/i386/i386/acpi_machdep.c Thu Jul 18 12:05:11 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.c,v 1.3 2002/06/15 18:01:05 thorpej Exp $ */
+/*     $NetBSD: acpi_machdep.c,v 1.4 2002/07/18 12:05:12 kanaoka Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.3 2002/06/15 18:01:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.4 2002/07/18 12:05:12 kanaoka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -49,6 +49,7 @@
 #include <uvm/uvm_extern.h>
 
 #include <machine/bus.h>
+#include <machine/cpufunc.h>
 
 #include <dev/acpi/acpica.h>
 #include <dev/acpi/acpivar.h>
@@ -190,3 +191,10 @@
 
        return (rv);
 }
+
+void 
+acpi_md_OsDisableInterrupt(void)
+{
+       disable_intr();
+}
+
diff -r 4a9f36a2d52c -r 33ae247633de sys/arch/i386/include/acpi_machdep.h
--- a/sys/arch/i386/include/acpi_machdep.h      Thu Jul 18 11:59:06 2002 +0000
+++ b/sys/arch/i386/include/acpi_machdep.h      Thu Jul 18 12:05:11 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.h,v 1.4 2002/06/18 07:56:14 tshiozak Exp $        */
+/*     $NetBSD: acpi_machdep.h,v 1.5 2002/07/18 12:05:12 kanaoka Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -65,6 +65,7 @@
 
 BOOLEAN                acpi_md_OsReadable(void *, UINT32);
 BOOLEAN                acpi_md_OsWritable(void *, UINT32);
+void           acpi_md_OsDisableInterrupt(void);
 
 int            acpi_md_sleep(int);
 
diff -r 4a9f36a2d52c -r 33ae247633de sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Thu Jul 18 11:59:06 2002 +0000
+++ b/sys/dev/acpi/acpi.c       Thu Jul 18 12:05:11 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.11 2002/06/18 10:26:15 drochner Exp $       */
+/*     $NetBSD: acpi.c,v 1.12 2002/07/18 12:05:11 kanaoka Exp $        */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.11 2002/06/18 10:26:15 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.12 2002/07/18 12:05:11 kanaoka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -762,6 +762,7 @@
                }
                if (state==ACPI_STATE_S1) {
                        /* just enter the state */
+                       acpi_md_OsDisableInterrupt();
                        AcpiEnterSleepState((UINT8)state);
                        AcpiUtReleaseMutex(ACPI_MTX_HARDWARE);
                } else {
@@ -782,6 +783,7 @@
                break;
        case ACPI_STATE_S5:
                AcpiEnterSleepStatePrep(ACPI_STATE_S5);
+               acpi_md_OsDisableInterrupt();
                AcpiEnterSleepState(ACPI_STATE_S5);
                printf("WARNING: powerdown failed!\n");
                break;



Home | Main Index | Thread Index | Old Index