[ACPICA]
authorThomas Faber <thomas.faber@reactos.org>
Tue, 10 Nov 2015 13:51:38 +0000 (13:51 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 10 Nov 2015 13:51:38 +0000 (13:51 +0000)
- Update to version 20141107
- Get rid of the ROS diffs in actypes.h by making use of the new ACPI_USE_SYSTEM_INTTYPES define

svn path=/trunk/; revision=69866

177 files changed:
reactos/drivers/bus/acpi/CMakeLists.txt
reactos/drivers/bus/acpi/acpica/dispatcher/dsargs.c
reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsfield.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsinit.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsmethod.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c
reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c
reactos/drivers/bus/acpi/acpica/dispatcher/dswload.c
reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c
reactos/drivers/bus/acpi/acpica/dispatcher/dswscope.c
reactos/drivers/bus/acpi/acpica/dispatcher/dswstate.c
reactos/drivers/bus/acpi/acpica/events/evglock.c
reactos/drivers/bus/acpi/acpica/events/evgpe.c
reactos/drivers/bus/acpi/acpica/events/evgpeblk.c
reactos/drivers/bus/acpi/acpica/events/evgpeinit.c
reactos/drivers/bus/acpi/acpica/events/evhandler.c
reactos/drivers/bus/acpi/acpica/events/evregion.c
reactos/drivers/bus/acpi/acpica/events/evrgnini.c
reactos/drivers/bus/acpi/acpica/events/evxface.c
reactos/drivers/bus/acpi/acpica/events/evxfevnt.c
reactos/drivers/bus/acpi/acpica/events/evxfgpe.c
reactos/drivers/bus/acpi/acpica/events/evxfregn.c
reactos/drivers/bus/acpi/acpica/executer/exconfig.c
reactos/drivers/bus/acpi/acpica/executer/exconvrt.c
reactos/drivers/bus/acpi/acpica/executer/excreate.c
reactos/drivers/bus/acpi/acpica/executer/exdebug.c
reactos/drivers/bus/acpi/acpica/executer/exdump.c
reactos/drivers/bus/acpi/acpica/executer/exfield.c
reactos/drivers/bus/acpi/acpica/executer/exfldio.c
reactos/drivers/bus/acpi/acpica/executer/exmisc.c
reactos/drivers/bus/acpi/acpica/executer/exmutex.c
reactos/drivers/bus/acpi/acpica/executer/exnames.c
reactos/drivers/bus/acpi/acpica/executer/exoparg1.c
reactos/drivers/bus/acpi/acpica/executer/exoparg2.c
reactos/drivers/bus/acpi/acpica/executer/exoparg3.c
reactos/drivers/bus/acpi/acpica/executer/exoparg6.c
reactos/drivers/bus/acpi/acpica/executer/exprep.c
reactos/drivers/bus/acpi/acpica/executer/exregion.c
reactos/drivers/bus/acpi/acpica/executer/exresnte.c
reactos/drivers/bus/acpi/acpica/executer/exresolv.c
reactos/drivers/bus/acpi/acpica/executer/exresop.c
reactos/drivers/bus/acpi/acpica/executer/exstore.c
reactos/drivers/bus/acpi/acpica/executer/exstoren.c
reactos/drivers/bus/acpi/acpica/executer/exstorob.c
reactos/drivers/bus/acpi/acpica/executer/exsystem.c
reactos/drivers/bus/acpi/acpica/executer/exutils.c
reactos/drivers/bus/acpi/acpica/hardware/hwacpi.c
reactos/drivers/bus/acpi/acpica/hardware/hwgpe.c
reactos/drivers/bus/acpi/acpica/hardware/hwpci.c
reactos/drivers/bus/acpi/acpica/hardware/hwregs.c
reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c
reactos/drivers/bus/acpi/acpica/include/acapps.h
reactos/drivers/bus/acpi/acpica/include/acbuffer.h
reactos/drivers/bus/acpi/acpica/include/acconfig.h
reactos/drivers/bus/acpi/acpica/include/acdebug.h
reactos/drivers/bus/acpi/acpica/include/acdisasm.h
reactos/drivers/bus/acpi/acpica/include/acdispat.h
reactos/drivers/bus/acpi/acpica/include/acevents.h
reactos/drivers/bus/acpi/acpica/include/acglobal.h
reactos/drivers/bus/acpi/acpica/include/aclocal.h
reactos/drivers/bus/acpi/acpica/include/acnames.h
reactos/drivers/bus/acpi/acpica/include/acobject.h
reactos/drivers/bus/acpi/acpica/include/acparser.h
reactos/drivers/bus/acpi/acpica/include/acpi.h
reactos/drivers/bus/acpi/acpica/include/acpiosxf.h
reactos/drivers/bus/acpi/acpica/include/acpixf.h
reactos/drivers/bus/acpi/acpica/include/acpredef.h
reactos/drivers/bus/acpi/acpica/include/actables.h
reactos/drivers/bus/acpi/acpica/include/actbl.h
reactos/drivers/bus/acpi/acpica/include/actbl1.h
reactos/drivers/bus/acpi/acpica/include/actbl2.h
reactos/drivers/bus/acpi/acpica/include/actbl3.h
reactos/drivers/bus/acpi/acpica/include/actypes.h
reactos/drivers/bus/acpi/acpica/include/acutils.h
reactos/drivers/bus/acpi/acpica/include/amlresrc.h
reactos/drivers/bus/acpi/acpica/include/platform/accygwin.h
reactos/drivers/bus/acpi/acpica/include/platform/acefi.h
reactos/drivers/bus/acpi/acpica/include/platform/acenv.h
reactos/drivers/bus/acpi/acpica/include/platform/acenvex.h [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/include/platform/achaiku.h
reactos/drivers/bus/acpi/acpica/include/platform/aclinux.h
reactos/drivers/bus/acpi/acpica/include/platform/aclinuxex.h [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h
reactos/drivers/bus/acpi/acpica/include/platform/acwin.h
reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c
reactos/drivers/bus/acpi/acpica/namespace/nsalloc.c
reactos/drivers/bus/acpi/acpica/namespace/nsconvert.c
reactos/drivers/bus/acpi/acpica/namespace/nsdump.c
reactos/drivers/bus/acpi/acpica/namespace/nsdumpdv.c
reactos/drivers/bus/acpi/acpica/namespace/nseval.c
reactos/drivers/bus/acpi/acpica/namespace/nsinit.c
reactos/drivers/bus/acpi/acpica/namespace/nsload.c
reactos/drivers/bus/acpi/acpica/namespace/nsnames.c
reactos/drivers/bus/acpi/acpica/namespace/nsobject.c
reactos/drivers/bus/acpi/acpica/namespace/nsparse.c
reactos/drivers/bus/acpi/acpica/namespace/nsprepkg.c
reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c
reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c
reactos/drivers/bus/acpi/acpica/namespace/nssearch.c
reactos/drivers/bus/acpi/acpica/namespace/nsutils.c
reactos/drivers/bus/acpi/acpica/namespace/nswalk.c
reactos/drivers/bus/acpi/acpica/namespace/nsxfeval.c
reactos/drivers/bus/acpi/acpica/namespace/nsxfname.c
reactos/drivers/bus/acpi/acpica/namespace/nsxfobj.c
reactos/drivers/bus/acpi/acpica/parser/psargs.c
reactos/drivers/bus/acpi/acpica/parser/psloop.c
reactos/drivers/bus/acpi/acpica/parser/psobject.c
reactos/drivers/bus/acpi/acpica/parser/psopcode.c
reactos/drivers/bus/acpi/acpica/parser/psopinfo.c
reactos/drivers/bus/acpi/acpica/parser/psparse.c
reactos/drivers/bus/acpi/acpica/parser/psscope.c
reactos/drivers/bus/acpi/acpica/parser/pstree.c
reactos/drivers/bus/acpi/acpica/parser/psutils.c
reactos/drivers/bus/acpi/acpica/parser/pswalk.c
reactos/drivers/bus/acpi/acpica/parser/psxface.c
reactos/drivers/bus/acpi/acpica/resources/rsaddr.c
reactos/drivers/bus/acpi/acpica/resources/rscalc.c
reactos/drivers/bus/acpi/acpica/resources/rscreate.c
reactos/drivers/bus/acpi/acpica/resources/rsdump.c
reactos/drivers/bus/acpi/acpica/resources/rsdumpinfo.c
reactos/drivers/bus/acpi/acpica/resources/rsinfo.c
reactos/drivers/bus/acpi/acpica/resources/rsio.c
reactos/drivers/bus/acpi/acpica/resources/rsirq.c
reactos/drivers/bus/acpi/acpica/resources/rslist.c
reactos/drivers/bus/acpi/acpica/resources/rsmemory.c
reactos/drivers/bus/acpi/acpica/resources/rsmisc.c
reactos/drivers/bus/acpi/acpica/resources/rsserial.c
reactos/drivers/bus/acpi/acpica/resources/rsutils.c
reactos/drivers/bus/acpi/acpica/resources/rsxface.c
reactos/drivers/bus/acpi/acpica/tables/tbdata.c
reactos/drivers/bus/acpi/acpica/tables/tbfadt.c
reactos/drivers/bus/acpi/acpica/tables/tbfind.c
reactos/drivers/bus/acpi/acpica/tables/tbinstal.c
reactos/drivers/bus/acpi/acpica/tables/tbprint.c
reactos/drivers/bus/acpi/acpica/tables/tbutils.c
reactos/drivers/bus/acpi/acpica/tables/tbxface.c
reactos/drivers/bus/acpi/acpica/tables/tbxfload.c
reactos/drivers/bus/acpi/acpica/tables/tbxfroot.c
reactos/drivers/bus/acpi/acpica/utilities/utaddress.c
reactos/drivers/bus/acpi/acpica/utilities/utalloc.c
reactos/drivers/bus/acpi/acpica/utilities/utbuffer.c
reactos/drivers/bus/acpi/acpica/utilities/utcache.c
reactos/drivers/bus/acpi/acpica/utilities/utclib.c
reactos/drivers/bus/acpi/acpica/utilities/utcopy.c
reactos/drivers/bus/acpi/acpica/utilities/utdebug.c
reactos/drivers/bus/acpi/acpica/utilities/utdecode.c
reactos/drivers/bus/acpi/acpica/utilities/utdelete.c
reactos/drivers/bus/acpi/acpica/utilities/uterror.c
reactos/drivers/bus/acpi/acpica/utilities/uteval.c
reactos/drivers/bus/acpi/acpica/utilities/utexcep.c
reactos/drivers/bus/acpi/acpica/utilities/utfileio.c [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/utilities/utglobal.c
reactos/drivers/bus/acpi/acpica/utilities/uthex.c [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/utilities/utids.c
reactos/drivers/bus/acpi/acpica/utilities/utinit.c
reactos/drivers/bus/acpi/acpica/utilities/utlock.c
reactos/drivers/bus/acpi/acpica/utilities/utmath.c
reactos/drivers/bus/acpi/acpica/utilities/utmisc.c
reactos/drivers/bus/acpi/acpica/utilities/utmutex.c
reactos/drivers/bus/acpi/acpica/utilities/utobject.c
reactos/drivers/bus/acpi/acpica/utilities/utosi.c
reactos/drivers/bus/acpi/acpica/utilities/utownerid.c
reactos/drivers/bus/acpi/acpica/utilities/utpredef.c
reactos/drivers/bus/acpi/acpica/utilities/utprint.c [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/utilities/utresrc.c
reactos/drivers/bus/acpi/acpica/utilities/utstate.c
reactos/drivers/bus/acpi/acpica/utilities/utstring.c
reactos/drivers/bus/acpi/acpica/utilities/uttrack.c
reactos/drivers/bus/acpi/acpica/utilities/utuuid.c [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/utilities/utxface.c
reactos/drivers/bus/acpi/acpica/utilities/utxferror.c
reactos/drivers/bus/acpi/acpica/utilities/utxfinit.c
reactos/drivers/bus/acpi/acpica/utilities/utxfmutex.c

index cac5c15..fcf9329 100644 (file)
@@ -133,11 +133,13 @@ list(APPEND ACPICA_SOURCE
     acpica/utilities/utcache.c
     acpica/utilities/utclib.c
     acpica/utilities/utcopy.c
     acpica/utilities/utcache.c
     acpica/utilities/utclib.c
     acpica/utilities/utcopy.c
-    acpica/utilities/utdebug.c
+    acpica/utilities/utdebug.c
     acpica/utilities/utdecode.c
     acpica/utilities/utdelete.c
     acpica/utilities/uterror.c
     acpica/utilities/uteval.c
     acpica/utilities/utdecode.c
     acpica/utilities/utdelete.c
     acpica/utilities/uterror.c
     acpica/utilities/uteval.c
+    # acpica/utilities/utfileio.c
+    acpica/utilities/uthex.c
     acpica/utilities/utids.c
     acpica/utilities/utinit.c
     acpica/utilities/utlock.c
     acpica/utilities/utids.c
     acpica/utilities/utinit.c
     acpica/utilities/utlock.c
@@ -148,9 +150,11 @@ list(APPEND ACPICA_SOURCE
     acpica/utilities/utosi.c
     acpica/utilities/utownerid.c
     acpica/utilities/utpredef.c
     acpica/utilities/utosi.c
     acpica/utilities/utownerid.c
     acpica/utilities/utpredef.c
+    # acpica/utilities/utprint.c
     acpica/utilities/utresrc.c
     acpica/utilities/utstate.c
     acpica/utilities/utstring.c
     acpica/utilities/utresrc.c
     acpica/utilities/utstate.c
     acpica/utilities/utstring.c
+    # acpica/utilities/utuuid.c
     acpica/utilities/uttrack.c
     acpica/utilities/utxface.c
     acpica/utilities/utxferror.c
     acpica/utilities/uttrack.c
     acpica/utilities/utxface.c
     acpica/utilities/utxferror.c
index 7801341..d70b6a9 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSARGS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 6ed6010..85df0e3 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSCONTROL_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
index 2219952..d14434b 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSFIELD_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
@@ -463,6 +461,7 @@ AcpiDsGetFieldNames (
              */
             Info->ResourceBuffer = NULL;
             Info->ConnectionNode = NULL;
              */
             Info->ResourceBuffer = NULL;
             Info->ConnectionNode = NULL;
+            Info->PinNumberIndex = 0;
 
             /*
              * A Connection() is either an actual resource descriptor (buffer)
 
             /*
              * A Connection() is either an actual resource descriptor (buffer)
@@ -538,6 +537,7 @@ AcpiDsGetFieldNames (
             }
 
             Info->FieldBitPosition += Info->FieldBitLength;
             }
 
             Info->FieldBitPosition += Info->FieldBitLength;
+            Info->PinNumberIndex++; /* Index relative to previous Connection() */
             break;
 
         default:
             break;
 
         default:
index 22ed601..f68c66e 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSINIT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
index 5d1985a..d8d8230 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSMETHOD_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
index 9b664bc..7f94325 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSMTHDAT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
index d6260b5..59d4656 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSOBJECT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 83d482d..c1f265d 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSOPCODE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 2553ad2..81d73cb 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSUTILS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index afa707d..877d30f 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSWEXEC_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 7f811dd..de70dee 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSWLOAD_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index bef85cb..4fc1485 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSWLOAD2_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 62f2596..7caa301 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __DSWSCOPE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
index e76d4ce..4d24d2c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __DSWSTATE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index fa1954a..6ddf32b 100644 (file)
 
 #define _COMPONENT          ACPI_EVENTS
         ACPI_MODULE_NAME    ("evglock")
 
 #define _COMPONENT          ACPI_EVENTS
         ACPI_MODULE_NAME    ("evglock")
-
+#if ACPI_REDUCED_HARDWARE
+#error
+#endif
 #if (!ACPI_REDUCED_HARDWARE) /* Entire module */
 
 /* Local prototypes */
 #if (!ACPI_REDUCED_HARDWARE) /* Entire module */
 
 /* Local prototypes */
index d27fd80..ea1a3a6 100644 (file)
@@ -504,7 +504,7 @@ AcpiEvGpeDetect (
                   GpeRegisterInfo->EnableForWake))
             {
                 ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
                   GpeRegisterInfo->EnableForWake))
             {
                 ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
-                    "Ignore disabled registers for GPE%02X-GPE%02X: "
+                    "Ignore disabled registers for GPE %02X-%02X: "
                     "RunEnable=%02X, WakeEnable=%02X\n",
                     GpeRegisterInfo->BaseGpeNumber,
                     GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
                     "RunEnable=%02X, WakeEnable=%02X\n",
                     GpeRegisterInfo->BaseGpeNumber,
                     GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
@@ -530,7 +530,7 @@ AcpiEvGpeDetect (
             }
 
             ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
             }
 
             ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
-                "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
+                "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
                 "RunEnable=%02X, WakeEnable=%02X\n",
                 GpeRegisterInfo->BaseGpeNumber,
                 GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
                 "RunEnable=%02X, WakeEnable=%02X\n",
                 GpeRegisterInfo->BaseGpeNumber,
                 GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
@@ -832,22 +832,6 @@ AcpiEvGpeDispatch (
              GpeNumber, AcpiGbl_GlobalEventHandlerContext);
     }
 
              GpeNumber, AcpiGbl_GlobalEventHandlerContext);
     }
 
-    /*
-     * If edge-triggered, clear the GPE status bit now. Note that
-     * level-triggered events are cleared after the GPE is serviced.
-     */
-    if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
-            ACPI_GPE_EDGE_TRIGGERED)
-    {
-        Status = AcpiHwClearGpe (GpeEventInfo);
-        if (ACPI_FAILURE (Status))
-        {
-            ACPI_EXCEPTION ((AE_INFO, Status,
-                "Unable to clear GPE%02X", GpeNumber));
-            return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
-        }
-    }
-
     /*
      * Always disable the GPE so that it does not keep firing before
      * any asynchronous activity completes (either from the execution
     /*
      * Always disable the GPE so that it does not keep firing before
      * any asynchronous activity completes (either from the execution
@@ -861,10 +845,28 @@ AcpiEvGpeDispatch (
     if (ACPI_FAILURE (Status))
     {
         ACPI_EXCEPTION ((AE_INFO, Status,
     if (ACPI_FAILURE (Status))
     {
         ACPI_EXCEPTION ((AE_INFO, Status,
-            "Unable to disable GPE%02X", GpeNumber));
+            "Unable to disable GPE %02X", GpeNumber));
         return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
     }
 
         return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
     }
 
+    /*
+     * If edge-triggered, clear the GPE status bit now. Note that
+     * level-triggered events are cleared after the GPE is serviced.
+     */
+    if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
+            ACPI_GPE_EDGE_TRIGGERED)
+    {
+        Status = AcpiHwClearGpe (GpeEventInfo);
+        if (ACPI_FAILURE (Status))
+        {
+            ACPI_EXCEPTION ((AE_INFO, Status,
+                "Unable to clear GPE %02X", GpeNumber));
+            (void) AcpiHwLowSetGpe (GpeEventInfo,
+                    ACPI_GPE_CONDITIONAL_ENABLE);
+            return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
+        }
+    }
+
     /*
      * Dispatch the GPE to either an installed handler or the control
      * method associated with this GPE (_Lxx or _Exx). If a handler
     /*
      * Dispatch the GPE to either an installed handler or the control
      * method associated with this GPE (_Lxx or _Exx). If a handler
@@ -901,7 +903,7 @@ AcpiEvGpeDispatch (
         if (ACPI_FAILURE (Status))
         {
             ACPI_EXCEPTION ((AE_INFO, Status,
         if (ACPI_FAILURE (Status))
         {
             ACPI_EXCEPTION ((AE_INFO, Status,
-                "Unable to queue handler for GPE%02X - event disabled",
+                "Unable to queue handler for GPE %02X - event disabled",
                 GpeNumber));
         }
         break;
                 GpeNumber));
         }
         break;
@@ -913,7 +915,7 @@ AcpiEvGpeDispatch (
          * a GPE to be enabled if it has no handler or method.
          */
         ACPI_ERROR ((AE_INFO,
          * a GPE to be enabled if it has no handler or method.
          */
         ACPI_ERROR ((AE_INFO,
-            "No handler or method for GPE%02X, disabling event",
+            "No handler or method for GPE %02X, disabling event",
             GpeNumber));
         break;
     }
             GpeNumber));
         break;
     }
index f1a5b1b..4de91c1 100644 (file)
@@ -354,17 +354,17 @@ AcpiEvCreateGpeInfoBlocks (
     {
         /* Init the RegisterInfo for this GPE register (8 GPEs) */
 
     {
         /* Init the RegisterInfo for this GPE register (8 GPEs) */
 
-        ThisRegister->BaseGpeNumber = (UINT8) (GpeBlock->BlockBaseNumber +
-                                             (i * ACPI_GPE_REGISTER_WIDTH));
+        ThisRegister->BaseGpeNumber = (UINT16)
+            (GpeBlock->BlockBaseNumber + (i * ACPI_GPE_REGISTER_WIDTH));
 
         ThisRegister->StatusAddress.Address =
 
         ThisRegister->StatusAddress.Address =
-            GpeBlock->BlockAddress.Address + i;
+            GpeBlock->Address + i;
 
         ThisRegister->EnableAddress.Address =
 
         ThisRegister->EnableAddress.Address =
-            GpeBlock->BlockAddress.Address + i + GpeBlock->RegisterCount;
+            GpeBlock->Address + i + GpeBlock->RegisterCount;
 
 
-        ThisRegister->StatusAddress.SpaceId   = GpeBlock->BlockAddress.SpaceId;
-        ThisRegister->EnableAddress.SpaceId   = GpeBlock->BlockAddress.SpaceId;
+        ThisRegister->StatusAddress.SpaceId   = GpeBlock->SpaceId;
+        ThisRegister->EnableAddress.SpaceId   = GpeBlock->SpaceId;
         ThisRegister->StatusAddress.BitWidth  = ACPI_GPE_REGISTER_WIDTH;
         ThisRegister->EnableAddress.BitWidth  = ACPI_GPE_REGISTER_WIDTH;
         ThisRegister->StatusAddress.BitOffset = 0;
         ThisRegister->StatusAddress.BitWidth  = ACPI_GPE_REGISTER_WIDTH;
         ThisRegister->EnableAddress.BitWidth  = ACPI_GPE_REGISTER_WIDTH;
         ThisRegister->StatusAddress.BitOffset = 0;
@@ -437,9 +437,10 @@ ErrorExit:
 ACPI_STATUS
 AcpiEvCreateGpeBlock (
     ACPI_NAMESPACE_NODE     *GpeDevice,
 ACPI_STATUS
 AcpiEvCreateGpeBlock (
     ACPI_NAMESPACE_NODE     *GpeDevice,
-    ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
+    UINT64                  Address,
+    UINT8                   SpaceId,
     UINT32                  RegisterCount,
     UINT32                  RegisterCount,
-    UINT                  GpeBlockBaseNumber,
+    UINT16                  GpeBlockBaseNumber,
     UINT32                  InterruptNumber,
     ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock)
 {
     UINT32                  InterruptNumber,
     ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock)
 {
@@ -466,15 +467,14 @@ AcpiEvCreateGpeBlock (
 
     /* Initialize the new GPE block */
 
 
     /* Initialize the new GPE block */
 
+    GpeBlock->Address = Address;
+    GpeBlock->SpaceId = SpaceId;
     GpeBlock->Node = GpeDevice;
     GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
     GpeBlock->Initialized = FALSE;
     GpeBlock->RegisterCount = RegisterCount;
     GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
 
     GpeBlock->Node = GpeDevice;
     GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
     GpeBlock->Initialized = FALSE;
     GpeBlock->RegisterCount = RegisterCount;
     GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
 
-    ACPI_MEMCPY (&GpeBlock->BlockAddress, GpeBlockAddress,
-        sizeof (ACPI_GENERIC_ADDRESS));
-
     /*
      * Create the RegisterInfo and EventInfo sub-structures
      * Note: disables and clears all GPEs in the block
     /*
      * Create the RegisterInfo and EventInfo sub-structures
      * Note: disables and clears all GPEs in the block
@@ -517,11 +517,11 @@ AcpiEvCreateGpeBlock (
     }
 
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
     }
 
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
-        "    Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
+        "    Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
         (UINT32) GpeBlock->BlockBaseNumber,
         (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
         (UINT32) GpeBlock->BlockBaseNumber,
         (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
-        GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
-        InterruptNumber));
+        GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
+        InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
 
     /* Update global count of currently available GPEs */
 
 
     /* Update global count of currently available GPEs */
 
index 6bf32ff..237a96c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
@@ -211,7 +210,9 @@ AcpiEvGpeInitialize (
         /* Install GPE Block 0 */
 
         Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
         /* Install GPE Block 0 */
 
         Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
-                    &AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,
+                    AcpiGbl_FADT.XGpe0Block.Address,
+                    AcpiGbl_FADT.XGpe0Block.SpaceId,
+                    RegisterCount0, 0,
                     AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
 
         if (ACPI_FAILURE (Status))
                     AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
 
         if (ACPI_FAILURE (Status))
@@ -249,7 +250,9 @@ AcpiEvGpeInitialize (
             /* Install GPE Block 1 */
 
             Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
             /* Install GPE Block 1 */
 
             Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
-                        &AcpiGbl_FADT.XGpe1Block, RegisterCount1,
+                        AcpiGbl_FADT.XGpe1Block.Address,
+                        AcpiGbl_FADT.XGpe1Block.SpaceId,
+                        RegisterCount1,
                         AcpiGbl_FADT.Gpe1Base,
                         AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
 
                         AcpiGbl_FADT.Gpe1Base,
                         AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
 
@@ -512,6 +515,10 @@ AcpiEvMatchGpeMethod (
         return_ACPI_STATUS (AE_OK);
     }
 
         return_ACPI_STATUS (AE_OK);
     }
 
+    /* Disable the GPE in case it's been enabled already. */
+
+    (void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
+
     /*
      * Add the GPE information from above to the GpeEventInfo block for
      * use during dispatch of this GPE.
     /*
      * Add the GPE information from above to the GpeEventInfo block for
      * use during dispatch of this GPE.
index d17411e..b67ba3e 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EVHANDLER_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
index 8f1b24b..ec681da 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EVREGION_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
@@ -231,6 +228,7 @@ AcpiEvAddressSpaceDispatch (
     ACPI_OPERAND_OBJECT     *RegionObj2;
     void                    *RegionContext = NULL;
     ACPI_CONNECTION_INFO    *Context;
     ACPI_OPERAND_OBJECT     *RegionObj2;
     void                    *RegionContext = NULL;
     ACPI_CONNECTION_INFO    *Context;
+    ACPI_PHYSICAL_ADDRESS   Address;
 
 
     ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
 
 
     ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
@@ -320,23 +318,33 @@ AcpiEvAddressSpaceDispatch (
     /* We have everything we need, we can invoke the address space handler */
 
     Handler = HandlerDesc->AddressSpace.Handler;
     /* We have everything we need, we can invoke the address space handler */
 
     Handler = HandlerDesc->AddressSpace.Handler;
-
-    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
-        "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
-        &RegionObj->Region.Handler->AddressSpace, Handler,
-        ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset),
-        AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+    Address = (RegionObj->Region.Address + RegionOffset);
 
     /*
      * Special handling for GenericSerialBus and GeneralPurposeIo:
      * There are three extra parameters that must be passed to the
      * handler via the context:
 
     /*
      * Special handling for GenericSerialBus and GeneralPurposeIo:
      * There are three extra parameters that must be passed to the
      * handler via the context:
-     *   1) Connection buffer, a resource template from Connection() op.
-     *   2) Length of the above buffer.
-     *   3) Actual access length from the AccessAs() op.
+     *   1) Connection buffer, a resource template from Connection() op
+     *   2) Length of the above buffer
+     *   3) Actual access length from the AccessAs() op
+     *
+     * In addition, for GeneralPurposeIo, the Address and BitWidth fields
+     * are defined as follows:
+     *   1) Address is the pin number index of the field (bit offset from
+     *      the previous Connection)
+     *   2) BitWidth is the actual bit length of the field (number of pins)
      */
      */
-    if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) ||
-            (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) &&
+    if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) &&
+        Context &&
+        FieldObj)
+    {
+        /* Get the Connection (ResourceTemplate) buffer */
+
+        Context->Connection = FieldObj->Field.ResourceBuffer;
+        Context->Length = FieldObj->Field.ResourceLength;
+        Context->AccessLength = FieldObj->Field.AccessLength;
+    }
+    if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) &&
         Context &&
         FieldObj)
     {
         Context &&
         FieldObj)
     {
@@ -345,8 +353,16 @@ AcpiEvAddressSpaceDispatch (
         Context->Connection = FieldObj->Field.ResourceBuffer;
         Context->Length = FieldObj->Field.ResourceLength;
         Context->AccessLength = FieldObj->Field.AccessLength;
         Context->Connection = FieldObj->Field.ResourceBuffer;
         Context->Length = FieldObj->Field.ResourceLength;
         Context->AccessLength = FieldObj->Field.AccessLength;
+        Address = FieldObj->Field.PinNumberIndex;
+        BitWidth = FieldObj->Field.BitLength;
     }
 
     }
 
+    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+        "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
+        &RegionObj->Region.Handler->AddressSpace, Handler,
+        ACPI_FORMAT_NATIVE_UINT (Address),
+        AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+
     if (!(HandlerDesc->AddressSpace.HandlerFlags &
             ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
     {
     if (!(HandlerDesc->AddressSpace.HandlerFlags &
             ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
     {
@@ -360,9 +376,8 @@ AcpiEvAddressSpaceDispatch (
 
     /* Call the handler */
 
 
     /* Call the handler */
 
-    Status = Handler (Function,
-        (RegionObj->Region.Address + RegionOffset), BitWidth, Value,
-        Context, RegionObj2->Extra.RegionContext);
+    Status = Handler (Function, Address, BitWidth, Value, Context,
+        RegionObj2->Extra.RegionContext);
 
     if (ACPI_FAILURE (Status))
     {
 
     if (ACPI_FAILURE (Status))
     {
index ac321c7..d439c31 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EVRGNINI_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
index 85355a5..9b8a1ce 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EVXFACE_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
@@ -1109,7 +1107,8 @@ AcpiRemoveGpeHandler (
      * enabled, it should be enabled at this point to restore the
      * post-initialization configuration.
      */
      * enabled, it should be enabled at this point to restore the
      * post-initialization configuration.
      */
-    if ((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) &&
+    if (((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) ||
+         (Handler->OriginalFlags & ACPI_GPE_DISPATCH_NOTIFY)) &&
         Handler->OriginallyEnabled)
     {
         (void) AcpiEvAddGpeReference (GpeEventInfo);
         Handler->OriginallyEnabled)
     {
         (void) AcpiEvAddGpeReference (GpeEventInfo);
index c099bdb..caa3810 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EVXFEVNT_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
@@ -437,7 +435,9 @@ AcpiGetEventStatus (
     UINT32                  Event,
     ACPI_EVENT_STATUS       *EventStatus)
 {
     UINT32                  Event,
     ACPI_EVENT_STATUS       *EventStatus)
 {
-    ACPI_STATUS             Status = AE_OK;
+    ACPI_STATUS             Status;
+    ACPI_EVENT_STATUS       LocalEventStatus = 0;
+    UINT32                  InByte;
 
 
     ACPI_FUNCTION_TRACE (AcpiGetEventStatus);
 
 
     ACPI_FUNCTION_TRACE (AcpiGetEventStatus);
@@ -455,12 +455,43 @@ AcpiGetEventStatus (
         return_ACPI_STATUS (AE_BAD_PARAMETER);
     }
 
         return_ACPI_STATUS (AE_BAD_PARAMETER);
     }
 
-    /* Get the status of the requested fixed event */
+    /* Fixed event currently can be dispatched? */
+
+    if (AcpiGbl_FixedEventHandlers[Event].Handler)
+    {
+        LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+    }
+
+    /* Fixed event currently enabled? */
 
     Status = AcpiReadBitRegister (
 
     Status = AcpiReadBitRegister (
-                AcpiGbl_FixedEventInfo[Event].StatusRegisterId, EventStatus);
+                AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
 
 
-    return_ACPI_STATUS (Status);
+    if (InByte)
+    {
+        LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
+    }
+
+    /* Fixed event currently active? */
+
+    Status = AcpiReadBitRegister (
+                AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    if (InByte)
+    {
+        LocalEventStatus |= ACPI_EVENT_FLAG_SET;
+    }
+
+    (*EventStatus) = LocalEventStatus;
+    return_ACPI_STATUS (AE_OK);
 }
 
 ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
 }
 
 ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
index 8ab1ed1..5da1775 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EVXFGPE_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
@@ -213,12 +211,23 @@ AcpiEnableGpe (
 
     Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
 
     Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
-    /* Ensure that we have a valid GPE number */
-
+    /*
+     * Ensure that we have a valid GPE number and that there is some way
+     * of handling the GPE (handler or a GPE method). In other words, we
+     * won't allow a valid GPE to be enabled if there is no way to handle it.
+     */
     GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
     if (GpeEventInfo)
     {
     GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
     if (GpeEventInfo)
     {
-        Status = AcpiEvAddGpeReference (GpeEventInfo);
+        if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
+            ACPI_GPE_DISPATCH_NONE)
+        {
+            Status = AcpiEvAddGpeReference (GpeEventInfo);
+        }
+        else
+        {
+            Status = AE_NO_HANDLER;
+        }
     }
 
     AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
     }
 
     AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
@@ -346,6 +355,60 @@ UnlockAndExit:
 ACPI_EXPORT_SYMBOL (AcpiSetGpe)
 
 
 ACPI_EXPORT_SYMBOL (AcpiSetGpe)
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiMarkGpeForWake
+ *
+ * PARAMETERS:  GpeDevice           - Parent GPE Device. NULL for GPE0/GPE1
+ *              GpeNumber           - GPE level within the GPE block
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Mark a GPE as having the ability to wake the system. Simply
+ *              sets the ACPI_GPE_CAN_WAKE flag.
+ *
+ * Some potential callers of AcpiSetupGpeForWake may know in advance that
+ * there won't be any notify handlers installed for device wake notifications
+ * from the given GPE (one example is a button GPE in Linux). For these cases,
+ * AcpiMarkGpeForWake should be used instead of AcpiSetupGpeForWake.
+ * This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
+ * setup implicit wake notification for it (since there's no handler method).
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiMarkGpeForWake (
+    ACPI_HANDLE             GpeDevice,
+    UINT32                  GpeNumber)
+{
+    ACPI_GPE_EVENT_INFO     *GpeEventInfo;
+    ACPI_STATUS             Status = AE_BAD_PARAMETER;
+    ACPI_CPU_FLAGS          Flags;
+
+
+    ACPI_FUNCTION_TRACE (AcpiMarkGpeForWake);
+
+
+    Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+
+    /* Ensure that we have a valid GPE number */
+
+    GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
+    if (GpeEventInfo)
+    {
+        /* Mark the GPE as a possible wake event */
+
+        GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
+        Status = AE_OK;
+    }
+
+    AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+    return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiMarkGpeForWake)
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiSetupGpeForWake
 /*******************************************************************************
  *
  * FUNCTION:    AcpiSetupGpeForWake
@@ -881,7 +944,8 @@ AcpiInstallGpeBlock (
      * For user-installed GPE Block Devices, the GpeBlockBaseNumber
      * is always zero
      */
      * For user-installed GPE Block Devices, the GpeBlockBaseNumber
      * is always zero
      */
-    Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
+    Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
+                GpeBlockAddress->SpaceId, RegisterCount,
                 0, InterruptNumber, &GpeBlock);
     if (ACPI_FAILURE (Status))
     {
                 0, InterruptNumber, &GpeBlock);
     if (ACPI_FAILURE (Status))
     {
index 014e375..a305e3f 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EVXFREGN_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
index 98caa14..2fd6e36 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXCONFIG_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index 2b2fffd..00f0310 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EXCONVRT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index 8f7b9e7..90a389a 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXCREATE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index e374e13..eb1daad 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXDEBUG_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
@@ -154,6 +152,7 @@ AcpiExDoDebugObject (
     UINT32                  Index)
 {
     UINT32                  i;
     UINT32                  Index)
 {
     UINT32                  i;
+    UINT32                  Timer;
 
 
     ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
 
 
     ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
@@ -167,13 +166,21 @@ AcpiExDoDebugObject (
         return_VOID;
     }
 
         return_VOID;
     }
 
+    /*
+     * We will emit the current timer value (in microseconds) with each
+     * debug output. Only need the lower 26 bits. This allows for 67
+     * million microseconds or 67 seconds before rollover.
+     */
+    Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
+    Timer &= 0x03FFFFFF;
+
     /*
      * Print line header as long as we are not in the middle of an
      * object display
      */
     if (!((Level > 0) && Index == 0))
     {
     /*
      * Print line header as long as we are not in the middle of an
      * object display
      */
     if (!((Level > 0) && Index == 0))
     {
-        AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
+        AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
     }
 
     /* Display the index for package output only */
     }
 
     /* Display the index for package output only */
index 7f66714..4d6a186 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXDUMP_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
@@ -580,7 +578,7 @@ AcpiExDumpObject (
                 }
             }
 
                 }
             }
 
-            AcpiOsPrintf ("\n", Next);
+            AcpiOsPrintf ("\n");
             break;
 
         case ACPI_EXD_HDLR_LIST:
             break;
 
         case ACPI_EXD_HDLR_LIST:
@@ -614,7 +612,7 @@ AcpiExDumpObject (
                 }
             }
 
                 }
             }
 
-            AcpiOsPrintf ("\n", Next);
+            AcpiOsPrintf ("\n");
             break;
 
         case ACPI_EXD_RGN_LIST:
             break;
 
         case ACPI_EXD_RGN_LIST:
@@ -648,7 +646,7 @@ AcpiExDumpObject (
                 }
             }
 
                 }
             }
 
-            AcpiOsPrintf ("\n", Next);
+            AcpiOsPrintf ("\n");
             break;
 
         case ACPI_EXD_NODE:
             break;
 
         case ACPI_EXD_NODE:
index 3cb1b12..e33f82c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EXFIELD_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
 #include "acinterp.h"
+#include "amlcode.h"
 
 
 #define _COMPONENT          ACPI_EXECUTER
         ACPI_MODULE_NAME    ("exfield")
 
 
 
 #define _COMPONENT          ACPI_EXECUTER
         ACPI_MODULE_NAME    ("exfield")
 
+/* Local prototypes */
+
+static UINT32
+AcpiExGetSerialAccessLength (
+    UINT32                  AccessorType,
+    UINT32                  AccessLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiExGetSerialAccessLength
+ *
+ * PARAMETERS:  AccessorType    - The type of the protocol indicated by region
+ *                                field access attributes
+ *              AccessLength    - The access length of the region field
+ *
+ * RETURN:      Decoded access length
+ *
+ * DESCRIPTION: This routine returns the length of the GenericSerialBus
+ *              protocol bytes
+ *
+ ******************************************************************************/
+
+static UINT32
+AcpiExGetSerialAccessLength (
+    UINT32                  AccessorType,
+    UINT32                  AccessLength)
+{
+    UINT32                  Length;
+
+
+    switch (AccessorType)
+    {
+    case AML_FIELD_ATTRIB_QUICK:
+
+        Length = 0;
+        break;
+
+    case AML_FIELD_ATTRIB_SEND_RCV:
+    case AML_FIELD_ATTRIB_BYTE:
+
+        Length = 1;
+        break;
+
+    case AML_FIELD_ATTRIB_WORD:
+    case AML_FIELD_ATTRIB_WORD_CALL:
+
+        Length = 2;
+        break;
+
+    case AML_FIELD_ATTRIB_MULTIBYTE:
+    case AML_FIELD_ATTRIB_RAW_BYTES:
+    case AML_FIELD_ATTRIB_RAW_PROCESS:
+
+        Length = AccessLength;
+        break;
+
+    case AML_FIELD_ATTRIB_BLOCK:
+    case AML_FIELD_ATTRIB_BLOCK_CALL:
+    default:
+
+        Length = ACPI_GSBUS_BUFFER_SIZE - 2;
+        break;
+    }
+
+    return (Length);
+}
+
 
 /*******************************************************************************
  *
 
 /*******************************************************************************
  *
@@ -152,6 +218,7 @@ AcpiExReadDataFromField (
     ACPI_SIZE               Length;
     void                    *Buffer;
     UINT32                  Function;
     ACPI_SIZE               Length;
     void                    *Buffer;
     UINT32                  Function;
+    UINT16                  AccessorType;
 
 
     ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
 
 
     ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
@@ -201,8 +268,19 @@ AcpiExReadDataFromField (
         }
         else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
         {
         }
         else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
         {
-            Length = ACPI_GSBUS_BUFFER_SIZE;
-            Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
+            AccessorType = ObjDesc->Field.Attribute;
+            Length = AcpiExGetSerialAccessLength (AccessorType,
+                ObjDesc->Field.AccessLength);
+
+            /*
+             * Add additional 2 bytes for the GenericSerialBus data buffer:
+             *
+             *     Status;      (Byte 0 of the data buffer)
+             *     Length;      (Byte 1 of the data buffer)
+             *     Data[x-1];   (Bytes 2-x of the arbitrary length data buffer)
+             */
+            Length += 2;
+            Function = ACPI_READ | (AccessorType << 16);
         }
         else /* IPMI */
         {
         }
         else /* IPMI */
         {
@@ -265,6 +343,39 @@ AcpiExReadDataFromField (
         Buffer = &BufferDesc->Integer.Value;
     }
 
         Buffer = &BufferDesc->Integer.Value;
     }
 
+    if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+        (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
+    {
+        /*
+         * For GPIO (GeneralPurposeIo), the Address will be the bit offset
+         * from the previous Connection() operator, making it effectively a
+         * pin number index. The BitLength is the length of the field, which
+         * is thus the number of pins.
+         */
+        ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+            "GPIO FieldRead [FROM]:  Pin %u Bits %u\n",
+            ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
+
+        /* Lock entire transaction if requested */
+
+        AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
+
+        /* Perform the write */
+
+        Status = AcpiExAccessRegion (ObjDesc, 0,
+                    (UINT64 *) Buffer, ACPI_READ);
+        AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
+        if (ACPI_FAILURE (Status))
+        {
+            AcpiUtRemoveReference (BufferDesc);
+        }
+        else
+        {
+            *RetBufferDesc = BufferDesc;
+        }
+        return_ACPI_STATUS (Status);
+    }
+
     ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
         "FieldRead [TO]:   Obj %p, Type %X, Buf %p, ByteLen %X\n",
         ObjDesc, ObjDesc->Common.Type, Buffer, (UINT32) Length));
     ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
         "FieldRead [TO]:   Obj %p, Type %X, Buf %p, ByteLen %X\n",
         ObjDesc, ObjDesc->Common.Type, Buffer, (UINT32) Length));
@@ -323,6 +434,7 @@ AcpiExWriteDataToField (
     void                    *Buffer;
     ACPI_OPERAND_OBJECT     *BufferDesc;
     UINT32                  Function;
     void                    *Buffer;
     ACPI_OPERAND_OBJECT     *BufferDesc;
     UINT32                  Function;
+    UINT16                  AccessorType;
 
 
     ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
 
 
     ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
@@ -382,8 +494,19 @@ AcpiExWriteDataToField (
         }
         else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
         {
         }
         else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
         {
-            Length = ACPI_GSBUS_BUFFER_SIZE;
-            Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
+            AccessorType = ObjDesc->Field.Attribute;
+            Length = AcpiExGetSerialAccessLength (AccessorType,
+                ObjDesc->Field.AccessLength);
+
+            /*
+             * Add additional 2 bytes for the GenericSerialBus data buffer:
+             *
+             *     Status;      (Byte 0 of the data buffer)
+             *     Length;      (Byte 1 of the data buffer)
+             *     Data[x-1];   (Bytes 2-x of the arbitrary length data buffer)
+             */
+            Length += 2;
+            Function = ACPI_WRITE | (AccessorType << 16);
         }
         else /* IPMI */
         {
         }
         else /* IPMI */
         {
@@ -426,6 +549,41 @@ AcpiExWriteDataToField (
         *ResultDesc = BufferDesc;
         return_ACPI_STATUS (Status);
     }
         *ResultDesc = BufferDesc;
         return_ACPI_STATUS (Status);
     }
+    else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+             (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
+    {
+        /*
+         * For GPIO (GeneralPurposeIo), we will bypass the entire field
+         * mechanism and handoff the bit address and bit width directly to
+         * the handler. The Address will be the bit offset
+         * from the previous Connection() operator, making it effectively a
+         * pin number index. The BitLength is the length of the field, which
+         * is thus the number of pins.
+         */
+        if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
+        {
+            return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+        }
+
+        ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+            "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X  [TO]:  Pin %u Bits %u\n",
+            AcpiUtGetTypeName (SourceDesc->Common.Type),
+            SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
+            ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
+
+        Buffer = &SourceDesc->Integer.Value;
+
+        /* Lock entire transaction if requested */
+
+        AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
+
+        /* Perform the write */
+
+        Status = AcpiExAccessRegion (ObjDesc, 0,
+                    (UINT64 *) Buffer, ACPI_WRITE);
+        AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
+        return_ACPI_STATUS (Status);
+    }
 
     /* Get a pointer to the data to be written */
 
 
     /* Get a pointer to the data to be written */
 
index 51a1e6d..e29ae66 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EXFLDIO_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index b78425c..94053d5 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXMISC_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index a613c54..962b9c1 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXMUTEX_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index e8dc00c..67f7930 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXNAMES_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index 30fc504..8ce7610 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXOPARG1_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 3a65485..2519dca 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EXOPARG2_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 97df207..4e6842b 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXOPARG3_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index 515fc59..9cd26e0 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXOPARG6_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index f170736..dc764bb 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXPREP_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
@@ -587,6 +585,8 @@ AcpiExPrepFieldValue (
             ObjDesc->Field.ResourceLength = Info->ResourceLength;
         }
 
             ObjDesc->Field.ResourceLength = Info->ResourceLength;
         }
 
+        ObjDesc->Field.PinNumberIndex = Info->PinNumberIndex;
+
         /* Allow full data read from EC address space */
 
         if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
         /* Allow full data read from EC address space */
 
         if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
index ea10a01..544412e 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __EXREGION_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index 323f9db..7640a01 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXRESNTE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
index e035918..35bb6bb 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXRESOLV_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
index aafc1dc..6dc28aa 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXRESOP_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
index 97b8be8..cf47621 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXSTORE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acdispat.h"
index d1fc09f..82944c5 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXSTOREN_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index dc64e92..f36e9fc 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXSTOROB_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index fcf3a7f..0bce72a 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXSYSTEM_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index 1a4a943..63bfb84 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __EXUTILS_C__
-
 /*
  * DEFINE_AML_GLOBALS is tested in amlcode.h
  * to determine whether certain global names should be "defined" or only
 /*
  * DEFINE_AML_GLOBALS is tested in amlcode.h
  * to determine whether certain global names should be "defined" or only
index 1facc20..0dff876 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __HWACPI_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
index a777e58..0125685 100644 (file)
@@ -313,6 +313,14 @@ AcpiHwGetGpeStatus (
         return (AE_BAD_PARAMETER);
     }
 
         return (AE_BAD_PARAMETER);
     }
 
+    /* GPE currently handled? */
+
+    if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
+            ACPI_GPE_DISPATCH_NONE)
+    {
+        LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+    }
+
     /* Get the info block for the entire GPE register */
 
     GpeRegisterInfo = GpeEventInfo->RegisterInfo;
     /* Get the info block for the entire GPE register */
 
     GpeRegisterInfo = GpeEventInfo->RegisterInfo;
index 42b5f59..4470b5c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __HWPCI_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
@@ -233,11 +231,12 @@ AcpiHwDerivePciId (
         /* Walk the list, updating the PCI device/function/bus numbers */
 
         Status = AcpiHwProcessPciList (PciId, ListHead);
         /* Walk the list, updating the PCI device/function/bus numbers */
 
         Status = AcpiHwProcessPciList (PciId, ListHead);
-    }
 
 
-    /* Always delete the list */
+        /* Delete the list */
+
+        AcpiHwDeletePciList (ListHead);
+    }
 
 
-    AcpiHwDeletePciList (ListHead);
     return_ACPI_STATUS (Status);
 }
 
     return_ACPI_STATUS (Status);
 }
 
@@ -285,6 +284,9 @@ AcpiHwBuildPciList (
         Status = AcpiGetParent (CurrentDevice, &ParentDevice);
         if (ACPI_FAILURE (Status))
         {
         Status = AcpiGetParent (CurrentDevice, &ParentDevice);
         if (ACPI_FAILURE (Status))
         {
+            /* Must delete the list before exit */
+
+            AcpiHwDeletePciList (*ReturnListHead);
             return (Status);
         }
 
             return (Status);
         }
 
@@ -299,6 +301,9 @@ AcpiHwBuildPciList (
         ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
         if (!ListElement)
         {
         ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
         if (!ListElement)
         {
+            /* Must delete the list before exit */
+
+            AcpiHwDeletePciList (*ReturnListHead);
             return (AE_NO_MEMORY);
         }
 
             return (AE_NO_MEMORY);
         }
 
index 9950579..7df29fd 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __HWREGS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acevents.h"
@@ -382,17 +380,19 @@ AcpiHwClearAcpiStatus (
 
     Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
                 ACPI_BITMASK_ALL_FIXED_STATUS);
 
     Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
                 ACPI_BITMASK_ALL_FIXED_STATUS);
+
+    AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+
     if (ACPI_FAILURE (Status))
     {
     if (ACPI_FAILURE (Status))
     {
-        goto UnlockAndExit;
+        goto Exit;
     }
 
     /* Clear the GPE Bits in all GPE registers in all GPE blocks */
 
     Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
 
     }
 
     /* Clear the GPE Bits in all GPE registers in all GPE blocks */
 
     Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
 
-UnlockAndExit:
-    AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+Exit:
     return_ACPI_STATUS (Status);
 }
 
     return_ACPI_STATUS (Status);
 }
 
