Source-Changes-HG archive

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

[src/trunk]: src/sys Update for acpica-unix-20020612. From Takayoshi Kochi.



details:   https://anonhg.NetBSD.org/src/rev/5b449ad53927
branches:  trunk
changeset: 532819:5b449ad53927
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jun 15 18:01:05 2002 +0000

description:
Update for acpica-unix-20020612.  From Takayoshi Kochi.

diffstat:

 sys/arch/i386/i386/acpi_machdep.c        |   6 ++--
 sys/arch/i386/include/acpi_machdep.h     |   4 +-
 sys/dev/acpi/acpi.c                      |  11 ++++----
 sys/dev/acpi/acpi_ec.c                   |  40 +++++++++++++++++--------------
 sys/dev/acpi/acpi_resource.c             |  10 ++++----
 sys/dev/acpi/acpica/Osd/OsdEnvironment.c |  12 ++++----
 sys/dev/acpi/acpica/Osd/OsdHardware.c    |  10 ++++----
 sys/dev/acpi/acpica/Osd/OsdInterrupt.c   |  10 ++++----
 sys/dev/acpi/acpica/Osd/OsdMemory.c      |  19 +-------------
 sys/dev/acpi/acpica/Osd/OsdMisc.c        |  12 ++++++++-
 sys/dev/acpi/acpica/Osd/OsdSchedule.c    |  16 ++++++------
 sys/dev/acpi/acpica/Osd/OsdStream.c      |  16 ++++--------
 sys/dev/acpi/acpica/Osd/OsdSynch.c       |  14 +++++-----
 sys/dev/acpi/acpireg.h                   |  14 ++++++++++-
 14 files changed, 100 insertions(+), 94 deletions(-)

diffs (truncated from 722 to 300 lines):

diff -r 2c9bf8b15934 -r 5b449ad53927 sys/arch/i386/i386/acpi_machdep.c
--- a/sys/arch/i386/i386/acpi_machdep.c Sat Jun 15 17:59:50 2002 +0000
+++ b/sys/arch/i386/i386/acpi_machdep.c Sat Jun 15 18:01:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.c,v 1.2 2001/11/15 07:03:28 lukem Exp $   */
+/*     $NetBSD: acpi_machdep.c,v 1.3 2002/06/15 18:01:05 thorpej Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.2 2001/11/15 07:03:28 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.3 2002/06/15 18:01:05 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -77,7 +77,7 @@
 }
 
 ACPI_STATUS
-acpi_md_OsGetRootPointer(UINT32 Flags, ACPI_PHYSICAL_ADDRESS *PhysicalAddress)
+acpi_md_OsGetRootPointer(UINT32 Flags, ACPI_POINTER *PhysicalAddress)
 {
 
        return (AcpiFindRootPointer(Flags, PhysicalAddress));
diff -r 2c9bf8b15934 -r 5b449ad53927 sys/arch/i386/include/acpi_machdep.h
--- a/sys/arch/i386/include/acpi_machdep.h      Sat Jun 15 17:59:50 2002 +0000
+++ b/sys/arch/i386/include/acpi_machdep.h      Sat Jun 15 18:01:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_machdep.h,v 1.2 2001/09/28 01:50:04 thorpej Exp $ */
+/*     $NetBSD: acpi_machdep.h,v 1.3 2002/06/15 18:01:05 thorpej Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -44,7 +44,7 @@
 
 ACPI_STATUS    acpi_md_OsInitialize(void);
 ACPI_STATUS    acpi_md_OsTerminate(void);
-ACPI_STATUS    acpi_md_OsGetRootPointer(UINT32, ACPI_PHYSICAL_ADDRESS *);
+ACPI_STATUS    acpi_md_OsGetRootPointer(UINT32, ACPI_POINTER *);
 
 #define        acpi_md_OsIn8(x)        inb((x))
 #define        acpi_md_OsIn16(x)       inw((x))
diff -r 2c9bf8b15934 -r 5b449ad53927 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Sat Jun 15 17:59:50 2002 +0000
+++ b/sys/dev/acpi/acpi.c       Sat Jun 15 18:01:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.7 2002/03/24 03:32:14 sommerfeld Exp $      */
+/*     $NetBSD: acpi.c,v 1.8 2002/06/15 18:03:41 thorpej Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.7 2002/03/24 03:32:14 sommerfeld Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.8 2002/06/15 18:03:41 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -558,7 +558,7 @@
 
        printf("%s: fixed power button pressed\n", sc->sc_dev.dv_xname);
 
-       return (INTERRUPT_HANDLED);
+       return (ACPI_INTERRUPT_HANDLED);
 }
 
 /*
@@ -575,7 +575,7 @@
 
        printf("%s: fixed sleep button pressed\n", sc->sc_dev.dv_xname);
 
-       return (INTERRUPT_HANDLED);
+       return (ACPI_INTERRUPT_HANDLED);
 }
 
 /*****************************************************************************
@@ -703,9 +703,10 @@
        if (rv != AE_BUFFER_OVERFLOW)
                return (rv);
 
-       buf->Pointer = AcpiOsCallocate(buf->Length);
+       buf->Pointer = AcpiOsAllocate(buf->Length);
        if (buf->Pointer == NULL)
                return (AE_NO_MEMORY);
+       memset(buf->Pointer, 0, buf->Length);
 
        return ((*getit)(handle, buf));
 }
diff -r 2c9bf8b15934 -r 5b449ad53927 sys/dev/acpi/acpi_ec.c
--- a/sys/dev/acpi/acpi_ec.c    Sat Jun 15 17:59:50 2002 +0000
+++ b/sys/dev/acpi/acpi_ec.c    Sat Jun 15 18:01:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_ec.c,v 1.3 2001/11/13 13:01:57 lukem Exp $        */
+/*     $NetBSD: acpi_ec.c,v 1.4 2002/06/15 18:03:41 thorpej Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -172,7 +172,7 @@
  *****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.3 2001/11/13 13:01:57 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.4 2002/06/15 18:03:41 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -183,11 +183,12 @@
 #include <machine/bus.h>
 
 #include <dev/acpi/acpica.h>
+#include <dev/acpi/acpireg.h>
 #include <dev/acpi/acpivar.h>
 #include <dev/acpi/acpi_ecreg.h>
 
-#define _COMPONENT     ACPI_EC
-MODULE_NAME("EC")
+#define _COMPONENT     ACPI_EC_COMPONENT
+ACPI_MODULE_NAME("EC")
 
 struct acpi_ec_softc {
        struct device   sc_dev;         /* base device glue */
