Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/acpi use AcpiHwRegister{Read, Write} functions ...



details:   https://anonhg.NetBSD.org/src/rev/941d1e4ba526
branches:  trunk
changeset: 532950:941d1e4ba526
user:      tshiozak <tshiozak%NetBSD.org@localhost>
date:      Tue Jun 18 07:53:05 2002 +0000

description:
use AcpiHwRegister{Read,Write} functions instead of (obsoleted)
AcpiHwBitRegister{Read,Write}.

diffstat:

 sys/arch/i386/acpi/acpi_wakeup.c |  38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diffs (76 lines):

diff -r 67491544a3b4 -r 941d1e4ba526 sys/arch/i386/acpi/acpi_wakeup.c
--- a/sys/arch/i386/acpi/acpi_wakeup.c  Tue Jun 18 07:41:15 2002 +0000
+++ b/sys/arch/i386/acpi/acpi_wakeup.c  Tue Jun 18 07:53:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_wakeup.c,v 1.1 2002/06/18 07:25:14 tshiozak Exp $ */
+/*     $NetBSD: acpi_wakeup.c,v 1.2 2002/06/18 07:53:05 tshiozak Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.1 2002/06/18 07:25:14 tshiozak Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.2 2002/06/18 07:53:05 tshiozak Exp $");
 
 /*-
  * Copyright (c) 2001 Takanori Watanabe <takawata%jp.freebsd.org@localhost>
@@ -115,28 +115,30 @@
 static ACPI_STATUS
 enter_s4_with_bios(void)
 {
-    ACPI_OBJECT_LIST    ArgList;
-    ACPI_OBJECT         Arg;
-       u_long          ef;
+       ACPI_OBJECT_LIST        ArgList;
+       ACPI_OBJECT             Arg;
+       u_long                  ef;
+       UINT32                  ret;
+       ACPI_STATUS             status;
 
        ACPI_FUNCTION_TRACE("AcpiEnterSleepStateS4Bios");
 
        /* run the _PTS and _GTS methods */
 
-    ACPI_MEMSET(&ArgList, 0, sizeof(ArgList));
-    ArgList.Count = 1;
-    ArgList.Pointer = &Arg;
+       ACPI_MEMSET(&ArgList, 0, sizeof(ArgList));
+       ArgList.Count = 1;
+       ArgList.Pointer = &Arg;
 
-    ACPI_MEMSET(&Arg, 0, sizeof(Arg));
-    Arg.Type = ACPI_TYPE_INTEGER;
-    Arg.Integer.Value = ACPI_STATE_S4;
+       ACPI_MEMSET(&Arg, 0, sizeof(Arg));
+       Arg.Type = ACPI_TYPE_INTEGER;
+       Arg.Integer.Value = ACPI_STATE_S4;
 
-    AcpiEvaluateObject (NULL, "\\_PTS", &ArgList, NULL);
-    AcpiEvaluateObject (NULL, "\\_GTS", &ArgList, NULL);
+       AcpiEvaluateObject (NULL, "\\_PTS", &ArgList, NULL);
+       AcpiEvaluateObject (NULL, "\\_GTS", &ArgList, NULL);
 
        /* clear wake status */
 
-       AcpiHwBitRegisterWrite(ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_LOCK);
+       AcpiHwRegisterWrite(TRUE, ACPI_BITREG_WAKE_STATUS, 1);
 
        ef = read_eflags();
        disable_intr();
@@ -154,8 +156,12 @@
                        AcpiOsStall(1000000);
                        AcpiOsWritePort(AcpiGbl_FADT->SmiCmd,
                                        AcpiGbl_FADT->S4BiosReq, 8);
-       } while (!AcpiHwBitRegisterRead(ACPI_BITREG_WAKE_STATUS,
-                                       ACPI_MTX_LOCK));
+                       status = AcpiHwRegisterRead(TRUE,
+                                                   ACPI_BITREG_WAKE_STATUS,
+                                                   &ret);
+                       if (ACPI_FAILURE(status))
+                               break;
+       } while (!ret);
 
        AcpiHwEnableNonWakeupGpes();
 



Home | Main Index | Thread Index | Old Index