index 511a631..dbbb3bb 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __HWVALID_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
index 63f879e..6536048 100644 (file)
 /* Macros for usage messages */
 
 #define ACPI_USAGE_HEADER(Usage) \
 /* Macros for usage messages */
 
 #define ACPI_USAGE_HEADER(Usage) \
-    printf ("Usage: %s\nOptions:\n", Usage);
+    AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
+
+#define ACPI_USAGE_TEXT(Description) \
+    AcpiOsPrintf (Description);
 
 #define ACPI_OPTION(Name, Description) \
 
 #define ACPI_OPTION(Name, Description) \
-    printf ("  %-18s%s\n", Name, Description);
+    AcpiOsPrintf ("  %-18s%s\n", Name, Description);
 
 
 #define FILE_SUFFIX_DISASSEMBLY     "dsl"
 
 
 #define FILE_SUFFIX_DISASSEMBLY     "dsl"
@@ -191,7 +194,7 @@ extern char                 *AcpiGbl_Optarg;
  */
 UINT32
 CmGetFileSize (
  */
 UINT32
 CmGetFileSize (
-    FILE                    *File);
+    ACPI_FILE               File);
 
 
 #ifndef ACPI_DUMP_APP
 
 
 #ifndef ACPI_DUMP_APP
index 3228bca..9ccb3ea 100644 (file)
@@ -191,7 +191,9 @@ typedef struct acpi_pld_info
 {
     UINT8               Revision;
     UINT8               IgnoreColor;
 {
     UINT8               Revision;
     UINT8               IgnoreColor;
-    UINT32              Color;
+    UINT8               Red;
+    UINT8               Green;
+    UINT8               Blue;
     UINT16              Width;
     UINT16              Height;
     UINT8               UserVisible;
     UINT16              Width;
     UINT16              Height;
     UINT8               UserVisible;
@@ -237,8 +239,14 @@ typedef struct acpi_pld_info
 #define ACPI_PLD_GET_IGNORE_COLOR(dword)        ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
 #define ACPI_PLD_SET_IGNORE_COLOR(dword,value)  ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value)     /* Offset 7, Len 1 */
 
 #define ACPI_PLD_GET_IGNORE_COLOR(dword)        ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
 #define ACPI_PLD_SET_IGNORE_COLOR(dword,value)  ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value)     /* Offset 7, Len 1 */
 
-#define ACPI_PLD_GET_COLOR(dword)               ACPI_GET_BITS (dword, 8, ACPI_24BIT_MASK)
-#define ACPI_PLD_SET_COLOR(dword,value)         ACPI_SET_BITS (dword, 8, ACPI_24BIT_MASK, value)    /* Offset 8, Len 24 */
+#define ACPI_PLD_GET_RED(dword)                 ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_RED(dword,value)           ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value)    /* Offset 8, Len 8 */
+
+#define ACPI_PLD_GET_GREEN(dword)               ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_GREEN(dword,value)         ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value)    /* Offset 16, Len 8 */
+
+#define ACPI_PLD_GET_BLUE(dword)                ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_BLUE(dword,value)          ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value)    /* Offset 24, Len 8 */
 
 /* Second 32-bit dword, bits 33:63 */
 
 
 /* Second 32-bit dword, bits 33:63 */
 
index 6b34484..3c7a3bd 100644 (file)
 #define ACPI_NUM_SxW_METHODS            5
 
 
 #define ACPI_NUM_SxW_METHODS            5
 
 
+/******************************************************************************
+ *
+ * Miscellaneous constants
+ *
+ *****************************************************************************/
+
+/* UUID constants */
+
+#define UUID_BUFFER_LENGTH          16 /* Length of UUID in memory */
+#define UUID_STRING_LENGTH          36 /* Total length of a UUID string */
+
+/* Positions for required hyphens (dashes) in UUID strings */
+
+#define UUID_HYPHEN1_OFFSET         8
+#define UUID_HYPHEN2_OFFSET         13
+#define UUID_HYPHEN3_OFFSET         18
+#define UUID_HYPHEN4_OFFSET         23
+
+
 /******************************************************************************
  *
  * ACPI AML Debugger
 /******************************************************************************
  *
  * ACPI AML Debugger
index 1807c31..b6105c2 100644 (file)
@@ -449,11 +449,6 @@ AcpiDbGetTableFromFile (
     char                    *Filename,
     ACPI_TABLE_HEADER       **Table);
 
     char                    *Filename,
     ACPI_TABLE_HEADER       **Table);
 
-ACPI_STATUS
-AcpiDbReadTableFromFile (
-    char                    *Filename,
-    ACPI_TABLE_HEADER       **Table);
-
 
 /*
  * dbhistry - debugger HISTORY command
 
 /*
  * dbhistry - debugger HISTORY command
index df8d2e7..f0cadef 100644 (file)
@@ -209,15 +209,18 @@ typedef enum
 
     ACPI_DMT_ASF,
     ACPI_DMT_DMAR,
 
     ACPI_DMT_ASF,
     ACPI_DMT_DMAR,
+    ACPI_DMT_DMAR_SCOPE,
     ACPI_DMT_EINJACT,
     ACPI_DMT_EINJINST,
     ACPI_DMT_ERSTACT,
     ACPI_DMT_ERSTINST,
     ACPI_DMT_FADTPM,
     ACPI_DMT_EINJACT,
     ACPI_DMT_EINJINST,
     ACPI_DMT_ERSTACT,
     ACPI_DMT_ERSTINST,
     ACPI_DMT_FADTPM,
+    ACPI_DMT_GTDT,
     ACPI_DMT_HEST,
     ACPI_DMT_HESTNTFY,
     ACPI_DMT_HESTNTYP,
     ACPI_DMT_IVRS,
     ACPI_DMT_HEST,
     ACPI_DMT_HESTNTFY,
     ACPI_DMT_HESTNTYP,
     ACPI_DMT_IVRS,
+    ACPI_DMT_LPIT,
     ACPI_DMT_MADT,
     ACPI_DMT_PCCT,
     ACPI_DMT_PMTT,
     ACPI_DMT_MADT,
     ACPI_DMT_PCCT,
     ACPI_DMT_PMTT,
@@ -259,6 +262,7 @@ typedef struct acpi_op_walk_info
     UINT32                  BitOffset;
     UINT32                  Flags;
     ACPI_WALK_STATE         *WalkState;
     UINT32                  BitOffset;
     UINT32                  Flags;
     ACPI_WALK_STATE         *WalkState;
+    ACPI_PARSE_OBJECT       *MappingOp;
 
 } ACPI_OP_WALK_INFO;
 
 
 } ACPI_OP_WALK_INFO;
 
@@ -276,6 +280,7 @@ ACPI_STATUS (*ASL_WALK_CALLBACK) (
 
 typedef
 void (*ACPI_RESOURCE_HANDLER) (
 
 typedef
 void (*ACPI_RESOURCE_HANDLER) (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
@@ -326,6 +331,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar3[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar3[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar4[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDrtm[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoEcdt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoEinj[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDrtm[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoEcdt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoEinj[];
@@ -343,6 +349,10 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFpdt0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFpdt1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGas[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFpdt1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGas[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdtHdr[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt0a[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHeader[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHeader[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest0[];
@@ -355,6 +365,9 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest9[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHestNotify[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHestBank[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHpet[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHestNotify[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHestBank[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHpet[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoLpitHdr[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoLpit0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoLpit1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIvrs[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIvrs0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIvrs1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIvrs[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIvrs0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIvrs1[];
@@ -377,6 +390,8 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt9[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt10[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt11[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt12[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt10[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt11[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt12[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt13[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt14[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadtHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMcfg[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMcfg0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadtHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMcfg[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMcfg0[];
@@ -400,6 +415,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPmttHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcctHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcctHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoS3pt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoS3pt[];
@@ -418,6 +434,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSratHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat2[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat3[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoTcpa[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoTpm2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoUefi[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoTcpa[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoTpm2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoUefi[];
@@ -512,6 +529,10 @@ void
 AcpiDmDumpFpdt (
     ACPI_TABLE_HEADER       *Table);
 
 AcpiDmDumpFpdt (
     ACPI_TABLE_HEADER       *Table);
 
+void
+AcpiDmDumpGtdt (
+    ACPI_TABLE_HEADER       *Table);
+
 void
 AcpiDmDumpHest (
     ACPI_TABLE_HEADER       *Table);
 void
 AcpiDmDumpHest (
     ACPI_TABLE_HEADER       *Table);
@@ -520,6 +541,10 @@ void
 AcpiDmDumpIvrs (
     ACPI_TABLE_HEADER       *Table);
 
 AcpiDmDumpIvrs (
     ACPI_TABLE_HEADER       *Table);
 
+void
+AcpiDmDumpLpit (
+    ACPI_TABLE_HEADER       *Table);
+
 void
 AcpiDmDumpMadt (
     ACPI_TABLE_HEADER       *Table);
 void
 AcpiDmDumpMadt (
     ACPI_TABLE_HEADER       *Table);
@@ -718,6 +743,10 @@ void
 AcpiDmDecompressEisaId (
     UINT32                  EncodedId);
 
 AcpiDmDecompressEisaId (
     UINT32                  EncodedId);
 
+BOOLEAN
+AcpiDmIsUuidBuffer (
+    ACPI_PARSE_OBJECT       *Op);
+
 BOOLEAN
 AcpiDmIsUnicodeBuffer (
     ACPI_PARSE_OBJECT       *Op);
 BOOLEAN
 AcpiDmIsUnicodeBuffer (
     ACPI_PARSE_OBJECT       *Op);
@@ -838,72 +867,84 @@ AcpiDmDescriptorName (
  */
 void
 AcpiDmWordDescriptor (
  */
 void
 AcpiDmWordDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmDwordDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmDwordDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmExtendedDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmExtendedDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmQwordDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmQwordDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmMemory24Descriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmMemory24Descriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmMemory32Descriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmMemory32Descriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmFixedMemory32Descriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmFixedMemory32Descriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmGenericRegisterDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmGenericRegisterDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmInterruptDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmInterruptDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmVendorLargeDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmVendorLargeDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmGpioDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmGpioDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmSerialBusDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmSerialBusDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
@@ -921,48 +962,56 @@ AcpiDmVendorCommon (
  */
 void
 AcpiDmIrqDescriptor (
  */
 void
 AcpiDmIrqDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmDmaDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmDmaDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmFixedDmaDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmFixedDmaDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmIoDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmIoDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmFixedIoDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmFixedIoDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmStartDependentDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmStartDependentDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmEndDependentDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmEndDependentDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmVendorSmallDescriptor (
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
 
 void
 AcpiDmVendorSmallDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
     AML_RESOURCE            *Resource,
     UINT32                  Length,
     UINT32                  Level);
@@ -1001,6 +1050,19 @@ AcpiDmCheckResourceReference (
     ACPI_WALK_STATE         *WalkState);
 
 
     ACPI_WALK_STATE         *WalkState);
 
 
+/*
+ * dmcstyle
+ */
+BOOLEAN
+AcpiDmCheckForSymbolicOpcode (
+    ACPI_PARSE_OBJECT       *Op,
+    ACPI_OP_WALK_INFO       *Info);
+
+void
+AcpiDmCloseOperator (
+    ACPI_PARSE_OBJECT       *Op);
+
+
 /*
  * acdisasm
  */
 /*
  * acdisasm
  */
@@ -1008,5 +1070,4 @@ void
 AdDisassemblerHeader (
     char                    *Filename);
 
 AdDisassemblerHeader (
     char                    *Filename);
 
-
 #endif  /* __ACDISASM_H__ */
 #endif  /* __ACDISASM_H__ */
index bfccbf1..2a47c52 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #ifndef _ACDISPAT_H_
 #define _ACDISPAT_H_
 
 #ifndef _ACDISPAT_H_
 #define _ACDISPAT_H_
 
index 731defb..8ca726c 100644 (file)
@@ -216,9 +216,10 @@ AcpiEvFinishGpe (
 ACPI_STATUS
 AcpiEvCreateGpeBlock (
     ACPI_NAMESPACE_NODE     *GpeDevice,
 ACPI_STATUS
 AcpiEvCreateGpeBlock (
     ACPI_NAMESPACE_NODE     *GpeDevice,
-    ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
+    UINT64                  Address,
+    UINT8                   SpaceId,
     UINT32                  RegisterCount,
     UINT32                  RegisterCount,
-    UINT                  GpeBlockBaseNumber,
+    UINT16                  GpeBlockBaseNumber,
     UINT32                  InterruptNumber,
     ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock);
 
     UINT32                  InterruptNumber,
     ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock);
 
index a3ae36a..91712b4 100644 (file)
 #define __ACGLOBAL_H__
 
 
 #define __ACGLOBAL_H__
 
 
-/*
- * Ensure that the globals are actually defined and initialized only once.
- *
- * The use of these macros allows a single list of globals (here) in order
- * to simplify maintenance of the code.
- */
-#ifdef DEFINE_ACPI_GLOBALS
-#define ACPI_GLOBAL(type,name) \
-    extern type name; \
-    type name
-
-#define ACPI_INIT_GLOBAL(type,name,value) \
-    type name=value
-
-#else
-#define ACPI_GLOBAL(type,name) \
-    extern type name
-
-#define ACPI_INIT_GLOBAL(type,name,value) \
-    extern type name
-#endif
-
-
-#ifdef DEFINE_ACPI_GLOBALS
-
-/* Public globals, available from outside ACPICA subsystem */
-
 /*****************************************************************************
  *
 /*****************************************************************************
  *
- * Runtime configuration (static defaults that can be overriden at runtime)
+ * Globals related to the ACPI tables
  *
  ****************************************************************************/
 
  *
  ****************************************************************************/
 
-/*
- * Enable "slack" in the AML interpreter?  Default is FALSE, and the
- * interpreter strictly follows the ACPI specification. Setting to TRUE
- * allows the interpreter to ignore certain errors and/or bad AML constructs.
- *
- * Currently, these features are enabled by this flag:
- *
- * 1) Allow "implicit return" of last value in a control method
- * 2) Allow access beyond the end of an operation region
- * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
- * 4) Allow ANY object type to be a source operand for the Store() operator
- * 5) Allow unresolved references (invalid target name) in package objects
- * 6) Enable warning messages for behavior that is not ACPI spec compliant
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_EnableInterpreterSlack, FALSE);
-
-/*
- * Automatically serialize all methods that create named objects? Default
- * is TRUE, meaning that all NonSerialized methods are scanned once at
- * table load time to determine those that create named objects. Methods
- * that create named objects are marked Serialized in order to prevent
- * possible run-time problems if they are entered by more than one thread.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_AutoSerializeMethods, TRUE);
-
-/*
- * Create the predefined _OSI method in the namespace? Default is TRUE
- * because ACPICA is fully compatible with other ACPI implementations.
- * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_CreateOsiMethod, TRUE);
-
-/*
- * Optionally use default values for the ACPI register widths. Set this to
- * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_UseDefaultRegisterWidths, TRUE);
+/* Master list of all ACPI tables that were found in the RSDT/XSDT */
 
 
-/*
- * Optionally enable output from the AML Debug Object.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_EnableAmlDebugObject, FALSE);
-
-/*
- * Optionally copy the entire DSDT to local memory (instead of simply
- * mapping it.) There are some BIOSs that corrupt or replace the original
- * DSDT, creating the need for this option. Default is FALSE, do not copy
- * the DSDT.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_CopyDsdtLocally, FALSE);
-
-/*
- * Optionally ignore an XSDT if present and use the RSDT instead.
- * Although the ACPI specification requires that an XSDT be used instead
- * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
- * some machines. Default behavior is to use the XSDT if present.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_DoNotUseXsdt, FALSE);
-
-/*
- * Optionally use 32-bit FADT addresses if and when there is a conflict
- * (address mismatch) between the 32-bit and 64-bit versions of the
- * address. Although ACPICA adheres to the ACPI specification which
- * requires the use of the corresponding 64-bit address if it is non-zero,
- * some machines have been found to have a corrupted non-zero 64-bit
- * address. Default is FALSE, do not favor the 32-bit addresses.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_Use32BitFadtAddresses, FALSE);
-
-/*
- * Optionally truncate I/O addresses to 16 bits. Provides compatibility
- * with other ACPI implementations. NOTE: During ACPICA initialization,
- * this value is set to TRUE if any Windows OSI strings have been
- * requested by the BIOS.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_TruncateIoAddresses, FALSE);
-
-/*
- * Disable runtime checking and repair of values returned by control methods.
- * Use only if the repair is causing a problem on a particular machine.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_DisableAutoRepair, FALSE);
-
-/*
- * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
- * This can be useful for debugging ACPI problems on some machines.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_DisableSsdtTableInstall, FALSE);
-
-/*
- * We keep track of the latest version of Windows that has been requested by
- * the BIOS.
- */
-ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_OsiData, 0);
-
-#endif /* DEFINE_ACPI_GLOBALS */
-
-
-/*****************************************************************************
- *
- * ACPI Table globals
- *
- ****************************************************************************/
-
-/*
- * Master list of all ACPI tables that were found in the RSDT/XSDT.
- */
 ACPI_GLOBAL (ACPI_TABLE_LIST,           AcpiGbl_RootTableList);
 
 /* DSDT information. Used to check for DSDT corruption */
 ACPI_GLOBAL (ACPI_TABLE_LIST,           AcpiGbl_RootTableList);
 
 /* DSDT information. Used to check for DSDT corruption */
@@ -356,7 +224,6 @@ ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER,    AcpiGbl_ExceptionHandler);
 ACPI_GLOBAL (ACPI_INIT_HANDLER,         AcpiGbl_InitHandler);
 ACPI_GLOBAL (ACPI_TABLE_HANDLER,        AcpiGbl_TableHandler);
 ACPI_GLOBAL (void *,                    AcpiGbl_TableHandlerContext);
 ACPI_GLOBAL (ACPI_INIT_HANDLER,         AcpiGbl_InitHandler);
 ACPI_GLOBAL (ACPI_TABLE_HANDLER,        AcpiGbl_TableHandler);
 ACPI_GLOBAL (void *,                    AcpiGbl_TableHandlerContext);
-ACPI_GLOBAL (ACPI_WALK_STATE *,         AcpiGbl_BreakpointWalk);
 ACPI_GLOBAL (ACPI_INTERFACE_HANDLER,    AcpiGbl_InterfaceHandler);
 ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *,   AcpiGbl_SciHandlerList);
 
 ACPI_GLOBAL (ACPI_INTERFACE_HANDLER,    AcpiGbl_InterfaceHandler);
 ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *,   AcpiGbl_SciHandlerList);
 
@@ -373,7 +240,6 @@ ACPI_GLOBAL (BOOLEAN,                   AcpiGbl_RegMethodsExecuted);
 /* Misc */
 
 ACPI_GLOBAL (UINT32,                    AcpiGbl_OriginalMode);
 /* Misc */
 
 ACPI_GLOBAL (UINT32,                    AcpiGbl_OriginalMode);
-ACPI_GLOBAL (UINT32,                    AcpiGbl_RsdpOriginalLocation);
 ACPI_GLOBAL (UINT32,                    AcpiGbl_NsLookupCount);
 ACPI_GLOBAL (UINT32,                    AcpiGbl_PsFindCount);
 ACPI_GLOBAL (UINT16,                    AcpiGbl_Pm1EnableRegisterSave);
 ACPI_GLOBAL (UINT32,                    AcpiGbl_NsLookupCount);
 ACPI_GLOBAL (UINT32,                    AcpiGbl_PsFindCount);
 ACPI_GLOBAL (UINT16,                    AcpiGbl_Pm1EnableRegisterSave);
@@ -507,7 +373,7 @@ ACPI_GLOBAL (UINT32,                    AcpiGbl_TraceDbgLayer);
  *
  ****************************************************************************/
 
  *
  ****************************************************************************/
 
-ACPI_GLOBAL (UINT8,                     AcpiGbl_DbOutputFlags);
+ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT);
 
 #ifdef ACPI_DISASSEMBLER
 
 
 #ifdef ACPI_DISASSEMBLER
 