@@ -223,12 +224,14 @@
 #define        EC_CSR_WRITE(sc, v)                                             \
        bus_space_write_1((sc)->sc_csr_st, (sc)->sc_csr_sh, 0, (v))
 
+static UINT32 glk;                     /* XXX XXX XXX */
+
 static __inline ACPI_STATUS
 EcLock(struct acpi_ec_softc *sc)
 {
        ACPI_STATUS status;
 
-       status = AcpiAcquireGlobalLock();
+       status = AcpiAcquireGlobalLock(EC_LOCK_TIMEOUT, &glk);
        if (status == AE_OK)
                (sc)->sc_flags |= EC_F_LOCKED;
        return (status);
@@ -239,7 +242,7 @@
 {
 
        (sc)->sc_flags &= ~EC_F_LOCKED;
-       AcpiReleaseGlobalLock();
+       AcpiReleaseGlobalLock(glk);
 }
 
 static __inline int
@@ -260,7 +263,8 @@
                            void *Context, void **return_Context);
 static ACPI_STATUS     EcSpaceHandler(UINT32 Function,
                            ACPI_PHYSICAL_ADDRESS Address, UINT32 width,
-                           UINT32 *Value, void *Context, void *RegionContext);
+                           ACPI_INTEGER *Value, void *Context,
+                           void *RegionContext);
 
 static ACPI_STATUS     EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event);
 static ACPI_STATUS     EcQuery(struct acpi_ec_softc *sc, UINT8 *Data);
@@ -310,7 +314,7 @@
        struct acpi_io *io0, *io1;
        ACPI_STATUS rv;
 
-       FUNCTION_TRACE(__FUNCTION__);
+       ACPI_FUNCTION_TRACE(__FUNCTION__);
 
        printf(": ACPI Embedded Controller\n");
 
@@ -402,7 +406,7 @@
        ACPI_STATUS Status;
        char qxx[5];
 