@@ -515,6 +381,7 @@ ACPI_GLOBAL (UINT8,                     AcpiGbl_DbOutputFlags);
 
 ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_NoResourceDisassembly, FALSE);
 ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_IgnoreNoopOperator, FALSE);
 
 ACPI_INIT_GLOBAL (UINT8,                AcpiGbl_NoResourceDisassembly, FALSE);
 ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_IgnoreNoopOperator, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_CstyleDisassembly, TRUE);
 
 ACPI_GLOBAL (BOOLEAN,                   AcpiGbl_DbOpt_disasm);
 ACPI_GLOBAL (BOOLEAN,                   AcpiGbl_DbOpt_verbose);
 
 ACPI_GLOBAL (BOOLEAN,                   AcpiGbl_DbOpt_disasm);
 ACPI_GLOBAL (BOOLEAN,                   AcpiGbl_DbOpt_verbose);
@@ -561,11 +428,6 @@ ACPI_GLOBAL (UINT16,                    AcpiGbl_NodeTypeCountMisc);
 ACPI_GLOBAL (UINT32,                    AcpiGbl_NumNodes);
 ACPI_GLOBAL (UINT32,                    AcpiGbl_NumObjects);
 
 ACPI_GLOBAL (UINT32,                    AcpiGbl_NumNodes);
 ACPI_GLOBAL (UINT32,                    AcpiGbl_NumObjects);
 
-ACPI_GLOBAL (UINT32,                    AcpiGbl_SizeOfParseTree);
-ACPI_GLOBAL (UINT32,                    AcpiGbl_SizeOfMethodTrees);
-ACPI_GLOBAL (UINT32,                    AcpiGbl_SizeOfNodeEntries);
-ACPI_GLOBAL (UINT32,                    AcpiGbl_SizeOfAcpiObjects);
-
 #endif /* ACPI_DEBUGGER */
 
 
 #endif /* ACPI_DEBUGGER */
 
 
@@ -578,6 +440,12 @@ ACPI_GLOBAL (UINT32,                    AcpiGbl_SizeOfAcpiObjects);
 #ifdef ACPI_APPLICATION
 
 ACPI_INIT_GLOBAL (ACPI_FILE,            AcpiGbl_DebugFile, NULL);
 #ifdef ACPI_APPLICATION
 
 ACPI_INIT_GLOBAL (ACPI_FILE,            AcpiGbl_DebugFile, NULL);
+ACPI_INIT_GLOBAL (ACPI_FILE,            AcpiGbl_OutputFile, NULL);
+
+/* Print buffer */
+
+ACPI_GLOBAL (ACPI_SPINLOCK,             AcpiGbl_PrintLock);     /* For print buffer */
+ACPI_GLOBAL (char,                      AcpiGbl_PrintBuffer[1024]);
 
 #endif /* ACPI_APPLICATION */
 
 
 #endif /* ACPI_APPLICATION */
 
index 147d0fb..f55c00a 100644 (file)
@@ -363,6 +363,7 @@ typedef struct acpi_create_field_info
     UINT32                          FieldBitPosition;
     UINT32                          FieldBitLength;
     UINT16                          ResourceLength;
     UINT32                          FieldBitPosition;
     UINT32                          FieldBitLength;
     UINT16                          ResourceLength;
+    UINT16                          PinNumberIndex;
     UINT8                           FieldFlags;
     UINT8                           Attribute;
     UINT8                           FieldType;
     UINT8                           FieldFlags;
     UINT8                           Attribute;
     UINT8                           FieldType;
@@ -588,9 +589,9 @@ typedef struct acpi_gpe_register_info
 {
     ACPI_GENERIC_ADDRESS            StatusAddress;  /* Address of status reg */
     ACPI_GENERIC_ADDRESS            EnableAddress;  /* Address of enable reg */
 {
     ACPI_GENERIC_ADDRESS            StatusAddress;  /* Address of status reg */
     ACPI_GENERIC_ADDRESS            EnableAddress;  /* Address of enable reg */
+    UINT16                          BaseGpeNumber;  /* Base GPE number for this register */
     UINT8                           EnableForWake;  /* GPEs to keep enabled when sleeping */
     UINT8                           EnableForRun;   /* GPEs to keep enabled when running */
     UINT8                           EnableForWake;  /* GPEs to keep enabled when sleeping */
     UINT8                           EnableForRun;   /* GPEs to keep enabled when running */
-    UINT8                           BaseGpeNumber;  /* Base GPE number for this register */
 
 } ACPI_GPE_REGISTER_INFO;
 
 
 } ACPI_GPE_REGISTER_INFO;
 
@@ -606,10 +607,11 @@ typedef struct acpi_gpe_block_info
     struct acpi_gpe_xrupt_info      *XruptBlock;    /* Backpointer to interrupt block */
     ACPI_GPE_REGISTER_INFO          *RegisterInfo;  /* One per GPE register pair */
     ACPI_GPE_EVENT_INFO             *EventInfo;     /* One for each GPE */
     struct acpi_gpe_xrupt_info      *XruptBlock;    /* Backpointer to interrupt block */
     ACPI_GPE_REGISTER_INFO          *RegisterInfo;  /* One per GPE register pair */
     ACPI_GPE_EVENT_INFO             *EventInfo;     /* One for each GPE */
-    ACPI_GENERIC_ADDRESS            BlockAddress;   /* Base address of the block */
+    UINT64                          Address;        /* Base address of the block */
     UINT32                          RegisterCount;  /* Number of register pairs in block */
     UINT16                          GpeCount;       /* Number of individual GPEs in block */
     UINT32                          RegisterCount;  /* Number of register pairs in block */
     UINT16                          GpeCount;       /* Number of individual GPEs in block */
-    UINT8                           BlockBaseNumber;/* Base GPE number for this block */
+    UINT16                          BlockBaseNumber;/* Base GPE number for this block */
+    UINT8                           SpaceId;
     BOOLEAN                         Initialized;    /* TRUE if this block is initialized */
 
 } ACPI_GPE_BLOCK_INFO;
     BOOLEAN                         Initialized;    /* TRUE if this block is initialized */
 
 } ACPI_GPE_BLOCK_INFO;
@@ -939,6 +941,7 @@ typedef union acpi_parse_value
     ACPI_DISASM_ONLY_MEMBERS (\
     UINT8                           DisasmFlags;    /* Used during AML disassembly */\
     UINT8                           DisasmOpcode;   /* Subtype used for disassembly */\
     ACPI_DISASM_ONLY_MEMBERS (\
     UINT8                           DisasmFlags;    /* Used during AML disassembly */\
     UINT8                           DisasmOpcode;   /* Subtype used for disassembly */\
+    char                            *OperatorSymbol;/* Used for C-style operator name strings */\
     char                            AmlOpName[16])  /* Op name (debug only) */
 
 
     char                            AmlOpName[16])  /* Op name (debug only) */
 
 
@@ -949,12 +952,13 @@ typedef union acpi_parse_value
 #define ACPI_DASM_STRING                0x02        /* Buffer is a ASCII string */
 #define ACPI_DASM_UNICODE               0x03        /* Buffer is a Unicode string */
 #define ACPI_DASM_PLD_METHOD            0x04        /* Buffer is a _PLD method bit-packed buffer */
 #define ACPI_DASM_STRING                0x02        /* Buffer is a ASCII string */
 #define ACPI_DASM_UNICODE               0x03        /* Buffer is a Unicode string */
 #define ACPI_DASM_PLD_METHOD            0x04        /* Buffer is a _PLD method bit-packed buffer */
-#define ACPI_DASM_EISAID                0x05        /* Integer is an EISAID */
-#define ACPI_DASM_MATCHOP               0x06        /* Parent opcode is a Match() operator */
-#define ACPI_DASM_LNOT_PREFIX           0x07        /* Start of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_LNOT_SUFFIX           0x08        /* End  of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_HID_STRING            0x09        /* String is a _HID or _CID */
-#define ACPI_DASM_IGNORE                0x0A        /* Not used at this time */
+#define ACPI_DASM_UUID                  0x05        /* Buffer is a UUID/GUID */
+#define ACPI_DASM_EISAID                0x06        /* Integer is an EISAID */
+#define ACPI_DASM_MATCHOP               0x07        /* Parent opcode is a Match() operator */
+#define ACPI_DASM_LNOT_PREFIX           0x08        /* Start of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_LNOT_SUFFIX           0x09        /* End  of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_HID_STRING            0x0A        /* String is a _HID or _CID */
+#define ACPI_DASM_IGNORE                0x0B        /* Not used at this time */
 
 /*
  * Generic operation (for example:  If, While, Store)
 
 /*
  * Generic operation (for example:  If, While, Store)
@@ -1060,6 +1064,8 @@ typedef struct acpi_parse_state
 #define ACPI_PARSEOP_EMPTY_TERMLIST     0x04
 #define ACPI_PARSEOP_PREDEF_CHECKED     0x08
 #define ACPI_PARSEOP_SPECIAL            0x10
 #define ACPI_PARSEOP_EMPTY_TERMLIST     0x04
 #define ACPI_PARSEOP_PREDEF_CHECKED     0x08
 #define ACPI_PARSEOP_SPECIAL            0x10
+#define ACPI_PARSEOP_COMPOUND           0x20
+#define ACPI_PARSEOP_ASSIGNMENT         0x40
 
 
 /*****************************************************************************
 
 
 /*****************************************************************************
@@ -1429,4 +1435,11 @@ typedef struct ah_device_id
 
 } AH_DEVICE_ID;
 
 
 } AH_DEVICE_ID;
 
+typedef struct ah_uuid
+{
+    char            *Description;
+    char            *String;
+
+} AH_UUID;
+
 #endif /* __ACLOCAL_H__ */
 #endif /* __ACLOCAL_H__ */
index bde34f5..b4fed5e 100644 (file)
 #define METHOD_NAME__CBA        "_CBA"
 #define METHOD_NAME__CID        "_CID"
 #define METHOD_NAME__CRS        "_CRS"
 #define METHOD_NAME__CBA        "_CBA"
 #define METHOD_NAME__CID        "_CID"
 #define METHOD_NAME__CRS        "_CRS"
+#define METHOD_NAME__DDN        "_DDN"
 #define METHOD_NAME__HID        "_HID"
 #define METHOD_NAME__INI        "_INI"
 #define METHOD_NAME__PLD        "_PLD"
 #define METHOD_NAME__HID        "_HID"
 #define METHOD_NAME__INI        "_INI"
 #define METHOD_NAME__PLD        "_PLD"
+#define METHOD_NAME__DSD        "_DSD"
 #define METHOD_NAME__PRS        "_PRS"
 #define METHOD_NAME__PRT        "_PRT"
 #define METHOD_NAME__PRW        "_PRW"
 #define METHOD_NAME__PRS        "_PRS"
 #define METHOD_NAME__PRT        "_PRT"
 #define METHOD_NAME__PRW        "_PRW"
+#define METHOD_NAME__PS0        "_PS0"
+#define METHOD_NAME__PS1        "_PS1"
+#define METHOD_NAME__PS2        "_PS2"
+#define METHOD_NAME__PS3        "_PS3"
 #define METHOD_NAME__REG        "_REG"
 #define METHOD_NAME__SB_        "_SB_"
 #define METHOD_NAME__SEG        "_SEG"
 #define METHOD_NAME__REG        "_REG"
 #define METHOD_NAME__SB_        "_SB_"
 #define METHOD_NAME__SEG        "_SEG"
index e90af0b..6e3d0de 100644 (file)
@@ -410,6 +410,7 @@ typedef struct acpi_object_region_field
     UINT16                          ResourceLength;
     union acpi_operand_object       *RegionObj;         /* Containing OpRegion object */
     UINT8                           *ResourceBuffer;    /* ResourceTemplate for serial regions/fields */
     UINT16                          ResourceLength;
     union acpi_operand_object       *RegionObj;         /* Containing OpRegion object */
     UINT8                           *ResourceBuffer;    /* ResourceTemplate for serial regions/fields */
+    UINT16                          PinNumberIndex;     /* Index relative to previous Connection/Template */
 
 } ACPI_OBJECT_REGION_FIELD;
 
 
 } ACPI_OBJECT_REGION_FIELD;
 
index 5827a8c..0899969 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #ifndef __ACPARSER_H__
 #define __ACPARSER_H__
 
 #ifndef __ACPARSER_H__
 #define __ACPARSER_H__
 
index 4ec64fa..5466aff 100644 (file)
 #include "acrestyp.h"           /* Resource Descriptor structs */
 #include "acpiosxf.h"           /* OSL interfaces (ACPICA-to-OS) */
 #include "acpixf.h"             /* ACPI core subsystem external interfaces */
 #include "acrestyp.h"           /* Resource Descriptor structs */
 #include "acpiosxf.h"           /* OSL interfaces (ACPICA-to-OS) */
 #include "acpixf.h"             /* ACPI core subsystem external interfaces */
-#ifdef ACPI_NATIVE_INTERFACE_HEADER
-#include ACPI_NATIVE_INTERFACE_HEADER
-#endif
+#include "platform/acenvex.h"   /* Extra environment-specific items */
 
 #endif /* __ACPI_H__ */
 
 #endif /* __ACPI_H__ */
index 00922c7..21e6ed9 100644 (file)
@@ -623,4 +623,53 @@ AcpiOsCloseDirectory (
 #endif
 
 
 #endif
 
 
+/*
+ * File I/O and related support
+ */
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenFile
+ACPI_FILE
+AcpiOsOpenFile (
+    const char              *Path,
+    UINT8                   Modes);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseFile
+void
+AcpiOsCloseFile (
+    ACPI_FILE               File);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadFile
+int
+AcpiOsReadFile (
+    ACPI_FILE               File,
+    void                    *Buffer,
+    ACPI_SIZE               Size,
+    ACPI_SIZE               Count);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteFile
+int
+AcpiOsWriteFile (
+    ACPI_FILE               File,
+    void                    *Buffer,
+    ACPI_SIZE               Size,
+    ACPI_SIZE               Count);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetFileOffset
+long
+AcpiOsGetFileOffset (
+    ACPI_FILE               File);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSetFileOffset
+ACPI_STATUS
+AcpiOsSetFileOffset (
+    ACPI_FILE               File,
+    long                    Offset,
+    UINT8                   From);
+#endif
+
+
 #endif /* __ACPIOSXF_H__ */
 #endif /* __ACPIOSXF_H__ */
index 61125f1..23f965f 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #ifndef __ACXFACE_H__
 #define __ACXFACE_H__
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
 #ifndef __ACXFACE_H__
 #define __ACXFACE_H__
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20140325
+#define ACPI_CA_VERSION                 0x20141107
 
 #include "acconfig.h"
 #include "actypes.h"
 #include "actbl.h"
 #include "acbuffer.h"
 
 
 #include "acconfig.h"
 #include "actypes.h"
 #include "actbl.h"
 #include "acbuffer.h"
 
+
+/*****************************************************************************
+ *
+ * Macros used for ACPICA globals and configuration
+ *
+ ****************************************************************************/
+
+/*
+ * Ensure that global variables are defined and initialized only once.
+ *
+ * The use of these macros allows for a single list of globals (here)
+ * in order to simplify maintenance of the code.
+ */
+#ifdef DEFINE_ACPI_GLOBALS
+#define ACPI_GLOBAL(type,name) \
+    extern type name; \
+    type name
+
+#define ACPI_INIT_GLOBAL(type,name,value) \
+    type name=value
+
+#else
+#ifndef ACPI_GLOBAL
+#define ACPI_GLOBAL(type,name) \
+    extern type name
+#endif
+
+#ifndef ACPI_INIT_GLOBAL
+#define ACPI_INIT_GLOBAL(type,name,value) \
+    extern type name
+#endif
+#endif
+
 /*
 /*
- * Globals that are publically available
+ * These macros configure the various ACPICA interfaces. They are
+ * useful for generating stub inline functions for features that are
+ * configured out of the current kernel or ACPICA application.
  */
  */
-extern UINT32               AcpiCurrentGpeCount;
-extern ACPI_TABLE_FADT      AcpiGbl_FADT;
-extern BOOLEAN              AcpiGbl_SystemAwakeAndRunning;
-extern BOOLEAN              AcpiGbl_ReducedHardware;        /* ACPI 5.0 */
-extern UINT8                AcpiGbl_OsiData;
+#ifndef ACPI_EXTERNAL_RETURN_STATUS
+#define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
+    Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_OK
+#define ACPI_EXTERNAL_RETURN_OK(Prototype) \
+    Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_VOID
+#define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
+    Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_UINT32
+#define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
+    Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_PTR
+#define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
+    Prototype;
+#endif
 
 
-/* Runtime configuration of debug print levels */
 
 
-extern UINT32               AcpiDbgLevel;
-extern UINT32               AcpiDbgLayer;
+/*****************************************************************************
+ *
+ * Public globals and runtime configuration options
+ *
+ ****************************************************************************/
 
 
-/* ACPICA runtime options */
+/*
+ * Enable "slack mode" of the AML interpreter?  Default is FALSE, and the
+ * interpreter strictly follows the ACPI specification. Setting to TRUE
+ * allows the interpreter to ignore certain errors and/or bad AML constructs.
+ *
+ * Currently, these features are enabled by this flag:
+ *
+ * 1) Allow "implicit return" of last value in a control method
+ * 2) Allow access beyond the end of an operation region
+ * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
+ * 4) Allow ANY object type to be a source operand for the Store() operator
+ * 5) Allow unresolved references (invalid target name) in package objects
+ * 6) Enable warning messages for behavior that is not ACPI spec compliant
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_EnableInterpreterSlack, FALSE);
 
 
-extern UINT8                AcpiGbl_AutoSerializeMethods;
-extern UINT8                AcpiGbl_CopyDsdtLocally;
-extern UINT8                AcpiGbl_CreateOsiMethod;
-extern UINT8                AcpiGbl_DisableAutoRepair;
-extern UINT8                AcpiGbl_DisableSsdtTableInstall;
-extern UINT8                AcpiGbl_DoNotUseXsdt;
-extern UINT8                AcpiGbl_EnableAmlDebugObject;
-extern UINT8                AcpiGbl_EnableInterpreterSlack;
-extern UINT32               AcpiGbl_TraceFlags;
-extern ACPI_NAME            AcpiGbl_TraceMethodName;
-extern UINT8                AcpiGbl_TruncateIoAddresses;
-extern UINT8                AcpiGbl_Use32BitFadtAddresses;
-extern UINT8                AcpiGbl_UseDefaultRegisterWidths;
+/*
+ * Automatically serialize all methods that create named objects? Default
+ * is TRUE, meaning that all NonSerialized methods are scanned once at
+ * table load time to determine those that create named objects. Methods
+ * that create named objects are marked Serialized in order to prevent
+ * possible run-time problems if they are entered by more than one thread.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_AutoSerializeMethods, TRUE);
 
 
+/*
+ * Create the predefined _OSI method in the namespace? Default is TRUE
+ * because ACPICA is fully compatible with other ACPI implementations.
+ * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_CreateOsiMethod, TRUE);
 
 /*
 
 /*
- * Hardware-reduced prototypes. All interfaces that use these macros will
- * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
+ * Optionally use default values for the ACPI register widths. Set this to
+ * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_UseDefaultRegisterWidths, TRUE);
+
+/*
+ * Whether or not to verify the table checksum before installation. Set
+ * this to TRUE to verify the table checksum before install it to the table
+ * manager. Note that enabling this option causes errors to happen in some
+ * OSPMs during early initialization stages. Default behavior is to do such
+ * verification.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_VerifyTableChecksum, TRUE);
+
+/*
+ * Optionally enable output from the AML Debug Object.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_EnableAmlDebugObject, FALSE);
+
+/*
+ * Optionally copy the entire DSDT to local memory (instead of simply
+ * mapping it.) There are some BIOSs that corrupt or replace the original
+ * DSDT, creating the need for this option. Default is FALSE, do not copy
+ * the DSDT.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_CopyDsdtLocally, FALSE);
+
+/*
+ * Optionally ignore an XSDT if present and use the RSDT instead.
+ * Although the ACPI specification requires that an XSDT be used instead
+ * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
+ * some machines. Default behavior is to use the XSDT if present.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_DoNotUseXsdt, FALSE);
+
+/*
+ * Optionally use 32-bit FADT addresses if and when there is a conflict
+ * (address mismatch) between the 32-bit and 64-bit versions of the
+ * address. Although ACPICA adheres to the ACPI specification which
+ * requires the use of the corresponding 64-bit address if it is non-zero,
+ * some machines have been found to have a corrupted non-zero 64-bit
+ * address. Default is FALSE, do not favor the 32-bit addresses.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_Use32BitFadtAddresses, FALSE);
+
+/*
+ * Optionally truncate I/O addresses to 16 bits. Provides compatibility
+ * with other ACPI implementations. NOTE: During ACPICA initialization,
+ * this value is set to TRUE if any Windows OSI strings have been
+ * requested by the BIOS.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_TruncateIoAddresses, FALSE);
+
+/*
+ * Disable runtime checking and repair of values returned by control methods.
+ * Use only if the repair is causing a problem on a particular machine.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_DisableAutoRepair, FALSE);
+
+/*
+ * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
+ * This can be useful for debugging ACPI problems on some machines.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_DisableSsdtTableInstall, FALSE);
+
+/*
+ * We keep track of the latest version of Windows that has been requested by
+ * the BIOS. ACPI 5.0.
+ */
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_OsiData, 0);
+
+/*
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
+ */
+ACPI_INIT_GLOBAL (BOOLEAN,          AcpiGbl_ReducedHardware, FALSE);
+
+/*
+ * This mechanism is used to trace a specified AML method. The method is
+ * traced each time it is executed.
+ */
+ACPI_INIT_GLOBAL (UINT32,           AcpiGbl_TraceFlags, 0);
+ACPI_INIT_GLOBAL (ACPI_NAME,        AcpiGbl_TraceMethodName, 0);
+
+/*
+ * Runtime configuration of debug output control masks. We want the debug
+ * switches statically initialized so they are already set when the debugger
+ * is entered.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+ACPI_INIT_GLOBAL (UINT32,           AcpiDbgLevel, ACPI_DEBUG_DEFAULT);
+#else
+ACPI_INIT_GLOBAL (UINT32,           AcpiDbgLevel, ACPI_NORMAL_DEFAULT);
+#endif
+ACPI_INIT_GLOBAL (UINT32,           AcpiDbgLayer, ACPI_COMPONENT_DEFAULT);
+
+/*
+ * Other miscellaneous globals
+ */
+ACPI_GLOBAL (ACPI_TABLE_FADT,       AcpiGbl_FADT);
+ACPI_GLOBAL (UINT32,                AcpiCurrentGpeCount);
+ACPI_GLOBAL (BOOLEAN,               AcpiGbl_SystemAwakeAndRunning);
+
+
+/*****************************************************************************
+ *
+ * ACPICA public interface configuration.
+ *
+ * Interfaces that are configured out of the ACPICA build are replaced
+ * by inlined stubs by default.
+ *
+ ****************************************************************************/
+
+/*
+ * Hardware-reduced prototypes (default: Not hardware reduced).
+ *
+ * All ACPICA hardware-related interfaces that use these macros will be
+ * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
  * is set to TRUE.
  * is set to TRUE.
+ *
+ * Note: This static build option for reduced hardware is intended to
+ * reduce ACPICA code size if desired or necessary. However, even if this
+ * option is not specified, the runtime behavior of ACPICA is dependent
+ * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
+ * the flag will enable similar behavior -- ACPICA will not attempt
+ * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
  */
 #if (!ACPI_REDUCED_HARDWARE)
 #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
  */
 #if (!ACPI_REDUCED_HARDWARE)
 #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
-    Prototype;
+    ACPI_EXTERNAL_RETURN_STATUS(Prototype)
 
 #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
 
 #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
-    Prototype;
+    ACPI_EXTERNAL_RETURN_OK(Prototype)
 
 #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
 
 #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
-    Prototype;
+    ACPI_EXTERNAL_RETURN_VOID(Prototype)
 
 #else
 #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
 
 #else
 #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
@@ -185,30 +379,95 @@ extern UINT8                AcpiGbl_UseDefaultRegisterWidths;
 #endif /* !ACPI_REDUCED_HARDWARE */
 
 
 #endif /* !ACPI_REDUCED_HARDWARE */
 
 
+/*
+ * Error message prototypes (default: error messages enabled).
+ *
+ * All interfaces related to error and warning messages
+ * will be configured out of the ACPICA build if the
+ * ACPI_NO_ERROR_MESSAGE flag is defined.
+ */
+#ifndef ACPI_NO_ERROR_MESSAGES
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+    Prototype;
+
+#else
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+    static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
+
+
+/*
+ * Debugging output prototypes (default: no debug output).
+ *
+ * All interfaces related to debug output messages
+ * will be configured out of the ACPICA build unless the
+ * ACPI_DEBUG_OUTPUT flag is defined.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+    Prototype;
+
+#else
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+    static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_DEBUG_OUTPUT */
+
+
+/*
+ * Application prototypes
+ *
+ * All interfaces used by application will be configured
+ * out of the ACPICA build unless the ACPI_APPLICATION
+ * flag is defined.
+ */
+#ifdef ACPI_APPLICATION
+#define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
+    Prototype;
+
+#else
+#define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
+    static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_APPLICATION */
+
+
+/*****************************************************************************
+ *
+ * ACPICA public interface prototypes
+ *
+ ****************************************************************************/
+
 /*
  * Initialization
  */
 /*
  * Initialization
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInitializeTables (
     ACPI_TABLE_DESC         *InitialStorage,
     UINT32                  InitialTableCount,
 ACPI_STATUS
 AcpiInitializeTables (
     ACPI_TABLE_DESC         *InitialStorage,
     UINT32                  InitialTableCount,
-    BOOLEAN                 AllowResize);
+    BOOLEAN                 AllowResize))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInitializeSubsystem (
 ACPI_STATUS
 AcpiInitializeSubsystem (
-    void);
+    void))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiEnableSubsystem (
 ACPI_STATUS
 AcpiEnableSubsystem (
-    UINT32                  Flags);
+    UINT32                  Flags))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInitializeObjects (
 ACPI_STATUS
 AcpiInitializeObjects (
-    UINT32                  Flags);
+    UINT32                  Flags))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiTerminate (
 ACPI_STATUS
 AcpiTerminate (
-    void);
+    void))
 
 
 /*
 
 
 /*
@@ -224,114 +483,136 @@ ACPI_STATUS
 AcpiDisable (
     void))
 
 AcpiDisable (
     void))
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiSubsystemStatus (
 ACPI_STATUS
 AcpiSubsystemStatus (
-    void);
+    void))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetSystemInfo (
 ACPI_STATUS
 AcpiGetSystemInfo (
-    ACPI_BUFFER             *RetBuffer);
+    ACPI_BUFFER             *RetBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetStatistics (
 ACPI_STATUS
 AcpiGetStatistics (
-    ACPI_STATISTICS         *Stats);
+    ACPI_STATISTICS         *Stats))
 
 
+ACPI_EXTERNAL_RETURN_PTR (
 const char *
 AcpiFormatException (
 const char *
 AcpiFormatException (
-    ACPI_STATUS             Exception);
+    ACPI_STATUS             Exception))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiPurgeCachedObjects (
 ACPI_STATUS
 AcpiPurgeCachedObjects (
-    void);
+    void))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallInterface (
 ACPI_STATUS
 AcpiInstallInterface (
-    ACPI_STRING             InterfaceName);
+    ACPI_STRING             InterfaceName))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiRemoveInterface (
 ACPI_STATUS
 AcpiRemoveInterface (
-    ACPI_STRING             InterfaceName);
+    ACPI_STRING             InterfaceName))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiUpdateInterfaces (
 ACPI_STATUS
 AcpiUpdateInterfaces (
-    UINT8                   Action);
+    UINT8                   Action))
 
 
+ACPI_EXTERNAL_RETURN_UINT32 (
 UINT32
 AcpiCheckAddressRange (
     ACPI_ADR_SPACE_TYPE     SpaceId,
     ACPI_PHYSICAL_ADDRESS   Address,
     ACPI_SIZE               Length,
 UINT32
 AcpiCheckAddressRange (
     ACPI_ADR_SPACE_TYPE     SpaceId,
     ACPI_PHYSICAL_ADDRESS   Address,
     ACPI_SIZE               Length,
-    BOOLEAN                 Warn);
+    BOOLEAN                 Warn))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiDecodePldBuffer (
     UINT8                   *InBuffer,
     ACPI_SIZE               Length,
 ACPI_STATUS
 AcpiDecodePldBuffer (
     UINT8                   *InBuffer,
     ACPI_SIZE               Length,
-    ACPI_PLD_INFO           **ReturnBuffer);
+    ACPI_PLD_INFO           **ReturnBuffer))
 
 
 /*
  * ACPI table load/unload interfaces
  */
 
 
 /*
  * ACPI table load/unload interfaces
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallTable (
     ACPI_PHYSICAL_ADDRESS   Address,
 ACPI_STATUS
 AcpiInstallTable (
     ACPI_PHYSICAL_ADDRESS   Address,
-    BOOLEAN                 Physical);
+    BOOLEAN                 Physical))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiLoadTable (
 ACPI_STATUS
 AcpiLoadTable (
-    ACPI_TABLE_HEADER       *Table);
+    ACPI_TABLE_HEADER       *Table))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiUnloadParentTable (
 ACPI_STATUS
 AcpiUnloadParentTable (
-    ACPI_HANDLE             Object);
+    ACPI_HANDLE             Object))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiLoadTables (
 ACPI_STATUS
 AcpiLoadTables (
-    void);
+    void))
 
 
 /*
  * ACPI table manipulation interfaces
  */
 
 
 /*
  * ACPI table manipulation interfaces
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiReallocateRootTable (
 ACPI_STATUS
 AcpiReallocateRootTable (
-    void);
+    void))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiFindRootPointer (
 ACPI_STATUS
 AcpiFindRootPointer (
-    ACPI_SIZE               *RsdpAddress);
+    ACPI_SIZE               *RsdpAddress))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetTableHeader (
     ACPI_STRING             Signature,
     UINT32                  Instance,
 ACPI_STATUS
 AcpiGetTableHeader (
     ACPI_STRING             Signature,
     UINT32                  Instance,
-    ACPI_TABLE_HEADER       *OutTableHeader);
+    ACPI_TABLE_HEADER       *OutTableHeader))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetTable (
     ACPI_STRING             Signature,
     UINT32                  Instance,
 ACPI_STATUS
 AcpiGetTable (
     ACPI_STRING             Signature,
     UINT32                  Instance,
-    ACPI_TABLE_HEADER       **OutTable);
+    ACPI_TABLE_HEADER       **OutTable))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetTableByIndex (
     UINT32                  TableIndex,
 ACPI_STATUS
 AcpiGetTableByIndex (
     UINT32                  TableIndex,
-    ACPI_TABLE_HEADER       **OutTable);
+    ACPI_TABLE_HEADER       **OutTable))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallTableHandler (
     ACPI_TABLE_HANDLER      Handler,
 ACPI_STATUS
 AcpiInstallTableHandler (
     ACPI_TABLE_HANDLER      Handler,
-    void                    *Context);
+    void                    *Context))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiRemoveTableHandler (
 ACPI_STATUS
 AcpiRemoveTableHandler (
-    ACPI_TABLE_HANDLER      Handler);
+    ACPI_TABLE_HANDLER      Handler))
 
 
 /*
  * Namespace and name interfaces
  */
 
 
 /*
  * Namespace and name interfaces
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiWalkNamespace (
     ACPI_OBJECT_TYPE        Type,
 ACPI_STATUS
 AcpiWalkNamespace (
     ACPI_OBJECT_TYPE        Type,
@@ -340,104 +621,119 @@ AcpiWalkNamespace (
     ACPI_WALK_CALLBACK      DescendingCallback,
     ACPI_WALK_CALLBACK      AscendingCallback,
     void                    *Context,
     ACPI_WALK_CALLBACK      DescendingCallback,
     ACPI_WALK_CALLBACK      AscendingCallback,
     void                    *Context,
-    void                    **ReturnValue);
+    void                    **ReturnValue))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetDevices (
     char                    *HID,
     ACPI_WALK_CALLBACK      UserFunction,
     void                    *Context,
 ACPI_STATUS
 AcpiGetDevices (
     char                    *HID,
     ACPI_WALK_CALLBACK      UserFunction,
     void                    *Context,
-    void                    **ReturnValue);
+    void                    **ReturnValue))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetName (
     ACPI_HANDLE             Object,
     UINT32                  NameType,
 ACPI_STATUS
 AcpiGetName (
     ACPI_HANDLE             Object,
     UINT32                  NameType,
-    ACPI_BUFFER             *RetPathPtr);
+    ACPI_BUFFER             *RetPathPtr))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetHandle (
     ACPI_HANDLE             Parent,
     ACPI_STRING             Pathname,
 ACPI_STATUS
 AcpiGetHandle (
     ACPI_HANDLE             Parent,
     ACPI_STRING             Pathname,
-    ACPI_HANDLE             *RetHandle);
+    ACPI_HANDLE             *RetHandle))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiAttachData (
     ACPI_HANDLE             Object,
     ACPI_OBJECT_HANDLER     Handler,
 ACPI_STATUS
 AcpiAttachData (
     ACPI_HANDLE             Object,
     ACPI_OBJECT_HANDLER     Handler,
-    void                    *Data);
+    void                    *Data))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiDetachData (
     ACPI_HANDLE             Object,
 ACPI_STATUS
 AcpiDetachData (
     ACPI_HANDLE             Object,
-    ACPI_OBJECT_HANDLER     Handler);
+    ACPI_OBJECT_HANDLER     Handler))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetData (
     ACPI_HANDLE             Object,
     ACPI_OBJECT_HANDLER     Handler,
 ACPI_STATUS
 AcpiGetData (
     ACPI_HANDLE             Object,
     ACPI_OBJECT_HANDLER     Handler,
-    void                    **Data);
+    void                    **Data))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiDebugTrace (
     char                    *Name,
     UINT32                  DebugLevel,
     UINT32                  DebugLayer,
 ACPI_STATUS
 AcpiDebugTrace (
     char                    *Name,
     UINT32                  DebugLevel,
     UINT32                  DebugLayer,
-    UINT32                  Flags);
+    UINT32                  Flags))
 
 
 /*
  * Object manipulation and enumeration
  */
 
 
 /*
  * Object manipulation and enumeration
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiEvaluateObject (
     ACPI_HANDLE             Object,
     ACPI_STRING             Pathname,
     ACPI_OBJECT_LIST        *ParameterObjects,
 ACPI_STATUS
 AcpiEvaluateObject (
     ACPI_HANDLE             Object,
     ACPI_STRING             Pathname,
     ACPI_OBJECT_LIST        *ParameterObjects,
-    ACPI_BUFFER             *ReturnObjectBuffer);
+    ACPI_BUFFER             *ReturnObjectBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiEvaluateObjectTyped (
     ACPI_HANDLE             Object,
     ACPI_STRING             Pathname,
     ACPI_OBJECT_LIST        *ExternalParams,
     ACPI_BUFFER             *ReturnBuffer,
 ACPI_STATUS
 AcpiEvaluateObjectTyped (
     ACPI_HANDLE             Object,
     ACPI_STRING             Pathname,
     ACPI_OBJECT_LIST        *ExternalParams,
     ACPI_BUFFER             *ReturnBuffer,
-    ACPI_OBJECT_TYPE        ReturnType);
+    ACPI_OBJECT_TYPE        ReturnType))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetObjectInfo (
     ACPI_HANDLE             Object,
 ACPI_STATUS
 AcpiGetObjectInfo (
     ACPI_HANDLE             Object,
-    ACPI_DEVICE_INFO        **ReturnBuffer);
+    ACPI_DEVICE_INFO        **ReturnBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallMethod (
 ACPI_STATUS
 AcpiInstallMethod (
-    UINT8                   *Buffer);
+    UINT8                   *Buffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetNextObject (
     ACPI_OBJECT_TYPE        Type,
     ACPI_HANDLE             Parent,
     ACPI_HANDLE             Child,
 ACPI_STATUS
 AcpiGetNextObject (
     ACPI_OBJECT_TYPE        Type,
     ACPI_HANDLE             Parent,
     ACPI_HANDLE             Child,
-    ACPI_HANDLE             *OutHandle);
+    ACPI_HANDLE             *OutHandle))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetType (
     ACPI_HANDLE             Object,
 ACPI_STATUS
 AcpiGetType (
     ACPI_HANDLE             Object,
-    ACPI_OBJECT_TYPE        *OutType);
+    ACPI_OBJECT_TYPE        *OutType))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetParent (
     ACPI_HANDLE             Object,
 ACPI_STATUS
 AcpiGetParent (
     ACPI_HANDLE             Object,
-    ACPI_HANDLE             *OutHandle);
+    ACPI_HANDLE             *OutHandle))
 
 
 /*
  * Handler interfaces
  */
 
 
 /*
  * Handler interfaces
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallInitializationHandler (
     ACPI_INIT_HANDLER       Handler,
 ACPI_STATUS
 AcpiInstallInitializationHandler (
     ACPI_INIT_HANDLER       Handler,
-    UINT32                  Function);
+    UINT32                  Function))
 
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
@@ -485,40 +781,46 @@ AcpiRemoveGpeHandler (
     UINT32                  GpeNumber,
     ACPI_GPE_HANDLER        Address))
 
     UINT32                  GpeNumber,
     ACPI_GPE_HANDLER        Address))
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallNotifyHandler (
     ACPI_HANDLE             Device,
     UINT32                  HandlerType,
     ACPI_NOTIFY_HANDLER     Handler,
 ACPI_STATUS
 AcpiInstallNotifyHandler (
     ACPI_HANDLE             Device,
     UINT32                  HandlerType,
     ACPI_NOTIFY_HANDLER     Handler,
-    void                    *Context);
+    void                    *Context))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiRemoveNotifyHandler (
     ACPI_HANDLE             Device,
     UINT32                  HandlerType,
 ACPI_STATUS
 AcpiRemoveNotifyHandler (
     ACPI_HANDLE             Device,
     UINT32                  HandlerType,
-    ACPI_NOTIFY_HANDLER     Handler);
+    ACPI_NOTIFY_HANDLER     Handler))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallAddressSpaceHandler (
     ACPI_HANDLE             Device,
     ACPI_ADR_SPACE_TYPE     SpaceId,
     ACPI_ADR_SPACE_HANDLER  Handler,
     ACPI_ADR_SPACE_SETUP    Setup,
 ACPI_STATUS
 AcpiInstallAddressSpaceHandler (
     ACPI_HANDLE             Device,
     ACPI_ADR_SPACE_TYPE     SpaceId,
     ACPI_ADR_SPACE_HANDLER  Handler,
     ACPI_ADR_SPACE_SETUP    Setup,
-    void                    *Context);
+    void                    *Context))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiRemoveAddressSpaceHandler (
     ACPI_HANDLE             Device,
     ACPI_ADR_SPACE_TYPE     SpaceId,
 ACPI_STATUS
 AcpiRemoveAddressSpaceHandler (
     ACPI_HANDLE             Device,
     ACPI_ADR_SPACE_TYPE     SpaceId,
-    ACPI_ADR_SPACE_HANDLER  Handler);
+    ACPI_ADR_SPACE_HANDLER  Handler))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallExceptionHandler (
 ACPI_STATUS
 AcpiInstallExceptionHandler (
-    ACPI_EXCEPTION_HANDLER  Handler);
+    ACPI_EXCEPTION_HANDLER  Handler))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiInstallInterfaceHandler (
 ACPI_STATUS
 AcpiInstallInterfaceHandler (
-    ACPI_INTERFACE_HANDLER  Handler);
+    ACPI_INTERFACE_HANDLER  Handler))
 
 
 /*
 
 
 /*
@@ -539,16 +841,18 @@ AcpiReleaseGlobalLock (
 /*
  * Interfaces to AML mutex objects
  */
 /*
  * Interfaces to AML mutex objects
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiAcquireMutex (
     ACPI_HANDLE             Handle,
     ACPI_STRING             Pathname,
 ACPI_STATUS
 AcpiAcquireMutex (
     ACPI_HANDLE             Handle,
     ACPI_STRING             Pathname,
-    UINT16                  Timeout);
+    UINT16                  Timeout))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiReleaseMutex (
     ACPI_HANDLE             Handle,
 ACPI_STATUS
 AcpiReleaseMutex (
     ACPI_HANDLE             Handle,
-    ACPI_STRING             Pathname);
+    ACPI_STRING             Pathname))
 
 
 /*
 
 
 /*
@@ -617,6 +921,12 @@ AcpiFinishGpe (
     ACPI_HANDLE             GpeDevice,
     UINT32                  GpeNumber))
 
     ACPI_HANDLE             GpeDevice,
     UINT32                  GpeNumber))
 
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
+AcpiMarkGpeForWake (
+    ACPI_HANDLE             GpeDevice,
+    UINT32                  GpeNumber))
+
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 AcpiSetupGpeForWake (
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 AcpiSetupGpeForWake (
@@ -676,79 +986,92 @@ ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
     ACPI_RESOURCE           *Resource,
     void                    *Context);
 
     ACPI_RESOURCE           *Resource,
     void                    *Context);
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetVendorResource (
     ACPI_HANDLE             Device,
     char                    *Name,
     ACPI_VENDOR_UUID        *Uuid,
 ACPI_STATUS
 AcpiGetVendorResource (
     ACPI_HANDLE             Device,
     char                    *Name,
     ACPI_VENDOR_UUID        *Uuid,
-    ACPI_BUFFER             *RetBuffer);
+    ACPI_BUFFER             *RetBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetCurrentResources (
     ACPI_HANDLE             Device,
 ACPI_STATUS
 AcpiGetCurrentResources (
     ACPI_HANDLE             Device,
-    ACPI_BUFFER             *RetBuffer);
+    ACPI_BUFFER             *RetBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetPossibleResources (
     ACPI_HANDLE             Device,
 ACPI_STATUS
 AcpiGetPossibleResources (
     ACPI_HANDLE             Device,
-    ACPI_BUFFER             *RetBuffer);
+    ACPI_BUFFER             *RetBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetEventResources (
     ACPI_HANDLE             DeviceHandle,
 ACPI_STATUS
 AcpiGetEventResources (
     ACPI_HANDLE             DeviceHandle,
-    ACPI_BUFFER             *RetBuffer);
+    ACPI_BUFFER             *RetBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiWalkResourceBuffer (
     ACPI_BUFFER                 *Buffer,
     ACPI_WALK_RESOURCE_CALLBACK UserFunction,
 ACPI_STATUS
 AcpiWalkResourceBuffer (
     ACPI_BUFFER                 *Buffer,
     ACPI_WALK_RESOURCE_CALLBACK UserFunction,
-    void                        *Context);
+    void                        *Context))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiWalkResources (
     ACPI_HANDLE                 Device,
     char                        *Name,
     ACPI_WALK_RESOURCE_CALLBACK UserFunction,
 ACPI_STATUS
 AcpiWalkResources (
     ACPI_HANDLE                 Device,
     char                        *Name,
     ACPI_WALK_RESOURCE_CALLBACK UserFunction,
-    void                        *Context);
+    void                        *Context))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiSetCurrentResources (
     ACPI_HANDLE             Device,
 ACPI_STATUS
 AcpiSetCurrentResources (
     ACPI_HANDLE             Device,
-    ACPI_BUFFER             *InBuffer);
+    ACPI_BUFFER             *InBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetIrqRoutingTable (
     ACPI_HANDLE             Device,
 ACPI_STATUS
 AcpiGetIrqRoutingTable (
     ACPI_HANDLE             Device,
-    ACPI_BUFFER             *RetBuffer);
+    ACPI_BUFFER             *RetBuffer))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiResourceToAddress64 (
     ACPI_RESOURCE           *Resource,
 ACPI_STATUS
 AcpiResourceToAddress64 (
     ACPI_RESOURCE           *Resource,
-    ACPI_RESOURCE_ADDRESS64 *Out);
+    ACPI_RESOURCE_ADDRESS64 *Out))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiBufferToResource (
     UINT8                   *AmlBuffer,
     UINT16                  AmlBufferLength,
 ACPI_STATUS
 AcpiBufferToResource (
     UINT8                   *AmlBuffer,
     UINT16                  AmlBufferLength,
-    ACPI_RESOURCE           **ResourcePtr);
+    ACPI_RESOURCE           **ResourcePtr))
 
 
 /*
  * Hardware (ACPI device) interfaces
  */
 
 
 /*
  * Hardware (ACPI device) interfaces
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiReset (
 ACPI_STATUS
 AcpiReset (
-    void);
+    void))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiRead (
     UINT64                  *Value,
 ACPI_STATUS
 AcpiRead (
     UINT64                  *Value,
-    ACPI_GENERIC_ADDRESS    *Reg);
+    ACPI_GENERIC_ADDRESS    *Reg))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiWrite (
     UINT64                  Value,
 ACPI_STATUS
 AcpiWrite (
     UINT64                  Value,
-    ACPI_GENERIC_ADDRESS    *Reg);
+    ACPI_GENERIC_ADDRESS    *Reg))
 
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
@@ -766,32 +1089,37 @@ AcpiWriteBitRegister (
 /*
  * Sleep/Wake interfaces
  */
 /*
  * Sleep/Wake interfaces
  */
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiGetSleepTypeData (
     UINT8                   SleepState,
     UINT8                   *Slp_TypA,
 ACPI_STATUS
 AcpiGetSleepTypeData (
     UINT8                   SleepState,
     UINT8                   *Slp_TypA,
-    UINT8                   *Slp_TypB);
+    UINT8                   *Slp_TypB))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiEnterSleepStatePrep (
 ACPI_STATUS
 AcpiEnterSleepStatePrep (
-    UINT8                   SleepState);
+    UINT8                   SleepState))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiEnterSleepState (
 ACPI_STATUS
 AcpiEnterSleepState (
-    UINT8                   SleepState);
+    UINT8                   SleepState))
 
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 AcpiEnterSleepStateS4bios (
     void))
 
 
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 AcpiEnterSleepStateS4bios (
     void))
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiLeaveSleepStatePrep (
 ACPI_STATUS
 AcpiLeaveSleepStatePrep (
-    UINT8                   SleepState);
+    UINT8                   SleepState))
 
 
+ACPI_EXTERNAL_RETURN_STATUS (
 ACPI_STATUS
 AcpiLeaveSleepState (
 ACPI_STATUS
 AcpiLeaveSleepState (
-    UINT8                   SleepState);
+    UINT8                   SleepState))
 
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
@@ -830,14 +1158,16 @@ AcpiGetTimerDuration (
 /*
  * Error/Warning output
  */
 /*
  * Error/Warning output
  */
+ACPI_MSG_DEPENDENT_RETURN_VOID (
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiError (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiError (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
-    ...);
+    ...))
 
 
+ACPI_MSG_DEPENDENT_RETURN_VOID (
 ACPI_PRINTF_LIKE(4)
 void  ACPI_INTERNAL_VAR_XFACE
 AcpiException (
 ACPI_PRINTF_LIKE(4)
 void  ACPI_INTERNAL_VAR_XFACE
 AcpiException (
@@ -845,46 +1175,49 @@ AcpiException (
     UINT32                  LineNumber,
     ACPI_STATUS             Status,
     const char              *Format,
     UINT32                  LineNumber,
     ACPI_STATUS             Status,
     const char              *Format,
-    ...);
+    ...))
 
 
+ACPI_MSG_DEPENDENT_RETURN_VOID (
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiWarning (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiWarning (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
-    ...);
+    ...))
 
 
+ACPI_MSG_DEPENDENT_RETURN_VOID (
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiInfo (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiInfo (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
-    ...);
+    ...))
 
 
+ACPI_MSG_DEPENDENT_RETURN_VOID (
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiBiosError (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiBiosError (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
-    ...);
+    ...))
 
 
+ACPI_MSG_DEPENDENT_RETURN_VOID (
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiBiosWarning (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
 ACPI_PRINTF_LIKE(3)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiBiosWarning (
     const char              *ModuleName,
     UINT32                  LineNumber,
     const char              *Format,
-    ...);
+    ...))
 
 
 /*
  * Debug output
  */
 
 
 /*
  * Debug output
  */
-#ifdef ACPI_DEBUG_OUTPUT
-
+ACPI_DBG_DEPENDENT_RETURN_VOID (
 ACPI_PRINTF_LIKE(6)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiDebugPrint (
 ACPI_PRINTF_LIKE(6)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiDebugPrint (
@@ -894,8 +1227,9 @@ AcpiDebugPrint (
     const char              *ModuleName,
     UINT32                  ComponentId,
     const char              *Format,
     const char              *ModuleName,
     UINT32                  ComponentId,
     const char              *Format,
-    ...);
+    ...))
 
 
+ACPI_DBG_DEPENDENT_RETURN_VOID (
 ACPI_PRINTF_LIKE(6)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiDebugPrintRaw (
 ACPI_PRINTF_LIKE(6)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiDebugPrintRaw (
@@ -905,7 +1239,13 @@ AcpiDebugPrintRaw (
     const char              *ModuleName,
     UINT32                  ComponentId,
     const char              *Format,
     const char              *ModuleName,
     UINT32                  ComponentId,
     const char              *Format,
-    ...);
-#endif
+    ...))
+
+ACPI_APP_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(1)
+void ACPI_INTERNAL_VAR_XFACE
+AcpiLogError (
+    const char              *Format,
+    ...))
 
 #endif /* __ACXFACE_H__ */
 
 #endif /* __ACXFACE_H__ */
index 7e804f3..1c1776a 100644 (file)
  *      count = 0 (optional)
  *      (Used for _DLM)
  *
  *      count = 0 (optional)
  *      (Used for _DLM)
  *
+ * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
+ *      defines the format of the package. Zero-length parent package is
+ *      allowed.
+ *      (Used for _DSD)
+ *
  *****************************************************************************/
 
 enum AcpiReturnPackageTypes
  *****************************************************************************/
 
 enum AcpiReturnPackageTypes
@@ -191,7 +196,8 @@ enum AcpiReturnPackageTypes
     ACPI_PTYPE2_FIXED       = 7,
     ACPI_PTYPE2_MIN         = 8,
     ACPI_PTYPE2_REV_FIXED   = 9,
     ACPI_PTYPE2_FIXED       = 7,
     ACPI_PTYPE2_MIN         = 8,
     ACPI_PTYPE2_REV_FIXED   = 9,
-    ACPI_PTYPE2_FIX_VAR     = 10
+    ACPI_PTYPE2_FIX_VAR     = 10,
+    ACPI_PTYPE2_UUID_PAIR   = 11
 };
 
 
 };
 
 
@@ -438,6 +444,9 @@ const ACPI_PREDEFINED_INFO          AcpiGbl_PredefinedMethods[] =
     {{"_CBA",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
 
     {{"_CBA",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
 
+    {{"_CCA",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
+
     {{"_CDM",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
     {{"_CDM",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
@@ -506,6 +515,10 @@ const ACPI_PREDEFINED_INFO          AcpiGbl_PredefinedMethods[] =
     {{"_DOS",   METHOD_1ARGS (ACPI_TYPE_INTEGER),
                 METHOD_NO_RETURN_VALUE}},
 
     {{"_DOS",   METHOD_1ARGS (ACPI_TYPE_INTEGER),
                 METHOD_NO_RETURN_VALUE}},
 
+    {{"_DSD",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
+                    PACKAGE_INFO (ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_PACKAGE, 1,0),
+
     {{"_DSM",   METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE),
                 METHOD_RETURNS (ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */
 
     {{"_DSM",   METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE),
                 METHOD_RETURNS (ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */
 
@@ -652,6 +665,10 @@ const ACPI_PREDEFINED_INFO          AcpiGbl_PredefinedMethods[] =
     {{"_LID",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
     {{"_LID",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
+    {{"_LPD",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Int) */
+                    PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0),
+
     {{"_MAT",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
     {{"_MAT",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
@@ -756,12 +773,6 @@ const ACPI_PREDEFINED_INFO          AcpiGbl_PredefinedMethods[] =
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */
                     PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0),
 
                 METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */
                     PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0),
 
-    {{"_PRP",   METHOD_0ARGS,
-                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Str, 1 Int/Str/Pkg */
-                    PACKAGE_INFO (ACPI_PTYPE2, ACPI_RTYPE_STRING, 1,
-                        ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
-                        ACPI_RTYPE_PACKAGE | ACPI_RTYPE_REFERENCE, 1,0),
-
     {{"_PRS",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
     {{"_PRS",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
index 3bcfd94..bb2a4f3 100644 (file)
@@ -124,6 +124,10 @@ AcpiAllocateRootTable (
 /*
  * tbxfroot - Root pointer utilities
  */
 /*
  * tbxfroot - Root pointer utilities
  */
+UINT32
+AcpiTbGetRsdpLength (
+    ACPI_TABLE_RSDP         *Rsdp);
+
 ACPI_STATUS
 AcpiTbValidateRsdp (
     ACPI_TABLE_RSDP         *Rsdp);
 ACPI_STATUS
 AcpiTbValidateRsdp (
     ACPI_TABLE_RSDP         *Rsdp);
@@ -158,6 +162,15 @@ void
 AcpiTbReleaseTempTable (
     ACPI_TABLE_DESC         *TableDesc);
 
 AcpiTbReleaseTempTable (
     ACPI_TABLE_DESC         *TableDesc);
 
+ACPI_STATUS
+AcpiTbValidateTempTable (
+    ACPI_TABLE_DESC         *TableDesc);
+
+ACPI_STATUS
+AcpiTbVerifyTempTable (
+    ACPI_TABLE_DESC         *TableDesc,
+    char                    *Signature);
+
 BOOLEAN
 AcpiTbIsTableLoaded (
     UINT32                  TableIndex);
 BOOLEAN
 AcpiTbIsTableLoaded (
     UINT32                  TableIndex);
@@ -207,11 +220,6 @@ void
 AcpiTbInvalidateTable (
     ACPI_TABLE_DESC         *TableDesc);
 
 AcpiTbInvalidateTable (
     ACPI_TABLE_DESC         *TableDesc);
 
-ACPI_STATUS
-AcpiTbVerifyTable (
-    ACPI_TABLE_DESC         *TableDesc,
-    char                    *Signature);
-
 void
 AcpiTbOverrideTable (
     ACPI_TABLE_DESC         *OldTableDesc);
 void
 AcpiTbOverrideTable (
     ACPI_TABLE_DESC         *OldTableDesc);
index 9a6625c..ea9fc58 100644 (file)
@@ -368,7 +368,8 @@ typedef struct acpi_table_fadt
     UINT32                  Flags;              /* Miscellaneous flag bits (see below for individual flags) */
     ACPI_GENERIC_ADDRESS    ResetRegister;      /* 64-bit address of the Reset register */
     UINT8                   ResetValue;         /* Value to write to the ResetRegister port to reset the system */
     UINT32                  Flags;              /* Miscellaneous flag bits (see below for individual flags) */
     ACPI_GENERIC_ADDRESS    ResetRegister;      /* 64-bit address of the Reset register */
     UINT8                   ResetValue;         /* Value to write to the ResetRegister port to reset the system */
-    UINT8                   Reserved4[3];       /* Reserved, must be zero */
+    UINT16                  ArmBootFlags;       /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
+    UINT8                   MinorRevision;      /* FADT Minor Revision (ACPI 5.1) */
     UINT64                  XFacs;              /* 64-bit physical address of FACS */
     UINT64                  XDsdt;              /* 64-bit physical address of DSDT */
     ACPI_GENERIC_ADDRESS    XPm1aEventBlock;    /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
     UINT64                  XFacs;              /* 64-bit physical address of FACS */
     UINT64                  XDsdt;              /* 64-bit physical address of DSDT */
     ACPI_GENERIC_ADDRESS    XPm1aEventBlock;    /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -385,7 +386,7 @@ typedef struct acpi_table_fadt
 } ACPI_TABLE_FADT;
 
 
 } ACPI_TABLE_FADT;
 
 
-/* Masks for FADT Boot Architecture Flags (BootFlags) [Vx]=Introduced in this FADT revision */
+/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
 
 #define ACPI_FADT_LEGACY_DEVICES    (1)         /* 00: [V2] System has LPC or ISA bus devices */
 #define ACPI_FADT_8042              (1<<1)      /* 01: [V3] System has an 8042 controller on port 60/64 */
 
 #define ACPI_FADT_LEGACY_DEVICES    (1)         /* 00: [V2] System has LPC or ISA bus devices */
 #define ACPI_FADT_8042              (1<<1)      /* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -394,6 +395,11 @@ typedef struct acpi_table_fadt
 #define ACPI_FADT_NO_ASPM           (1<<4)      /* 04: [V4] PCIe ASPM control must not be enabled */
 #define ACPI_FADT_NO_CMOS_RTC       (1<<5)      /* 05: [V5] No CMOS real-time clock present */
 
 #define ACPI_FADT_NO_ASPM           (1<<4)      /* 04: [V4] PCIe ASPM control must not be enabled */
 #define ACPI_FADT_NO_CMOS_RTC       (1<<5)      /* 05: [V5] No CMOS real-time clock present */
 
+/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
+
+#define ACPI_FADT_PSCI_COMPLIANT    (1)         /* 00: [V5+] PSCI 0.2+ is implemented */
+#define ACPI_FADT_PSCI_USE_HVC      (1<<1)      /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
+
 /* Masks for FADT flags */
 
 #define ACPI_FADT_WBINVD            (1)         /* 00: [V1] The WBINVD instruction works properly */
 /* Masks for FADT flags */
 
 #define ACPI_FADT_WBINVD            (1)         /* 00: [V1] The WBINVD instruction works properly */
@@ -507,7 +513,7 @@ typedef struct acpi_table_desc
  *     FADT V5  size: 0x10C
  */
 #define ACPI_FADT_V1_SIZE       (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
  *     FADT V5  size: 0x10C
  */
 #define ACPI_FADT_V1_SIZE       (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
-#define ACPI_FADT_V2_SIZE       (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3)
+#define ACPI_FADT_V2_SIZE       (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1)
 #define ACPI_FADT_V3_SIZE       (UINT32) (ACPI_FADT_OFFSET (SleepControl))
 #define ACPI_FADT_V5_SIZE       (UINT32) (sizeof (ACPI_TABLE_FADT))
 
 #define ACPI_FADT_V3_SIZE       (UINT32) (ACPI_FADT_OFFSET (SleepControl))
 #define ACPI_FADT_V5_SIZE       (UINT32) (sizeof (ACPI_TABLE_FADT))
 
index 4710672..4c5ffee 100644 (file)
@@ -834,25 +834,27 @@ typedef struct acpi_table_madt
 
 enum AcpiMadtType
 {
 
 enum AcpiMadtType
 {
-    ACPI_MADT_TYPE_LOCAL_APIC           = 0,
-    ACPI_MADT_TYPE_IO_APIC              = 1,
-    ACPI_MADT_TYPE_INTERRUPT_OVERRIDE   = 2,
-    ACPI_MADT_TYPE_NMI_SOURCE           = 3,
-    ACPI_MADT_TYPE_LOCAL_APIC_NMI       = 4,
-    ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE  = 5,
-    ACPI_MADT_TYPE_IO_SAPIC             = 6,
-    ACPI_MADT_TYPE_LOCAL_SAPIC          = 7,
-    ACPI_MADT_TYPE_INTERRUPT_SOURCE     = 8,
-    ACPI_MADT_TYPE_LOCAL_X2APIC         = 9,
-    ACPI_MADT_TYPE_LOCAL_X2APIC_NMI     = 10,
-    ACPI_MADT_TYPE_GENERIC_INTERRUPT    = 11,
-    ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR  = 12,
-    ACPI_MADT_TYPE_RESERVED             = 13    /* 13 and greater are reserved */
+    ACPI_MADT_TYPE_LOCAL_APIC               = 0,
+    ACPI_MADT_TYPE_IO_APIC                  = 1,
+    ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
+    ACPI_MADT_TYPE_NMI_SOURCE               = 3,
+    ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
+    ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
+    ACPI_MADT_TYPE_IO_SAPIC                 = 6,
+    ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
+    ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
+    ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
+    ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
+    ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
+    ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
+    ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
+    ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
+    ACPI_MADT_TYPE_RESERVED                 = 15    /* 15 and greater are reserved */
 };
 
 
 /*
 };
 
 
 /*
- * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
  */
 
 /* 0: Processor Local APIC */
  */
 
 /* 0: Processor Local APIC */
@@ -1008,16 +1010,27 @@ typedef struct acpi_madt_generic_interrupt
 {
     ACPI_SUBTABLE_HEADER    Header;
     UINT16                  Reserved;           /* Reserved - must be zero */
 {
     ACPI_SUBTABLE_HEADER    Header;
     UINT16                  Reserved;           /* Reserved - must be zero */
-    UINT32                  GicId;
+    UINT32                  CpuInterfaceNumber;
     UINT32                  Uid;
     UINT32                  Flags;
     UINT32                  ParkingVersion;
     UINT32                  PerformanceInterrupt;
     UINT64                  ParkedAddress;
     UINT64                  BaseAddress;
     UINT32                  Uid;
     UINT32                  Flags;
     UINT32                  ParkingVersion;
     UINT32                  PerformanceInterrupt;
     UINT64                  ParkedAddress;
     UINT64                  BaseAddress;
+    UINT64                  GicvBaseAddress;
+    UINT64                  GichBaseAddress;
+    UINT32                  VgicInterrupt;
+    UINT64                  GicrBaseAddress;
+    UINT64                  ArmMpidr;
 
 } ACPI_MADT_GENERIC_INTERRUPT;
 
 
 } ACPI_MADT_GENERIC_INTERRUPT;
 
+/* Masks for Flags field above */
+
+/* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
+#define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
+
 
 /* 12: Generic Distributor (ACPI 5.0) */
 
 
 /* 12: Generic Distributor (ACPI 5.0) */
 
@@ -1033,11 +1046,42 @@ typedef struct acpi_madt_generic_distributor
 } ACPI_MADT_GENERIC_DISTRIBUTOR;
 
 
 } ACPI_MADT_GENERIC_DISTRIBUTOR;
 
 
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_msi_frame
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* Reserved - must be zero */
+    UINT32                  MsiFrameId;
+    UINT64                  BaseAddress;
+    UINT32                  Flags;
+    UINT16                  SpiCount;
+    UINT16                  SpiBase;
+
+} ACPI_MADT_GENERIC_MSI_FRAME;
+
+/* Masks for Flags field above */
+
+#define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
+
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_redistributor
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* reserved - must be zero */
+    UINT64                  BaseAddress;
+    UINT32                  Length;
+
+} ACPI_MADT_GENERIC_REDISTRIBUTOR;
+
+
 /*
  * Common flags fields for MADT subtables
  */
 
 /*
  * Common flags fields for MADT subtables
  */
 
-/* MADT Local APIC flags (LapicFlags) and GIC flags */
+/* MADT Local APIC flags */
 
 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
 
 
 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
 
@@ -1146,11 +1190,12 @@ enum AcpiSratType
     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
-    ACPI_SRAT_TYPE_RESERVED             = 3     /* 3 and greater are reserved */
+    ACPI_SRAT_TYPE_GICC_AFFINITY        = 3,
+    ACPI_SRAT_TYPE_RESERVED             = 4     /* 4 and greater are reserved */
 };
 
 /*
 };
 
 /*
- * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
  */
 
 /* 0: Processor Local APIC/SAPIC Affinity */
  */
 
 /* 0: Processor Local APIC/SAPIC Affinity */
@@ -1163,7 +1208,7 @@ typedef struct acpi_srat_cpu_affinity
     UINT32                  Flags;
     UINT8                   LocalSapicEid;
     UINT8                   ProximityDomainHi[3];
     UINT32                  Flags;
     UINT8                   LocalSapicEid;
     UINT8                   ProximityDomainHi[3];
-    UINT32                  Reserved;           /* Reserved, must be zero */
+    UINT32                  ClockDomain;
 
 } ACPI_SRAT_CPU_AFFINITY;
 
 
 } ACPI_SRAT_CPU_AFFINITY;
 
@@ -1213,6 +1258,22 @@ typedef struct acpi_srat_x2apic_cpu_affinity
 #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
 
 
 #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
 
 
+/* 3: GICC Affinity (ACPI 5.1) */
+
+typedef struct acpi_srat_gicc_affinity
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  ProximityDomain;
+    UINT32                  AcpiProcessorUid;
+    UINT32                  Flags;
+    UINT32                  ClockDomain;
+
+} ACPI_SRAT_GICC_AFFINITY;
+
+/* Flags for ACPI_SRAT_GICC_AFFINITY */
+
+#define ACPI_SRAT_GICC_ENABLED     (1)         /* 00: Use affinity structure */
+
 /* Reset to default packing */
 
 #pragma pack()
 /* Reset to default packing */
 
 #pragma pack()
index 2ae8ce3..7d62862 100644 (file)
 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
 #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
 #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
+#define ACPI_SIG_LPIT           "LPIT"      /* Low Power Idle Table */
 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
 #define ACPI_SIG_MTMR           "MTMR"      /* MID Timer table */
 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
 #define ACPI_SIG_MTMR           "MTMR"      /* MID Timer table */
@@ -521,7 +522,7 @@ typedef struct acpi_table_dbgp
  *        Version 1
  *
  * Conforms to "Intel Virtualization Technology for Directed I/O",
  *        Version 1
  *
  * Conforms to "Intel Virtualization Technology for Directed I/O",
- * Version 1.2, Sept. 2008
+ * Version 2.2, Sept. 2013
  *
  ******************************************************************************/
 
  *
  ******************************************************************************/
 
@@ -554,9 +555,10 @@ enum AcpiDmarType
 {
     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
 {
     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
-    ACPI_DMAR_TYPE_ATSR                 = 2,
-    ACPI_DMAR_HARDWARE_AFFINITY         = 3,
-    ACPI_DMAR_TYPE_RESERVED             = 4     /* 4 and greater are reserved */
+    ACPI_DMAR_TYPE_ROOT_ATS             = 2,
+    ACPI_DMAR_TYPE_HARDWARE_AFFINITY    = 3,
+    ACPI_DMAR_TYPE_NAMESPACE            = 4,
+    ACPI_DMAR_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
 };
 
 
 };
 
 
@@ -572,7 +574,7 @@ typedef struct acpi_dmar_device_scope
 
 } ACPI_DMAR_DEVICE_SCOPE;
 
 
 } ACPI_DMAR_DEVICE_SCOPE;
 
-/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
+/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
 
 enum AcpiDmarScopeType
 {
 
 enum AcpiDmarScopeType
 {
@@ -581,7 +583,8 @@ enum AcpiDmarScopeType
     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
-    ACPI_DMAR_SCOPE_TYPE_RESERVED       = 5     /* 5 and greater are reserved */
+    ACPI_DMAR_SCOPE_TYPE_NAMESPACE      = 5,
+    ACPI_DMAR_SCOPE_TYPE_RESERVED       = 6     /* 6 and greater are reserved */
 };
 
 typedef struct acpi_dmar_pci_path
 };
 
 typedef struct acpi_dmar_pci_path
@@ -593,7 +596,7 @@ typedef struct acpi_dmar_pci_path
 
 
 /*
 
 
 /*
- * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
+ * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
  */
 
 /* 0: Hardware Unit Definition */
  */
 
 /* 0: Hardware Unit Definition */
@@ -658,6 +661,18 @@ typedef struct acpi_dmar_rhsa
 } ACPI_DMAR_RHSA;
 
 
 } ACPI_DMAR_RHSA;
 
 
+/* 4: ACPI Namespace Device Declaration Structure */
+
+typedef struct acpi_dmar_andd
+{
+    ACPI_DMAR_HEADER        Header;
+    UINT8                   Reserved[3];
+    UINT8                   DeviceNumber;
+    char                    DeviceName[1];
+
+} ACPI_DMAR_ANDD;
+
+
 /*******************************************************************************
  *
  * HPET - High Precision Event Timer table
 /*******************************************************************************
  *
  * HPET - High Precision Event Timer table
@@ -1006,7 +1021,83 @@ typedef struct acpi_ivrs_memory
 
 /*******************************************************************************
  *
 
 /*******************************************************************************
  *
- * MCFG - PCI Memory Mapped Configuration table and sub-table
+ * LPIT - Low Power Idle Table
+ *
+ * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_lpit
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+
+} ACPI_TABLE_LPIT;
+
+
+/* LPIT subtable header */
+
+typedef struct acpi_lpit_header
+{
+    UINT32                  Type;               /* Subtable type */
+    UINT32                  Length;             /* Subtable length */
+    UINT16                  UniqueId;
+    UINT16                  Reserved;
+    UINT32                  Flags;
+
+} ACPI_LPIT_HEADER;
+
+/* Values for subtable Type above */
+
+enum AcpiLpitType
+{
+    ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
+    ACPI_LPIT_TYPE_SIMPLE_IO        = 0x01
+};
+
+/* Masks for Flags field above  */
+
+#define ACPI_LPIT_STATE_DISABLED    (1)
+#define ACPI_LPIT_NO_COUNTER        (1<<1)
+
+/*
+ * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
+ */
+
+/* 0x00: Native C-state instruction based LPI structure */
+
+typedef struct acpi_lpit_native
+{
+    ACPI_LPIT_HEADER        Header;
+    ACPI_GENERIC_ADDRESS    EntryTrigger;
+    UINT32                  Residency;
+    UINT32                  Latency;
+    ACPI_GENERIC_ADDRESS    ResidencyCounter;
+    UINT64                  CounterFrequency;
+
+} ACPI_LPIT_NATIVE;
+
+
+/* 0x01: Simple I/O based LPI structure */
+
+typedef struct acpi_lpit_io
+{
+    ACPI_LPIT_HEADER        Header;
+    ACPI_GENERIC_ADDRESS    EntryTrigger;
+    UINT32                  TriggerAction;
+    UINT64                  TriggerValue;
+    UINT64                  TriggerMask;
+    ACPI_GENERIC_ADDRESS    MinimumIdleState;
+    UINT32                  Residency;
+    UINT32                  Latency;
+    ACPI_GENERIC_ADDRESS    ResidencyCounter;
+    UINT64                  CounterFrequency;
+
+} ACPI_LPIT_IO;
+
+
+/*******************************************************************************
+ *
+ * MCFG - PCI Memory Mapped Configuration table and subtable
  *        Version 1
  *
  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
  *        Version 1
  *
  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
@@ -1130,7 +1221,7 @@ enum AcpiSlicType
 
 
 /*
 
 
 /*
- * SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
+ * SLIC Subtables, correspond to Type in ACPI_SLIC_HEADER
  */
 
 /* 0: Public Key Structure */
  */
 
 /* 0: Public Key Structure */
index efec7e8..4e3b77a 100644 (file)
@@ -352,35 +352,115 @@ typedef struct acpi_s3pt_suspend
 
 /*******************************************************************************
  *
 
 /*******************************************************************************
  *
- * GTDT - Generic Timer Description Table (ACPI 5.0)
- *        Version 1
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ *        Version 2
  *
  ******************************************************************************/
 
 typedef struct acpi_table_gtdt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
  *
  ******************************************************************************/
 
 typedef struct acpi_table_gtdt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT64                  Address;
-    UINT32                  Flags;
-    UINT32                  SecurePl1Interrupt;
-    UINT32                  SecurePl1Flags;
-    UINT32                  NonSecurePl1Interrupt;
-    UINT32                  NonSecurePl1Flags;
+    UINT64                  CounterBlockAddresss;
+    UINT32                  Reserved;
+    UINT32                  SecureEl1Interrupt;
+    UINT32                  SecureEl1Flags;
+    UINT32                  NonSecureEl1Interrupt;
+    UINT32                  NonSecureEl1Flags;
     UINT32                  VirtualTimerInterrupt;
     UINT32                  VirtualTimerFlags;
     UINT32                  VirtualTimerInterrupt;
     UINT32                  VirtualTimerFlags;
-    UINT32                  NonSecurePl2Interrupt;
-    UINT32                  NonSecurePl2Flags;
+    UINT32                  NonSecureEl2Interrupt;
+    UINT32                  NonSecureEl2Flags;
+    UINT64                  CounterReadBlockAddress;
+    UINT32                  PlatformTimerCount;
+    UINT32                  PlatformTimerOffset;
 
 } ACPI_TABLE_GTDT;
 
 
 } ACPI_TABLE_GTDT;
 
-/* Values for Flags field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
+
+#define ACPI_GTDT_INTERRUPT_MODE        (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
+#define ACPI_GTDT_ALWAYS_ON             (1<<2)
+
+
+/* Common GTDT subtable header */
+
+typedef struct acpi_gtdt_header
+{
+    UINT8                   Type;
+    UINT16                  Length;
+
+} ACPI_GTDT_HEADER;
+
+/* Values for GTDT subtable type above */
 
 
-#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
+enum AcpiGtdtType
+{
+    ACPI_GTDT_TYPE_TIMER_BLOCK      = 0,
+    ACPI_GTDT_TYPE_WATCHDOG         = 1,
+    ACPI_GTDT_TYPE_RESERVED         = 2    /* 2 and greater are reserved */
+};
+
+
+/* GTDT Subtables, correspond to Type in acpi_gtdt_header */
+
+/* 0: Generic Timer Block */
+
+typedef struct acpi_gtdt_timer_block
+{
+    ACPI_GTDT_HEADER        Header;
+    UINT8                   Reserved;
+    UINT64                  BlockAddress;
+    UINT32                  TimerCount;
+    UINT32                  TimerOffset;
+
+} ACPI_GTDT_TIMER_BLOCK;
+
+/* Timer Sub-Structure, one per timer */
+
+typedef struct acpi_gtdt_timer_entry
+{
+    UINT8                   FrameNumber;
+    UINT8                   Reserved[3];
+    UINT64                  BaseAddress;
+    UINT64                  El0BaseAddress;
+    UINT32                  TimerInterrupt;
+    UINT32                  TimerFlags;
+    UINT32                  VirtualTimerInterrupt;
+    UINT32                  VirtualTimerFlags;
+    UINT32                  CommonFlags;
 
 
-/* Values for all "TimerFlags" fields above */
+} ACPI_GTDT_TIMER_ENTRY;
 
 
-#define ACPI_GTDT_INTERRUPT_MODE            1
-#define ACPI_GTDT_INTERRUPT_POLARITY        2
+/* Flag Definitions: TimerFlags and VirtualTimerFlags above */
+
+#define ACPI_GTDT_GT_IRQ_MODE               (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
+
+/* Flag Definitions: CommonFlags above */
+
+#define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
+#define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
+
+
+/* 1: SBSA Generic Watchdog Structure */
+
+typedef struct acpi_gtdt_watchdog
+{
+    ACPI_GTDT_HEADER        Header;
+    UINT8                   Reserved;
+    UINT64                  RefreshFrameAddress;
+    UINT64                  ControlFrameAddress;
+    UINT32                  TimerInterrupt;
+    UINT32                  TimerFlags;
+
+} ACPI_GTDT_WATCHDOG;
+
+/* Flag Definitions: TimerFlags above */
+
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
 
 
 /*******************************************************************************
 
 
 /*******************************************************************************
@@ -525,7 +605,8 @@ typedef struct acpi_table_pcct
 enum AcpiPcctType
 {
     ACPI_PCCT_TYPE_GENERIC_SUBSPACE     = 0,
 enum AcpiPcctType
 {
     ACPI_PCCT_TYPE_GENERIC_SUBSPACE     = 0,
-    ACPI_PCCT_TYPE_RESERVED             = 1     /* 1 and greater are reserved */
+    ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE  = 1,
+    ACPI_PCCT_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
 };
 
 /*
 };
 
 /*
@@ -550,6 +631,31 @@ typedef struct acpi_pcct_subspace
 } ACPI_PCCT_SUBSPACE;
 
 
 } ACPI_PCCT_SUBSPACE;
 
 
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
+
+typedef struct acpi_pcct_hw_reduced
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  DoorbellInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved;
+    UINT64                  BaseAddress;
+    UINT64                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT16                  MinTurnaroundTime;
+
+} ACPI_PCCT_HW_REDUCED;
+
+/* Values for doorbell flags above */
+
+#define ACPI_PCCT_INTERRUPT_POLARITY    (1)
+#define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
+
+
 /*
  * PCC memory structures (not part of the ACPI table)
  */
 /*
  * PCC memory structures (not part of the ACPI table)
  */
index 847a20d..3b15441 100644 (file)
 #error ACPI_MACHINE_WIDTH not defined
 #endif
 
 #error ACPI_MACHINE_WIDTH not defined
 #endif
 
-/*! [Begin] no source code translation */
-
 /*
  * Data type ranges
  * Note: These macros are designed to be compiler independent as well as
 /*
  * Data type ranges
  * Note: These macros are designed to be compiler independent as well as
  *
  ******************************************************************************/
 
  *
  ******************************************************************************/
 
-#ifndef __REACTOS__
+#ifndef ACPI_USE_SYSTEM_INTTYPES
+
 typedef unsigned char                   BOOLEAN;
 typedef unsigned char                   UINT8;
 typedef unsigned short                  UINT16;
 typedef unsigned char                   BOOLEAN;
 typedef unsigned char                   UINT8;
 typedef unsigned short                  UINT16;
+typedef short                           INT16;
 typedef COMPILER_DEPENDENT_UINT64       UINT64;
 typedef COMPILER_DEPENDENT_INT64        INT64;
 typedef COMPILER_DEPENDENT_UINT64       UINT64;
 typedef COMPILER_DEPENDENT_INT64        INT64;
-#endif /* __REACTOS__ */
 
 
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
 
 /*
  * Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
 
 /*
  * Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
@@ -225,14 +224,13 @@ typedef COMPILER_DEPENDENT_INT64        INT64;
 
 #if ACPI_MACHINE_WIDTH == 64
 
 
 #if ACPI_MACHINE_WIDTH == 64
 
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
 
 
-#ifndef __REACTOS__
 typedef unsigned int                    UINT32;
 typedef int                             INT32;
 typedef unsigned int                    UINT32;
 typedef int                             INT32;
-#endif /* __REACTOS__ */
 
 
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
+
 
 
 typedef INT64                           ACPI_NATIVE_INT;
 
 
 typedef INT64                           ACPI_NATIVE_INT;
@@ -266,14 +264,13 @@ typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
 
 #elif ACPI_MACHINE_WIDTH == 32
 
 
 #elif ACPI_MACHINE_WIDTH == 32
 
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
 
 
-#ifndef __REACTOS__
 typedef unsigned int                    UINT32;
 typedef int                             INT32;
 typedef unsigned int                    UINT32;
 typedef int                             INT32;
-#endif /* __REACTOS__ */
 
 
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
+
 
 
 typedef INT32                           ACPI_NATIVE_INT;
 
 
 typedef INT32                           ACPI_NATIVE_INT;
@@ -412,6 +409,15 @@ typedef UINT32                          ACPI_PHYSICAL_ADDRESS;
  *
  ******************************************************************************/
 
  *
  ******************************************************************************/
 
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE(a)                NULL
+#define ACPI_ALLOCATE_ZEROED(a)         NULL
+#define ACPI_FREE(a)
+#define ACPI_MEM_TRACKING(a)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 /*
  * Memory allocation tracking (used by AcpiExec to detect memory leaks)
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 /*
  * Memory allocation tracking (used by AcpiExec to detect memory leaks)
@@ -433,6 +439,8 @@ typedef UINT32                          ACPI_PHYSICAL_ADDRESS;
 
 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
 
 
 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
 
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
+
 
 /******************************************************************************
  *
 
 /******************************************************************************
  *
@@ -590,7 +598,7 @@ typedef UINT64                          ACPI_INTEGER;
 
 #define ACPI_TO_POINTER(i)              ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i)
 #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) NULL)
 
 #define ACPI_TO_POINTER(i)              ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i)
 #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) NULL)
-#define ACPI_OFFSET(d, f)               (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
+#define ACPI_OFFSET(d, f)               ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
 #define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
 #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
 
 #define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
 #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
 
@@ -684,8 +692,9 @@ typedef UINT64                          ACPI_INTEGER;
 #define ACPI_NOTIFY_RESERVED            (UINT8) 0x0A
 #define ACPI_NOTIFY_LOCALITY_UPDATE     (UINT8) 0x0B
 #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (UINT8) 0x0C
 #define ACPI_NOTIFY_RESERVED            (UINT8) 0x0A
 #define ACPI_NOTIFY_LOCALITY_UPDATE     (UINT8) 0x0B
 #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (UINT8) 0x0C
+#define ACPI_NOTIFY_AFFINITY_UPDATE     (UINT8) 0x0D
 
 
-#define ACPI_NOTIFY_MAX                 0x0C
+#define ACPI_NOTIFY_MAX                 0x0D
 
 /*
  * Types associated with ACPI names and objects. The first group of
 
 /*
  * Types associated with ACPI names and objects. The first group of
@@ -785,14 +794,15 @@ typedef UINT32                          ACPI_EVENT_TYPE;
  * The encoding of ACPI_EVENT_STATUS is illustrated below.
  * Note that a set bit (1) indicates the property is TRUE
  * (e.g. if bit 0 is set then the event is enabled).
  * The encoding of ACPI_EVENT_STATUS is illustrated below.
  * Note that a set bit (1) indicates the property is TRUE
  * (e.g. if bit 0 is set then the event is enabled).
- * +-------------+-+-+-+
- * |   Bits 31:3 |2|1|0|
- * +-------------+-+-+-+
- *          |     | | |
- *          |     | | +- Enabled?
- *          |     | +--- Enabled for wake?
- *          |     +----- Set?
- *          +----------- <Reserved>
+ * +-------------+-+-+-+-+
+ * |   Bits 31:4 |3|2|1|0|
+ * +-------------+-+-+-+-+
+ *          |     | | | |
+ *          |     | | | +- Enabled?
+ *          |     | | +--- Enabled for wake?
+ *          |     | +----- Set?
+ *          |     +------- Has a handler?
+ *          +------------- <Reserved>
  */
 typedef UINT32                          ACPI_EVENT_STATUS;
 
  */
 typedef UINT32                          ACPI_EVENT_STATUS;
 
@@ -800,6 +810,7 @@ typedef UINT32                          ACPI_EVENT_STATUS;
 #define ACPI_EVENT_FLAG_ENABLED         (ACPI_EVENT_STATUS) 0x01
 #define ACPI_EVENT_FLAG_WAKE_ENABLED    (ACPI_EVENT_STATUS) 0x02
 #define ACPI_EVENT_FLAG_SET             (ACPI_EVENT_STATUS) 0x04
 #define ACPI_EVENT_FLAG_ENABLED         (ACPI_EVENT_STATUS) 0x01
 #define ACPI_EVENT_FLAG_WAKE_ENABLED    (ACPI_EVENT_STATUS) 0x02
 #define ACPI_EVENT_FLAG_SET             (ACPI_EVENT_STATUS) 0x04
+#define ACPI_EVENT_FLAG_HAS_HANDLER     (ACPI_EVENT_STATUS) 0x08
 
 /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
 
 
 /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
 
@@ -1032,9 +1043,19 @@ typedef struct acpi_object_list
  * Miscellaneous common Data Structures used by the interfaces
  */
 #define ACPI_NO_BUFFER              0
  * Miscellaneous common Data Structures used by the interfaces
  */
 #define ACPI_NO_BUFFER              0
+
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (0)
+#define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (0)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
 #define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (-1)    /* Let ACPICA allocate buffer */
 #define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (-2)    /* For internal use only (enables tracking) */
 
 #define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (-1)    /* Let ACPICA allocate buffer */
 #define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (-2)    /* For internal use only (enables tracking) */
 
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
+
 typedef struct acpi_buffer
 {
     ACPI_SIZE                       Length;         /* Length in bytes of the buffer */
 typedef struct acpi_buffer
 {
     ACPI_SIZE                       Length;         /* Length in bytes of the buffer */
@@ -1393,4 +1414,19 @@ typedef struct acpi_memory_list
 #define ACPI_OSI_WIN_8                  0x0C
 
 
 #define ACPI_OSI_WIN_8                  0x0C
 
 
+/* Definitions of file IO */
+
+#define ACPI_FILE_READING               0x01
+#define ACPI_FILE_WRITING               0x02
+#define ACPI_FILE_BINARY                0x04
+
+#define ACPI_FILE_BEGIN                 0x01
+#define ACPI_FILE_END                   0x02
+
+
+/* Definitions of getopt */
+
+#define ACPI_OPT_END                    -1
+
+
 #endif /* __ACTYPES_H__ */
 #endif /* __ACTYPES_H__ */
index b1c512b..2aea248 100644 (file)
@@ -168,7 +168,6 @@ extern const char                       *AcpiGbl_PtDecode[];
 #ifdef ACPI_ASL_COMPILER
 
 #include <stdio.h>
 #ifdef ACPI_ASL_COMPILER
 
 #include <stdio.h>
-extern FILE                 *AcpiGbl_OutputFile;
 
 #define ACPI_MSG_REDIRECT_BEGIN \
     FILE                    *OutputFile = AcpiGbl_OutputFile; \
 
 #define ACPI_MSG_REDIRECT_BEGIN \
     FILE                    *OutputFile = AcpiGbl_OutputFile; \
@@ -298,6 +297,10 @@ AcpiUtHexToAsciiChar (
     UINT64                  Integer,
     UINT32                  Position);
 
     UINT64                  Integer,
     UINT32                  Position);
 
+UINT8
+AcpiUtAsciiCharToHex (
+    int                     HexChar);
+
 BOOLEAN
 AcpiUtValidObjectType (
     ACPI_OBJECT_TYPE        Type);
 BOOLEAN
 AcpiUtValidObjectType (
     ACPI_OBJECT_TYPE        Type);
@@ -324,6 +327,11 @@ ACPI_SIZE
 AcpiUtStrlen (
     const char              *String);
 
 AcpiUtStrlen (
     const char              *String);
 
+char *
+AcpiUtStrchr (
+    const char              *String,
+    int                     ch);
+
 char *
 AcpiUtStrcpy (
     char                    *DstString,
 char *
 AcpiUtStrcpy (
     char                    *DstString,
@@ -412,7 +420,7 @@ extern const UINT8 _acpi_ctype[];
 #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
 #define ACPI_IS_UPPER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
 #define ACPI_IS_LOWER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
 #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
 #define ACPI_IS_UPPER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
 #define ACPI_IS_LOWER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
-#define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
+#define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
 #define ACPI_IS_ALPHA(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
 
 #endif /* !ACPI_USE_SYSTEM_CLIBRARY */
 #define ACPI_IS_ALPHA(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
 
 #endif /* !ACPI_USE_SYSTEM_CLIBRARY */
@@ -554,6 +562,16 @@ AcpiUtDumpBuffer (
     UINT32                  Display,
     UINT32                  Offset);
 
     UINT32                  Display,
     UINT32                  Offset);
 
+#ifdef ACPI_APPLICATION
+void
+AcpiUtDumpBufferToFile (
+    ACPI_FILE               File,
+    UINT8                   *Buffer,
+    UINT32                  Count,
+    UINT32                  Display,
+    UINT32                  BaseOffset);
+#endif
+
 void
 AcpiUtReportError (
     char                    *ModuleName,
 void
 AcpiUtReportError (
     char                    *ModuleName,
@@ -622,6 +640,17 @@ AcpiUtExecutePowerMethods (
     UINT8                   *OutValues);
 
 
     UINT8                   *OutValues);
 
 
+/*
+ * utfileio - file operations
+ */
+#ifdef ACPI_APPLICATION
+ACPI_STATUS
+AcpiUtReadTableFromFile (
+    char                    *Filename,
+    ACPI_TABLE_HEADER       **Table);
+#endif
+
+
 /*
  * utids - device ID support
  */
 /*
  * utids - device ID support
  */
@@ -1182,4 +1211,57 @@ const AH_DEVICE_ID *
 AcpiAhMatchHardwareId (
     char                    *Hid);
 
 AcpiAhMatchHardwareId (
     char                    *Hid);
 
+const char *
+AcpiAhMatchUuid (
+    UINT8                   *Data);
+
+/*
+ * utprint - printf/vprintf output functions
+ */
+const char *
+AcpiUtScanNumber (
+    const char              *String,
+    UINT64                  *NumberPtr);
+
+const char *
+AcpiUtPrintNumber (
+    char                    *String,
+    UINT64                  Number);
+
+int
+AcpiUtVsnprintf (
+    char                    *String,
+    ACPI_SIZE               Size,
+    const char              *Format,
+    va_list                 Args);
+
+int
+AcpiUtSnprintf (
+    char                    *String,
+    ACPI_SIZE               Size,
+    const char              *Format,
+    ...);
+
+#ifdef ACPI_APPLICATION
+int
+AcpiUtFileVprintf (
+    ACPI_FILE               File,
+    const char              *Format,
+    va_list                 Args);
+
+int
+AcpiUtFilePrintf (
+    ACPI_FILE               File,
+    const char              *Format,
+    ...);
+#endif
+
+/*
+ * utuuid -- UUID support functions
+ */
+void
+AcpiUtConvertStringToUuid (
+    char                    *InString,
+    UINT8                   *UuidBuffer);
+
 #endif /* _ACUTILS_H */
 #endif /* _ACUTILS_H */
index 3fcd9ed..e54f567 100644 (file)
@@ -194,6 +194,14 @@ typedef struct asl_resource_node
 
 } ASL_RESOURCE_NODE;
 
 
 } ASL_RESOURCE_NODE;
 
+typedef struct asl_resource_info
+{
+    ACPI_PARSE_OBJECT               *DescriptorTypeOp;  /* Resource descriptor parse node */
+    ACPI_PARSE_OBJECT               *MappingOp;         /* Used for mapfile support */
+    UINT32                          CurrentByteOffset;  /* Offset in resource template */
+
+} ASL_RESOURCE_INFO;
+
 
 /* Macros used to generate AML resource length fields */
 
 
 /* Macros used to generate AML resource length fields */
 
@@ -646,4 +654,50 @@ typedef union aml_resource
 
 } AML_RESOURCE;
 
 
 } AML_RESOURCE;
 
+
+/* Interfaces used by both the disassembler and compiler */
+
+void
+MpSaveGpioInfo (
+    ACPI_PARSE_OBJECT       *Op,
+    AML_RESOURCE            *Resource,
+    UINT32                  PinCount,
+    UINT16                  *PinList,
+    char                    *DeviceName);
+
+void
+MpSaveSerialInfo (
+    ACPI_PARSE_OBJECT       *Op,
+    AML_RESOURCE            *Resource,
+    char                    *DeviceName);
+
+char *
+MpGetHidFromParseTree (
+    ACPI_NAMESPACE_NODE     *HidNode);
+
+char *
+MpGetHidViaNamestring (
+    char                    *DeviceName);
+
+char *
+MpGetConnectionInfo (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  PinIndex,
+    ACPI_NAMESPACE_NODE     **TargetNode,
+    char                    **TargetName);
+
+char *
+MpGetParentDeviceHid (
+    ACPI_PARSE_OBJECT       *Op,
+    ACPI_NAMESPACE_NODE     **TargetNode,
+    char                    **ParentDeviceName);
+
+char *
+MpGetDdnValue (
+    char                    *DeviceName);
+
+char *
+MpGetHidValue (
+    ACPI_NAMESPACE_NODE     *DeviceNode);
+
 #endif
 #endif
index 41e80fe..4065d32 100644 (file)
 
 
 /*
 
 
 /*
- * The vsnprintf function is defined by c99, but cygwin/gcc does not
- * enable this prototype when the -ansi flag is set. Also related to
- * __STRICT_ANSI__. So, we just declare the prototype here.
+ * The vsnprintf/snprintf functions are defined by c99, but cygwin/gcc
+ * does not enable this prototype when the -ansi flag is set. Also related
+ * to __STRICT_ANSI__. So, we just declare the prototype here.
  */
 int
 vsnprintf (char *s, size_t n, const char *format, va_list ap);
 
  */
 int
 vsnprintf (char *s, size_t n, const char *format, va_list ap);
 
+int
+snprintf (char *s, size_t n, const char *format, ...);
+
 #endif /* __ACCYGWIN_H__ */
 #endif /* __ACCYGWIN_H__ */
index ef46761..9266e96 100644 (file)
 #ifndef __ACEFI_H__
 #define __ACEFI_H__
 
 #ifndef __ACEFI_H__
 #define __ACEFI_H__
 
+#include <stdarg.h>
+#if defined(_GNU_EFI)
+#include <stdint.h>
+#include <unistd.h>
+#endif
 #include <efi.h>
 #include <efistdarg.h>
 #include <efilib.h>
 
 
 #include <efi.h>
 #include <efistdarg.h>
 #include <efilib.h>
 
 
+/* AED EFI definitions */
+
+#if defined(_AED_EFI)
+
 /* _int64 works for both IA32 and IA64 */
 
 #define COMPILER_DEPENDENT_INT64   __int64
 /* _int64 works for both IA32 and IA64 */
 
 #define COMPILER_DEPENDENT_INT64   __int64
 
 #pragma warning(disable:4142)
 
 
 #pragma warning(disable:4142)
 
+#endif
+
+
+/* GNU EFI definitions */
+
+#if defined(_GNU_EFI)
+
+/* Using GCC for GNU EFI */
+
+#include "acgcc.h"
+
+#undef ACPI_USE_SYSTEM_CLIBRARY
+#undef ACPI_USE_STANDARD_HEADERS
+#undef ACPI_USE_NATIVE_DIVIDE
+#define ACPI_USE_SYSTEM_INTTYPES
+
+#define ACPI_FILE           SIMPLE_TEXT_OUTPUT_INTERFACE *
+#define ACPI_FILE_OUT       ST->ConOut
+#define ACPI_FILE_ERR       ST->ConOut
+
+/*
+ * Math helpers
+ */
+#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
+    do {                                             \
+        UINT64 __n = ((UINT64) n_hi) << 32 | (n_lo); \
+        (q32) = DivU64x32 ((__n), (d32), &(r32));    \
+    } while (0)
+
+#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
+    do {                                \
+        (n_lo) >>= 1;                   \
+        (n_lo) |= (((n_hi) & 1) << 31); \
+        (n_hi) >>= 1;                   \
+    } while (0)
+
+/*
+ * EFI specific prototypes
+ */
+EFI_STATUS
+efi_main (
+    EFI_HANDLE              Image,
+    EFI_SYSTEM_TABLE        *SystemTab);
+
+int
+acpi_main (
+    int                     argc,
+    char                    *argv[]);
+
+
+#endif
+
 
 #endif /* __ACEFI_H__ */
 
 #endif /* __ACEFI_H__ */
index d910945..ed65b28 100644 (file)
 #define ACPI_DBG_TRACK_ALLOCATIONS
 #endif
 
 #define ACPI_DBG_TRACK_ALLOCATIONS
 #endif
 
-/* AcpiNames configuration. Single threaded with debugger output enabled. */
-
-#ifdef ACPI_NAMES_APP
-#define ACPI_DEBUGGER
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
-#endif
-
 /*
 /*
- * AcpiBin/AcpiDump/AcpiSrc/AcpiXtract/Example configuration. All single
- * threaded, with no debug output.
+ * AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example configuration.
+ * All single threaded.
  */
 #if (defined ACPI_BIN_APP)      || \
     (defined ACPI_DUMP_APP)     || \
  */
 #if (defined ACPI_BIN_APP)      || \
     (defined ACPI_DUMP_APP)     || \
+    (defined ACPI_HELP_APP)     || \
+    (defined ACPI_NAMES_APP)    || \
     (defined ACPI_SRC_APP)      || \
     (defined ACPI_XTRACT_APP)   || \
     (defined ACPI_EXAMPLE_APP)
     (defined ACPI_SRC_APP)      || \
     (defined ACPI_XTRACT_APP)   || \
     (defined ACPI_EXAMPLE_APP)
 #define ACPI_SINGLE_THREADED
 #endif
 
 #define ACPI_SINGLE_THREADED
 #endif
 
+/* AcpiHelp configuration. Error messages disabled. */
+
 #ifdef ACPI_HELP_APP
 #ifdef ACPI_HELP_APP
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
 #define ACPI_NO_ERROR_MESSAGES
 #endif
 
 #define ACPI_NO_ERROR_MESSAGES
 #endif
 
+/* AcpiNames configuration. Debug output enabled. */
+
+#ifdef ACPI_NAMES_APP
+#define ACPI_DEBUG_OUTPUT
+#endif
+
+/* AcpiExec/AcpiNames/Example configuration. Native RSDP used. */
+
+#if (defined ACPI_EXEC_APP)     || \
+    (defined ACPI_EXAMPLE_APP)  || \
+    (defined ACPI_NAMES_APP)
+#define ACPI_USE_NATIVE_RSDP_POINTER
+#endif
+
+/* AcpiDump configuration. Native mapping used if provied by OSPMs */
+
+#ifdef ACPI_DUMP_APP
+#define ACPI_USE_NATIVE_MEMORY_MAPPING
+#define USE_NATIVE_ALLOCATE_ZEROED
+#endif
+
+/* AcpiNames/Example configuration. Hardware disabled */
+
+#if (defined ACPI_EXAMPLE_APP)  || \
+    (defined ACPI_NAMES_APP)
+#define ACPI_REDUCED_HARDWARE 1
+#endif
+
 /* Linkable ACPICA library */
 
 #ifdef ACPI_LIBRARY
 /* Linkable ACPICA library */
 
 #ifdef ACPI_LIBRARY
 #elif defined(_AED_EFI)
 #include "acefi.h"
 
 #elif defined(_AED_EFI)
 #include "acefi.h"
 
+#elif defined(_GNU_EFI)
+#include "acefi.h"
+
 #elif defined(__HAIKU__)
 #include "achaiku.h"
 
 #elif defined(__HAIKU__)
 #include "achaiku.h"
 
@@ -477,8 +502,12 @@ typedef char *va_list;
 #ifdef ACPI_APPLICATION
 #include <stdio.h>
 #define ACPI_FILE              FILE *
 #ifdef ACPI_APPLICATION
 #include <stdio.h>
 #define ACPI_FILE              FILE *
+#define ACPI_FILE_OUT          stdout
+#define ACPI_FILE_ERR          stderr
 #else
 #define ACPI_FILE              void *
 #else
 #define ACPI_FILE              void *
+#define ACPI_FILE_OUT          NULL
+#define ACPI_FILE_ERR          NULL
 #endif /* ACPI_APPLICATION */
 #endif /* ACPI_FILE */
 
 #endif /* ACPI_APPLICATION */
 #endif /* ACPI_FILE */
 
diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acenvex.h b/reactos/drivers/bus/acpi/acpica/include/platform/acenvex.h
new file mode 100644 (file)
index 0000000..2c50162
--- /dev/null
@@ -0,0 +1,135 @@
+/******************************************************************************
+ *
+ * Name: acenvex.h - Extra host and compiler configuration
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#ifndef __ACENVEX_H__
+#define __ACENVEX_H__
+
+/*! [Begin] no source code translation */
+
+/******************************************************************************
+ *
+ * Extra host configuration files. All ACPICA headers are included before
+ * including these files.
+ *
+ *****************************************************************************/
+
+#if defined(_LINUX) || defined(__linux__)
+#include "aclinuxex.h"
+
+#endif
+
+/*! [End] no source code translation !*/
+
+#endif /* __ACENVEX_H__ */
index 859b336..5a90c71 100644 (file)
@@ -132,7 +132,8 @@ struct mutex;
 
 #define ACPI_USE_NATIVE_DIVIDE
 
 
 #define ACPI_USE_NATIVE_DIVIDE
 
-// #define ACPI_THREAD_ID               thread_id
+/* #define ACPI_THREAD_ID               thread_id */
+
 #define ACPI_SEMAPHORE              sem_id
 #define ACPI_SPINLOCK               spinlock *
 #define ACPI_CPU_FLAGS              cpu_status
 #define ACPI_SEMAPHORE              sem_id
 #define ACPI_SPINLOCK               spinlock *
 #define ACPI_CPU_FLAGS              cpu_status
index c7ca287..e7df0b7 100644 (file)
 #ifndef __ACLINUX_H__
 #define __ACLINUX_H__
 
 #ifndef __ACLINUX_H__
 #define __ACLINUX_H__
 
+#ifdef __KERNEL__
+
+/* ACPICA external files should not include ACPICA headers directly. */
+
+#if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H)
+#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
+#endif
+
+#endif
+
 /* Common (in-kernel/user-space) ACPICA configuration */
 
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_DO_WHILE_0
 /* Common (in-kernel/user-space) ACPICA configuration */
 
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_DO_WHILE_0
-#define ACPI_MUTEX_TYPE             ACPI_BINARY_SEMAPHORE
 
 
 #ifdef __KERNEL__
 
 
 
 #ifdef __KERNEL__
 
+#define ACPI_USE_SYSTEM_INTTYPES
+
+/* Compile for reduced hardware mode only with this kernel config */
+
+#ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY
+#define ACPI_REDUCED_HARDWARE 1
+#endif
+
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/ctype.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/ctype.h>
 #ifdef EXPORT_ACPI_INTERFACES
 #include <linux/export.h>
 #endif
 #ifdef EXPORT_ACPI_INTERFACES
 #include <linux/export.h>
 #endif
-#include <asm/acpi.h>
+#ifdef CONFIG_ACPI
+#include <asm/acenv.h>
+#endif
+
+#ifndef CONFIG_ACPI
+
+/* External globals for __KERNEL__, stubs is needed */
+
+#define ACPI_GLOBAL(t,a)
+#define ACPI_INIT_GLOBAL(t,a,b)
+
+/* Generating stubs for configurable ACPICA macros */
+
+#define ACPI_NO_MEM_ALLOCATIONS
+
+/* Generating stubs for configurable ACPICA functions */
+
+#define ACPI_NO_ERROR_MESSAGES
+#undef ACPI_DEBUG_OUTPUT
+
+/* External interface for __KERNEL__, stub is needed */
+
+#define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
+    static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
+#define ACPI_EXTERNAL_RETURN_OK(Prototype) \
+    static ACPI_INLINE Prototype {return(AE_OK);}
+#define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
+    static ACPI_INLINE Prototype {return;}
+#define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
+    static ACPI_INLINE Prototype {return(0);}
+#define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
+    static ACPI_INLINE Prototype {return(NULL);}
+
+#endif /* CONFIG_ACPI */
 
 /* Host-dependent types and defines for in-kernel ACPICA */
 
 
 /* Host-dependent types and defines for in-kernel ACPICA */
 
 #define ACPI_SPINLOCK               spinlock_t *
 #define ACPI_CPU_FLAGS              unsigned long
 
 #define ACPI_SPINLOCK               spinlock_t *
 #define ACPI_CPU_FLAGS              unsigned long
 
+/* Use native linux version of AcpiOsAllocateZeroed */
+
+#define USE_NATIVE_ALLOCATE_ZEROED
+
+/*
+ * Overrides for in-kernel ACPICA
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
+
+/*
+ * OSL interfaces used by debugger/disassembler
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
+
+/*
+ * OSL interfaces used by utilities
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
+
 #else /* !__KERNEL__ */
 
 #include <stdarg.h>
 #else /* !__KERNEL__ */
 
 #include <stdarg.h>
 #define __init
 #endif
 
 #define __init
 #endif
 
-#ifndef __iomem
-#define __iomem
-#endif
-
 /* Host-dependent types and defines for user-space ACPICA */
 
 #define ACPI_FLUSH_CPU_CACHE()
 /* Host-dependent types and defines for user-space ACPICA */
 
 #define ACPI_FLUSH_CPU_CACHE()
 
 #include "acgcc.h"
 
 
 #include "acgcc.h"
 
-
-#ifdef __KERNEL__
-
-/*
- * FIXME: Inclusion of actypes.h
- * Linux kernel need this before defining inline OSL interfaces as
- * actypes.h need to be included to find ACPICA type definitions.
- * Since from ACPICA's perspective, the actypes.h should be included after
- * acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue.
- */
-#include <acpi/actypes.h>
-
-/*
- * Overrides for in-kernel ACPICA
- */
-ACPI_STATUS __init AcpiOsInitialize (
-    void);
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
-
-ACPI_STATUS AcpiOsTerminate (
-    void);
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
-
-/*
- * Memory allocation/deallocation
- */
-
-/*
- * The irqs_disabled() check is for resume from RAM.
- * Interrupts are off during resume, just like they are for boot.
- * However, boot has  (system_state != SYSTEM_RUNNING)
- * to quiet __might_sleep() in kmalloc() and resume does not.
- */
-static inline void *
-AcpiOsAllocate (
-    ACPI_SIZE               Size)
-{
-    return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
-
-/* Use native linux version of AcpiOsAllocateZeroed */
-
-static inline void *
-AcpiOsAllocateZeroed (
-    ACPI_SIZE               Size)
-{
-    return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
-#define USE_NATIVE_ALLOCATE_ZEROED
-
-static inline void
-AcpiOsFree (
-    void                   *Memory)
-{
-    kfree (Memory);
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
-
-static inline void *
-AcpiOsAcquireObject (
-    ACPI_CACHE_T           *Cache)
-{
-    return kmem_cache_zalloc (Cache,
-        irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
-
-static inline ACPI_THREAD_ID
-AcpiOsGetThreadId (
-    void)
-{
-    return (ACPI_THREAD_ID) (unsigned long) current;
-}
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
-
-#ifndef CONFIG_PREEMPT
-
-/*
- * Used within ACPICA to show where it is safe to preempt execution
- * when CONFIG_PREEMPT=n
- */
-#define ACPI_PREEMPTION_POINT() \
-    do { \
-        if (!irqs_disabled()) \
-            cond_resched(); \
-    } while (0)
-
-#endif
-
-/*
- * When lockdep is enabled, the spin_lock_init() macro stringifies it's
- * argument and uses that as a name for the lock in debugging.
- * By executing spin_lock_init() in a macro the key changes from "lock" for
- * all locks to the name of the argument of acpi_os_create_lock(), which
- * prevents lockdep from reporting false positives for ACPICA locks.
- */
-#define AcpiOsCreateLock(__Handle) \
-    ({ \
-        spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \
-        if (Lock) { \
-            *(__Handle) = Lock; \
-            spin_lock_init(*(__Handle)); \
-        } \
-        Lock ? AE_OK : AE_NO_MEMORY; \
-    })
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
-
-void __iomem *
-AcpiOsMapMemory (
-    ACPI_PHYSICAL_ADDRESS   Where,
-    ACPI_SIZE               Length);
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
-
-void
-AcpiOsUnmapMemory (
-    void __iomem            *LogicalAddress,
-    ACPI_SIZE               Size);
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
-
-/*
- * OSL interfaces used by debugger/disassembler
- */
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
-
-/*
- * OSL interfaces used by utilities
- */
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
-
-/*
- * OSL interfaces added by Linux
- */
-void
-EarlyAcpiOsUnmapMemory (
-    void __iomem            *Virt,
-    ACPI_SIZE               Size);
-
-#endif /* __KERNEL__ */
-
 #endif /* __ACLINUX_H__ */
 #endif /* __ACLINUX_H__ */
diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/aclinuxex.h b/reactos/drivers/bus/acpi/acpica/include/platform/aclinuxex.h
new file mode 100644 (file)
index 0000000..d4111a1
--- /dev/null
@@ -0,0 +1,221 @@
+/******************************************************************************
+ *
+ * Name: aclinuxex.h - Extra OS specific defines, etc. for Linux
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#ifndef __ACLINUXEX_H__
+#define __ACLINUXEX_H__
+
+#ifdef __KERNEL__
+
+#ifndef ACPI_USE_NATIVE_DIVIDE
+
+#ifndef ACPI_DIV_64_BY_32
+#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
+    do { \
+        UINT64 (__n) = ((UINT64) n_hi) << 32 | (n_lo); \
+        (r32) = do_div ((__n), (d32)); \
+        (q32) = (UINT32) (__n); \
+    } while (0)
+#endif
+
+#ifndef ACPI_SHIFT_RIGHT_64
+#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
+    do { \
+        (n_lo) >>= 1; \
+        (n_lo) |= (((n_hi) & 1) << 31); \
+        (n_hi) >>= 1; \
+    } while (0)
+#endif
+
+#endif
+
+/*
+ * Overrides for in-kernel ACPICA
+ */
+ACPI_STATUS __init AcpiOsInitialize (
+    void);
+
+ACPI_STATUS AcpiOsTerminate (
+    void);
+
+/*
+ * The irqs_disabled() check is for resume from RAM.
+ * Interrupts are off during resume, just like they are for boot.
+ * However, boot has  (system_state != SYSTEM_RUNNING)
+ * to quiet __might_sleep() in kmalloc() and resume does not.
+ */
+static inline void *
+AcpiOsAllocate (
+    ACPI_SIZE               Size)
+{
+    return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
+}
+
+static inline void *
+AcpiOsAllocateZeroed (
+    ACPI_SIZE               Size)
+{
+    return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
+}
+
+static inline void
+AcpiOsFree (
+    void                   *Memory)
+{
+    kfree (Memory);
+}
+
+static inline void *
+AcpiOsAcquireObject (
+    ACPI_CACHE_T           *Cache)
+{
+    return kmem_cache_zalloc (Cache,
+        irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
+}
+
+static inline ACPI_THREAD_ID
+AcpiOsGetThreadId (
+    void)
+{
+    return (ACPI_THREAD_ID) (unsigned long) current;
+}
+
+/*
+ * When lockdep is enabled, the spin_lock_init() macro stringifies it's
+ * argument and uses that as a name for the lock in debugging.
+ * By executing spin_lock_init() in a macro the key changes from "lock" for
+ * all locks to the name of the argument of acpi_os_create_lock(), which
+ * prevents lockdep from reporting false positives for ACPICA locks.
+ */
+#define AcpiOsCreateLock(__Handle) \
+    ({ \
+        spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \
+        if (Lock) { \
+            *(__Handle) = Lock; \
+            spin_lock_init(*(__Handle)); \
+        } \
+        Lock ? AE_OK : AE_NO_MEMORY; \
+    })
+
+/*
+ * OSL interfaces added by Linux
+ */
+void
+EarlyAcpiOsUnmapMemory (
+    void __iomem            *Virt,
+    ACPI_SIZE               Size);
+
+#endif /* __KERNEL__ */
+
+#endif /* __ACLINUXEX_H__ */
index 3bbab80..2433a42 100644 (file)
 /* Debug support. Must be last in this file, do not move. */
 
 #ifdef _DEBUG
 /* Debug support. Must be last in this file, do not move. */
 
 #ifdef _DEBUG
+#define _CRTDBG_MAP_ALLOC /* Enables specific file/lineno for leaks */
+
+#include <stdlib.h>
+#include <malloc.h>
 #include <crtdbg.h>
 
 /*
 #include <crtdbg.h>
 
 /*
  * This can quickly localize the memory corruption.
  */
 #define ACPI_DEBUG_INITIALIZE() \
  * This can quickly localize the memory corruption.
  */
 #define ACPI_DEBUG_INITIALIZE() \
-    _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | \
-        _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_CRT_DF | \
-        _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
+    _CrtSetDbgFlag (\
+        _CRTDBG_CHECK_ALWAYS_DF | \
+        _CRTDBG_ALLOC_MEM_DF | \
+        _CRTDBG_DELAY_FREE_MEM_DF | \
+        _CRTDBG_LEAK_CHECK_DF | \
+        _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
+
+#if 0
+/*
+ * _CrtSetBreakAlloc can be used to set a breakpoint at a particular
+ * memory leak, add to the macro above.
+ */
+Detected memory leaks!
+Dumping objects ->
+..\..\source\os_specific\service_layers\oswinxf.c(701) : {937} normal block at 0x002E9190, 40 bytes long.
+ Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+_CrtSetBreakAlloc (937);
+#endif
+
 #endif
 
 #endif /* __ACMSVC_H__ */
 #endif
 
 #endif /* __ACMSVC_H__ */
index b884d4a..1be7c6d 100644 (file)
 #if !defined(_MSC_VER) && defined(__GNUC__)
 #include "acgcc.h"
 #endif
 #if !defined(_MSC_VER) && defined(__GNUC__)
 #include "acgcc.h"
 #endif
+
+#define ACPI_USE_SYSTEM_INTTYPES
 #endif /* __REACTOS __ */
 /*! [End] no source code translation !*/
 
 #endif /* __REACTOS __ */
 /*! [End] no source code translation !*/
 
index 4c8bd30..37f6913 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSACCESS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
index d1701b8..c4a08cd 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __NSALLOC_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 5bd6868..7226917 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSCONVERT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 4823046..5631cab 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSDUMP_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index ed1b8a9..8510eb2 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSDUMPDV_C__
-
 #include "acpi.h"
 
 
 #include "acpi.h"
 
 
index 227a103..2f32e5e 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSEVAL_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 2e35355..2c4db99 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __NSXFINIT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 7d68af7..e15e6a4 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSLOAD_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index f345d90..2dc5d7b 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSNAMES_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "amlcode.h"
index 7981e62..7a0d8ef 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __NSOBJECT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
@@ -335,6 +332,16 @@ AcpiNsDetachObject (
         {
             Node->Object = Node->Object->Common.NextObject;
         }
         {
             Node->Object = Node->Object->Common.NextObject;
         }
+
+        /*
+         * Detach the object from any data objects (which are still held by
+         * the namespace node)
+         */
+        if (ObjDesc->Common.NextObject &&
+           ((ObjDesc->Common.NextObject)->Common.Type == ACPI_TYPE_LOCAL_DATA))
+        {
+           ObjDesc->Common.NextObject = NULL;
+        }
     }
 
     /* Reset the node type to untyped */
     }
 
     /* Reset the node type to untyped */
index 847e61b..f880207 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSPARSE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 41dc5a7..b44d12b 100644 (file)
@@ -393,6 +393,46 @@ AcpiNsCheckPackage (
         Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
         break;
 
         Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
         break;
 
+    case ACPI_PTYPE2_UUID_PAIR:
+
+        /* The package must contain pairs of (UUID + type) */
+
+        if (Count & 1)
+        {
+            ExpectedCount = Count + 1;
+            goto PackageTooSmall;
+        }
+
+        while (Count > 0)
+        {
+            Status = AcpiNsCheckObjectType(Info, Elements,
+                        Package->RetInfo.ObjectType1, 0);
+            if (ACPI_FAILURE(Status))
+            {
+                return (Status);
+            }
+
+            /* Validate length of the UUID buffer */
+
+            if ((*Elements)->Buffer.Length != 16)
+            {
+                ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+                    Info->NodeFlags, "Invalid length for UUID Buffer"));
+                return (AE_AML_OPERAND_VALUE);
+            }
+
+            Status = AcpiNsCheckObjectType(Info, Elements + 1,
+                        Package->RetInfo.ObjectType2, 0);
+            if (ACPI_FAILURE(Status))
+            {
+                return (Status);
+            }
+
+            Elements += 2;
+            Count -= 2;
+         }
+         break;
+
     default:
 
         /* Should not get here if predefined info table is correct */
     default:
 
         /* Should not get here if predefined info table is correct */
index 11a43b1..cf3c411 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSREPAIR_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index ea7c0be..ffba457 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSREPAIR2_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 1632f2e..9169866 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSSEARCH_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index cf4214e..b237390 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSUTILS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index c6c5663..bcbed65 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __NSWALK_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 4864e61..5425a54 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __NSXFEVAL_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
index 475491c..f45a2bd 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __NSXFNAME_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
index 0f61a71..763e044 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __NSXFOBJ_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
index 5e2e434..ad86a1f 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __PSARGS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index ec7db25..cf52d5f 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 /*
  * Parse the AML and build an operation tree as most interpreters, (such as
  * Perl) do. Parsing is done by hand rather than with a YACC generated parser
 /*
  * Parse the AML and build an operation tree as most interpreters, (such as
  * Perl) do. Parsing is done by hand rather than with a YACC generated parser
index f4ecc33..705aa6c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 0af5e9a..40243a5 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acopcode.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acopcode.h"
index 5118ccd..198d9a3 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index b9038f1..afbcc62 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 /*
  * Parse the AML and build an operation tree as most interpreters,
  * like Perl, do. Parsing is done by hand rather than with a YACC
 /*
  * Parse the AML and build an operation tree as most interpreters,
  * like Perl, do. Parsing is done by hand rather than with a YACC
index 45a5768..3c0fb90 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 4a6403d..fc2477b 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __PSTREE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 12d74a9..bce4010 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 7226e48..1605428 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index 65758fc..8930af0 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __PSXFACE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acparser.h"
index d29307d..9c7f2aa 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSADDR_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index b2742ae..2b6a4f9 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSCALC_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index 7c23893..deaaba5 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSCREATE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
@@ -149,6 +147,10 @@ AcpiBufferToResource (
     void                    *Resource;
     void                    *CurrentResourcePtr;
 
     void                    *Resource;
     void                    *CurrentResourcePtr;
 
+
+    ACPI_FUNCTION_TRACE (AcpiBufferToResource);
+
+
     /*
      * Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag
      * is not required here.
     /*
      * Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag
      * is not required here.
@@ -164,7 +166,7 @@ AcpiBufferToResource (
     }
     if (ACPI_FAILURE (Status))
     {
     }
     if (ACPI_FAILURE (Status))
     {
-        return (Status);
+        return_ACPI_STATUS (Status);
     }
 
     /* Allocate a buffer for the converted resource */
     }
 
     /* Allocate a buffer for the converted resource */
@@ -173,7 +175,7 @@ AcpiBufferToResource (
     CurrentResourcePtr = Resource;
     if (!Resource)
     {
     CurrentResourcePtr = Resource;
     if (!Resource)
     {
-        return (AE_NO_MEMORY);
+        return_ACPI_STATUS (AE_NO_MEMORY);
     }
 
     /* Perform the AML-to-Resource conversion */
     }
 
     /* Perform the AML-to-Resource conversion */
@@ -193,9 +195,11 @@ AcpiBufferToResource (
         *ResourcePtr = Resource;
     }
 
         *ResourcePtr = Resource;
     }
 
-    return (Status);
+    return_ACPI_STATUS (Status);
 }
 
 }
 
+ACPI_EXPORT_SYMBOL (AcpiBufferToResource)
+
 
 /*******************************************************************************
  *
 
 /*******************************************************************************
  *
index ae295fa..34b4abf 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __RSDUMP_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index 2aef0e5..bb41c71 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __RSDUMPINFO_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index 05f02a8..da2cb5d 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSINFO_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index b0e6f1d..a641c0c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSIO_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index 1bd887b..33f400f 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSIRQ_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index 71e3164..ea2d1d5 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSLIST_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index 727d3ee..ae94a1f 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSMEMORY_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index a697602..8de7ca5 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSMISC_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index 2eee1a2..b71dcad 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __RSIRQ_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
index e9952f0..42ff2a3 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __RSUTILS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 2ae63b3..9e9af3a 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __RSXFACE_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
index 818637e..10924ab 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBDATA_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
@@ -424,7 +422,43 @@ AcpiTbInvalidateTable (
 
 /******************************************************************************
  *
 
 /******************************************************************************
  *
- * FUNCTION:    AcpiTbVerifyTable
+ * FUNCTION:    AcpiTbValidateTempTable
+ *
+ * PARAMETERS:  TableDesc           - Table descriptor
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: This function is called to validate the table, the returned
+ *              table descriptor is in "VALIDATED" state.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiTbValidateTempTable (
+    ACPI_TABLE_DESC         *TableDesc)
+{
+
+    if (!TableDesc->Pointer && !AcpiGbl_VerifyTableChecksum)
+    {
+        /*
+         * Only validates the header of the table.
+         * Note that Length contains the size of the mapping after invoking
+         * this work around, this value is required by
+         * AcpiTbReleaseTempTable().
+         * We can do this because in AcpiInitTableDescriptor(), the Length
+         * field of the installed descriptor is filled with the actual
+         * table length obtaining from the table header.
+         */
+        TableDesc->Length = sizeof (ACPI_TABLE_HEADER);
+    }
+
+    return (AcpiTbValidateTable (TableDesc));
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION:    AcpiTbVerifyTempTable
  *
  * PARAMETERS:  TableDesc           - Table descriptor
  *              Signature           - Table signature to verify
  *
  * PARAMETERS:  TableDesc           - Table descriptor
  *              Signature           - Table signature to verify
@@ -437,19 +471,19 @@ AcpiTbInvalidateTable (
  *****************************************************************************/
 
 ACPI_STATUS
  *****************************************************************************/
 
 ACPI_STATUS
-AcpiTbVerifyTable (
+AcpiTbVerifyTempTable (
     ACPI_TABLE_DESC         *TableDesc,
     char                    *Signature)
 {
     ACPI_STATUS             Status = AE_OK;
 
 
     ACPI_TABLE_DESC         *TableDesc,
     char                    *Signature)
 {
     ACPI_STATUS             Status = AE_OK;
 
 
-    ACPI_FUNCTION_TRACE (TbVerifyTable);
+    ACPI_FUNCTION_TRACE (TbVerifyTempTable);
 
 
     /* Validate the table */
 
 
 
     /* Validate the table */
 
-    Status = AcpiTbValidateTable (TableDesc);
+    Status = AcpiTbValidateTempTable (TableDesc);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (AE_NO_MEMORY);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (AE_NO_MEMORY);
@@ -469,16 +503,19 @@ AcpiTbVerifyTable (
 
     /* Verify the checksum */
 
 
     /* Verify the checksum */
 
-    Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
-    if (ACPI_FAILURE (Status))
+    if (AcpiGbl_VerifyTableChecksum)
     {
     {
-        ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
-            "%4.4s " ACPI_PRINTF_UINT
-            " Attempted table install failed",
-            AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
-                TableDesc->Signature.Ascii : "????",
-            ACPI_FORMAT_TO_UINT (TableDesc->Address)));
-        goto InvalidateAndExit;
+        Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
+        if (ACPI_FAILURE (Status))
+        {
+            ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
+                "%4.4s " ACPI_PRINTF_UINT
+                " Attempted table install failed",
+                AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
+                    TableDesc->Signature.Ascii : "????",
+                ACPI_FORMAT_TO_UINT (TableDesc->Address)));
+            goto InvalidateAndExit;
+        }
     }
 
     return_ACPI_STATUS (AE_OK);
     }
 
     return_ACPI_STATUS (AE_OK);
index 9809274..f3f27cd 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBFADT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
@@ -130,7 +128,8 @@ AcpiTbInitGenericAddress (
     UINT8                   SpaceId,
     UINT8                   ByteWidth,
     UINT64                  Address,
     UINT8                   SpaceId,
     UINT8                   ByteWidth,
     UINT64                  Address,
-    char                    *RegisterName);
+    char                    *RegisterName,
+    UINT8                   Flags);
 
 static void
 AcpiTbConvertFadt (
 
 static void
 AcpiTbConvertFadt (
@@ -156,13 +155,14 @@ typedef struct acpi_fadt_info
     UINT16                  Address32;
     UINT16                  Length;
     UINT8                   DefaultLength;
     UINT16                  Address32;
     UINT16                  Length;
     UINT8                   DefaultLength;
-    UINT8                   Type;
+    UINT8                   Flags;
 
 } ACPI_FADT_INFO;
 
 #define ACPI_FADT_OPTIONAL          0
 #define ACPI_FADT_REQUIRED          1
 #define ACPI_FADT_SEPARATE_LENGTH   2
 
 } ACPI_FADT_INFO;
 
 #define ACPI_FADT_OPTIONAL          0
 #define ACPI_FADT_REQUIRED          1
 #define ACPI_FADT_SEPARATE_LENGTH   2
+#define ACPI_FADT_GPE_REGISTER      4
 
 static ACPI_FADT_INFO     FadtInfoTable[] =
 {
 
 static ACPI_FADT_INFO     FadtInfoTable[] =
 {
@@ -213,14 +213,14 @@ static ACPI_FADT_INFO     FadtInfoTable[] =
         ACPI_FADT_OFFSET (Gpe0Block),
         ACPI_FADT_OFFSET (Gpe0BlockLength),
         0,
         ACPI_FADT_OFFSET (Gpe0Block),
         ACPI_FADT_OFFSET (Gpe0BlockLength),
         0,
-        ACPI_FADT_SEPARATE_LENGTH},
+        ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER},
 
     {"Gpe1Block",
         ACPI_FADT_OFFSET (XGpe1Block),
         ACPI_FADT_OFFSET (Gpe1Block),
         ACPI_FADT_OFFSET (Gpe1BlockLength),
         0,
 
     {"Gpe1Block",
         ACPI_FADT_OFFSET (XGpe1Block),
         ACPI_FADT_OFFSET (Gpe1Block),
         ACPI_FADT_OFFSET (Gpe1BlockLength),
         0,
-        ACPI_FADT_SEPARATE_LENGTH}
+        ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER}
 };
 
 #define ACPI_FADT_INFO_ENTRIES \
 };
 
 #define ACPI_FADT_INFO_ENTRIES \
@@ -284,21 +284,31 @@ AcpiTbInitGenericAddress (
     UINT8                   SpaceId,
     UINT8                   ByteWidth,
     UINT64                  Address,
     UINT8                   SpaceId,
     UINT8                   ByteWidth,
     UINT64                  Address,
-    char                    *RegisterName)
+    char                    *RegisterName,
+    UINT8                   Flags)
 {
     UINT8                   BitWidth;
 
 
 {
     UINT8                   BitWidth;
 
 
-    /* Bit width field in the GAS is only one byte long, 255 max */
-
+    /*
+     * Bit width field in the GAS is only one byte long, 255 max.
+     * Check for BitWidth overflow in GAS.
+     */
     BitWidth = (UINT8) (ByteWidth * 8);
     BitWidth = (UINT8) (ByteWidth * 8);
-
-    if (ByteWidth > 31) /* (31*8)=248 */
+    if (ByteWidth > 31)     /* (31*8)=248, (32*8)=256 */
     {
     {
-        ACPI_ERROR ((AE_INFO,
-            "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
-            "to convert to GAS struct - 255 bits max, truncating",
-            RegisterName, ByteWidth, (ByteWidth * 8)));
+        /*
+         * No error for GPE blocks, because we do not use the BitWidth
+         * for GPEs, the legacy length (ByteWidth) is used instead to
+         * allow for a large number of GPEs.
+         */
+        if (!(Flags & ACPI_FADT_GPE_REGISTER))
+        {
+            ACPI_ERROR ((AE_INFO,
+                "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
+                "to convert to GAS struct - 255 bits max, truncating",
+                RegisterName, ByteWidth, (ByteWidth * 8)));
+        }
 
         BitWidth = 255;
     }
 
         BitWidth = 255;
     }
@@ -564,6 +574,7 @@ AcpiTbConvertFadt (
     ACPI_GENERIC_ADDRESS    *Address64;
     UINT32                  Address32;
     UINT8                   Length;
     ACPI_GENERIC_ADDRESS    *Address64;
     UINT32                  Address32;
     UINT8                   Length;
+    UINT8                   Flags;
     UINT32                  i;
 
 
     UINT32                  i;
 
 
@@ -628,6 +639,7 @@ AcpiTbConvertFadt (
             &AcpiGbl_FADT, FadtInfoTable[i].Length);
 
         Name = FadtInfoTable[i].Name;
             &AcpiGbl_FADT, FadtInfoTable[i].Length);
 
         Name = FadtInfoTable[i].Name;
+        Flags = FadtInfoTable[i].Flags;
 
         /*
          * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
 
         /*
          * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
@@ -664,7 +676,7 @@ AcpiTbConvertFadt (
                     ACPI_ADR_SPACE_SYSTEM_IO,
                     *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
                         FadtInfoTable[i].Length),
                     ACPI_ADR_SPACE_SYSTEM_IO,
                     *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
                         FadtInfoTable[i].Length),
-                    (UINT64) Address32, Name);
+                    (UINT64) Address32, Name, Flags);
             }
             else if (Address64->Address != (UINT64) Address32)
             {
             }
             else if (Address64->Address != (UINT64) Address32)
             {
@@ -685,7 +697,7 @@ AcpiTbConvertFadt (
                         ACPI_ADR_SPACE_SYSTEM_IO,
                         *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
                             FadtInfoTable[i].Length),
                         ACPI_ADR_SPACE_SYSTEM_IO,
                         *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
                             FadtInfoTable[i].Length),
-                        (UINT64) Address32, Name);
+                        (UINT64) Address32, Name, Flags);
                 }
             }
         }
                 }
             }
         }
@@ -706,7 +718,7 @@ AcpiTbConvertFadt (
                 Name, ACPI_MUL_8 (Length), Address64->BitWidth));
         }
 
                 Name, ACPI_MUL_8 (Length), Address64->BitWidth));
         }
 
-        if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED)
+        if (FadtInfoTable[i].Flags & ACPI_FADT_REQUIRED)
         {
             /*
              * Field is required (PM1aEvent, PM1aControl).
         {
             /*
              * Field is required (PM1aEvent, PM1aControl).
@@ -720,7 +732,7 @@ AcpiTbConvertFadt (
                     Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));
             }
         }
                     Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));
             }
         }
-        else if (FadtInfoTable[i].Type & ACPI_FADT_SEPARATE_LENGTH)
+        else if (FadtInfoTable[i].Flags & ACPI_FADT_SEPARATE_LENGTH)
         {
             /*
              * Field is optional (PM2Control, GPE0, GPE1) AND has its own
         {
             /*
              * Field is optional (PM2Control, GPE0, GPE1) AND has its own
@@ -827,7 +839,7 @@ AcpiTbSetupFadtRegisters (
                 Source64->SpaceId, Pm1RegisterByteWidth,
                 Source64->Address +
                     (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
                 Source64->SpaceId, Pm1RegisterByteWidth,
                 Source64->Address +
                     (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
-                "PmRegisters");
+                "PmRegisters", 0);
         }
     }
 }
         }
     }
 }
index 42ce181..56b4e8a 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBFIND_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
index 4560d0f..38de06c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBINSTAL_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
@@ -282,7 +280,7 @@ AcpiTbInstallFixedTable (
 
     /* Validate and verify a table before installation */
 
 
     /* Validate and verify a table before installation */
 
-    Status = AcpiTbVerifyTable (&NewTableDesc, Signature);
+    Status = AcpiTbVerifyTempTable (&NewTableDesc, Signature);
     if (ACPI_FAILURE (Status))
     {
         goto ReleaseAndExit;
     if (ACPI_FAILURE (Status))
     {
         goto ReleaseAndExit;
@@ -362,7 +360,7 @@ AcpiTbInstallStandardTable (
 
     /* Validate and verify a table before installation */
 
 
     /* Validate and verify a table before installation */
 
-    Status = AcpiTbVerifyTable (&NewTableDesc, NULL);
+    Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
     if (ACPI_FAILURE (Status))
     {
         goto ReleaseAndExit;
     if (ACPI_FAILURE (Status))
     {
         goto ReleaseAndExit;
@@ -527,7 +525,7 @@ FinishOverride:
 
     /* Validate and verify a table before overriding */
 
 
     /* Validate and verify a table before overriding */
 
-    Status = AcpiTbVerifyTable (&NewTableDesc, NULL);
+    Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
     if (ACPI_FAILURE (Status))
     {
         return;
     if (ACPI_FAILURE (Status))
     {
         return;
@@ -549,7 +547,7 @@ FinishOverride:
      */
     AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,
         NewTableDesc.Flags, NewTableDesc.Pointer);
      */
     AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,
         NewTableDesc.Flags, NewTableDesc.Pointer);
-    AcpiTbValidateTable (OldTableDesc);
+    AcpiTbValidateTempTable (OldTableDesc);
 
     /* Release the temporary table descriptor */
 
 
     /* Release the temporary table descriptor */
 
index 553daf9..d4bba45 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBPRINT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
index 73cf76e..ec1843c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBUTILS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
 
 /* Local prototypes */
 
 
 /* Local prototypes */
 
-static ACPI_STATUS
-AcpiTbValidateXsdt (
-    ACPI_PHYSICAL_ADDRESS   Address);
-
 static ACPI_PHYSICAL_ADDRESS
 AcpiTbGetRootTableEntry (
     UINT8                   *TableEntry,
 static ACPI_PHYSICAL_ADDRESS
 AcpiTbGetRootTableEntry (
     UINT8                   *TableEntry,
@@ -346,92 +340,6 @@ AcpiTbGetRootTableEntry (
 }
 
 
 }
 
 
-/*******************************************************************************
- *
- * FUNCTION:    AcpiTbValidateXsdt
- *
- * PARAMETERS:  Address             - Physical address of the XSDT (from RSDP)
- *
- * RETURN:      Status. AE_OK if the table appears to be valid.
- *
- * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does
- *              not contain any NULL entries. A problem that is seen in the
- *              field is that the XSDT exists, but is actually useless because
- *              of one or more (or all) NULL entries.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiTbValidateXsdt (
-    ACPI_PHYSICAL_ADDRESS   XsdtAddress)
-{
-    ACPI_TABLE_HEADER       *Table;
-    UINT8                   *NextEntry;
-    ACPI_PHYSICAL_ADDRESS   Address;
-    UINT32                  Length;
-    UINT32                  EntryCount;
-    ACPI_STATUS             Status;
-    UINT32                  i;
-
-
-    /* Get the XSDT length */
-
-    Table = AcpiOsMapMemory (XsdtAddress, sizeof (ACPI_TABLE_HEADER));
-    if (!Table)
-    {
-        return (AE_NO_MEMORY);
-    }
-
-    Length = Table->Length;
-    AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
-
-    /*
-     * Minimum XSDT length is the size of the standard ACPI header
-     * plus one physical address entry
-     */
-    if (Length < (sizeof (ACPI_TABLE_HEADER) + ACPI_XSDT_ENTRY_SIZE))
-    {
-        return (AE_INVALID_TABLE_LENGTH);
-    }
-
-    /* Map the entire XSDT */
-
-    Table = AcpiOsMapMemory (XsdtAddress, Length);
-    if (!Table)
-    {
-        return (AE_NO_MEMORY);
-    }
-
-    /* Get the number of entries and pointer to first entry */
-
-    Status = AE_OK;
-    NextEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
-    EntryCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
-        ACPI_XSDT_ENTRY_SIZE);
-
-    /* Validate each entry (physical address) within the XSDT */
-
-    for (i = 0; i < EntryCount; i++)
-    {
-        Address = AcpiTbGetRootTableEntry (NextEntry, ACPI_XSDT_ENTRY_SIZE);
-        if (!Address)
-        {
-            /* Detected a NULL entry, XSDT is invalid */
-
-            Status = AE_NULL_ENTRY;
-            break;
-        }
-
-        NextEntry += ACPI_XSDT_ENTRY_SIZE;
-    }
-
-    /* Unmap table */
-
-    AcpiOsUnmapMemory (Table, Length);
-    return (Status);
-}
-
-
 /*******************************************************************************
  *
  * FUNCTION:    AcpiTbParseRootTable
 /*******************************************************************************
  *
  * FUNCTION:    AcpiTbParseRootTable
@@ -507,25 +415,6 @@ AcpiTbParseRootTable (
      */
     AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP));
 
      */
     AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP));
 
-    /*
-     * If it is present and used, validate the XSDT for access/size
-     * and ensure that all table entries are at least non-NULL
-     */
-    if (TableEntrySize == ACPI_XSDT_ENTRY_SIZE)
-    {
-        Status = AcpiTbValidateXsdt (Address);
-        if (ACPI_FAILURE (Status))
-        {
-            ACPI_BIOS_WARNING ((AE_INFO, "XSDT is invalid (%s), using RSDT",
-                AcpiFormatException (Status)));
-
-            /* Fall back to the RSDT */
-
-            Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress;
-            TableEntrySize = ACPI_RSDT_ENTRY_SIZE;
-        }
-    }
-
     /* Map the RSDT/XSDT table header to get the full table length */
 
     Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
     /* Map the RSDT/XSDT table header to get the full table length */
 
     Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
@@ -584,8 +473,16 @@ AcpiTbParseRootTable (
     {
         /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
 
     {
         /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
 
-        Status = AcpiTbInstallStandardTable (
-            AcpiTbGetRootTableEntry (TableEntry, TableEntrySize),
+        Address = AcpiTbGetRootTableEntry (TableEntry, TableEntrySize);
+
+        /* Skip NULL entries in RSDT/XSDT */
+
+        if (!Address)
+        {
+            goto NextTable;
+        }
+
+        Status = AcpiTbInstallStandardTable (Address,
             ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
 
         if (ACPI_SUCCESS (Status) &&
             ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
 
         if (ACPI_SUCCESS (Status) &&
@@ -595,13 +492,11 @@ AcpiTbParseRootTable (
             AcpiTbParseFadt (TableIndex);
         }
 
             AcpiTbParseFadt (TableIndex);
         }
 
+NextTable:
+
         TableEntry += TableEntrySize;
     }
 
         TableEntry += TableEntrySize;
     }
 
-    /*
-     * It is not possible to map more than one entry in some environments,
-     * so unmap the root table here before mapping other tables
-     */
     AcpiOsUnmapMemory (Table, Length);
 
     return_ACPI_STATUS (AE_OK);
     AcpiOsUnmapMemory (Table, Length);
 
     return_ACPI_STATUS (AE_OK);
index cbdede5..df4e402 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBXFACE_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
index 77c1be6..88834db 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBXFLOAD_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
index 81d08a9..8354e94 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __TBXFROOT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "actables.h"
         ACPI_MODULE_NAME    ("tbxfroot")
 
 
         ACPI_MODULE_NAME    ("tbxfroot")
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiTbGetRsdpLength
+ *
+ * PARAMETERS:  Rsdp                - Pointer to RSDP
+ *
+ * RETURN:      Table length
+ *
+ * DESCRIPTION: Get the length of the RSDP
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiTbGetRsdpLength (
+    ACPI_TABLE_RSDP         *Rsdp)
+{
+
+    if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature))
+    {
+        /* BAD Signature */
+
+        return (0);
+    }
+
+    /* "Length" field is available if table version >= 2 */
+
+    if (Rsdp->Revision >= 2)
+    {
+        return (Rsdp->Length);
+    }
+    else
+    {
+        return (ACPI_RSDP_CHECKSUM_LENGTH);
+    }
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiTbValidateRsdp
 /*******************************************************************************
  *
  * FUNCTION:    AcpiTbValidateRsdp
index 750f47c..864c0c3 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTADDRESS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 00345fc..dd7c8d6 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTALLOC_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acdebug.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acdebug.h"
index c241f7d..cc2d769 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTBUFFER_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
@@ -290,3 +288,138 @@ AcpiUtDebugDumpBuffer (
 
     AcpiUtDumpBuffer (Buffer, Count, Display, 0);
 }
 
     AcpiUtDumpBuffer (Buffer, Count, Display, 0);
 }
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtDumpBufferToFile
+ *
+ * PARAMETERS:  File                - File descriptor
+ *              Buffer              - Buffer to dump
+ *              Count               - Amount to dump, in bytes
+ *              Display             - BYTE, WORD, DWORD, or QWORD display:
+ *                                      DB_BYTE_DISPLAY
+ *                                      DB_WORD_DISPLAY
+ *                                      DB_DWORD_DISPLAY
+ *                                      DB_QWORD_DISPLAY
+ *              BaseOffset          - Beginning buffer offset (display only)
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Generic dump buffer in both hex and ascii to a file.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtDumpBufferToFile (
+    ACPI_FILE               File,
+    UINT8                   *Buffer,
+    UINT32                  Count,
+    UINT32                  Display,
+    UINT32                  BaseOffset)
+{
+    UINT32                  i = 0;
+    UINT32                  j;
+    UINT32                  Temp32;
+    UINT8                   BufChar;
+
+
+    if (!Buffer)
+    {
+        AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n");
+        return;
+    }
+
+    if ((Count < 4) || (Count & 0x01))
+    {
+        Display = DB_BYTE_DISPLAY;
+    }
+
+    /* Nasty little dump buffer routine! */
+
+    while (i < Count)
+    {
+        /* Print current offset */
+
+        AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i));
+
+        /* Print 16 hex chars */
+
+        for (j = 0; j < 16;)
+        {
+            if (i + j >= Count)
+            {
+                /* Dump fill spaces */
+
+                AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " ");
+                j += Display;
+                continue;
+            }
+
+            switch (Display)
+            {
+            case DB_BYTE_DISPLAY:
+            default:    /* Default is BYTE display */
+
+                AcpiUtFilePrintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
+                break;
+
+            case DB_WORD_DISPLAY:
+
+                ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+                AcpiUtFilePrintf (File, "%04X ", Temp32);
+                break;
+
+            case DB_DWORD_DISPLAY:
+
+                ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+                AcpiUtFilePrintf (File, "%08X ", Temp32);
+                break;
+
+            case DB_QWORD_DISPLAY:
+
+                ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+                AcpiUtFilePrintf (File, "%08X", Temp32);
+
+                ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
+                AcpiUtFilePrintf (File, "%08X ", Temp32);
+                break;
+            }
+
+            j += Display;
+        }
+
+        /*
+         * Print the ASCII equivalent characters but watch out for the bad
+         * unprintable ones (printable chars are 0x20 through 0x7E)
+         */
+        AcpiUtFilePrintf (File, " ");
+        for (j = 0; j < 16; j++)
+        {
+            if (i + j >= Count)
+            {
+                AcpiUtFilePrintf (File, "\n");
+                return;
+            }
+
+            BufChar = Buffer[(ACPI_SIZE) i + j];
+            if (ACPI_IS_PRINT (BufChar))
+            {
+                AcpiUtFilePrintf (File, "%c", BufChar);
+            }
+            else
+            {
+                AcpiUtFilePrintf (File, ".");
+            }
+        }
+
+        /* Done with that line. */
+
+        AcpiUtFilePrintf (File, "\n");
+        i += 16;
+    }
+
+    return;
+}
+#endif
index 1bd2c54..cb8116e 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTCACHE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
index da2c833..13f33dc 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __CMCLIB_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
@@ -380,8 +377,6 @@ AcpiUtStrcmp (
 }
 
 
 }
 
 
-#ifdef ACPI_FUTURE_IMPLEMENTATION
-/* Not used at this time */
 /*******************************************************************************
  *
  * FUNCTION:    AcpiUtStrchr (strchr)
 /*******************************************************************************
  *
  * FUNCTION:    AcpiUtStrchr (strchr)
@@ -412,7 +407,7 @@ AcpiUtStrchr (
 
     return (NULL);
 }
 
     return (NULL);
 }
-#endif
+
 
 /*******************************************************************************
  *
 
 /*******************************************************************************
  *
index 4ca33bc..ea70d13 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTCOPY_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
@@ -1135,5 +1133,12 @@ AcpiUtCopyIobjectToIobject (
         Status = AcpiUtCopySimpleObject (SourceDesc, *DestDesc);
     }
 
         Status = AcpiUtCopySimpleObject (SourceDesc, *DestDesc);
     }
 
+    /* Delete the allocated object if copy failed */
+
+    if (ACPI_FAILURE (Status))
+    {
+        AcpiUtRemoveReference(*DestDesc);
+    }
+
     return_ACPI_STATUS (Status);
 }
     return_ACPI_STATUS (Status);
 }
index 5a1f981..5c86223 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTDEBUG_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
@@ -708,3 +707,33 @@ AcpiUtPtrExit (
 }
 
 #endif
 }
 
 #endif
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiLogError
+ *
+ * PARAMETERS:  Format              - Printf format field
+ *              ...                 - Optional printf arguments
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Print error message to the console, used by applications.
+ *
+ ******************************************************************************/
+
+void  ACPI_INTERNAL_VAR_XFACE
+AcpiLogError (
+    const char              *Format,
+    ...)
+{
+    va_list                 Args;
+
+    va_start (Args, Format);
+    (void) AcpiUtFileVprintf (ACPI_FILE_ERR, Format, Args);
+    va_end (Args);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiLogError)
+#endif
index 8566819..fcd6393 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTDECODE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
@@ -163,38 +161,6 @@ const UINT8                     AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
 };
 
 
 };
 
 
-/*******************************************************************************
- *
- * FUNCTION:    AcpiUtHexToAsciiChar
- *
- * PARAMETERS:  Integer             - Contains the hex digit
- *              Position            - bit position of the digit within the
- *                                    integer (multiple of 4)
- *
- * RETURN:      The converted Ascii character
- *
- * DESCRIPTION: Convert a hex digit to an Ascii character
- *
- ******************************************************************************/
-
-/* Hex to ASCII conversion table */
-
-static const char           AcpiGbl_HexToAscii[] =
-{
-    '0','1','2','3','4','5','6','7',
-    '8','9','A','B','C','D','E','F'
-};
-
-char
-AcpiUtHexToAsciiChar (
-    UINT64                  Integer,
-    UINT32                  Position)
-{
-
-    return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
-}
-
-
 /*******************************************************************************
  *
  * FUNCTION:    AcpiUtGetRegionName
 /*******************************************************************************
  *
  * FUNCTION:    AcpiUtGetRegionName
@@ -613,7 +579,8 @@ static const char           *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] =
     /* 09 */ "Device PLD Check",
     /* 0A */ "Reserved",
     /* 0B */ "System Locality Update",
     /* 09 */ "Device PLD Check",
     /* 0A */ "Reserved",
     /* 0B */ "System Locality Update",
-    /* 0C */ "Shutdown Request"
+    /* 0C */ "Shutdown Request",
+    /* 0D */ "System Resource Affinity Update"
 };
 
 static const char           *AcpiGbl_DeviceNotify[4] =
 };
 
 static const char           *AcpiGbl_DeviceNotify[4] =
@@ -647,7 +614,7 @@ AcpiUtGetNotifyName (
     ACPI_OBJECT_TYPE        Type)
 {
 
     ACPI_OBJECT_TYPE        Type)
 {
 
-    /* 00 - 0C are common to all object types */
+    /* 00 - 0D are common to all object types */
 
     if (NotifyValue <= ACPI_NOTIFY_MAX)
     {
 
     if (NotifyValue <= ACPI_NOTIFY_MAX)
     {
index d42d8a7..e6825ca 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTDELETE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index b590af7..5d7dfca 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTERROR_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index b3a7341..00f1483 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTEVAL_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index d9f0471..2c046c4 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTEXCEP_C__
 #define EXPORT_ACPI_INTERFACES
 
 #define ACPI_DEFINE_EXCEPTION_TABLE
 #define EXPORT_ACPI_INTERFACES
 
 #define ACPI_DEFINE_EXCEPTION_TABLE
diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utfileio.c b/reactos/drivers/bus/acpi/acpica/utilities/utfileio.c
new file mode 100644 (file)
index 0000000..956f300
--- /dev/null
@@ -0,0 +1,433 @@
+/*******************************************************************************
+ *
+ * Module Name: utfileio - simple file I/O routines
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+#include "actables.h"
+#include "acapps.h"
+
+#ifdef ACPI_ASL_COMPILER
+#include "aslcompiler.h"
+#endif
+
+
+#define _COMPONENT          ACPI_CA_DEBUGGER
+        ACPI_MODULE_NAME    ("utfileio")
+
+
+#ifdef ACPI_APPLICATION
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiUtCheckTextModeCorruption (
+    UINT8                   *Table,
+    UINT32                  TableLength,
+    UINT32                  FileLength);
+
+static ACPI_STATUS
+AcpiUtReadTable (
+    FILE                    *fp,
+    ACPI_TABLE_HEADER       **Table,
+    UINT32                  *TableLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtCheckTextModeCorruption
+ *
+ * PARAMETERS:  Table           - Table buffer
+ *              TableLength     - Length of table from the table header
+ *              FileLength      - Length of the file that contains the table
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Check table for text mode file corruption where all linefeed
+ *              characters (LF) have been replaced by carriage return linefeed
+ *              pairs (CR/LF).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtCheckTextModeCorruption (
+    UINT8                   *Table,
+    UINT32                  TableLength,
+    UINT32                  FileLength)
+{
+    UINT32                  i;
+    UINT32                  Pairs = 0;
+
+
+    if (TableLength != FileLength)
+    {
+        ACPI_WARNING ((AE_INFO,
+            "File length (0x%X) is not the same as the table length (0x%X)",
+            FileLength, TableLength));
+    }
+
+    /* Scan entire table to determine if each LF has been prefixed with a CR */
+
+    for (i = 1; i < FileLength; i++)
+    {
+        if (Table[i] == 0x0A)
+        {
+            if (Table[i - 1] != 0x0D)
+            {
+                /* The LF does not have a preceding CR, table not corrupted */
+
+                return (AE_OK);
+            }
+            else
+            {
+                /* Found a CR/LF pair */
+
+                Pairs++;
+            }
+            i++;
+        }
+    }
+
+    if (!Pairs)
+    {
+        return (AE_OK);
+    }
+
+    /*
+     * Entire table scanned, each CR is part of a CR/LF pair --
+     * meaning that the table was treated as a text file somewhere.
+     *
+     * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
+     * original table are left untouched by the text conversion process --
+     * meaning that we cannot simply replace CR/LF pairs with LFs.
+     */
+    AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
+    AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
+    AcpiOsPrintf ("Table cannot be repaired!\n");
+    return (AE_BAD_VALUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtReadTable
+ *
+ * PARAMETERS:  fp              - File that contains table
+ *              Table           - Return value, buffer with table
+ *              TableLength     - Return value, length of table
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Load the DSDT from the file pointer
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtReadTable (
+    FILE                    *fp,
+    ACPI_TABLE_HEADER       **Table,
+    UINT32                  *TableLength)
+{
+    ACPI_TABLE_HEADER       TableHeader;
+    UINT32                  Actual;
+    ACPI_STATUS             Status;
+    UINT32                  FileSize;
+    BOOLEAN                 StandardHeader = TRUE;
+    INT32                   Count;
+
+    /* Get the file size */
+
+    FileSize = CmGetFileSize (fp);
+    if (FileSize == ACPI_UINT32_MAX)
+    {
+        return (AE_ERROR);
+    }
+
+    if (FileSize < 4)
+    {
+        return (AE_BAD_HEADER);
+    }
+
+    /* Read the signature */
+
+    fseek (fp, 0, SEEK_SET);
+
+    Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp);
+    if (Count != sizeof (ACPI_TABLE_HEADER))
+    {
+        AcpiOsPrintf ("Could not read the table header\n");
+        return (AE_BAD_HEADER);
+    }
+
+    /* The RSDP table does not have standard ACPI header */
+
+    if (ACPI_VALIDATE_RSDP_SIG (TableHeader.Signature))
+    {
+        *TableLength = FileSize;
+        StandardHeader = FALSE;
+    }
+    else
+    {
+
+#if 0
+        /* Validate the table header/length */
+
+        Status = AcpiTbValidateTableHeader (&TableHeader);
+        if (ACPI_FAILURE (Status))
+        {
+            AcpiOsPrintf ("Table header is invalid!\n");
+            return (Status);
+        }
+#endif
+
+        /* File size must be at least as long as the Header-specified length */
+
+        if (TableHeader.Length > FileSize)
+        {
+            AcpiOsPrintf (
+                "TableHeader length [0x%X] greater than the input file size [0x%X]\n",
+                TableHeader.Length, FileSize);
+
+#ifdef ACPI_ASL_COMPILER
+            Status = FlCheckForAscii (fp, NULL, FALSE);
+            if (ACPI_SUCCESS (Status))
+            {
+                AcpiOsPrintf ("File appears to be ASCII only, must be binary\n");
+            }
+#endif
+            return (AE_BAD_HEADER);
+        }
+
+#ifdef ACPI_OBSOLETE_CODE
+        /* We only support a limited number of table types */
+
+        if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) &&
+            !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) &&
+            !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT))
+        {
+            AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n",
+                (char *) TableHeader.Signature);
+            ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER));
+            return (AE_ERROR);
+        }
+#endif
+
+        *TableLength = TableHeader.Length;
+    }
+
+    /* Allocate a buffer for the table */
+
+    *Table = AcpiOsAllocate ((size_t) FileSize);
+    if (!*Table)
+    {
+        AcpiOsPrintf (
+            "Could not allocate memory for ACPI table %4.4s (size=0x%X)\n",
+            TableHeader.Signature, *TableLength);
+        return (AE_NO_MEMORY);
+    }
+
+    /* Get the rest of the table */
+
+    fseek (fp, 0, SEEK_SET);
+    Actual = fread (*Table, 1, (size_t) FileSize, fp);
+    if (Actual == FileSize)
+    {
+        if (StandardHeader)
+        {
+            /* Now validate the checksum */
+
+            Status = AcpiTbVerifyChecksum ((void *) *Table,
+                        ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
+
+            if (Status == AE_BAD_CHECKSUM)
+            {
+                Status = AcpiUtCheckTextModeCorruption ((UINT8 *) *Table,
+                            FileSize, (*Table)->Length);
+                return (Status);
+            }
+        }
+        return (AE_OK);
+    }
+
+    if (Actual > 0)
+    {
+        AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n",
+            FileSize, Actual);
+        return (AE_OK);
+    }
+
+    AcpiOsPrintf ("Error - could not read the table file\n");
+    AcpiOsFree (*Table);
+    *Table = NULL;
+    *TableLength = 0;
+    return (AE_ERROR);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtReadTableFromFile
+ *
+ * PARAMETERS:  Filename         - File where table is located
+ *              Table            - Where a pointer to the table is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Get an ACPI table from a file
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtReadTableFromFile (
+    char                    *Filename,
+    ACPI_TABLE_HEADER       **Table)
+{
+    FILE                    *File;
+    UINT32                  FileSize;
+    UINT32                  TableLength;
+    ACPI_STATUS             Status = AE_ERROR;
+
+
+    /* Open the file, get current size */
+
+    File = fopen (Filename, "rb");
+    if (!File)
+    {
+        perror ("Could not open input file");
+        return (Status);
+    }
+
+    FileSize = CmGetFileSize (File);
+    if (FileSize == ACPI_UINT32_MAX)
+    {
+        goto Exit;
+    }
+
+    /* Get the entire file */
+
+    fprintf (stderr, "Loading Acpi table from file %10s - Length %.8u (%06X)\n",
+        Filename, FileSize, FileSize);
+
+    Status = AcpiUtReadTable (File, Table, &TableLength);
+    if (ACPI_FAILURE (Status))
+    {
+        AcpiOsPrintf ("Could not get table from the file\n");
+    }
+
+Exit:
+    fclose(File);
+    return (Status);
+}
+
+#endif
index 77294c4..34438c8 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTGLOBAL_C__
 #define EXPORT_ACPI_INTERFACES
 #define DEFINE_ACPI_GLOBALS
 
 #define EXPORT_ACPI_INTERFACES
 #define DEFINE_ACPI_GLOBALS
 
  *
  ******************************************************************************/
 
  *
  ******************************************************************************/
 