-       FUNCTION_TRACE(__FUNCTION__);
+       ACPI_FUNCTION_TRACE(__FUNCTION__);
 
        for (;;) {
                /*
@@ -455,7 +459,7 @@
        /* I know I request Level trigger cleanup */
        if (AcpiClearEvent(sc->sc_gpebit, ACPI_EVENT_GPE) != AE_OK)
                printf("%s: AcpiClearEvent failed\n", sc->sc_dev.dv_xname);
-       if (AcpiEnableEvent(sc->sc_gpebit, ACPI_EVENT_GPE) != AE_OK)
+       if (AcpiEnableEvent(sc->sc_gpebit, ACPI_EVENT_GPE, 0) != AE_OK)
                printf("%s: AcpiEnableEvent failed\n", sc->sc_dev.dv_xname);
 
        return_VOID;
@@ -496,7 +500,7 @@
     void **RegionContext)
 {
 
-       FUNCTION_TRACE(__FUNCTION__);
+       ACPI_FUNCTION_TRACE(__FUNCTION__);
 
        /*
         * Just pass the context through, there's nothing to do here.
@@ -508,27 +512,27 @@
 
 static ACPI_STATUS
 EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width,
-    UINT32 *Value, void *Context, void *RegionContext)
+    ACPI_INTEGER *Value, void *Context, void *RegionContext)
 {
        struct acpi_ec_softc *sc = Context;
        ACPI_STATUS Status = AE_OK;
        EC_REQUEST EcRequest;
        int i;
 
-       FUNCTION_TRACE_U32(__FUNCTION__, (UINT32)Address);
+       ACPI_FUNCTION_TRACE_U32(__FUNCTION__, (UINT32)Address);
 
        if ((Address > 0xFF) || (width % 8 != 0) || (Value == NULL) ||
            (Context == NULL))
                return_ACPI_STATUS(AE_BAD_PARAMETER);
 
        switch (Function) {
-       case ACPI_READ_ADR_SPACE:
+       case ACPI_READ:
                EcRequest.Command = EC_COMMAND_READ;
                EcRequest.Address = Address;
                (*Value) = 0;
                break;
 
-       case ACPI_WRITE_ADR_SPACE:
+       case ACPI_WRITE:
                EcRequest.Command = EC_COMMAND_WRITE;
                EcRequest.Address = Address;
                break;
@@ -544,7 +548,7 @@
         */
        (*Value) = 0;
        for (i = 0; i < width; i += 8) {
-               if (Function == ACPI_READ_ADR_SPACE)
+               if (Function == ACPI_READ)
                        EcRequest.Data = 0;
                else
                        EcRequest.Data = (UINT8)((*Value) >> i);
@@ -566,7 +570,7 @@
        EC_STATUS EcStatus;
        int i;
 
-       FUNCTION_TRACE_U32(__FUNCTION__, (UINT32)Event);
+       ACPI_FUNCTION_TRACE_U32(__FUNCTION__, (UINT32)Event);
 
        /* XXX Need better test for "yes, you have interrupts". */
        if (cold)
@@ -711,7 +715,7 @@
        if (AcpiClearEvent(sc->sc_gpebit, ACPI_EVENT_GPE) != AE_OK)
                printf("%s: EcRequest: unable to clear EC GPE\n",
                    sc->sc_dev.dv_xname);
-       if (AcpiEnableEvent(sc->sc_gpebit, ACPI_EVENT_GPE) != AE_OK)
+       if (AcpiEnableEvent(sc->sc_gpebit, ACPI_EVENT_GPE, 0) != AE_OK)
                printf("%s: EcRequest: unable to reenable EC GPE\n",
                    sc->sc_dev.dv_xname);
 
diff -r 2c9bf8b15934 -r 5b449ad53927 sys/dev/acpi/acpi_resource.c
--- a/sys/dev/acpi/acpi_resource.c      Sat Jun 15 17:59:50 2002 +0000
+++ b/sys/dev/acpi/acpi_resource.c      Sat Jun 15 18:01:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_resource.c,v 1.3 2002/06/01 23:50:56 lukem Exp $  */
+/*     $NetBSD: acpi_resource.c,v 1.4 2002/06/15 18:03:42 thorpej Exp $        */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.3 2002/06/01 23:50:56 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.4 2002/06/15 18:03:42 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -78,8 +78,8 @@
 #include <dev/acpi/acpireg.h>
 #include <dev/acpi/acpivar.h>
 
-#define        _COMPONENT      ACPI_BUS
-MODULE_NAME("RESOURCE")
+#define        _COMPONENT      ACPI_RESOURCE_COMPONENT
+ACPI_MODULE_NAME("RESOURCE")
 
 /*
  * acpi_resource_parse:
@@ -101,7 +101,7 @@
        void *context;
        int i;
 
-       FUNCTION_TRACE(__FUNCTION__);
+       ACPI_FUNCTION_TRACE(__FUNCTION__);
 
        /*
         * XXX Note, this means we only get devices that are currently
diff -r 2c9bf8b15934 -r 5b449ad53927 sys/dev/acpi/acpica/Osd/OsdEnvironment.c
--- a/sys/dev/acpi/acpica/Osd/OsdEnvironment.c  Sat Jun 15 17:59:50 2002 +0000
+++ b/sys/dev/acpi/acpica/Osd/OsdEnvironment.c  Sat Jun 15 18:01:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdEnvironment.c,v 1.2 2001/11/13 13:01:58 lukem Exp $ */
+/*     $NetBSD: OsdEnvironment.c,v 1.3 2002/06/15 18:02:43 thorpej Exp $       */



Home | Main Index | Thread Index | Old Index