-/* Debug output control masks */
-
-#ifdef ACPI_DEBUG_OUTPUT
-UINT32                      AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
-#else
-UINT32                      AcpiDbgLevel = ACPI_NORMAL_DEFAULT;
-#endif
-
-UINT32                      AcpiDbgLayer = ACPI_COMPONENT_DEFAULT;
-
-/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
-
-ACPI_TABLE_FADT             AcpiGbl_FADT;
-UINT32                      AcpiGbl_TraceFlags;
-ACPI_NAME                   AcpiGbl_TraceMethodName;
-BOOLEAN                     AcpiGbl_SystemAwakeAndRunning;
-UINT32                      AcpiCurrentGpeCount;
-
-/*
- * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
- * that the ACPI hardware is no longer required. A flag in the FADT indicates
- * a reduced HW machine, and that flag is duplicated here for convenience.
- */
-BOOLEAN                     AcpiGbl_ReducedHardware;
-
 /* Various state name strings */
 
 const char                  *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
 /* Various state name strings */
 
 const char                  *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
@@ -270,166 +244,6 @@ ACPI_FIXED_EVENT_INFO       AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
 };
 #endif /* !ACPI_REDUCED_HARDWARE */
 
 };
 #endif /* !ACPI_REDUCED_HARDWARE */
 
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiUtInitGlobals
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
- *              initialization should be initialized here. This allows for
- *              a warm restart.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtInitGlobals (
-    void)
-{
-    ACPI_STATUS             Status;
-    UINT32                  i;
-
-
-    ACPI_FUNCTION_TRACE (UtInitGlobals);
-
-
-    /* Create all memory caches */
-
-    Status = AcpiUtCreateCaches ();
-    if (ACPI_FAILURE (Status))
-    {
-        return_ACPI_STATUS (Status);
-    }
-
-    /* Address Range lists */
-
-    for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
-    {
-        AcpiGbl_AddressRangeList[i] = NULL;
-    }
-
-    /* Mutex locked flags */
-
-    for (i = 0; i < ACPI_NUM_MUTEX; i++)
-    {
-        AcpiGbl_MutexInfo[i].Mutex          = NULL;
-        AcpiGbl_MutexInfo[i].ThreadId       = ACPI_MUTEX_NOT_ACQUIRED;
-        AcpiGbl_MutexInfo[i].UseCount       = 0;
-    }
-
-    for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
-    {
-        AcpiGbl_OwnerIdMask[i]              = 0;
-    }
-
-    /* Last OwnerID is never valid */
-
-    AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
-
-    /* Event counters */
-
-    AcpiMethodCount                     = 0;
-    AcpiSciCount                        = 0;
-    AcpiGpeCount                        = 0;
-
-    for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
-    {
-        AcpiFixedEventCount[i]              = 0;
-    }
-
-#if (!ACPI_REDUCED_HARDWARE)
-
-    /* GPE/SCI support */
-
-    AcpiGbl_AllGpesInitialized          = FALSE;
-    AcpiGbl_GpeXruptListHead            = NULL;
-    AcpiGbl_GpeFadtBlocks[0]            = NULL;
-    AcpiGbl_GpeFadtBlocks[1]            = NULL;
-    AcpiCurrentGpeCount                 = 0;
-
-    AcpiGbl_GlobalEventHandler          = NULL;
-    AcpiGbl_SciHandlerList              = NULL;
-
-#endif /* !ACPI_REDUCED_HARDWARE */
-
-    /* Global handlers */
-
-    AcpiGbl_GlobalNotify[0].Handler     = NULL;
-    AcpiGbl_GlobalNotify[1].Handler     = NULL;
-    AcpiGbl_ExceptionHandler            = NULL;
-    AcpiGbl_InitHandler                 = NULL;
-    AcpiGbl_TableHandler                = NULL;
-    AcpiGbl_InterfaceHandler            = NULL;
-
-    /* Global Lock support */
-
-    AcpiGbl_GlobalLockSemaphore         = NULL;
-    AcpiGbl_GlobalLockMutex             = NULL;
-    AcpiGbl_GlobalLockAcquired          = FALSE;
-    AcpiGbl_GlobalLockHandle            = 0;
-    AcpiGbl_GlobalLockPresent           = FALSE;
-
-    /* Miscellaneous variables */
-
-    AcpiGbl_DSDT                        = NULL;
-    AcpiGbl_CmSingleStep                = FALSE;
-    AcpiGbl_Shutdown                    = FALSE;
-    AcpiGbl_NsLookupCount               = 0;
-    AcpiGbl_PsFindCount                 = 0;
-    AcpiGbl_AcpiHardwarePresent         = TRUE;
-    AcpiGbl_LastOwnerIdIndex            = 0;
-    AcpiGbl_NextOwnerIdOffset           = 0;
-    AcpiGbl_TraceMethodName             = 0;
-    AcpiGbl_TraceDbgLevel               = 0;
-    AcpiGbl_TraceDbgLayer               = 0;
-    AcpiGbl_DebuggerConfiguration       = DEBUGGER_THREADING;
-    AcpiGbl_DbOutputFlags               = ACPI_DB_CONSOLE_OUTPUT;
-    AcpiGbl_OsiMutex                    = NULL;
-    AcpiGbl_RegMethodsExecuted          = FALSE;
-
-    /* Hardware oriented */
-
-    AcpiGbl_EventsInitialized           = FALSE;
-    AcpiGbl_SystemAwakeAndRunning       = TRUE;
-
-    /* Namespace */
-
-    AcpiGbl_ModuleCodeList              = NULL;
-    AcpiGbl_RootNode                    = NULL;
-    AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
-    AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
-    AcpiGbl_RootNodeStruct.Type         = ACPI_TYPE_DEVICE;
-    AcpiGbl_RootNodeStruct.Parent       = NULL;
-    AcpiGbl_RootNodeStruct.Child        = NULL;
-    AcpiGbl_RootNodeStruct.Peer         = NULL;
-    AcpiGbl_RootNodeStruct.Object       = NULL;
-
-
-#ifdef ACPI_DISASSEMBLER
-    AcpiGbl_ExternalList                = NULL;
-    AcpiGbl_NumExternalMethods          = 0;
-    AcpiGbl_ResolvedExternalMethods     = 0;
-#endif
-
-#ifdef ACPI_DEBUG_OUTPUT
-    AcpiGbl_LowestStackPointer          = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
-#endif
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-    AcpiGbl_DisplayFinalMemStats        = FALSE;
-    AcpiGbl_DisableMemTracking          = FALSE;
-#endif
-
-#ifdef ACPI_DEBUGGER
-    AcpiGbl_DbTerminateThreads          = FALSE;
-#endif
-
-    return_ACPI_STATUS (AE_OK);
-}
-
 /* Public globals */
 
 ACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
 /* Public globals */
 
 ACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
diff --git a/reactos/drivers/bus/acpi/acpica/utilities/uthex.c b/reactos/drivers/bus/acpi/acpica/utilities/uthex.c
new file mode 100644 (file)
index 0000000..80ad2ba
--- /dev/null
@@ -0,0 +1,183 @@
+/******************************************************************************
+ *
+ * Module Name: uthex -- Hex/ASCII support functions
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("uthex")
+
+
+/* Hex to ASCII conversion table */
+
+static char                 AcpiGbl_HexToAscii[] =
+{
+    '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtHexToAsciiChar
+ *
+ * PARAMETERS:  Integer             - Contains the hex digit
+ *              Position            - bit position of the digit within the
+ *                                    integer (multiple of 4)
+ *
+ * RETURN:      The converted Ascii character
+ *
+ * DESCRIPTION: Convert a hex digit to an Ascii character
+ *
+ ******************************************************************************/
+
+char
+AcpiUtHexToAsciiChar (
+    UINT64                  Integer,
+    UINT32                  Position)
+{
+
+    return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtHexCharToValue
+ *
+ * PARAMETERS:  AsciiChar             - Hex character in Ascii
+ *
+ * RETURN:      The binary value of the ascii/hex character
+ *
+ * DESCRIPTION: Perform ascii-to-hex translation
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiUtAsciiCharToHex (
+    int                     HexChar)
+{
+
+    if (HexChar <= 0x39)
+    {
+        return ((UINT8) (HexChar - 0x30));
+    }
+
+    if (HexChar <= 0x46)
+    {
+        return ((UINT8) (HexChar - 0x37));
+    }
+
+    return ((UINT8) (HexChar - 0x57));
+}
index 4cf84e8..5f15f62 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTIDS_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acinterp.h"
index 46df0ab..7c0b67b 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTINIT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
@@ -188,6 +185,162 @@ AcpiUtFreeGpeLists (
 #endif /* !ACPI_REDUCED_HARDWARE */
 
 
 #endif /* !ACPI_REDUCED_HARDWARE */
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtInitGlobals
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
+ *              initialization should be initialized here. This allows for
+ *              a warm restart.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtInitGlobals (
+    void)
+{
+    ACPI_STATUS             Status;
+    UINT32                  i;
+
+
+    ACPI_FUNCTION_TRACE (UtInitGlobals);
+
+
+    /* Create all memory caches */
+
+    Status = AcpiUtCreateCaches ();
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    /* Address Range lists */
+
+    for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
+    {
+        AcpiGbl_AddressRangeList[i] = NULL;
+    }
+
+    /* Mutex locked flags */
+
+    for (i = 0; i < ACPI_NUM_MUTEX; i++)
+    {
+        AcpiGbl_MutexInfo[i].Mutex          = NULL;
+        AcpiGbl_MutexInfo[i].ThreadId       = ACPI_MUTEX_NOT_ACQUIRED;
+        AcpiGbl_MutexInfo[i].UseCount       = 0;
+    }
+
+    for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
+    {
+        AcpiGbl_OwnerIdMask[i]              = 0;
+    }
+
+    /* Last OwnerID is never valid */
+
+    AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
+
+    /* Event counters */
+
+    AcpiMethodCount                     = 0;
+    AcpiSciCount                        = 0;
+    AcpiGpeCount                        = 0;
+
+    for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
+    {
+        AcpiFixedEventCount[i]              = 0;
+    }
+
+#if (!ACPI_REDUCED_HARDWARE)
+
+    /* GPE/SCI support */
+
+    AcpiGbl_AllGpesInitialized          = FALSE;
+    AcpiGbl_GpeXruptListHead            = NULL;
+    AcpiGbl_GpeFadtBlocks[0]            = NULL;
+    AcpiGbl_GpeFadtBlocks[1]            = NULL;
+    AcpiCurrentGpeCount                 = 0;
+
+    AcpiGbl_GlobalEventHandler          = NULL;
+    AcpiGbl_SciHandlerList              = NULL;
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+    /* Global handlers */
+
+    AcpiGbl_GlobalNotify[0].Handler     = NULL;
+    AcpiGbl_GlobalNotify[1].Handler     = NULL;
+    AcpiGbl_ExceptionHandler            = NULL;
+    AcpiGbl_InitHandler                 = NULL;
+    AcpiGbl_TableHandler                = NULL;
+    AcpiGbl_InterfaceHandler            = NULL;
+
+    /* Global Lock support */
+
+    AcpiGbl_GlobalLockSemaphore         = NULL;
+    AcpiGbl_GlobalLockMutex             = NULL;
+    AcpiGbl_GlobalLockAcquired          = FALSE;
+    AcpiGbl_GlobalLockHandle            = 0;
+    AcpiGbl_GlobalLockPresent           = FALSE;
+
+    /* Miscellaneous variables */
+
+    AcpiGbl_DSDT                        = NULL;
+    AcpiGbl_CmSingleStep                = FALSE;
+    AcpiGbl_Shutdown                    = FALSE;
+    AcpiGbl_NsLookupCount               = 0;
+    AcpiGbl_PsFindCount                 = 0;
+    AcpiGbl_AcpiHardwarePresent         = TRUE;
+    AcpiGbl_LastOwnerIdIndex            = 0;
+    AcpiGbl_NextOwnerIdOffset           = 0;
+    AcpiGbl_TraceDbgLevel               = 0;
+    AcpiGbl_TraceDbgLayer               = 0;
+    AcpiGbl_DebuggerConfiguration       = DEBUGGER_THREADING;
+    AcpiGbl_OsiMutex                    = NULL;
+    AcpiGbl_RegMethodsExecuted          = FALSE;
+
+    /* Hardware oriented */
+
+    AcpiGbl_EventsInitialized           = FALSE;
+    AcpiGbl_SystemAwakeAndRunning       = TRUE;
+
+    /* Namespace */
+
+    AcpiGbl_ModuleCodeList              = NULL;
+    AcpiGbl_RootNode                    = NULL;
+    AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
+    AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
+    AcpiGbl_RootNodeStruct.Type         = ACPI_TYPE_DEVICE;
+    AcpiGbl_RootNodeStruct.Parent       = NULL;
+    AcpiGbl_RootNodeStruct.Child        = NULL;
+    AcpiGbl_RootNodeStruct.Peer         = NULL;
+    AcpiGbl_RootNodeStruct.Object       = NULL;
+
+
+#ifdef ACPI_DISASSEMBLER
+    AcpiGbl_ExternalList                = NULL;
+    AcpiGbl_NumExternalMethods          = 0;
+    AcpiGbl_ResolvedExternalMethods     = 0;
+#endif
+
+#ifdef ACPI_DEBUG_OUTPUT
+    AcpiGbl_LowestStackPointer          = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
+#endif
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+    AcpiGbl_DisplayFinalMemStats        = FALSE;
+    AcpiGbl_DisableMemTracking          = FALSE;
+#endif
+
+    ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = FALSE);
+
+    return_ACPI_STATUS (AE_OK);
+}
+
+
 /******************************************************************************
  *
  * FUNCTION:    AcpiUtTerminate
 /******************************************************************************
  *
  * FUNCTION:    AcpiUtTerminate
index b3e4cb4..1d7dadc 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTLOCK_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
index c781c7e..95a9d72 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTMATH_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
index 69d8350..5e86e0a 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTMISC_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index 168afa3..1537422 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTMUTEX_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
index c32782b..4c64061 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTOBJECT_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
@@ -472,7 +470,7 @@ AcpiUtValidInternalObject (
     default:
 
         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
     default:
 
         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-                "%p is not not an ACPI operand obj [%s]\n",
+                "%p is not an ACPI operand obj [%s]\n",
                 Object, AcpiUtGetDescriptorName (Object)));
         break;
     }
                 Object, AcpiUtGetDescriptorName (Object)));
         break;
     }
index a001d06..3b49ded 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTOSI_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
index ae42970..1ae1398 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTOWNERID_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index d20e905..ab275ee 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTPREDEF_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acpredef.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acpredef.h"
diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utprint.c b/reactos/drivers/bus/acpi/acpica/utilities/utprint.c
new file mode 100644 (file)
index 0000000..543bad8
--- /dev/null
@@ -0,0 +1,883 @@
+/******************************************************************************
+ *
+ * Module Name: utprint - Formatted printing routines
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT          ACPI_UTILITIES
+        ACPI_MODULE_NAME    ("utprint")
+
+
+#define ACPI_FORMAT_SIGN            0x01
+#define ACPI_FORMAT_SIGN_PLUS       0x02
+#define ACPI_FORMAT_SIGN_PLUS_SPACE 0x04
+#define ACPI_FORMAT_ZERO            0x08
+#define ACPI_FORMAT_LEFT            0x10
+#define ACPI_FORMAT_UPPER           0x20
+#define ACPI_FORMAT_PREFIX          0x40
+
+
+/* Local prototypes */
+
+static ACPI_SIZE
+AcpiUtBoundStringLength (
+    const char              *String,
+    ACPI_SIZE               Count);
+
+static char *
+AcpiUtBoundStringOutput (
+    char                    *String,
+    const char              *End,
+    char                    c);
+
+static char *
+AcpiUtFormatNumber (
+    char                    *String,
+    char                    *End,
+    UINT64                  Number,
+    UINT8                   Base,
+    INT32                   Width,
+    INT32                   Precision,
+    UINT8                   Type);
+
+static char *
+AcpiUtPutNumber (
+    char                    *String,
+    UINT64                  Number,
+    UINT8                   Base,
+    BOOLEAN                 Upper);
+
+
+/* Module globals */
+
+static const char           AcpiGbl_LowerHexDigits[] = "0123456789abcdef";
+static const char           AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF";
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtBoundStringLength
+ *
+ * PARAMETERS:  String              - String with boundary
+ *              Count               - Boundary of the string
+ *
+ * RETURN:      Length of the string. Less than or equal to Count.
+ *
+ * DESCRIPTION: Calculate the length of a string with boundary.
+ *
+ ******************************************************************************/
+
+static ACPI_SIZE
+AcpiUtBoundStringLength (
+    const char              *String,
+    ACPI_SIZE               Count)
+{
+    UINT32                  Length = 0;
+
+
+    while (*String && Count)
+    {
+        Length++;
+        String++;
+        Count--;
+    }
+
+    return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtBoundStringOutput
+ *
+ * PARAMETERS:  String              - String with boundary
+ *              End                 - Boundary of the string
+ *              c                   - Character to be output to the string
+ *
+ * RETURN:      Updated position for next valid character
+ *
+ * DESCRIPTION: Output a character into a string with boundary check.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtBoundStringOutput (
+    char                    *String,
+    const char              *End,
+    char                    c)
+{
+
+    if (String < End)
+    {
+        *String = c;
+    }
+
+    ++String;
+    return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtPutNumber
+ *
+ * PARAMETERS:  String              - Buffer to hold reverse-ordered string
+ *              Number              - Integer to be converted
+ *              Base                - Base of the integer
+ *              Upper               - Whether or not using upper cased digits
+ *
+ * RETURN:      Updated position for next valid character
+ *
+ * DESCRIPTION: Convert an integer into a string, note that, the string holds a
+ *              reversed ordered number without the trailing zero.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtPutNumber (
+    char                    *String,
+    UINT64                  Number,
+    UINT8                   Base,
+    BOOLEAN                 Upper)
+{
+    const char              *Digits;
+    UINT64                  DigitIndex;
+    char                    *Pos;
+
+
+    Pos = String;
+    Digits = Upper ? AcpiGbl_UpperHexDigits : AcpiGbl_LowerHexDigits;
+
+    if (Number == 0)
+    {
+        *(Pos++) = '0';
+    }
+    else
+    {
+        while (Number)
+        {
+            (void) AcpiUtDivide (Number, Base, &Number, &DigitIndex);
+            *(Pos++) = Digits[DigitIndex];
+        }
+    }
+
+    /* *(Pos++) = '0'; */
+    return (Pos);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtScanNumber
+ *
+ * PARAMETERS:  String              - String buffer
+ *              NumberPtr           - Where the number is returned
+ *
+ * RETURN:      Updated position for next valid character
+ *
+ * DESCRIPTION: Scan a string for a decimal integer.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtScanNumber (
+    const char              *String,
+    UINT64                  *NumberPtr)
+{
+    UINT64                  Number = 0;
+
+
+    while (ACPI_IS_DIGIT (*String))
+    {
+        Number *= 10;
+        Number += *(String++) - '0';
+    }
+
+    *NumberPtr = Number;
+    return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtPrintNumber
+ *
+ * PARAMETERS:  String              - String buffer
+ *              Number              - The number to be converted
+ *
+ * RETURN:      Updated position for next valid character
+ *
+ * DESCRIPTION: Print a decimal integer into a string.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtPrintNumber (
+    char                    *String,
+    UINT64                  Number)
+{
+    char                    AsciiString[20];
+    const char              *Pos1;
+    char                    *Pos2;
+
+
+    Pos1 = AcpiUtPutNumber (AsciiString, Number, 10, FALSE);
+    Pos2 = String;
+
+    while (Pos1 != AsciiString)
+    {
+        *(Pos2++) = *(--Pos1);
+    }
+
+    *Pos2 = 0;
+    return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtFormatNumber
+ *
+ * PARAMETERS:  String              - String buffer with boundary
+ *              End                 - Boundary of the string
+ *              Number              - The number to be converted
+ *              Base                - Base of the integer
+ *              Width               - Field width
+ *              Precision           - Precision of the integer
+ *              Type                - Special printing flags
+ *
+ * RETURN:      Updated position for next valid character
+ *
+ * DESCRIPTION: Print an integer into a string with any base and any precision.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtFormatNumber (
+    char                    *String,
+    char                    *End,
+    UINT64                  Number,
+    UINT8                   Base,
+    INT32                   Width,
+    INT32                   Precision,
+    UINT8                   Type)
+{
+    char                    *Pos;
+    char                    Sign;
+    char                    Zero;
+    BOOLEAN                 NeedPrefix;
+    BOOLEAN                 Upper;
+    INT32                   i;
+    char                    ReversedString[66];
+
+
+    /* Parameter validation */
+
+    if (Base < 2 || Base > 16)
+    {
+        return (NULL);
+    }
+
+    if (Type & ACPI_FORMAT_LEFT)
+    {
+        Type &= ~ACPI_FORMAT_ZERO;
+    }
+
+    NeedPrefix = ((Type & ACPI_FORMAT_PREFIX) && Base != 10) ? TRUE : FALSE;
+    Upper = (Type & ACPI_FORMAT_UPPER) ? TRUE : FALSE;
+    Zero = (Type & ACPI_FORMAT_ZERO) ? '0' : ' ';
+
+    /* Calculate size according to sign and prefix */
+
+    Sign = '\0';
+    if (Type & ACPI_FORMAT_SIGN)
+    {
+        if ((INT64) Number < 0)
+        {
+            Sign = '-';
+            Number = - (INT64) Number;
+            Width--;
+        }
+        else if (Type & ACPI_FORMAT_SIGN_PLUS)
+        {
+            Sign = '+';
+            Width--;
+        }
+        else if (Type & ACPI_FORMAT_SIGN_PLUS_SPACE)
+        {
+            Sign = ' ';
+            Width--;
+        }
+    }
+    if (NeedPrefix)
+    {
+        Width--;
+        if (Base == 16)
+        {
+            Width--;
+        }
+    }
+
+    /* Generate full string in reverse order */
+
+    Pos = AcpiUtPutNumber (ReversedString, Number, Base, Upper);
+    i = ACPI_PTR_DIFF (Pos, ReversedString);
+
+    /* Printing 100 using %2d gives "100", not "00" */
+
+    if (i > Precision)
+    {
+        Precision = i;
+    }
+
+    Width -= Precision;
+
+    /* Output the string */
+
+    if (!(Type & (ACPI_FORMAT_ZERO | ACPI_FORMAT_LEFT)))
+    {
+        while (--Width >= 0)
+        {
+            String = AcpiUtBoundStringOutput (String, End, ' ');
+        }
+    }
+    if (Sign)
+    {
+        String = AcpiUtBoundStringOutput (String, End, Sign);
+    }
+    if (NeedPrefix)
+    {
+        String = AcpiUtBoundStringOutput (String, End, '0');
+        if (Base == 16)
+        {
+            String = AcpiUtBoundStringOutput (String, End,
+                        Upper ? 'X' : 'x');
+        }
+    }
+    if (!(Type & ACPI_FORMAT_LEFT))
+    {
+        while (--Width >= 0)
+        {
+            String = AcpiUtBoundStringOutput (String, End, Zero);
+        }
+    }
+
+    while (i <= --Precision)
+    {
+        String = AcpiUtBoundStringOutput (String, End, '0');
+    }
+    while (--i >= 0)
+    {
+        String = AcpiUtBoundStringOutput (String, End,
+                    ReversedString[i]);
+    }
+    while (--Width >= 0)
+    {
+        String = AcpiUtBoundStringOutput (String, End, ' ');
+    }
+
+    return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtVsnprintf
+ *
+ * PARAMETERS:  String              - String with boundary
+ *              Size                - Boundary of the string
+ *              Format              - Standard printf format
+ *              Args                - Argument list
+ *
+ * RETURN:      Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtVsnprintf (
+    char                    *String,
+    ACPI_SIZE               Size,
+    const char              *Format,
+    va_list                 Args)
+{
+    UINT8                   Base = 10;
+    UINT8                   Type = 0;
+    INT32                   Width = -1;
+    INT32                   Precision = -1;
+    char                    Qualifier = 0;
+    UINT64                  Number;
+    char                    *Pos;
+    char                    *End;
+    char                    c;
+    const char              *s;
+    const void              *p;
+    INT32                   Length;
+    int                     i;
+
+
+    Pos = String;
+    End = String + Size;
+
+    for (; *Format; ++Format)
+    {
+        if (*Format != '%')
+        {
+            Pos = AcpiUtBoundStringOutput (Pos, End, *Format);
+            continue;
+        }
+
+        /* Process sign */
+
+        do
+        {
+            ++Format;
+            if (*Format == '#')
+            {
+                Type |= ACPI_FORMAT_PREFIX;
+            }
+            else if (*Format == '0')
+            {
+                Type |= ACPI_FORMAT_ZERO;
+            }
+            else if (*Format == '+')
+            {
+                Type |= ACPI_FORMAT_SIGN_PLUS;
+            }
+            else if (*Format == ' ')
+            {
+                Type |= ACPI_FORMAT_SIGN_PLUS_SPACE;
+            }
+            else if (*Format == '-')
+            {
+                Type |= ACPI_FORMAT_LEFT;
+            }
+            else
+            {
+                break;
+            }
+        } while (1);
+
+        /* Process width */
+
+        Width = -1;
+        if (ACPI_IS_DIGIT (*Format))
+        {
+            Format = AcpiUtScanNumber (Format, &Number);
+            Width = (INT32) Number;
+        }
+        else if (*Format == '*')
+        {
+            ++Format;
+            Width = va_arg (Args, int);
+            if (Width < 0)
+            {
+                Width = -Width;
+                Type |= ACPI_FORMAT_LEFT;
+            }
+        }
+
+        /* Process precision */
+
+        Precision = -1;
+        if (*Format == '.')
+        {
+            ++Format;
+            if (ACPI_IS_DIGIT(*Format))
+            {
+                Format = AcpiUtScanNumber (Format, &Number);
+                Precision = (INT32) Number;
+            }
+            else if (*Format == '*')
+            {
+                ++Format;
+                Precision = va_arg (Args, int);
+            }
+            if (Precision < 0)
+            {
+                Precision = 0;
+            }
+        }
+
+        /* Process qualifier */
+
+        Qualifier = -1;
+        if (*Format == 'h' || *Format == 'l' || *Format == 'L')
+        {
+            Qualifier = *Format;
+            ++Format;
+
+            if (Qualifier == 'l' && *Format == 'l')
+            {
+                Qualifier = 'L';
+                ++Format;
+            }
+        }
+
+        switch (*Format)
+        {
+        case '%':
+
+            Pos = AcpiUtBoundStringOutput (Pos, End, '%');
+            continue;
+
+        case 'c':
+
+            if (!(Type & ACPI_FORMAT_LEFT))
+            {
+                while (--Width > 0)
+                {
+                    Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+                }
+            }
+
+            c = (char) va_arg (Args, int);
+            Pos = AcpiUtBoundStringOutput (Pos, End, c);
+
+            while (--Width > 0)
+            {
+                Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+            }
+            continue;
+
+        case 's':
+
+            s = va_arg (Args, char *);
+            if (!s)
+            {
+                s = "<NULL>";
+            }
+            Length = AcpiUtBoundStringLength (s, Precision);
+            if (!(Type & ACPI_FORMAT_LEFT))
+            {
+                while (Length < Width--)
+                {
+                    Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+                }
+            }
+            for (i = 0; i < Length; ++i)
+            {
+                Pos = AcpiUtBoundStringOutput (Pos, End, *s);
+                ++s;
+            }
+            while (Length < Width--)
+            {
+                Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+            }
+            continue;
+
+        case 'o':
+
+            Base = 8;
+            break;
+
+        case 'X':
+
+            Type |= ACPI_FORMAT_UPPER;
+
+        case 'x':
+
+            Base = 16;
+            break;
+
+        case 'd':
+        case 'i':
+
+            Type |= ACPI_FORMAT_SIGN;
+
+        case 'u':
+
+            break;
+
+        case 'p':
+
+            if (Width == -1)
+            {
+                Width = 2 * sizeof (void *);
+                Type |= ACPI_FORMAT_ZERO;
+            }
+
+            p = va_arg (Args, void *);
+            Pos = AcpiUtFormatNumber (Pos, End,
+                    ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
+            continue;
+
+        default:
+
+            Pos = AcpiUtBoundStringOutput (Pos, End, '%');
+            if (*Format)
+            {
+                Pos = AcpiUtBoundStringOutput (Pos, End, *Format);
+            }
+            else
+            {
+                --Format;
+            }
+            continue;
+        }
+
+        if (Qualifier == 'L')
+        {
+            Number = va_arg (Args, UINT64);
+            if (Type & ACPI_FORMAT_SIGN)
+            {
+                Number = (INT64) Number;
+            }
+        }
+        else if (Qualifier == 'l')
+        {
+            Number = va_arg (Args, unsigned long);
+            if (Type & ACPI_FORMAT_SIGN)
+            {
+                Number = (INT32) Number;
+            }
+        }
+        else if (Qualifier == 'h')
+        {
+            Number = (UINT16) va_arg (Args, int);
+            if (Type & ACPI_FORMAT_SIGN)
+            {
+                Number = (INT16) Number;
+            }
+        }
+        else
+        {
+            Number = va_arg (Args, unsigned int);
+            if (Type & ACPI_FORMAT_SIGN)
+            {
+                Number = (signed int) Number;
+            }
+        }
+
+        Pos = AcpiUtFormatNumber (Pos, End, Number, Base,
+                Width, Precision, Type);
+    }
+
+    if (Size > 0)
+    {
+        if (Pos < End)
+        {
+            *Pos = '\0';
+        }
+        else
+        {
+            End[-1] = '\0';
+        }
+    }
+
+    return (ACPI_PTR_DIFF (Pos, String));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtSnprintf
+ *
+ * PARAMETERS:  String              - String with boundary
+ *              Size                - Boundary of the string
+ *              Format, ...         - Standard printf format
+ *
+ * RETURN:      Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtSnprintf (
+    char                    *String,
+    ACPI_SIZE               Size,
+    const char              *Format,
+    ...)
+{
+    va_list                 Args;
+    int                     Length;
+
+
+    va_start (Args, Format);
+    Length = AcpiUtVsnprintf (String, Size, Format, Args);
+    va_end (Args);
+
+    return (Length);
+}
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtFileVprintf
+ *
+ * PARAMETERS:  File                - File descriptor
+ *              Format              - Standard printf format
+ *              Args                - Argument list
+ *
+ * RETURN:      Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a file using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtFileVprintf (
+    ACPI_FILE               File,
+    const char              *Format,
+    va_list                 Args)
+{
+    ACPI_CPU_FLAGS          Flags;
+    int                     Length;
+
+
+    Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
+    Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
+                sizeof (AcpiGbl_PrintBuffer), Format, Args);
+
+    (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
+    AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
+
+    return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtFilePrintf
+ *
+ * PARAMETERS:  File                - File descriptor
+ *              Format, ...         - Standard printf format
+ *
+ * RETURN:      Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a file.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtFilePrintf (
+    ACPI_FILE               File,
+    const char              *Format,
+    ...)
+{
+    va_list                 Args;
+    int                     Length;
+
+
+    va_start (Args, Format);
+    Length = AcpiUtFileVprintf (File, Format, Args);
+    va_end (Args);
+
+    return (Length);
+}
+#endif
index f5af86f..3569fcf 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTRESRC_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acresrc.h"
@@ -172,7 +169,9 @@ const char                      *AcpiGbl_IoDecode[] =
 const char                      *AcpiGbl_LlDecode[] =
 {
     "ActiveHigh",
 const char                      *AcpiGbl_LlDecode[] =
 {
     "ActiveHigh",
-    "ActiveLow"
+    "ActiveLow",
+    "ActiveBoth",
+    "Reserved"
 };
 
 const char                      *AcpiGbl_MaxDecode[] =
 };
 
 const char                      *AcpiGbl_MaxDecode[] =
@@ -371,7 +370,7 @@ const char                      *AcpiGbl_BpbDecode[] =
 
 const char                      *AcpiGbl_SbDecode[] =
 {
 
 const char                      *AcpiGbl_SbDecode[] =
 {
-    "StopBitsNone",
+    "StopBitsZero",
     "StopBitsOne",
     "StopBitsOnePlusHalf",
     "StopBitsTwo"
     "StopBitsOne",
     "StopBitsOnePlusHalf",
     "StopBitsTwo"
index fc99c56..cf96d8e 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTSTATE_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
index c4ead02..2d218c3 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTSTRING_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
index df04aa3..43a993a 100644 (file)
  * occurs in the body of AcpiUtFree.
  */
 
  * occurs in the body of AcpiUtFree.
  */
 
-#define __UTTRACK_C__
-
 #include "acpi.h"
 #include "accommon.h"
 
 #include "acpi.h"
 #include "accommon.h"
 
diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utuuid.c b/reactos/drivers/bus/acpi/acpica/utilities/utuuid.c
new file mode 100644 (file)
index 0000000..65338cc
--- /dev/null
@@ -0,0 +1,173 @@
+/******************************************************************************
+ *
+ * Module Name: utuuid -- UUID support functions
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("utuuid")
+
+
+/*
+ * UUID support functions.
+ *
+ * This table is used to convert an input UUID ascii string to a 16 byte
+ * buffer and the reverse. The table maps a UUID buffer index 0-15 to
+ * the index within the 36-byte UUID string where the associated 2-byte
+ * hex value can be found.
+ *
+ * 36-byte UUID strings are of the form:
+ *     aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
+ * Where aa-pp are one byte hex numbers, made up of two hex digits
+ *
+ * Note: This table is basically the inverse of the string-to-offset table
+ * found in the ACPI spec in the description of the ToUUID macro.
+ */
+const UINT8    AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH] =
+{
+    6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtConvertStringToUuid
+ *
+ * PARAMETERS:  InString            - 36-byte formatted UUID string
+ *              UuidBuffer          - Where the 16-byte UUID buffer is returned
+ *
+ * RETURN:      None. Output data is returned in the UuidBuffer
+ *
+ * DESCRIPTION: Convert a 36-byte formatted UUID string to 16-byte UUID buffer
+ *
+ ******************************************************************************/
+
+void
+AcpiUtConvertStringToUuid (
+    char                    *InString,
+    UINT8                   *UuidBuffer)
+{
+    UINT32                  i;
+
+
+    for (i = 0; i < UUID_BUFFER_LENGTH; i++)
+    {
+        UuidBuffer[i] =
+            (AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
+
+        UuidBuffer[i] |=
+            AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
+    }
+}
index e915b84..7f2752c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTXFACE_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
@@ -694,7 +692,9 @@ AcpiDecodePldBuffer (
     ACPI_MOVE_32_TO_32 (&Dword, &Buffer[0]);
     PldInfo->Revision =             ACPI_PLD_GET_REVISION (&Dword);
     PldInfo->IgnoreColor =          ACPI_PLD_GET_IGNORE_COLOR (&Dword);
     ACPI_MOVE_32_TO_32 (&Dword, &Buffer[0]);
     PldInfo->Revision =             ACPI_PLD_GET_REVISION (&Dword);
     PldInfo->IgnoreColor =          ACPI_PLD_GET_IGNORE_COLOR (&Dword);
-    PldInfo->Color =                ACPI_PLD_GET_COLOR (&Dword);
+    PldInfo->Red =                  ACPI_PLD_GET_RED (&Dword);
+    PldInfo->Green =                ACPI_PLD_GET_GREEN (&Dword);
+    PldInfo->Blue =                 ACPI_PLD_GET_BLUE (&Dword);
 
     /* Second 32-bit DWord */
 
 
     /* Second 32-bit DWord */
 
index af396c6..7b11f4c 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTXFERROR_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
  * tools/applications.
  */
 
  * tools/applications.
  */
 
+#ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiError
 /*******************************************************************************
  *
  * FUNCTION:    AcpiError
@@ -362,3 +363,5 @@ AcpiBiosWarning (
 }
 
 ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
 }
 
 ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
index b9b1326..a50cc55 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-
-#define __UTXFINIT_C__
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define EXPORT_ACPI_INTERFACES
 
 #include "acpi.h"
 #define _COMPONENT          ACPI_UTILITIES
         ACPI_MODULE_NAME    ("utxfinit")
 
 #define _COMPONENT          ACPI_UTILITIES
         ACPI_MODULE_NAME    ("utxfinit")
 
+/* For AcpiExec only */
+void
+AeDoObjectOverrides (
+    void);
+
 
 /*******************************************************************************
  *
 
 /*******************************************************************************
  *
@@ -382,6 +385,14 @@ AcpiInitializeObjects (
         }
     }
 
         }
     }
 
+#ifdef ACPI_EXEC_APP
+    /*
+     * This call implements the "initialization file" option for AcpiExec.
+     * This is the precise point that we want to perform the overrides.
+     */
+    AeDoObjectOverrides ();
+#endif
+
     /*
      * Execute any module-level code that was detected during the table load
      * phase. Although illegal since ACPI 2.0, there are many machines that
     /*
      * Execute any module-level code that was detected during the table load
      * phase. Although illegal since ACPI 2.0, there are many machines that
index 52ca318..5fc2b32 100644 (file)
  *
  *****************************************************************************/
 
  *
  *****************************************************************************/
 
-#define __UTXFMUTEX_C__
-
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"
 #include "acpi.h"
 #include "accommon.h"
 #include "acnamesp.h"