[ACPICA]
authorThomas Faber <thomas.faber@reactos.org>
Thu, 31 Dec 2015 14:25:35 +0000 (14:25 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Thu, 31 Dec 2015 14:25:35 +0000 (14:25 +0000)
- Update to version 20151218
CORE-10765

svn path=/trunk/; revision=70472

160 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/dsdebug.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/evevent.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/evgpeutil.c
reactos/drivers/bus/acpi/acpica/events/evhandler.c
reactos/drivers/bus/acpi/acpica/events/evmisc.c
reactos/drivers/bus/acpi/acpica/events/evregion.c
reactos/drivers/bus/acpi/acpica/events/evrgnini.c
reactos/drivers/bus/acpi/acpica/events/evsci.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/extrace.c [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/executer/exutils.c
reactos/drivers/bus/acpi/acpica/hardware/hwacpi.c
reactos/drivers/bus/acpi/acpica/hardware/hwesleep.c
reactos/drivers/bus/acpi/acpica/hardware/hwgpe.c
reactos/drivers/bus/acpi/acpica/hardware/hwregs.c
reactos/drivers/bus/acpi/acpica/hardware/hwsleep.c
reactos/drivers/bus/acpi/acpica/hardware/hwxface.c
reactos/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
reactos/drivers/bus/acpi/acpica/include/acapps.h
reactos/drivers/bus/acpi/acpica/include/acdebug.h
reactos/drivers/bus/acpi/acpica/include/acdisasm.h
reactos/drivers/bus/acpi/acpica/include/acevents.h
reactos/drivers/bus/acpi/acpica/include/acexcep.h
reactos/drivers/bus/acpi/acpica/include/acglobal.h
reactos/drivers/bus/acpi/acpica/include/aclocal.h
reactos/drivers/bus/acpi/acpica/include/acmacros.h
reactos/drivers/bus/acpi/acpica/include/acnamesp.h
reactos/drivers/bus/acpi/acpica/include/acobject.h
reactos/drivers/bus/acpi/acpica/include/acopcode.h
reactos/drivers/bus/acpi/acpica/include/acparser.h
reactos/drivers/bus/acpi/acpica/include/acpiosxf.h
reactos/drivers/bus/acpi/acpica/include/acpixf.h
reactos/drivers/bus/acpi/acpica/include/actables.h
reactos/drivers/bus/acpi/acpica/include/actypes.h
reactos/drivers/bus/acpi/acpica/include/acutils.h
reactos/drivers/bus/acpi/acpica/include/amlcode.h
reactos/drivers/bus/acpi/acpica/include/platform/aclinux.h
reactos/drivers/bus/acpi/acpica/include/platform/aclinuxex.h
reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c
reactos/drivers/bus/acpi/acpica/namespace/nsalloc.c
reactos/drivers/bus/acpi/acpica/namespace/nsarguments.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/psparse.c
reactos/drivers/bus/acpi/acpica/parser/psscope.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/rslist.c
reactos/drivers/bus/acpi/acpica/resources/rsmisc.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/utcache.c
reactos/drivers/bus/acpi/acpica/utilities/utcopy.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/utfileio.c [deleted file]
reactos/drivers/bus/acpi/acpica/utilities/uthex.c
reactos/drivers/bus/acpi/acpica/utilities/utids.c
reactos/drivers/bus/acpi/acpica/utilities/utinit.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/utnonansi.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
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
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 a4dc55d..2a78232 100644 (file)
@@ -61,6 +61,7 @@ list(APPEND ACPICA_SOURCE
     acpica/executer/exstoren.c
     acpica/executer/exstorob.c
     acpica/executer/exsystem.c
+    acpica/executer/extrace.c
     acpica/executer/exutils.c
     acpica/hardware/hwacpi.c
     acpica/hardware/hwesleep.c
index 344e55e..6343d32 100644 (file)
@@ -186,7 +186,7 @@ AcpiDsExecuteArguments (
     }
 
     Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
-                    AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
+        AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
     if (ACPI_FAILURE (Status))
     {
         AcpiDsDeleteWalkState (WalkState);
@@ -233,7 +233,7 @@ AcpiDsExecuteArguments (
     /* Execute the opcode and arguments */
 
     Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
-                    AmlLength, NULL, ACPI_IMODE_EXECUTE);
+        AmlLength, NULL, ACPI_IMODE_EXECUTE);
     if (ACPI_FAILURE (Status))
     {
         AcpiDsDeleteWalkState (WalkState);
@@ -286,8 +286,8 @@ AcpiDsGetBufferFieldArguments (
     ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
     Node = ObjDesc->BufferField.Node;
 
-    ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD,
-        Node, NULL));
+    ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
+        ACPI_TYPE_BUFFER_FIELD, Node, NULL));
 
     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
         AcpiUtGetNodeName (Node)));
@@ -295,7 +295,7 @@ AcpiDsGetBufferFieldArguments (
     /* Execute the AML code for the TermArg arguments */
 
     Status = AcpiDsExecuteArguments (Node, Node->Parent,
-                ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
+        ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
     return_ACPI_STATUS (Status);
 }
 
@@ -335,8 +335,8 @@ AcpiDsGetBankFieldArguments (
     ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
     Node = ObjDesc->BankField.Node;
 
-    ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_LOCAL_BANK_FIELD,
-        Node, NULL));
+    ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
+        ACPI_TYPE_LOCAL_BANK_FIELD, Node, NULL));
 
     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
         AcpiUtGetNodeName (Node)));
@@ -344,7 +344,7 @@ AcpiDsGetBankFieldArguments (
     /* Execute the AML code for the TermArg arguments */
 
     Status = AcpiDsExecuteArguments (Node, Node->Parent,
-                ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
+        ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
     return_ACPI_STATUS (Status);
 }
 
@@ -384,7 +384,8 @@ AcpiDsGetBufferArguments (
     if (!Node)
     {
         ACPI_ERROR ((AE_INFO,
-            "No pointer back to namespace node in buffer object %p", ObjDesc));
+            "No pointer back to namespace node in buffer object %p",
+            ObjDesc));
         return_ACPI_STATUS (AE_AML_INTERNAL);
     }
 
@@ -393,7 +394,7 @@ AcpiDsGetBufferArguments (
     /* Execute the AML code for the TermArg arguments */
 
     Status = AcpiDsExecuteArguments (Node, Node,
-                ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
+        ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
     return_ACPI_STATUS (Status);
 }
 
@@ -442,7 +443,7 @@ AcpiDsGetPackageArguments (
     /* Execute the AML code for the TermArg arguments */
 
     Status = AcpiDsExecuteArguments (Node, Node,
-                ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
+        ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
     return_ACPI_STATUS (Status);
 }
 
@@ -487,22 +488,23 @@ AcpiDsGetRegionArguments (
 
     Node = ObjDesc->Region.Node;
 
-    ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL));
+    ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
+        ACPI_TYPE_REGION, Node, NULL));
 
-    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
+    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+        "[%4.4s] OpRegion Arg Init at AML %p\n",
         AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
 
     /* Execute the argument AML */
 
     Status = AcpiDsExecuteArguments (Node, ExtraDesc->Extra.ScopeNode,
-                ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
+        ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
     }
 
     Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId,
-                 ObjDesc->Region.Address, ObjDesc->Region.Length,
-                 Node);
+        ObjDesc->Region.Address, ObjDesc->Region.Length, Node);
     return_ACPI_STATUS (Status);
 }
index a069ed5..270cf0e 100644 (file)
 #include "amlcode.h"
 #include "acdispat.h"
 #include "acinterp.h"
+#include "acdebug.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
         ACPI_MODULE_NAME    ("dscontrol")
@@ -191,9 +192,12 @@ AcpiDsExecBeginControlOp (
          * Save a pointer to the predicate for multiple executions
          * of a loop
          */
-        ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
-        ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
-        ControlState->Control.Opcode = Op->Common.AmlOpcode;
+        ControlState->Control.AmlPredicateStart =
+            WalkState->ParserState.Aml - 1;
+        ControlState->Control.PackageEnd =
+            WalkState->ParserState.PkgEnd;
+        ControlState->Control.Opcode =
+            Op->Common.AmlOpcode;
 
 
         /* Push the control state on this walk's control stack */
@@ -304,7 +308,8 @@ AcpiDsExecEndControlOp (
              * another time
              */
             Status = AE_CTRL_PENDING;
-            WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
+            WalkState->AmlLastWhile =
+                ControlState->Control.AmlPredicateStart;
             break;
         }
 
@@ -348,7 +353,8 @@ AcpiDsExecEndControlOp (
              * an arg or local), resolve it now because it may
              * cease to exist at the end of the method.
              */
-            Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
+            Status = AcpiExResolveToValue (
+                &WalkState->Operands [0], WalkState);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -377,11 +383,15 @@ AcpiDsExecEndControlOp (
              * Allow references created by the Index operator to return
              * unchanged.
              */
-            if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
-                ((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
-                ((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
+            if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) ==
+                    ACPI_DESC_TYPE_OPERAND) &&
+                ((WalkState->Results->Results.ObjDesc [0])->Common.Type ==
+                    ACPI_TYPE_LOCAL_REFERENCE) &&
+                ((WalkState->Results->Results.ObjDesc [0])->Reference.Class !=
+                    ACPI_REFCLASS_INDEX))
             {
-                Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
+                Status = AcpiExResolveToValue (
+                    &WalkState->Results->Results.ObjDesc [0], WalkState);
                 if (ACPI_FAILURE (Status))
                 {
                     return (Status);
@@ -399,9 +409,9 @@ AcpiDsExecEndControlOp (
                 AcpiUtRemoveReference (WalkState->Operands [0]);
             }
 
-            WalkState->Operands [0]     = NULL;
-            WalkState->NumOperands      = 0;
-            WalkState->ReturnDesc       = NULL;
+            WalkState->Operands[0] = NULL;
+            WalkState->NumOperands = 0;
+            WalkState->ReturnDesc = NULL;
         }
 
 
@@ -422,20 +432,12 @@ AcpiDsExecEndControlOp (
 
     case AML_BREAK_POINT_OP:
 
-        /*
-         * Set the single-step flag. This will cause the debugger (if present)
-         * to break to the console within the AML debugger at the start of the
-         * next AML instruction.
-         */
-        ACPI_DEBUGGER_EXEC (
-            AcpiGbl_CmSingleStep = TRUE);
-        ACPI_DEBUGGER_EXEC (
-            AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
+        AcpiDbSignalBreakPoint (WalkState);
 
         /* Call to the OSL in case OS wants a piece of the action */
 
         Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
-                    "Executed AML Breakpoint opcode");
+            "Executed AML Breakpoint opcode");
         break;
 
     case AML_BREAK_OP:
@@ -459,7 +461,8 @@ AcpiDsExecEndControlOp (
 
         /* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
 
-        WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
+        WalkState->AmlLastWhile =
+            WalkState->ControlState->Control.PackageEnd;
 
         /* Return status depending on opcode */
 
index 80b3e0c..02fdebc 100644 (file)
@@ -247,6 +247,7 @@ AcpiDsDumpMethodStack (
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
         "\n**** Exception %s during execution of method ",
         AcpiFormatException (Status)));
+
     AcpiDsPrintNodePathname (WalkState->MethodNode, NULL);
 
     /* Display stack of executing methods */
@@ -263,8 +264,8 @@ AcpiDsDumpMethodStack (
         if (MethodDesc)
         {
             AcpiExStopTraceMethod (
-                    (ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
-                    MethodDesc, WalkState);
+                (ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
+                MethodDesc, WalkState);
         }
 
         ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
@@ -292,8 +293,8 @@ AcpiDsDumpMethodStack (
         {
             /*
              * This method has called another method
-             * NOTE: the method call parse subtree is already deleted at this
-             * point, so we cannot disassemble the method invocation.
+             * NOTE: the method call parse subtree is already deleted at
+             * this point, so we cannot disassemble the method invocation.
              */
             ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Call to method "));
             AcpiDsPrintNodePathname (PreviousMethod, NULL);
index cf8c189..b2d5cfd 100644 (file)
@@ -187,6 +187,7 @@ AcpiDsCreateExternalRegion (
      * insert the name into the namespace.
      */
     AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
+
     Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
        ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
     if (ACPI_FAILURE (Status))
@@ -282,7 +283,7 @@ AcpiDsCreateBufferField (
         /* Creating new namespace node, should not already exist */
 
         Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
-                ACPI_NS_ERROR_IF_FOUND;
+            ACPI_NS_ERROR_IF_FOUND;
 
         /*
          * Mark node temporary if we are executing a normal control
@@ -296,9 +297,9 @@ AcpiDsCreateBufferField (
 
         /* Enter the NameString into the namespace */
 
-        Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
-                    ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
-                    Flags, WalkState, &Node);
+        Status = AcpiNsLookup (WalkState->ScopeInfo,
+            Arg->Common.Value.String, ACPI_TYPE_ANY,
+            ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
         if (ACPI_FAILURE (Status))
         {
             ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
@@ -339,13 +340,13 @@ AcpiDsCreateBufferField (
     }
 
     /*
-     * Remember location in AML stream of the field unit opcode and operands --
-     * since the buffer and index operands must be evaluated.
+     * Remember location in AML stream of the field unit opcode and operands
+     * -- since the buffer and index operands must be evaluated.
      */
-    SecondDesc                  = ObjDesc->Common.NextObject;
-    SecondDesc->Extra.AmlStart  = Op->Named.Data;
+    SecondDesc = ObjDesc->Common.NextObject;
+    SecondDesc->Extra.AmlStart = Op->Named.Data;
     SecondDesc->Extra.AmlLength = Op->Named.Length;
-    ObjDesc->BufferField.Node   = Node;
+    ObjDesc->BufferField.Node = Node;
 
     /* Attach constructed field descriptors to parent node */
 
@@ -413,8 +414,8 @@ AcpiDsGetFieldNames (
         {
         case AML_INT_RESERVEDFIELD_OP:
 
-            Position = (UINT64) Info->FieldBitPosition
-                        + (UINT64) Arg->Common.Value.Size;
+            Position = (UINT64) Info->FieldBitPosition +
+                (UINT64) Arg->Common.Value.Size;
 
             if (Position > ACPI_UINT32_MAX)
             {
@@ -447,11 +448,13 @@ AcpiDsGetFieldNames (
 
             /* AccessAttribute (AttribQuick, AttribByte, etc.) */
 
-            Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF);
+            Info->Attribute = (UINT8)
+                ((Arg->Common.Value.Integer >> 8) & 0xFF);
 
             /* AccessLength (for serial/buffer protocols) */
 
-            Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF);
+            Info->AccessLength = (UINT8)
+                ((Arg->Common.Value.Integer >> 16) & 0xFF);
             break;
 
         case AML_INT_CONNECTION_OP:
@@ -478,9 +481,9 @@ AcpiDsGetFieldNames (
                 /* Lookup the Connection() namepath, it should already exist */
 
                 Status = AcpiNsLookup (WalkState->ScopeInfo,
-                            Child->Common.Value.Name, ACPI_TYPE_ANY,
-                            ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
-                            WalkState, &Info->ConnectionNode);
+                    Child->Common.Value.Name, ACPI_TYPE_ANY,
+                    ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
+                    WalkState, &Info->ConnectionNode);
                 if (ACPI_FAILURE (Status))
                 {
                     ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status);
@@ -494,9 +497,9 @@ AcpiDsGetFieldNames (
             /* Lookup the name, it should already exist */
 
             Status = AcpiNsLookup (WalkState->ScopeInfo,
-                        (char *) &Arg->Named.Name, Info->FieldType,
-                        ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
-                        WalkState, &Info->FieldNode);
+                (char *) &Arg->Named.Name, Info->FieldType,
+                ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
+                WalkState, &Info->FieldNode);
             if (ACPI_FAILURE (Status))
             {
                 ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status);
@@ -525,8 +528,8 @@ AcpiDsGetFieldNames (
 
             /* Keep track of bit position for the next field */
 
-            Position = (UINT64) Info->FieldBitPosition
-                        + (UINT64) Arg->Common.Value.Size;
+            Position = (UINT64) Info->FieldBitPosition +
+                (UINT64) Arg->Common.Value.Size;
 
             if (Position > ACPI_UINT32_MAX)
             {
@@ -543,7 +546,8 @@ AcpiDsGetFieldNames (
         default:
 
             ACPI_ERROR ((AE_INFO,
-                "Invalid opcode in field list: 0x%X", Arg->Common.AmlOpcode));
+                "Invalid opcode in field list: 0x%X",
+                Arg->Common.AmlOpcode));
             return_ACPI_STATUS (AE_AML_BAD_OPCODE);
         }
 
@@ -589,8 +593,8 @@ AcpiDsCreateField (
     if (!RegionNode)
     {
         Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
-                        ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
-                        ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
+            ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
+            ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
 #ifdef ACPI_ASL_COMPILER
         Status = AcpiDsCreateExternalRegion (Status, Arg,
             Arg->Common.Value.Name, WalkState, &RegionNode);
@@ -696,7 +700,7 @@ AcpiDsInitFieldObjects (
     /* Creating new namespace node(s), should not already exist */
 
     Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
-            ACPI_NS_ERROR_IF_FOUND;
+        ACPI_NS_ERROR_IF_FOUND;
 
     /*
      * Mark node(s) temporary if we are executing a normal control
@@ -721,8 +725,8 @@ AcpiDsInitFieldObjects (
         if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
         {
             Status = AcpiNsLookup (WalkState->ScopeInfo,
-                        (char *) &Arg->Named.Name, Type, ACPI_IMODE_LOAD_PASS1,
-                        Flags, WalkState, &Node);
+                (char *) &Arg->Named.Name, Type, ACPI_IMODE_LOAD_PASS1,
+                Flags, WalkState, &Node);
             if (ACPI_FAILURE (Status))
             {
                 ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status);
@@ -782,8 +786,8 @@ AcpiDsCreateBankField (
     if (!RegionNode)
     {
         Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
-                        ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
-                        ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
+            ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
+            ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
 #ifdef ACPI_ASL_COMPILER
         Status = AcpiDsCreateExternalRegion (Status, Arg,
             Arg->Common.Value.Name, WalkState, &RegionNode);
@@ -799,8 +803,8 @@ AcpiDsCreateBankField (
 
     Arg = Arg->Common.Next;
     Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
-                    ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
-                    ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
+        ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+        ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
     if (ACPI_FAILURE (Status))
     {
         ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
@@ -826,11 +830,12 @@ AcpiDsCreateBankField (
 
     /*
      * Use Info.DataRegisterNode to store BankField Op
-     * It's safe because DataRegisterNode will never be used when create bank field
-     * We store AmlStart and AmlLength in the BankField Op for late evaluation
-     * Used in AcpiExPrepFieldValue(Info)
+     * It's safe because DataRegisterNode will never be used when create
+     * bank field \we store AmlStart and AmlLength in the BankField Op for
+     * late evaluation. Used in AcpiExPrepFieldValue(Info)
      *
-     * TBD: Or, should we add a field in ACPI_CREATE_FIELD_INFO, like "void *ParentOp"?
+     * TBD: Or, should we add a field in ACPI_CREATE_FIELD_INFO, like
+     * "void *ParentOp"?
      */
     Info.DataRegisterNode = (ACPI_NAMESPACE_NODE*) Op;
 
@@ -871,8 +876,8 @@ AcpiDsCreateIndexField (
 
     Arg = Op->Common.Value.Arg;
     Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
-                    ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
-                    ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
+        ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+        ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
     if (ACPI_FAILURE (Status))
     {
         ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
@@ -883,8 +888,8 @@ AcpiDsCreateIndexField (
 
     Arg = Arg->Common.Next;
     Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
-                    ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
-                    ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode);
+        ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+        ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode);
     if (ACPI_FAILURE (Status))
     {
         ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
index d24cc01..e153717 100644 (file)
@@ -314,7 +314,7 @@ AcpiDsInitializeObjects (
      * the namespace reader lock.
      */
     Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX,
-                ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL);
+        ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL);
     if (ACPI_FAILURE (Status))
     {
         ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
@@ -331,17 +331,19 @@ AcpiDsInitializeObjects (
 
     if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
     {
-        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "\nInitializing Namespace objects:\n"));
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
+            "\nInitializing Namespace objects:\n"));
     }
 
     /* Summary of objects initialized */
 
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
-        "Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, "
+        "Table [%4.4s: %-8.8s] (id %.2X) - %4u Objects with %3u Devices, "
         "%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
-        Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount, Info.DeviceCount,
-        Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
-        Info.NonSerialMethodCount, Info.SerializedMethodCount));
+        Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount,
+        Info.DeviceCount,Info.OpRegionCount, Info.MethodCount,
+        Info.SerialMethodCount, Info.NonSerialMethodCount,
+        Info.SerializedMethodCount));
 
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
         Info.MethodCount, Info.OpRegionCount));
index 10c3548..0436ee1 100644 (file)
@@ -199,8 +199,8 @@ AcpiDsAutoSerializeMethod (
         return_ACPI_STATUS (AE_NO_MEMORY);
     }
 
-    Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
-                ObjDesc->Method.AmlLength, NULL, 0);
+    Status = AcpiDsInitAmlWalk (WalkState, Op, Node,
+        ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, 0);
     if (ACPI_FAILURE (Status))
     {
         AcpiDsDeleteWalkState (WalkState);
@@ -323,12 +323,12 @@ AcpiDsMethodError (
          * AE_OK, in which case the executing method will not be aborted.
          */
         AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
-                        WalkState->ParserState.AmlStart);
+            WalkState->ParserState.AmlStart);
 
         Status = AcpiGbl_ExceptionHandler (Status,
-                    WalkState->MethodNode ?
-                        WalkState->MethodNode->Name.Integer : 0,
-                    WalkState->Opcode, AmlOffset, NULL);
+            WalkState->MethodNode ?
+                WalkState->MethodNode->Name.Integer : 0,
+            WalkState->Opcode, AmlOffset, NULL);
         AcpiExEnterInterpreter ();
     }
 
@@ -472,10 +472,12 @@ AcpiDsBeginMethodExecution (
          */
         if (WalkState &&
             (!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
-            (WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel))
+            (WalkState->Thread->CurrentSyncLevel >
+                ObjDesc->Method.Mutex->Mutex.SyncLevel))
         {
             ACPI_ERROR ((AE_INFO,
-                "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)",
+                "Cannot acquire Mutex for method [%4.4s]"
+                ", current SyncLevel is too large (%u)",
                 AcpiUtGetNodeName (MethodNode),
                 WalkState->Thread->CurrentSyncLevel));
 
@@ -488,14 +490,15 @@ AcpiDsBeginMethodExecution (
          */
         if (!WalkState ||
             !ObjDesc->Method.Mutex->Mutex.ThreadId ||
-            (WalkState->Thread->ThreadId != ObjDesc->Method.Mutex->Mutex.ThreadId))
+            (WalkState->Thread->ThreadId !=
+                ObjDesc->Method.Mutex->Mutex.ThreadId))
         {
             /*
              * Acquire the method mutex. This releases the interpreter if we
              * block (and reacquires it before it returns)
              */
-            Status = AcpiExSystemWaitMutex (ObjDesc->Method.Mutex->Mutex.OsMutex,
-                        ACPI_WAIT_FOREVER);
+            Status = AcpiExSystemWaitMutex (
+                ObjDesc->Method.Mutex->Mutex.OsMutex, ACPI_WAIT_FOREVER);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -508,8 +511,22 @@ AcpiDsBeginMethodExecution (
                 ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
                     WalkState->Thread->CurrentSyncLevel;
 
-                ObjDesc->Method.Mutex->Mutex.ThreadId = WalkState->Thread->ThreadId;
-                WalkState->Thread->CurrentSyncLevel = ObjDesc->Method.SyncLevel;
+                ObjDesc->Method.Mutex->Mutex.ThreadId =
+                    WalkState->Thread->ThreadId;
+
+                /*
+                 * Update the current SyncLevel only if this is not an auto-
+                 * serialized method. In the auto case, we have to ignore
+                 * the sync level for the method mutex (created for the
+                 * auto-serialization) because we have no idea of what the
+                 * sync level should be. Therefore, just ignore it.
+                 */
+                if (!(ObjDesc->Method.InfoFlags &
+                    ACPI_METHOD_IGNORE_SYNC_LEVEL))
+                {
+                    WalkState->Thread->CurrentSyncLevel =
+                        ObjDesc->Method.SyncLevel;
+                }
             }
             else
             {
@@ -587,7 +604,8 @@ AcpiDsCallControlMethod (
 
     ACPI_FUNCTION_TRACE_PTR (DsCallControlMethod, ThisWalkState);
 
-    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Calling method %p, currentstate=%p\n",
+    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+        "Calling method %p, currentstate=%p\n",
         ThisWalkState->PrevOp, ThisWalkState));
 
     /*
@@ -607,8 +625,8 @@ AcpiDsCallControlMethod (
 
     /* Init for new method, possibly wait on method mutex */
 
-    Status = AcpiDsBeginMethodExecution (MethodNode, ObjDesc,
-                ThisWalkState);
+    Status = AcpiDsBeginMethodExecution (
+        MethodNode, ObjDesc, ThisWalkState);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -616,8 +634,8 @@ AcpiDsCallControlMethod (
 
     /* Begin method parse/execution. Create a new walk state */
 
-    NextWalkState = AcpiDsCreateWalkState (ObjDesc->Method.OwnerId,
-                        NULL, ObjDesc, Thread);
+    NextWalkState = AcpiDsCreateWalkState (
+        ObjDesc->Method.OwnerId, NULL, ObjDesc, Thread);
     if (!NextWalkState)
     {
         Status = AE_NO_MEMORY;
@@ -646,8 +664,8 @@ AcpiDsCallControlMethod (
     Info->Parameters = &ThisWalkState->Operands[0];
 
     Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode,
-                ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,
-                Info, ACPI_IMODE_EXECUTE);
+        ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,
+        Info, ACPI_IMODE_EXECUTE);
 
     ACPI_FREE (Info);
     if (ACPI_FAILURE (Status))
@@ -842,7 +860,8 @@ AcpiDsTerminateControlMethod (
                 WalkState->Thread->CurrentSyncLevel =
                     MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel;
 
-                AcpiOsReleaseMutex (MethodDesc->Method.Mutex->Mutex.OsMutex);
+                AcpiOsReleaseMutex (
+                    MethodDesc->Method.Mutex->Mutex.OsMutex);
                 MethodDesc->Method.Mutex->Mutex.ThreadId = 0;
             }
         }
@@ -872,7 +891,8 @@ AcpiDsTerminateControlMethod (
             if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
             {
                 AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
-                MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_MODIFIED_NAMESPACE;
+                MethodDesc->Method.InfoFlags &=
+                    ~ACPI_METHOD_MODIFIED_NAMESPACE;
             }
         }
     }
@@ -920,7 +940,8 @@ AcpiDsTerminateControlMethod (
             if (WalkState)
             {
                 ACPI_INFO ((AE_INFO,
-                    "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
+                    "Marking method %4.4s as Serialized "
+                    "because of AE_ALREADY_EXISTS error",
                     WalkState->MethodNode->Name.Ascii));
             }
 
@@ -935,7 +956,9 @@ AcpiDsTerminateControlMethod (
              * marking the method permanently as Serialized when the last
              * thread exits here.
              */
-            MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING;
+            MethodDesc->Method.InfoFlags &=
+                ~ACPI_METHOD_SERIALIZED_PENDING;
+
             MethodDesc->Method.InfoFlags |=
                 (ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
             MethodDesc->Method.SyncLevel = 0;
@@ -950,7 +973,7 @@ AcpiDsTerminateControlMethod (
     }
 
     AcpiExStopTraceMethod ((ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
-            MethodDesc, WalkState);
+        MethodDesc, WalkState);
 
     return_VOID;
 }
index 2b7fce2..04892a6 100644 (file)
@@ -182,7 +182,9 @@ AcpiDsMethodDataInit (
 
     for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
     {
-        ACPI_MOVE_32_TO_32 (&WalkState->Arguments[i].Name, NAMEOF_ARG_NTE);
+        ACPI_MOVE_32_TO_32 (&WalkState->Arguments[i].Name,
+            NAMEOF_ARG_NTE);
+
         WalkState->Arguments[i].Name.Integer |= (i << 24);
         WalkState->Arguments[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
         WalkState->Arguments[i].Type = ACPI_TYPE_ANY;
@@ -193,7 +195,8 @@ AcpiDsMethodDataInit (
 
     for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
     {
-        ACPI_MOVE_32_TO_32 (&WalkState->LocalVariables[i].Name, NAMEOF_LOCAL_NTE);
+        ACPI_MOVE_32_TO_32 (&WalkState->LocalVariables[i].Name,
+            NAMEOF_LOCAL_NTE);
 
         WalkState->LocalVariables[i].Name.Integer |= (i << 24);
         WalkState->LocalVariables[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
@@ -235,7 +238,7 @@ AcpiDsMethodDataDeleteAll (
         if (WalkState->LocalVariables[Index].Object)
         {
             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%u=%p\n",
-                    Index, WalkState->LocalVariables[Index].Object));
+                Index, WalkState->LocalVariables[Index].Object));
 
             /* Detach object (if present) and remove a reference */
 
@@ -250,7 +253,7 @@ AcpiDsMethodDataDeleteAll (
         if (WalkState->Arguments[Index].Object)
         {
             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%u=%p\n",
-                    Index, WalkState->Arguments[Index].Object));
+                Index, WalkState->Arguments[Index].Object));
 
             /* Detach object (if present) and remove a reference */
 
@@ -293,7 +296,8 @@ AcpiDsMethodDataInitArgs (
 
     if (!Params)
     {
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "No param list passed to method\n"));
+        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+            "No parameter list passed to method\n"));
         return_ACPI_STATUS (AE_OK);
     }
 
@@ -308,8 +312,8 @@ AcpiDsMethodDataInitArgs (
          * Store the argument in the method/walk descriptor.
          * Do not copy the arg in order to implement call by reference
          */
-        Status = AcpiDsMethodDataSetValue (ACPI_REFCLASS_ARG, Index,
-                    Params[Index], WalkState);
+        Status = AcpiDsMethodDataSetValue (
+            ACPI_REFCLASS_ARG, Index, Params[Index], WalkState);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
@@ -699,7 +703,8 @@ AcpiDsStoreObjectToLocal (
     NewObjDesc = ObjDesc;
     if (ObjDesc->Common.ReferenceCount > 1)
     {
-        Status = AcpiUtCopyIobjectToIobject (ObjDesc, &NewObjDesc, WalkState);
+        Status = AcpiUtCopyIobjectToIobject (
+            ObjDesc, &NewObjDesc, WalkState);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
@@ -736,13 +741,16 @@ AcpiDsStoreObjectToLocal (
              * If we have a valid reference object that came from RefOf(),
              * do the indirect store
              */
-            if ((ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) == ACPI_DESC_TYPE_OPERAND) &&
-                (CurrentObjDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
-                (CurrentObjDesc->Reference.Class == ACPI_REFCLASS_REFOF))
+            if ((ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) ==
+                    ACPI_DESC_TYPE_OPERAND) &&
+                (CurrentObjDesc->Common.Type ==
+                    ACPI_TYPE_LOCAL_REFERENCE) &&
+                (CurrentObjDesc->Reference.Class ==
+                    ACPI_REFCLASS_REFOF))
             {
                 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-                        "Arg (%p) is an ObjRef(Node), storing in node %p\n",
-                        NewObjDesc, CurrentObjDesc));
+                    "Arg (%p) is an ObjRef(Node), storing in node %p\n",
+                    NewObjDesc, CurrentObjDesc));
 
                 /*
                  * Store this object to the Node (perform the indirect store)
@@ -750,8 +758,8 @@ AcpiDsStoreObjectToLocal (
                  * specification rules on storing to Locals/Args.
                  */
                 Status = AcpiExStoreObjectToNode (NewObjDesc,
-                            CurrentObjDesc->Reference.Object, WalkState,
-                            ACPI_NO_IMPLICIT_CONVERSION);
+                    CurrentObjDesc->Reference.Object, WalkState,
+                    ACPI_NO_IMPLICIT_CONVERSION);
 
                 /* Remove local reference if we copied the object above */
 
@@ -759,6 +767,7 @@ AcpiDsStoreObjectToLocal (
                 {
                     AcpiUtRemoveReference (NewObjDesc);
                 }
+
                 return_ACPI_STATUS (Status);
             }
         }
index 0eb2f44..d448aaf 100644 (file)
@@ -174,10 +174,10 @@ AcpiDsBuildInternalObject (
         if (!Op->Common.Node)
         {
             Status = AcpiNsLookup (WalkState->ScopeInfo,
-                        Op->Common.Value.String,
-                        ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
-                        ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
-                        ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
+                Op->Common.Value.String,
+                ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+                ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
+                ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
             if (ACPI_FAILURE (Status))
             {
                 /* Check if we are resolving a named reference within a package */
@@ -233,8 +233,8 @@ AcpiDsBuildInternalObject (
             ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Op->Common.Node);
 
             Status = AcpiExResolveNodeToValue (
-                        ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
-                        WalkState);
+                ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
+                WalkState);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -294,14 +294,14 @@ AcpiDsBuildInternalObject (
     /* Create and init a new internal ACPI object */
 
     ObjDesc = AcpiUtCreateInternalObject (
-                (AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode))->ObjectType);
+        (AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode))->ObjectType);
     if (!ObjDesc)
     {
         return_ACPI_STATUS (AE_NO_MEMORY);
     }
 
-    Status = AcpiDsInitObjectFromOp (WalkState, Op, Op->Common.AmlOpcode,
-                &ObjDesc);
+    Status = AcpiDsInitObjectFromOp (
+        WalkState, Op, Op->Common.AmlOpcode, &ObjDesc);
     if (ACPI_FAILURE (Status))
     {
         AcpiUtRemoveReference (ObjDesc);
@@ -408,8 +408,8 @@ AcpiDsBuildInternalBufferObj (
     }
     else
     {
-        ObjDesc->Buffer.Pointer = ACPI_ALLOCATE_ZEROED (
-                                        ObjDesc->Buffer.Length);
+        ObjDesc->Buffer.Pointer =
+            ACPI_ALLOCATE_ZEROED (ObjDesc->Buffer.Length);
         if (!ObjDesc->Buffer.Pointer)
         {
             AcpiUtDeleteObjectDesc (ObjDesc);
@@ -421,7 +421,7 @@ AcpiDsBuildInternalBufferObj (
         if (ByteList)
         {
             memcpy (ObjDesc->Buffer.Pointer, ByteList->Named.Data,
-                         ByteListLength);
+                ByteListLength);
         }
     }
 
@@ -540,8 +540,8 @@ AcpiDsBuildInternalPackageObj (
                  * invocation, so we special case it here
                  */
                 Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
-                Status = AcpiDsBuildInternalObject (WalkState, Arg,
-                            &ObjDesc->Package.Elements[i]);
+                Status = AcpiDsBuildInternalObject (
+                    WalkState, Arg, &ObjDesc->Package.Elements[i]);
             }
             else
             {
@@ -553,8 +553,8 @@ AcpiDsBuildInternalPackageObj (
         }
         else
         {
-            Status = AcpiDsBuildInternalObject (WalkState, Arg,
-                        &ObjDesc->Package.Elements[i]);
+            Status = AcpiDsBuildInternalObject (
+                WalkState, Arg, &ObjDesc->Package.Elements[i]);
         }
 
         if (*ObjDescPtr)
@@ -611,7 +611,8 @@ AcpiDsBuildInternalPackageObj (
         }
 
         ACPI_INFO ((AE_INFO,
-            "Actual Package length (%u) is larger than NumElements field (%u), truncated",
+            "Actual Package length (%u) is larger than "
+            "NumElements field (%u), truncated",
             i, ElementCount));
     }
     else if (i < ElementCount)
@@ -621,7 +622,8 @@ AcpiDsBuildInternalPackageObj (
          * Note: this is not an error, the package is padded out with NULLs.
          */
         ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-            "Package List length (%u) smaller than NumElements count (%u), padded with null elements\n",
+            "Package List length (%u) smaller than NumElements "
+            "count (%u), padded with null elements\n",
             i, ElementCount));
     }
 
@@ -677,8 +679,8 @@ AcpiDsCreateNode (
 
     /* Build an internal object for the argument(s) */
 
-    Status = AcpiDsBuildInternalObject (WalkState, Op->Common.Value.Arg,
-                &ObjDesc);
+    Status = AcpiDsBuildInternalObject (
+        WalkState, Op->Common.Value.Arg, &ObjDesc);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -750,9 +752,9 @@ AcpiDsInitObjectFromOp (
         /*
          * Defer evaluation of Buffer TermArg operand
          */
-        ObjDesc->Buffer.Node      = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
-                                        WalkState->Operands[0]);
-        ObjDesc->Buffer.AmlStart  = Op->Named.Data;
+        ObjDesc->Buffer.Node = ACPI_CAST_PTR (
+            ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
+        ObjDesc->Buffer.AmlStart = Op->Named.Data;
         ObjDesc->Buffer.AmlLength = Op->Named.Length;
         break;
 
@@ -760,9 +762,9 @@ AcpiDsInitObjectFromOp (
         /*
          * Defer evaluation of Package TermArg operand
          */
-        ObjDesc->Package.Node      = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
-                                        WalkState->Operands[0]);
-        ObjDesc->Package.AmlStart  = Op->Named.Data;
+        ObjDesc->Package.Node = ACPI_CAST_PTR (
+            ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
+        ObjDesc->Package.AmlStart = Op->Named.Data;
         ObjDesc->Package.AmlLength = Op->Named.Length;
         break;
 
@@ -872,9 +874,9 @@ AcpiDsInitObjectFromOp (
 
 #ifndef ACPI_NO_METHOD_EXECUTION
             Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL,
-                        ObjDesc->Reference.Value, WalkState,
-                        ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
-                            &ObjDesc->Reference.Object));
+                ObjDesc->Reference.Value, WalkState,
+                ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
+                    &ObjDesc->Reference.Object));
 #endif
             break;
 
@@ -887,9 +889,9 @@ AcpiDsInitObjectFromOp (
 
 #ifndef ACPI_NO_METHOD_EXECUTION
             Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_ARG,
-                        ObjDesc->Reference.Value, WalkState,
-                        ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
-                            &ObjDesc->Reference.Object));
+                ObjDesc->Reference.Value, WalkState,
+                ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
+                    &ObjDesc->Reference.Object));
 #endif
             break;
 
index 6e2c784..45a7e7a 100644 (file)
@@ -331,8 +331,8 @@ AcpiDsInitBufferField (
      * For FieldFlags, use LOCK_RULE = 0 (NO_LOCK),
      * UPDATE_RULE = 0 (UPDATE_PRESERVE)
      */
-    Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, 0,
-                                            BitOffset, BitCount);
+    Status = AcpiExPrepCommonFieldObject (
+        ObjDesc, FieldFlags, 0, BitOffset, BitCount);
     if (ACPI_FAILURE (Status))
     {
         goto Cleanup;
@@ -429,8 +429,8 @@ AcpiDsEvalBufferFieldOperands (
 
     /* Resolve the operands */
 
-    Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
-                    ACPI_WALK_OPERANDS, WalkState);
+    Status = AcpiExResolveOperands (
+        Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
     if (ACPI_FAILURE (Status))
     {
         ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X",
@@ -446,16 +446,16 @@ AcpiDsEvalBufferFieldOperands (
         /* NOTE: Slightly different operands for this opcode */
 
         Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
-                    WalkState->Operands[0], WalkState->Operands[1],
-                    WalkState->Operands[2], WalkState->Operands[3]);
+            WalkState->Operands[0], WalkState->Operands[1],
+            WalkState->Operands[2], WalkState->Operands[3]);
     }
     else
     {
         /* All other, CreateXxxField opcodes */
 
         Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
-                    WalkState->Operands[0], WalkState->Operands[1],
-                                      NULL, WalkState->Operands[2]);
+            WalkState->Operands[0], WalkState->Operands[1],
+            NULL, WalkState->Operands[2]);
     }
 
     return_ACPI_STATUS (Status);
@@ -515,8 +515,8 @@ AcpiDsEvalRegionOperands (
 
     /* Resolve the length and address operands to numbers */
 
-    Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
-                ACPI_WALK_OPERANDS, WalkState);
+    Status = AcpiExResolveOperands (
+        Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -544,18 +544,16 @@ AcpiDsEvalRegionOperands (
     OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];
 
     ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS)
-                                OperandDesc->Integer.Value;
+        OperandDesc->Integer.Value;
     AcpiUtRemoveReference (OperandDesc);
 
     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
-        ObjDesc,
-        ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
+        ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
         ObjDesc->Region.Length));
 
     /* Now the address and length are valid for this opregion */
 
     ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
-
     return_ACPI_STATUS (Status);
 }
 
@@ -618,8 +616,8 @@ AcpiDsEvalTableRegionOperands (
      * Resolve the Signature string, OemId string,
      * and OemTableId string operands
      */
-    Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
-                ACPI_WALK_OPERANDS, WalkState);
+    Status = AcpiExResolveOperands (
+        Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
     if (ACPI_FAILURE (Status))
     {
         goto Cleanup;
@@ -628,9 +626,9 @@ AcpiDsEvalTableRegionOperands (
     /* Find the ACPI table */
 
     Status = AcpiTbFindTable (
-                Operand[0]->String.Pointer,
-                Operand[1]->String.Pointer,
-                Operand[2]->String.Pointer, &TableIndex);
+        Operand[0]->String.Pointer,
+        Operand[1]->String.Pointer,
+        Operand[2]->String.Pointer, &TableIndex);
     if (ACPI_FAILURE (Status))
     {
         if (Status == AE_NOT_FOUND)
@@ -721,8 +719,8 @@ AcpiDsEvalDataObjectOperands (
     }
 
     Status = AcpiExResolveOperands (WalkState->Opcode,
-                    &(WalkState->Operands [WalkState->NumOperands -1]),
-                    WalkState);
+        &(WalkState->Operands [WalkState->NumOperands -1]),
+        WalkState);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -750,13 +748,15 @@ AcpiDsEvalDataObjectOperands (
     {
     case AML_BUFFER_OP:
 
-        Status = AcpiDsBuildInternalBufferObj (WalkState, Op, Length, &ObjDesc);
+        Status = AcpiDsBuildInternalBufferObj (
+            WalkState, Op, Length, &ObjDesc);
         break;
 
     case AML_PACKAGE_OP:
     case AML_VAR_PACKAGE_OP:
 
-        Status = AcpiDsBuildInternalPackageObj (WalkState, Op, Length, &ObjDesc);
+        Status = AcpiDsBuildInternalPackageObj (
+            WalkState, Op, Length, &ObjDesc);
         break;
 
     default:
index 0ba26fa..35611d7 100644 (file)
@@ -212,9 +212,9 @@ AcpiDsDoImplicitReturn (
     }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-            "Result %p will be implicitly returned; Prev=%p\n",
-            ReturnDesc,
-            WalkState->ImplicitReturnObj));
+        "Result %p will be implicitly returned; Prev=%p\n",
+        ReturnDesc,
+        WalkState->ImplicitReturnObj));
 
     /*
      * Delete any "stale" implicit return value first. However, in
@@ -338,7 +338,8 @@ AcpiDsIsResultUsed (
              * If we are executing the predicate AND this is the predicate op,
              * we will use the return value
              */
-            if ((WalkState->ControlState->Common.State == ACPI_CONTROL_PREDICATE_EXECUTING) &&
+            if ((WalkState->ControlState->Common.State ==
+                    ACPI_CONTROL_PREDICATE_EXECUTING) &&
                 (WalkState->ControlState->Control.PredicateOp == Op))
             {
                 goto ResultUsed;
@@ -595,8 +596,8 @@ AcpiDsCreateOperand (
 
         /* Get the entire name string from the AML stream */
 
-        Status = AcpiExGetNameString (ACPI_TYPE_ANY, Arg->Common.Value.Buffer,
-                        &NameString, &NameLength);
+        Status = AcpiExGetNameString (ACPI_TYPE_ANY,
+            Arg->Common.Value.Buffer, &NameString, &NameLength);
 
         if (ACPI_FAILURE (Status))
         {
@@ -616,10 +617,11 @@ AcpiDsCreateOperand (
          */
         if ((WalkState->DeferredNode) &&
             (WalkState->DeferredNode->Type == ACPI_TYPE_BUFFER_FIELD) &&
-            (ArgIndex == (UINT32) ((WalkState->Opcode == AML_CREATE_FIELD_OP) ? 3 : 2)))
+            (ArgIndex == (UINT32)
+                ((WalkState->Opcode == AML_CREATE_FIELD_OP) ? 3 : 2)))
         {
             ObjDesc = ACPI_CAST_PTR (
-                        ACPI_OPERAND_OBJECT, WalkState->DeferredNode);
+                ACPI_OPERAND_OBJECT, WalkState->DeferredNode);
             Status = AE_OK;
         }
         else    /* All other opcodes */
@@ -632,6 +634,7 @@ AcpiDsCreateOperand (
              */
             ParentOp = Arg->Common.Parent;
             OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Common.AmlOpcode);
+
             if ((OpInfo->Flags & AML_NSNODE) &&
                 (ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
                 (ParentOp->Common.AmlOpcode != AML_REGION_OP) &&
@@ -649,10 +652,9 @@ AcpiDsCreateOperand (
             }
 
             Status = AcpiNsLookup (WalkState->ScopeInfo, NameString,
-                        ACPI_TYPE_ANY, InterpreterMode,
-                        ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
-                        WalkState,
-                        ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc));
+                ACPI_TYPE_ANY, InterpreterMode,
+                ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, WalkState,
+                ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc));
             /*
              * The only case where we pass through (ignore) a NOT_FOUND
              * error is for the CondRefOf opcode.
@@ -668,7 +670,7 @@ AcpiDsCreateOperand (
                      * object to the root
                      */
                     ObjDesc = ACPI_CAST_PTR (
-                                ACPI_OPERAND_OBJECT, AcpiGbl_RootNode);
+                        ACPI_OPERAND_OBJECT, AcpiGbl_RootNode);
                     Status = AE_OK;
                 }
                 else if (ParentOp->Common.AmlOpcode == AML_EXTERNAL_OP)
@@ -714,7 +716,8 @@ AcpiDsCreateOperand (
         {
             return_ACPI_STATUS (Status);
         }
-        ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (ObjDesc, WalkState));
+
+        AcpiDbDisplayArgumentObject (ObjDesc, WalkState);
     }
     else
     {
@@ -747,13 +750,14 @@ AcpiDsCreateOperand (
             return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
         }
 
-        if ((OpInfo->Flags & AML_HAS_RETVAL) || (Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
+        if ((OpInfo->Flags & AML_HAS_RETVAL) ||
+            (Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
         {
             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
                 "Argument previously created, already stacked\n"));
 
-            ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (
-                WalkState->Operands [WalkState->NumOperands - 1], WalkState));
+            AcpiDbDisplayArgumentObject (
+                WalkState->Operands [WalkState->NumOperands - 1], WalkState);
 
             /*
              * Use value that was already previously returned
@@ -784,7 +788,7 @@ AcpiDsCreateOperand (
             /* Initialize the new object */
 
             Status = AcpiDsInitObjectFromOp (
-                        WalkState, Arg, Opcode, &ObjDesc);
+                WalkState, Arg, Opcode, &ObjDesc);
             if (ACPI_FAILURE (Status))
             {
                 AcpiUtDeleteObjectDesc (ObjDesc);
@@ -800,7 +804,7 @@ AcpiDsCreateOperand (
             return_ACPI_STATUS (Status);
         }
 
-        ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (ObjDesc, WalkState));
+        AcpiDbDisplayArgumentObject (ObjDesc, WalkState);
     }
 
     return_ACPI_STATUS (AE_OK);
@@ -970,7 +974,8 @@ AcpiDsEvaluateNamePath (
 
         AcpiUtRemoveReference (*Operand);
 
-        Status = AcpiUtCopyIobjectToIobject (*Operand, &NewObjDesc, WalkState);
+        Status = AcpiUtCopyIobjectToIobject (
+            *Operand, &NewObjDesc, WalkState);
         if (ACPI_FAILURE (Status))
         {
             goto Exit;
index f650ced..4cdc53d 100644 (file)
@@ -261,12 +261,13 @@ AcpiDsGetPredicateValue (
 
 Cleanup:
 
-    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
+    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+        "Completed a predicate eval=%X Op=%p\n",
         WalkState->ControlState->Common.Value, WalkState->Op));
 
-     /* Break to debugger to display result */
+    /* Break to debugger to display result */
 
-    ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (LocalObjDesc, WalkState));
+    AcpiDbDisplayResultObject (LocalObjDesc, WalkState);
 
     /*
      * Delete the predicate result object (we know that
@@ -358,10 +359,12 @@ AcpiDsExecBeginOp (
         (WalkState->ControlState->Common.State ==
             ACPI_CONTROL_CONDITIONAL_EXECUTING))
     {
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
-                        Op, WalkState));
+        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+            "Exec predicate Op=%p State=%p\n",
+            Op, WalkState));
 
-        WalkState->ControlState->Common.State = ACPI_CONTROL_PREDICATE_EXECUTING;
+        WalkState->ControlState->Common.State =
+            ACPI_CONTROL_PREDICATE_EXECUTING;
 
         /* Save start of predicate */
 
@@ -409,8 +412,8 @@ AcpiDsExecBeginOp (
             }
             else
             {
-                Status = AcpiDsScopeStackPush (Op->Named.Node,
-                            Op->Named.Node->Type, WalkState);
+                Status = AcpiDsScopeStackPush (
+                    Op->Named.Node, Op->Named.Node->Type, WalkState);
                 if (ACPI_FAILURE (Status))
                 {
                     return_ACPI_STATUS (Status);
@@ -469,8 +472,8 @@ AcpiDsExecEndOp (
     ACPI_FUNCTION_TRACE_PTR (DsExecEndOp, WalkState);
 
 
-    Op      = WalkState->Op;
-    OpType  = WalkState->OpInfo->Type;
+    Op = WalkState->Op;
+    OpType = WalkState->OpInfo->Type;
     OpClass = WalkState->OpInfo->Class;
 
     if (OpClass == AML_CLASS_UNKNOWN)
@@ -490,8 +493,11 @@ AcpiDsExecEndOp (
 
     /* Call debugger for single step support (DEBUG build only) */
 
-    ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
-    ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
+    Status = AcpiDbSingleStep (WalkState, Op, OpClass);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
 
     /* Decode the Opcode Class */
 
@@ -528,8 +534,8 @@ AcpiDsExecEndOp (
             /* Resolve all operands */
 
             Status = AcpiExResolveOperands (WalkState->Opcode,
-                        &(WalkState->Operands [WalkState->NumOperands -1]),
-                        WalkState);
+                &(WalkState->Operands [WalkState->NumOperands -1]),
+                WalkState);
         }
 
         if (ACPI_SUCCESS (Status))
@@ -606,7 +612,8 @@ AcpiDsExecEndOp (
                 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
                     "Method Reference in a Package, Op=%p\n", Op));
 
-                Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
+                Op->Common.Node = (ACPI_NAMESPACE_NODE *)
+                    Op->Asl.Value.Arg->Asl.Node;
                 AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
                 return_ACPI_STATUS (AE_OK);
             }
@@ -688,12 +695,12 @@ AcpiDsExecEndOp (
                  * Put the Node on the object stack (Contains the ACPI Name
                  * of this object)
                  */
-                WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
+                WalkState->Operands[0] = (void *)
+                    Op->Common.Parent->Common.Node;
                 WalkState->NumOperands = 1;
 
                 Status = AcpiDsCreateNode (WalkState,
-                            Op->Common.Parent->Common.Node,
-                            Op->Common.Parent);
+                    Op->Common.Parent->Common.Node, Op->Common.Parent);
                 if (ACPI_FAILURE (Status))
                 {
                     break;
@@ -705,7 +712,7 @@ AcpiDsExecEndOp (
             case AML_INT_EVAL_SUBTREE_OP:
 
                 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
-                            AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
+                    AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
                 break;
 
             default:
@@ -786,7 +793,8 @@ AcpiDsExecEndOp (
         default:
 
             ACPI_ERROR ((AE_INFO,
-                "Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
+                "Unimplemented opcode, class=0x%X "
+                "type=0x%X Opcode=0x%X Op=%p",
                 OpClass, OpType, Op->Common.AmlOpcode, Op));
 
             Status = AE_NOT_IMPLEMENTED;
@@ -821,8 +829,7 @@ Cleanup:
     {
         /* Break to debugger to display result */
 
-        ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (WalkState->ResultObj,
-                                WalkState));
+        AcpiDbDisplayResultObject (WalkState->ResultObj,WalkState);
 
         /*
          * Delete the result op if and only if:
index a984075..765102d 100644 (file)
@@ -260,7 +260,8 @@ AcpiDsLoad1BeginOp (
     ObjectType = WalkState->OpInfo->ObjectType;
 
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-        "State=%p Op=%p [%s]\n", WalkState, Op, AcpiUtGetTypeName (ObjectType)));
+        "State=%p Op=%p [%s]\n", WalkState, Op,
+        AcpiUtGetTypeName (ObjectType)));
 
     switch (WalkState->Opcode)
     {
@@ -271,7 +272,7 @@ AcpiDsLoad1BeginOp (
          * Allow search-to-root for single namesegs.
          */
         Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
-                        ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &(Node));
+            ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &(Node));
 #ifdef ACPI_ASL_COMPILER
         if (Status == AE_NOT_FOUND)
         {
@@ -282,8 +283,8 @@ AcpiDsLoad1BeginOp (
              */
             AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0);
             Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
-                       ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
-                       WalkState, &Node);
+               ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
+               WalkState, &Node);
         }
 #endif
         if (ACPI_FAILURE (Status))
@@ -401,20 +402,20 @@ AcpiDsLoad1BeginOp (
             {
                 Flags |= ACPI_NS_OVERRIDE_IF_FOUND;
                 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Override allowed\n",
-                        AcpiUtGetTypeName (ObjectType)));
+                    AcpiUtGetTypeName (ObjectType)));
             }
             else
             {
                 Flags |= ACPI_NS_ERROR_IF_FOUND;
                 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
-                        AcpiUtGetTypeName (ObjectType)));
+                    AcpiUtGetTypeName (ObjectType)));
             }
         }
         else
         {
             ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
                 "[%s] Both Find or Create allowed\n",
-                    AcpiUtGetTypeName (ObjectType)));
+                AcpiUtGetTypeName (ObjectType)));
         }
 
         /*
@@ -424,7 +425,7 @@ AcpiDsLoad1BeginOp (
          * parse tree later.
          */
         Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
-                        ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
+            ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
         if (ACPI_FAILURE (Status))
         {
             if (Status == AE_ALREADY_EXISTS)
@@ -444,7 +445,8 @@ AcpiDsLoad1BeginOp (
 
                     if (AcpiNsOpensScope (ObjectType))
                     {
-                        Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
+                        Status = AcpiDsScopeStackPush (
+                            Node, ObjectType, WalkState);
                         if (ACPI_FAILURE (Status))
                         {
                             return_ACPI_STATUS (Status);
@@ -566,8 +568,9 @@ AcpiDsLoad1EndOp (
         if (Op->Common.AmlOpcode == AML_REGION_OP)
         {
             Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
-                        (ACPI_ADR_SPACE_TYPE) ((Op->Common.Value.Arg)->Common.Value.Integer),
-                        WalkState);
+                (ACPI_ADR_SPACE_TYPE)
+                    ((Op->Common.Value.Arg)->Common.Value.Integer),
+                WalkState);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -576,7 +579,7 @@ AcpiDsLoad1EndOp (
         else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
         {
             Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
-                        ACPI_ADR_SPACE_DATA_TABLE, WalkState);
+                ACPI_ADR_SPACE_DATA_TABLE, WalkState);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -628,11 +631,12 @@ AcpiDsLoad1EndOp (
                 WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
                 WalkState->NumOperands = 1;
 
-                Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
+                Status = AcpiDsCreateOperands (
+                    WalkState, Op->Common.Value.Arg);
                 if (ACPI_SUCCESS (Status))
                 {
                     Status = AcpiExCreateMethod (Op->Named.Data,
-                                        Op->Named.Length, WalkState);
+                        Op->Named.Length, WalkState);
                 }
 
                 WalkState->Operands[0] = NULL;
index d5f9b1c..1a01a43 100644 (file)
@@ -231,8 +231,8 @@ AcpiDsLoad2BeginOp (
          * for use later.
          */
         Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
-                        ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
-                        WalkState, &(Node));
+            ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
+            WalkState, &(Node));
         break;
 
     case AML_SCOPE_OP:
@@ -257,8 +257,8 @@ AcpiDsLoad2BeginOp (
              * for use later.
              */
             Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
-                        ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
-                        WalkState, &(Node));
+                ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
+                WalkState, &(Node));
             if (ACPI_FAILURE (Status))
             {
 #ifdef ACPI_ASL_COMPILER
@@ -395,7 +395,7 @@ AcpiDsLoad2BeginOp (
         /* Add new entry or lookup existing entry */
 
         Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
-                    ACPI_IMODE_LOAD_PASS2, Flags, WalkState, &Node);
+            ACPI_IMODE_LOAD_PASS2, Flags, WalkState, &Node);
 
         if (ACPI_SUCCESS (Status) && (Flags & ACPI_NS_TEMPORARY))
         {
@@ -473,7 +473,7 @@ AcpiDsLoad2EndOp (
 
     Op = WalkState->Op;
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
-            WalkState->OpInfo->Name, Op, WalkState));
+        WalkState->OpInfo->Name, Op, WalkState));
 
     /* Check if opcode had an associated namespace object */
 
@@ -579,8 +579,8 @@ AcpiDsLoad2EndOp (
         {
         case AML_INDEX_FIELD_OP:
 
-            Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
-                        WalkState);
+            Status = AcpiDsCreateIndexField (
+                Op, (ACPI_HANDLE) Arg->Common.Node, WalkState);
             break;
 
         case AML_BANK_FIELD_OP:
@@ -665,7 +665,7 @@ AcpiDsLoad2EndOp (
             if (Op->Common.AmlOpcode == AML_REGION_OP)
             {
                 RegionSpace = (ACPI_ADR_SPACE_TYPE)
-                      ((Op->Common.Value.Arg)->Common.Value.Integer);
+                    ((Op->Common.Value.Arg)->Common.Value.Integer);
             }
             else
             {
@@ -690,8 +690,8 @@ AcpiDsLoad2EndOp (
                  * Executing a method: initialize the region and unlock
                  * the interpreter
                  */
-                Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
-                            RegionSpace, WalkState);
+                Status = AcpiExCreateRegion (Op->Named.Data,
+                    Op->Named.Length, RegionSpace, WalkState);
                 if (ACPI_FAILURE (Status))
                 {
                     return_ACPI_STATUS (Status);
@@ -700,8 +700,8 @@ AcpiDsLoad2EndOp (
                 AcpiExExitInterpreter ();
             }
 
-            Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
-                        FALSE);
+            Status = AcpiEvInitializeRegion (
+                AcpiNsGetAttachedObject (Node), FALSE);
             if (WalkState->MethodNode)
             {
                 AcpiExEnterInterpreter ();
@@ -744,12 +744,14 @@ AcpiDsLoad2EndOp (
                 WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
                 WalkState->NumOperands = 1;
 
-                Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
+                Status = AcpiDsCreateOperands (
+                    WalkState, Op->Common.Value.Arg);
                 if (ACPI_SUCCESS (Status))
                 {
-                    Status = AcpiExCreateMethod (Op->Named.Data,
-                                        Op->Named.Length, WalkState);
+                    Status = AcpiExCreateMethod (
+                        Op->Named.Data, Op->Named.Length, WalkState);
                 }
+
                 WalkState->Operands[0] = NULL;
                 WalkState->NumOperands = 0;
 
@@ -784,9 +786,9 @@ AcpiDsLoad2EndOp (
          * Lookup the method name and save the Node
          */
         Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
-                        ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
-                        ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
-                        WalkState, &(NewNode));
+            ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
+            ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+            WalkState, &(NewNode));
         if (ACPI_SUCCESS (Status))
         {
             /*
index 9865dcd..1ce2ed9 100644 (file)
@@ -154,6 +154,7 @@ AcpiDsScopeStackClear (
         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
             "Popped object type (%s)\n",
             AcpiUtGetTypeName (ScopeInfo->Common.Value)));
+
         AcpiUtDeleteGenericState (ScopeInfo);
     }
 }
index e5ea508..faf6a2b 100644 (file)
@@ -371,8 +371,8 @@ AcpiDsResultStackPop (
 
     if (WalkState->Results == NULL)
     {
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Result stack underflow - State=%p\n",
-            WalkState));
+        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+            "Result stack underflow - State=%p\n", WalkState));
         return (AE_AML_NO_OPERAND);
     }
 
@@ -779,7 +779,8 @@ AcpiDsInitAmlWalk (
 
         /* Push start scope on scope stack and make it current  */
 
-        Status = AcpiDsScopeStackPush (MethodNode, ACPI_TYPE_METHOD, WalkState);
+        Status = AcpiDsScopeStackPush (
+            MethodNode, ACPI_TYPE_METHOD, WalkState);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
@@ -822,7 +823,7 @@ AcpiDsInitAmlWalk (
             /* Push start scope on scope stack and make it current  */
 
             Status = AcpiDsScopeStackPush (ParserState->StartNode,
-                            ParserState->StartNode->Type, WalkState);
+                ParserState->StartNode->Type, WalkState);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
index e447356..eda09eb 100644 (file)
@@ -275,8 +275,8 @@ AcpiEvFixedEventInitialize (
         if (AcpiGbl_FixedEventInfo[i].EnableRegisterId != 0xFF)
         {
             Status = AcpiWriteBitRegister (
-                        AcpiGbl_FixedEventInfo[i].EnableRegisterId,
-                        ACPI_DISABLE_EVENT);
+                AcpiGbl_FixedEventInfo[i].EnableRegisterId,
+                ACPI_DISABLE_EVENT);
             if (ACPI_FAILURE (Status))
             {
                 return (Status);
@@ -379,8 +379,8 @@ AcpiEvFixedEventDispatch (
     /* Clear the status bit */
 
     (void) AcpiWriteBitRegister (
-            AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
-            ACPI_CLEAR_STATUS);
+        AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
+        ACPI_CLEAR_STATUS);
 
     /*
      * Make sure that a handler exists. If not, report an error
@@ -389,8 +389,8 @@ AcpiEvFixedEventDispatch (
     if (!AcpiGbl_FixedEventHandlers[Event].Handler)
     {
         (void) AcpiWriteBitRegister (
-                AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
-                ACPI_DISABLE_EVENT);
+            AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
+            ACPI_DISABLE_EVENT);
 
         ACPI_ERROR ((AE_INFO,
             "No installed handler for fixed event - %s (%u), disabling",
@@ -402,7 +402,7 @@ AcpiEvFixedEventDispatch (
     /* Invoke the Fixed Event handler */
 
     return ((AcpiGbl_FixedEventHandlers[Event].Handler)(
-                AcpiGbl_FixedEventHandlers[Event].Context));
+        AcpiGbl_FixedEventHandlers[Event].Context));
 }
 
 #endif /* !ACPI_REDUCED_HARDWARE */
index e1ebf19..8353ffb 100644 (file)
@@ -162,7 +162,7 @@ AcpiEvInitGlobalLockHandler (
     /* Attempt installation of the global lock handler */
 
     Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL,
-                AcpiEvGlobalLockHandler, NULL);
+        AcpiEvGlobalLockHandler, NULL);
 
     /*
      * If the global lock does not exist on this platform, the attempt to
@@ -212,9 +212,10 @@ AcpiEvRemoveGlobalLockHandler (
 
     ACPI_FUNCTION_TRACE (EvRemoveGlobalLockHandler);
 
+
     AcpiGbl_GlobalLockPresent = FALSE;
     Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL,
-                AcpiEvGlobalLockHandler);
+        AcpiEvGlobalLockHandler);
 
     AcpiOsDeleteLock (AcpiGbl_GlobalLockPendingLock);
     return_ACPI_STATUS (Status);
@@ -374,8 +375,8 @@ AcpiEvAcquireGlobalLock (
          * Wait for handshake with the global lock interrupt handler.
          * This interface releases the interpreter if we must wait.
          */
-        Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
-                    ACPI_WAIT_FOREVER);
+        Status = AcpiExSystemWaitSemaphore (
+            AcpiGbl_GlobalLockSemaphore, ACPI_WAIT_FOREVER);
 
         Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
 
@@ -433,7 +434,7 @@ AcpiEvReleaseGlobalLock (
         if (Pending)
         {
             Status = AcpiWriteBitRegister (
-                        ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT);
+                ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT);
         }
 
         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Released hardware Global Lock\n"));
index 4dceaa4..54316fe 100644 (file)
@@ -176,8 +176,8 @@ AcpiEvUpdateGpeEnableMask (
     {
         ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit);
     }
-    GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
 
+    GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
     return_ACPI_STATUS (AE_OK);
 }
 
@@ -399,7 +399,7 @@ AcpiEvGetGpeEventInfo (
         for (i = 0; i < ACPI_MAX_GPE_BLOCKS; i++)
         {
             GpeInfo = AcpiEvLowGetGpeInfo (GpeNumber,
-                        AcpiGbl_GpeFadtBlocks[i]);
+                AcpiGbl_GpeFadtBlocks[i]);
             if (GpeInfo)
             {
                 return (GpeInfo);
@@ -660,8 +660,8 @@ AcpiEvAsynchExecuteGpeMethod (
         Notify = GpeEventInfo->Dispatch.NotifyList;
         while (ACPI_SUCCESS (Status) && Notify)
         {
-            Status = AcpiEvQueueNotifyRequest (Notify->DeviceNode,
-                        ACPI_NOTIFY_DEVICE_WAKE);
+            Status = AcpiEvQueueNotifyRequest (
+                Notify->DeviceNode, ACPI_NOTIFY_DEVICE_WAKE);
 
             Notify = Notify->Next;
         }
@@ -705,7 +705,7 @@ AcpiEvAsynchExecuteGpeMethod (
     /* Defer enabling of GPE until all notify handlers are done */
 
     Status = AcpiOsExecute (OSL_NOTIFY_HANDLER,
-                AcpiEvAsynchEnableGpe, GpeEventInfo);
+        AcpiEvAsynchEnableGpe, GpeEventInfo);
     if (ACPI_SUCCESS (Status))
     {
         return_VOID;
@@ -850,8 +850,8 @@ AcpiEvGpeDispatch (
         {
             ACPI_EXCEPTION ((AE_INFO, Status,
                 "Unable to clear GPE %02X", GpeNumber));
-            (void) AcpiHwLowSetGpe (GpeEventInfo,
-                    ACPI_GPE_CONDITIONAL_ENABLE);
+            (void) AcpiHwLowSetGpe (
+                GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
             return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
         }
     }
@@ -888,7 +888,7 @@ AcpiEvGpeDispatch (
          * NOTE: Level-triggered GPEs are cleared after the method completes.
          */
         Status = AcpiOsExecute (OSL_GPE_HANDLER,
-                    AcpiEvAsynchExecuteGpeMethod, GpeEventInfo);
+            AcpiEvAsynchExecuteGpeMethod, GpeEventInfo);
         if (ACPI_FAILURE (Status))
         {
             ACPI_EXCEPTION ((AE_INFO, Status,
index e067457..7a3c15d 100644 (file)
@@ -265,6 +265,7 @@ AcpiEvDeleteGpeBlock (
         {
             GpeBlock->Next->Previous = GpeBlock->Previous;
         }
+
         AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
     }
 
@@ -313,8 +314,8 @@ AcpiEvCreateGpeInfoBlocks (
     /* Allocate the GPE register information block */
 
     GpeRegisterInfo = ACPI_ALLOCATE_ZEROED (
-                        (ACPI_SIZE) GpeBlock->RegisterCount *
-                        sizeof (ACPI_GPE_REGISTER_INFO));
+        (ACPI_SIZE) GpeBlock->RegisterCount *
+        sizeof (ACPI_GPE_REGISTER_INFO));
     if (!GpeRegisterInfo)
     {
         ACPI_ERROR ((AE_INFO,
@@ -327,7 +328,7 @@ AcpiEvCreateGpeInfoBlocks (
      * per register. Initialization to zeros is sufficient.
      */
     GpeEventInfo = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) GpeBlock->GpeCount *
-                    sizeof (ACPI_GPE_EVENT_INFO));
+        sizeof (ACPI_GPE_EVENT_INFO));
     if (!GpeEventInfo)
     {
         ACPI_ERROR ((AE_INFO,
@@ -339,7 +340,7 @@ AcpiEvCreateGpeInfoBlocks (
     /* Save the new Info arrays in the GPE block */
 
     GpeBlock->RegisterInfo = GpeRegisterInfo;
-    GpeBlock->EventInfo    = GpeEventInfo;
+    GpeBlock->EventInfo = GpeEventInfo;
 
     /*
      * Initialize the GPE Register and Event structures. A goal of these
@@ -348,7 +349,7 @@ AcpiEvCreateGpeInfoBlocks (
      * first half, and the enable registers occupy the second half.
      */
     ThisRegister = GpeRegisterInfo;
-    ThisEvent    = GpeEventInfo;
+    ThisEvent = GpeEventInfo;
 
     for (i = 0; i < GpeBlock->RegisterCount; i++)
     {
@@ -506,8 +507,8 @@ AcpiEvCreateGpeBlock (
     WalkInfo.ExecuteByOwnerId = FALSE;
 
     Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
-                ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
-                AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);
+        ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
+        AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);
 
     /* Return the new block */
 
index bf3c6e5..d8e4ee9 100644 (file)
@@ -210,10 +210,10 @@ AcpiEvGpeInitialize (
         /* Install GPE Block 0 */
 
         Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
-                    AcpiGbl_FADT.XGpe0Block.Address,
-                    AcpiGbl_FADT.XGpe0Block.SpaceId,
-                    RegisterCount0, 0,
-                    AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
+            AcpiGbl_FADT.XGpe0Block.Address,
+            AcpiGbl_FADT.XGpe0Block.SpaceId,
+            RegisterCount0, 0,
+            AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
 
         if (ACPI_FAILURE (Status))
         {
@@ -250,11 +250,11 @@ AcpiEvGpeInitialize (
             /* Install GPE Block 1 */
 
             Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
-                        AcpiGbl_FADT.XGpe1Block.Address,
-                        AcpiGbl_FADT.XGpe1Block.SpaceId,
-                        RegisterCount1,
-                        AcpiGbl_FADT.Gpe1Base,
-                        AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
+                AcpiGbl_FADT.XGpe1Block.Address,
+                AcpiGbl_FADT.XGpe1Block.SpaceId,
+                RegisterCount1,
+                AcpiGbl_FADT.Gpe1Base,
+                AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
 
             if (ACPI_FAILURE (Status))
             {
@@ -267,7 +267,7 @@ AcpiEvGpeInitialize (
              * space. However, GPE0 always starts at GPE number zero.
              */
             GpeNumberMax = AcpiGbl_FADT.Gpe1Base +
-                            ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1);
+                ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1);
         }
     }
 
@@ -347,9 +347,9 @@ AcpiEvUpdateGpes (
             WalkInfo.GpeDevice = GpeBlock->Node;
 
             Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD,
-                        WalkInfo.GpeDevice, ACPI_UINT32_MAX,
-                        ACPI_NS_WALK_NO_UNLOCK, AcpiEvMatchGpeMethod,
-                        NULL, &WalkInfo, NULL);
+                WalkInfo.GpeDevice, ACPI_UINT32_MAX,
+                ACPI_NS_WALK_NO_UNLOCK, AcpiEvMatchGpeMethod,
+                NULL, &WalkInfo, NULL);
             if (ACPI_FAILURE (Status))
             {
                 ACPI_EXCEPTION ((AE_INFO, Status,
@@ -502,7 +502,7 @@ AcpiEvMatchGpeMethod (
     }
 
     if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
-            ACPI_GPE_DISPATCH_METHOD)
+        ACPI_GPE_DISPATCH_METHOD)
     {
         /*
          * If there is already a method, ignore this method. But check
index f204bba..aafbac9 100644 (file)
@@ -310,7 +310,7 @@ AcpiEvGetGpeXruptBlock (
     if (InterruptNumber != AcpiGbl_FADT.SciInterrupt)
     {
         Status = AcpiOsInstallInterruptHandler (InterruptNumber,
-                    AcpiEvGpeXruptHandler, GpeXrupt);
+            AcpiEvGpeXruptHandler, GpeXrupt);
         if (ACPI_FAILURE (Status))
         {
             ACPI_EXCEPTION ((AE_INFO, Status,
@@ -360,7 +360,7 @@ AcpiEvDeleteGpeXrupt (
     /* Disable this interrupt */
 
     Status = AcpiOsRemoveInterruptHandler (
-                GpeXrupt->InterruptNumber, AcpiEvGpeXruptHandler);
+        GpeXrupt->InterruptNumber, AcpiEvGpeXruptHandler);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -446,7 +446,7 @@ AcpiEvDeleteGpeHandlers (
                 GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
             }
             else if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
-                    ACPI_GPE_DISPATCH_NOTIFY)
+                ACPI_GPE_DISPATCH_NOTIFY)
             {
                 /* Delete the implicit notification device list */
 
@@ -457,6 +457,7 @@ AcpiEvDeleteGpeHandlers (
                     ACPI_FREE (Notify);
                     Notify = Next;
                 }
+
                 GpeEventInfo->Dispatch.NotifyList = NULL;
                 GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
             }
index d02ea53..c7f2350 100644 (file)
@@ -132,6 +132,7 @@ AcpiEvInstallHandler (
     void                    *Context,
     void                    **ReturnValue);
 
+
 /* These are the address spaces that will get default handlers */
 
 UINT8        AcpiGbl_DefaultAddressSpaces[ACPI_NUM_DEFAULT_SPACES] =
@@ -194,8 +195,8 @@ AcpiEvInstallRegionHandlers (
     for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
     {
         Status = AcpiEvInstallSpaceHandler (AcpiGbl_RootNode,
-                    AcpiGbl_DefaultAddressSpaces[i],
-                    ACPI_DEFAULT_HANDLER, NULL, NULL);
+            AcpiGbl_DefaultAddressSpaces[i],
+            ACPI_DEFAULT_HANDLER, NULL, NULL);
         switch (Status)
         {
         case AE_OK:
@@ -247,7 +248,7 @@ AcpiEvHasDefaultHandler (
     ObjDesc = AcpiNsGetAttachedObject (Node);
     if (ObjDesc)
     {
-        HandlerObj = ObjDesc->Device.Handler;
+        HandlerObj = ObjDesc->CommonNotify.Handler;
 
         /* Walk the linked list of handlers for this object */
 
@@ -256,7 +257,7 @@ AcpiEvHasDefaultHandler (
             if (HandlerObj->AddressSpace.SpaceId == SpaceId)
             {
                 if (HandlerObj->AddressSpace.HandlerFlags &
-                        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
+                    ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
                 {
                     return (TRUE);
                 }
@@ -348,33 +349,25 @@ AcpiEvInstallHandler (
     {
         /* Check if this Device already has a handler for this address space */
 
-        NextHandlerObj = ObjDesc->Device.Handler;
-        while (NextHandlerObj)
+        NextHandlerObj = AcpiEvFindRegionHandler (
+            HandlerObj->AddressSpace.SpaceId, ObjDesc->CommonNotify.Handler);
+        if (NextHandlerObj)
         {
             /* Found a handler, is it for the same address space? */
 
-            if (NextHandlerObj->AddressSpace.SpaceId ==
-                    HandlerObj->AddressSpace.SpaceId)
-            {
-                ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
-                    "Found handler for region [%s] in device %p(%p) "
-                    "handler %p\n",
-                    AcpiUtGetRegionName (HandlerObj->AddressSpace.SpaceId),
-                    ObjDesc, NextHandlerObj, HandlerObj));
-
-                /*
-                 * Since the object we found it on was a device, then it
-                 * means that someone has already installed a handler for
-                 * the branch of the namespace from this device on. Just
-                 * bail out telling the walk routine to not traverse this
-                 * branch. This preserves the scoping rule for handlers.
-                 */
-                return (AE_CTRL_DEPTH);
-            }
-
-            /* Walk the linked list of handlers attached to this device */
-
-            NextHandlerObj = NextHandlerObj->AddressSpace.Next;
+            ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+                "Found handler for region [%s] in device %p(%p) handler %p\n",
+                AcpiUtGetRegionName (HandlerObj->AddressSpace.SpaceId),
+                ObjDesc, NextHandlerObj, HandlerObj));
+
+            /*
+             * Since the object we found it on was a device, then it means
+             * that someone has already installed a handler for the branch
+             * of the namespace from this device on. Just bail out telling
+             * the walk routine to not traverse this branch. This preserves
+             * the scoping rule for handlers.
+             */
+            return (AE_CTRL_DEPTH);
         }
 
         /*
@@ -407,6 +400,46 @@ AcpiEvInstallHandler (
 }
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiEvFindRegionHandler
+ *
+ * PARAMETERS:  SpaceId         - The address space ID
+ *              HandlerObj      - Head of the handler object list
+ *
+ * RETURN:      Matching handler object. NULL if space ID not matched
+ *
+ * DESCRIPTION: Search a handler object list for a match on the address
+ *              space ID.
+ *
+ ******************************************************************************/
+
+ACPI_OPERAND_OBJECT *
+AcpiEvFindRegionHandler (
+    ACPI_ADR_SPACE_TYPE     SpaceId,
+    ACPI_OPERAND_OBJECT     *HandlerObj)
+{
+
+    /* Walk the handler list for this device */
+
+    while (HandlerObj)
+    {
+        /* Same SpaceId indicates a handler is installed */
+
+        if (HandlerObj->AddressSpace.SpaceId == SpaceId)
+        {
+            return (HandlerObj);
+        }
+
+        /* Next handler object */
+
+        HandlerObj = HandlerObj->AddressSpace.Next;
+    }
+
+    return (NULL);
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiEvInstallSpaceHandler
@@ -434,17 +467,17 @@ AcpiEvInstallSpaceHandler (
 {
     ACPI_OPERAND_OBJECT     *ObjDesc;
     ACPI_OPERAND_OBJECT     *HandlerObj;
-    ACPI_STATUS             Status;
+    ACPI_STATUS             Status = AE_OK;
     ACPI_OBJECT_TYPE        Type;
-    UINT8                  Flags = 0;
+    UINT8                   Flags = 0;
 
 
     ACPI_FUNCTION_TRACE (EvInstallSpaceHandler);
 
 
     /*
-     * This registration is valid for only the types below and the root. This
-     * is where the default handlers get placed.
+     * This registration is valid for only the types below and the root.
+     * The root node is where the default handlers get installed.
      */
     if ((Node->Type != ACPI_TYPE_DEVICE)     &&
         (Node->Type != ACPI_TYPE_PROCESSOR)  &&
@@ -517,47 +550,39 @@ AcpiEvInstallSpaceHandler (
     if (ObjDesc)
     {
         /*
-         * The attached device object already exists. Make sure the handler
-         * is not already installed.
+         * The attached device object already exists. Now make sure
+         * the handler is not already installed.
          */
-        HandlerObj = ObjDesc->Device.Handler;
+        HandlerObj = AcpiEvFindRegionHandler (SpaceId,
+            ObjDesc->CommonNotify.Handler);
 
-        /* Walk the handler list for this device */
-
-        while (HandlerObj)
+        if (HandlerObj)
         {
-            /* Same SpaceId indicates a handler already installed */
-
-            if (HandlerObj->AddressSpace.SpaceId == SpaceId)
+            if (HandlerObj->AddressSpace.Handler == Handler)
             {
-                if (HandlerObj->AddressSpace.Handler == Handler)
-                {
-                    /*
-                     * It is (relatively) OK to attempt to install the SAME
-                     * handler twice. This can easily happen with the
-                     * PCI_Config space.
-                     */
-                    Status = AE_SAME_HANDLER;
-                    goto UnlockAndExit;
-                }
-                else
-                {
-                    /* A handler is already installed */
-
-                    Status = AE_ALREADY_EXISTS;
-                }
+                /*
+                 * It is (relatively) OK to attempt to install the SAME
+                 * handler twice. This can easily happen with the
+                 * PCI_Config space.
+                 */
+                Status = AE_SAME_HANDLER;
                 goto UnlockAndExit;
             }
+            else
+            {
+                /* A handler is already installed */
 
-            /* Walk the linked list of handlers */
+                Status = AE_ALREADY_EXISTS;
+            }
 
-            HandlerObj = HandlerObj->AddressSpace.Next;
+            goto UnlockAndExit;
         }
     }
     else
     {
         ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
-            "Creating object on Device %p while installing handler\n", Node));
+            "Creating object on Device %p while installing handler\n",
+            Node));
 
         /* ObjDesc does not exist, create one */
 
@@ -596,7 +621,8 @@ AcpiEvInstallSpaceHandler (
     }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
-        "Installing address handler for region %s(%X) on Device %4.4s %p(%p)\n",
+        "Installing address handler for region %s(%X) "
+        "on Device %4.4s %p(%p)\n",
         AcpiUtGetRegionName (SpaceId), SpaceId,
         AcpiUtGetNodeName (Node), Node, ObjDesc));
 
@@ -621,33 +647,31 @@ AcpiEvInstallSpaceHandler (
     HandlerObj->AddressSpace.Node = Node;
     HandlerObj->AddressSpace.Handler = Handler;
     HandlerObj->AddressSpace.Context = Context;
-    HandlerObj->AddressSpace.Setup  = Setup;
+    HandlerObj->AddressSpace.Setup = Setup;
 
     /* Install at head of Device.AddressSpace list */
 
-    HandlerObj->AddressSpace.Next = ObjDesc->Device.Handler;
+    HandlerObj->AddressSpace.Next = ObjDesc->CommonNotify.Handler;
 
     /*
      * The Device object is the first reference on the HandlerObj.
      * Each region that uses the handler adds a reference.
      */
-    ObjDesc->Device.Handler = HandlerObj;
+    ObjDesc->CommonNotify.Handler = HandlerObj;
 
     /*
-     * Walk the namespace finding all of the regions this
-     * handler will manage.
+     * Walk the namespace finding all of the regions this handler will
+     * manage.
      *
-     * Start at the device and search the branch toward
-     * the leaf nodes until either the leaf is encountered or
-     * a device is detected that has an address handler of the
-     * same type.
+     * Start at the device and search the branch toward the leaf nodes
+     * until either the leaf is encountered or a device is detected that
+     * has an address handler of the same type.
      *
-     * In either case, back up and search down the remainder
-     * of the branch
+     * In either case, back up and search down the remainder of the branch
      */
-    Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
-                ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL,
-                HandlerObj, NULL);
+    Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node,
+        ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
+        AcpiEvInstallHandler, NULL, HandlerObj, NULL);
 
 UnlockAndExit:
     return_ACPI_STATUS (Status);
index 1735038..0d6492f 100644 (file)
@@ -147,6 +147,7 @@ BOOLEAN
 AcpiEvIsNotifyObject (
     ACPI_NAMESPACE_NODE     *Node)
 {
+
     switch (Node->Type)
     {
     case ACPI_TYPE_DEVICE:
@@ -255,8 +256,8 @@ AcpiEvQueueNotifyRequest (
         AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
         NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
 
-    Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
-        Info);
+    Status = AcpiOsExecute (OSL_NOTIFY_HANDLER,
+        AcpiEvNotifyDispatch, Info);
     if (ACPI_FAILURE (Status))
     {
         AcpiUtDeleteGenericState (Info);
index 24848db..c251b9b 100644 (file)
@@ -171,6 +171,7 @@ AcpiEvInitializeOpRegions (
 
     /* Run the _REG methods for OpRegions in each default address space */
 
+    AcpiGbl_RegMethodsEnabled = TRUE;
     for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
     {
         /*
@@ -181,13 +182,11 @@ AcpiEvInitializeOpRegions (
         if (AcpiEvHasDefaultHandler (AcpiGbl_RootNode,
                AcpiGbl_DefaultAddressSpaces[i]))
         {
-            Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
-                        AcpiGbl_DefaultAddressSpaces[i]);
+            AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
+                AcpiGbl_DefaultAddressSpaces[i], ACPI_REG_CONNECT);
         }
     }
 
-    AcpiGbl_RegMethodsExecuted = TRUE;
-
     (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
     return_ACPI_STATUS (Status);
 }
@@ -210,6 +209,12 @@ AcpiEvInitializeOpRegions (
  * DESCRIPTION: Dispatch an address space or operation region access to
  *              a previously installed handler.
  *
+ * NOTE: During early initialization, we always install the default region
+ * handlers for Memory, I/O and PCI_Config. This ensures that these operation
+ * region address spaces are always available as per the ACPI specification.
+ * This is especially needed in order to support the execution of
+ * module-level AML code during loading of the ACPI tables.
+ *
  ******************************************************************************/
 
 ACPI_STATUS
@@ -282,7 +287,7 @@ AcpiEvAddressSpaceDispatch (
         AcpiExExitInterpreter ();
 
         Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE,
-                    Context, &RegionContext);
+            Context, &RegionContext);
 
         /* Re-enter the interpreter */
 
@@ -364,7 +369,7 @@ AcpiEvAddressSpaceDispatch (
         AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
 
     if (!(HandlerDesc->AddressSpace.HandlerFlags &
-            ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
+        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
     {
         /*
          * For handlers other than the default (supplied) handlers, we must
@@ -386,13 +391,13 @@ AcpiEvAddressSpaceDispatch (
     }
 
     if (!(HandlerDesc->AddressSpace.HandlerFlags &
-            ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
+        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
     {
         /*
          * We just returned from a non-default handler, we must re-enter the
          * interpreter
          */
-       AcpiExEnterInterpreter ();
+        AcpiExEnterInterpreter ();
     }
 
     return_ACPI_STATUS (Status);
@@ -414,7 +419,7 @@ AcpiEvAddressSpaceDispatch (
  ******************************************************************************/
 
 void
-AcpiEvDetachRegion(
+AcpiEvDetachRegion (
     ACPI_OPERAND_OBJECT     *RegionObj,
     BOOLEAN                 AcpiNsIsLocked)
 {
@@ -593,6 +598,13 @@ AcpiEvAttachRegion (
     ACPI_FUNCTION_TRACE (EvAttachRegion);
 
 
+    /* Install the region's handler */
+
+    if (RegionObj->Region.Handler)
+    {
+        return_ACPI_STATUS (AE_ALREADY_EXISTS);
+    }
+
     ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
         "Adding Region [%4.4s] %p to address handler %p [%s]\n",
         AcpiUtGetNodeName (RegionObj->Region.Node),
@@ -603,18 +615,62 @@ AcpiEvAttachRegion (
 
     RegionObj->Region.Next = HandlerObj->AddressSpace.RegionList;
     HandlerObj->AddressSpace.RegionList = RegionObj;
+    RegionObj->Region.Handler = HandlerObj;
+    AcpiUtAddReference (HandlerObj);
 
-    /* Install the region's handler */
+    return_ACPI_STATUS (AE_OK);
+}
 
-    if (RegionObj->Region.Handler)
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiEvAssociateRegMethod
+ *
+ * PARAMETERS:  RegionObj           - Region object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Find and associate _REG method to a region
+ *
+ ******************************************************************************/
+
+void
+AcpiEvAssociateRegMethod (
+    ACPI_OPERAND_OBJECT     *RegionObj)
+{
+    ACPI_NAME               *RegNamePtr = (ACPI_NAME *) METHOD_NAME__REG;
+    ACPI_NAMESPACE_NODE     *MethodNode;
+    ACPI_NAMESPACE_NODE     *Node;
+    ACPI_OPERAND_OBJECT     *RegionObj2;
+    ACPI_STATUS             Status;
+
+
+    ACPI_FUNCTION_TRACE (EvAssociateRegMethod);
+
+
+    RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
+    if (!RegionObj2)
     {
-        return_ACPI_STATUS (AE_ALREADY_EXISTS);
+        return_VOID;
     }
 
-    RegionObj->Region.Handler = HandlerObj;
-    AcpiUtAddReference (HandlerObj);
+    Node = RegionObj->Region.Node->Parent;
 
-    return_ACPI_STATUS (AE_OK);
+    /* Find any "_REG" method associated with this region definition */
+
+    Status = AcpiNsSearchOneScope (
+        *RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);
+    if (ACPI_SUCCESS (Status))
+    {
+        /*
+         * The _REG method is optional and there can be only one per region
+         * definition. This will be executed when the handler is attached
+         * or removed
+         */
+        RegionObj2->Extra.Method_REG = MethodNode;
+    }
+
+    return_VOID;
 }
 
 
@@ -651,7 +707,19 @@ AcpiEvExecuteRegMethod (
         return_ACPI_STATUS (AE_NOT_EXIST);
     }
 
-    if (RegionObj2->Extra.Method_REG == NULL)
+    if (RegionObj2->Extra.Method_REG == NULL ||
+        RegionObj->Region.Handler == NULL ||
+        !AcpiGbl_RegMethodsEnabled)
+    {
+        return_ACPI_STATUS (AE_OK);
+    }
+
+    /* _REG(DISCONNECT) should be paired with _REG(CONNECT) */
+
+    if ((Function == ACPI_REG_CONNECT &&
+        RegionObj->Common.Flags & AOPOBJ_REG_CONNECTED) ||
+        (Function == ACPI_REG_DISCONNECT &&
+         !(RegionObj->Common.Flags & AOPOBJ_REG_CONNECTED)))
     {
         return_ACPI_STATUS (AE_OK);
     }
@@ -703,6 +771,20 @@ AcpiEvExecuteRegMethod (
     Status = AcpiNsEvaluate (Info);
     AcpiUtRemoveReference (Args[1]);
 
+    if (ACPI_FAILURE (Status))
+    {
+        goto Cleanup2;
+    }
+
+    if (Function == ACPI_REG_CONNECT)
+    {
+        RegionObj->Common.Flags |= AOPOBJ_REG_CONNECTED;
+    }
+    else
+    {
+        RegionObj->Common.Flags &= ~AOPOBJ_REG_CONNECTED;
+    }
+
 Cleanup2:
     AcpiUtRemoveReference (Args[0]);
 
@@ -718,26 +800,28 @@ Cleanup1:
  *
  * PARAMETERS:  Node            - Namespace node for the device
  *              SpaceId         - The address space ID
+ *              Function        - Passed to _REG: On (1) or Off (0)
  *
- * RETURN:      Status
+ * RETURN:      None
  *
  * DESCRIPTION: Run all _REG methods for the input Space ID;
  *              Note: assumes namespace is locked, or system init time.
  *
  ******************************************************************************/
 
-ACPI_STATUS
+void
 AcpiEvExecuteRegMethods (
     ACPI_NAMESPACE_NODE     *Node,
-    ACPI_ADR_SPACE_TYPE     SpaceId)
+    ACPI_ADR_SPACE_TYPE     SpaceId,
+    UINT32                  Function)
 {
-    ACPI_STATUS             Status;
     ACPI_REG_WALK_INFO      Info;
 
 
     ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
 
     Info.SpaceId = SpaceId;
+    Info.Function = Function;
     Info.RegRunCount = 0;
 
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
@@ -750,7 +834,7 @@ AcpiEvExecuteRegMethods (
      * regions and _REG methods. (i.e. handlers must be installed for all
      * regions of this Space ID before we can run any _REG methods)
      */
-    Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
+    (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
         ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL);
 
     /* Special case for EC: handle "orphan" _REG methods with no region */
@@ -764,7 +848,7 @@ AcpiEvExecuteRegMethods (
         "    Executed %u _REG methods for SpaceId %s\n",
         Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId)));
 
-    return_ACPI_STATUS (Status);
+    return_VOID;
 }
 
 
@@ -831,7 +915,7 @@ AcpiEvRegRun (
     }
 
     Info->RegRunCount++;
-    Status = AcpiEvExecuteRegMethod (ObjDesc, ACPI_REG_CONNECT);
+    Status = AcpiEvExecuteRegMethod (ObjDesc, Info->Function);
     return (Status);
 }
 
index 405af22..448e57e 100644 (file)
@@ -320,9 +320,9 @@ AcpiEvPciConfigRegionSetup (
                 /* Install a handler for this PCI root bridge */
 
                 Status = AcpiInstallAddressSpaceHandler (
-                            (ACPI_HANDLE) PciRootNode,
-                            ACPI_ADR_SPACE_PCI_CONFIG,
-                            ACPI_DEFAULT_HANDLER, NULL, NULL);
+                    (ACPI_HANDLE) PciRootNode,
+                    ACPI_ADR_SPACE_PCI_CONFIG,
+                    ACPI_DEFAULT_HANDLER, NULL, NULL);
                 if (ACPI_FAILURE (Status))
                 {
                     if (Status == AE_SAME_HANDLER)
@@ -396,7 +396,7 @@ AcpiEvPciConfigRegionSetup (
      * contained in the parent's scope.
      */
     Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR,
-                PciDeviceNode, &PciValue);
+        PciDeviceNode, &PciValue);
 
     /*
      * The default is zero, and since the allocation above zeroed the data,
@@ -411,7 +411,7 @@ AcpiEvPciConfigRegionSetup (
     /* The PCI segment number comes from the _SEG method */
 
     Status = AcpiUtEvaluateNumericObject (METHOD_NAME__SEG,
-                PciRootNode, &PciValue);
+        PciRootNode, &PciValue);
     if (ACPI_SUCCESS (Status))
     {
         PciId->Segment = ACPI_LOWORD (PciValue);
@@ -420,7 +420,7 @@ AcpiEvPciConfigRegionSetup (
     /* The PCI bus number comes from the _BBN method */
 
     Status = AcpiUtEvaluateNumericObject (METHOD_NAME__BBN,
-                PciRootNode, &PciValue);
+        PciRootNode, &PciValue);
     if (ACPI_SUCCESS (Status))
     {
         PciId->Bus = ACPI_LOWORD (PciValue);
@@ -639,9 +639,6 @@ AcpiEvInitializeRegion (
     ACPI_ADR_SPACE_TYPE     SpaceId;
     ACPI_NAMESPACE_NODE     *Node;
     ACPI_STATUS             Status;
-    ACPI_NAMESPACE_NODE     *MethodNode;
-    ACPI_NAME               *RegNamePtr = (ACPI_NAME *) METHOD_NAME__REG;
-    ACPI_OPERAND_OBJECT     *RegionObj2;
 
 
     ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked);
@@ -657,39 +654,15 @@ AcpiEvInitializeRegion (
         return_ACPI_STATUS (AE_OK);
     }
 
-    RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
-    if (!RegionObj2)
-    {
-        return_ACPI_STATUS (AE_NOT_EXIST);
-    }
+    AcpiEvAssociateRegMethod (RegionObj);
+    RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;
 
     Node = RegionObj->Region.Node->Parent;
     SpaceId = RegionObj->Region.SpaceId;
 
-    /* Setup defaults */
-
-    RegionObj->Region.Handler = NULL;
-    RegionObj2->Extra.Method_REG = NULL;
-    RegionObj->Common.Flags &= ~(AOPOBJ_SETUP_COMPLETE);
-    RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;
-
-    /* Find any "_REG" method associated with this region definition */
-
-    Status = AcpiNsSearchOneScope (
-                *RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);
-    if (ACPI_SUCCESS (Status))
-    {
-        /*
-         * The _REG method is optional and there can be only one per region
-         * definition. This will be executed when the handler is attached
-         * or removed
-         */
-        RegionObj2->Extra.Method_REG = MethodNode;
-    }
-
     /*
      * The following loop depends upon the root Node having no parent
-     * ie: AcpiGbl_RootNode->ParentEntry being set to NULL
+     * ie: AcpiGbl_RootNode->Parent being set to NULL
      */
     while (Node)
     {
@@ -704,18 +677,10 @@ AcpiEvInitializeRegion (
             switch (Node->Type)
             {
             case ACPI_TYPE_DEVICE:
-
-                HandlerObj = ObjDesc->Device.Handler;
-                break;
-
             case ACPI_TYPE_PROCESSOR:
-
-                HandlerObj = ObjDesc->Processor.Handler;
-                break;
-
             case ACPI_TYPE_THERMAL:
 
-                HandlerObj = ObjDesc->ThermalZone.Handler;
+                HandlerObj = ObjDesc->CommonNotify.Handler;
                 break;
 
             case ACPI_TYPE_METHOD:
@@ -739,51 +704,43 @@ AcpiEvInitializeRegion (
                 break;
             }
 
-            while (HandlerObj)
+            HandlerObj = AcpiEvFindRegionHandler (SpaceId, HandlerObj);
+            if (HandlerObj)
             {
-                /* Is this handler of the correct type? */
-
-                if (HandlerObj->AddressSpace.SpaceId == SpaceId)
-                {
-                    /* Found correct handler */
+                /* Found correct handler */
 
-                    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
-                        "Found handler %p for region %p in obj %p\n",
-                        HandlerObj, RegionObj, ObjDesc));
+                ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+                    "Found handler %p for region %p in obj %p\n",
+                    HandlerObj, RegionObj, ObjDesc));
 
-                    Status = AcpiEvAttachRegion (HandlerObj, RegionObj,
-                                AcpiNsLocked);
+                Status = AcpiEvAttachRegion (HandlerObj, RegionObj,
+                    AcpiNsLocked);
 
-                    /*
-                     * Tell all users that this region is usable by
-                     * running the _REG method
-                     */
-                    if (AcpiNsLocked)
+                /*
+                 * Tell all users that this region is usable by
+                 * running the _REG method
+                 */
+                if (AcpiNsLocked)
+                {
+                    Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+                    if (ACPI_FAILURE (Status))
                     {
-                        Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-                        if (ACPI_FAILURE (Status))
-                        {
-                            return_ACPI_STATUS (Status);
-                        }
+                        return_ACPI_STATUS (Status);
                     }
+                }
 
-                    Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);
+                Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);
 
-                    if (AcpiNsLocked)
+                if (AcpiNsLocked)
+                {
+                    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+                    if (ACPI_FAILURE (Status))
                     {
-                        Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
-                        if (ACPI_FAILURE (Status))
-                        {
-                            return_ACPI_STATUS (Status);
-                        }
+                        return_ACPI_STATUS (Status);
                     }
-
-                    return_ACPI_STATUS (AE_OK);
                 }
 
-                /* Try next handler in the list */
-
-                HandlerObj = HandlerObj->AddressSpace.Next;
+                return_ACPI_STATUS (AE_OK);
             }
         }
 
index 987b03c..f021ab8 100644 (file)
@@ -291,7 +291,7 @@ AcpiEvInstallSciHandler (
 
 
     Status = AcpiOsInstallInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
-                AcpiEvSciXruptHandler, AcpiGbl_GpeXruptListHead);
+        AcpiEvSciXruptHandler, AcpiGbl_GpeXruptListHead);
     return_ACPI_STATUS (Status);
 }
 
@@ -330,7 +330,7 @@ AcpiEvRemoveAllSciHandlers (
     /* Just let the OS remove the handler and disable the level */
 
     Status = AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
-                AcpiEvSciXruptHandler);
+        AcpiEvSciXruptHandler);
 
     if (!AcpiGbl_SciHandlerList)
     {
index 5e3391d..5469a22 100644 (file)
@@ -1074,8 +1074,8 @@ AcpiInstallGpeHandler (
     ACPI_FUNCTION_TRACE (AcpiInstallGpeHandler);
 
 
-    Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type, FALSE,
-                Address, Context);
+    Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type,
+        FALSE, Address, Context);
 
     return_ACPI_STATUS (Status);
 }
@@ -1115,8 +1115,8 @@ AcpiInstallGpeRawHandler (
     ACPI_FUNCTION_TRACE (AcpiInstallGpeRawHandler);
 
 
-    Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type, TRUE,
-                Address, Context);
+    Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type,
+        TRUE, Address, Context);
 
     return_ACPI_STATUS (Status);
 }
@@ -1282,7 +1282,7 @@ AcpiAcquireGlobalLock (
     AcpiExEnterInterpreter ();
 
     Status = AcpiExAcquireMutexObject (Timeout,
-                AcpiGbl_GlobalLockMutex, AcpiOsGetThreadId ());
+        AcpiGbl_GlobalLockMutex, AcpiOsGetThreadId ());
 
     if (ACPI_SUCCESS (Status))
     {
index 271aacc..b4fd27e 100644 (file)
@@ -148,7 +148,7 @@ AcpiEnable (
 
     /* ACPI tables must be present */
 
-    if (!AcpiTbTablesLoaded ())
+    if (AcpiGbl_FadtIndex == ACPI_INVALID_TABLE_INDEX)
     {
         return_ACPI_STATUS (AE_NO_ACPI_TABLES);
     }
@@ -164,7 +164,8 @@ AcpiEnable (
 
     if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI)
     {
-        ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "System is already in ACPI mode\n"));
+        ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
+            "System is already in ACPI mode\n"));
     }
     else
     {
@@ -234,7 +235,8 @@ AcpiDisable (
             return_ACPI_STATUS (Status);
         }
 
-        ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI mode disabled\n"));
+        ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
+            "ACPI mode disabled\n"));
     }
 
     return_ACPI_STATUS (Status);
@@ -280,8 +282,8 @@ AcpiEnableEvent (
      * register bit)
      */
     Status = AcpiWriteBitRegister (
-                AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
-                ACPI_ENABLE_EVENT);
+        AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
+        ACPI_ENABLE_EVENT);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -290,7 +292,7 @@ AcpiEnableEvent (
     /* Make sure that the hardware responded */
 
     Status = AcpiReadBitRegister (
-                AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
+        AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -346,15 +348,15 @@ AcpiDisableEvent (
      * register bit)
      */
     Status = AcpiWriteBitRegister (
-                AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
-                ACPI_DISABLE_EVENT);
+        AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
+        ACPI_DISABLE_EVENT);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
     }
 
     Status = AcpiReadBitRegister (
-                AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
+        AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -407,8 +409,8 @@ AcpiClearEvent (
      * register bit)
      */
     Status = AcpiWriteBitRegister (
-                AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
-                ACPI_CLEAR_STATUS);
+        AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
+        ACPI_CLEAR_STATUS);
 
     return_ACPI_STATUS (Status);
 }
@@ -465,7 +467,7 @@ AcpiGetEventStatus (
     /* Fixed event currently enabled? */
 
     Status = AcpiReadBitRegister (
-                AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
+        AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -480,7 +482,7 @@ AcpiGetEventStatus (
     /* Fixed event currently active? */
 
     Status = AcpiReadBitRegister (
-                AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
+        AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
index f4f0da1..f55261f 100644 (file)
@@ -512,7 +512,7 @@ AcpiSetupGpeForWake (
      * level-triggered (for windows compatibility).
      */
     if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
-            ACPI_GPE_DISPATCH_NONE)
+        ACPI_GPE_DISPATCH_NONE)
     {
         /*
          * This is the first device for implicit notify on this GPE.
@@ -527,7 +527,7 @@ AcpiSetupGpeForWake (
      * this device to the notify list.
      */
     if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
-            ACPI_GPE_DISPATCH_NOTIFY)
+        ACPI_GPE_DISPATCH_NOTIFY)
     {
         /* Ensure that the device is not already in the list */
 
@@ -992,8 +992,8 @@ AcpiInstallGpeBlock (
      * is always zero
      */
     Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
-                GpeBlockAddress->SpaceId, RegisterCount,
-                0, InterruptNumber, &GpeBlock);
+        GpeBlockAddress->SpaceId, RegisterCount,
+        0, InterruptNumber, &GpeBlock);
     if (ACPI_FAILURE (Status))
     {
         goto UnlockAndExit;
index e220676..6617321 100644 (file)
@@ -186,48 +186,16 @@ AcpiInstallAddressSpaceHandler (
 
     /* Install the handler for all Regions for this Space ID */
 
-    Status = AcpiEvInstallSpaceHandler (Node, SpaceId, Handler, Setup, Context);
+    Status = AcpiEvInstallSpaceHandler (
+        Node, SpaceId, Handler, Setup, Context);
     if (ACPI_FAILURE (Status))
     {
         goto UnlockAndExit;
     }
 
-    /*
-     * For the default SpaceIDs, (the IDs for which there are default region handlers
-     * installed) Only execute the _REG methods if the global initialization _REG
-     * methods have already been run (via AcpiInitializeObjects). In other words,
-     * we will defer the execution of the _REG methods for these SpaceIDs until
-     * execution of AcpiInitializeObjects. This is done because we need the handlers
-     * for the default spaces (mem/io/pci/table) to be installed before we can run
-     * any control methods (or _REG methods). There is known BIOS code that depends
-     * on this.
-     *
-     * For all other SpaceIDs, we can safely execute the _REG methods immediately.
-     * This means that for IDs like EmbeddedController, this function should be called
-     * only after AcpiEnableSubsystem has been called.
-     */
-    switch (SpaceId)
-    {
-    case ACPI_ADR_SPACE_SYSTEM_MEMORY:
-    case ACPI_ADR_SPACE_SYSTEM_IO:
-    case ACPI_ADR_SPACE_PCI_CONFIG:
-    case ACPI_ADR_SPACE_DATA_TABLE:
-
-        if (!AcpiGbl_RegMethodsExecuted)
-        {
-            /* We will defer execution of the _REG methods for this space */
-            goto UnlockAndExit;
-        }
-        break;
-
-    default:
-
-        break;
-    }
-
     /* Run all _REG methods for this address space */
 
-    Status = AcpiEvExecuteRegMethods (Node, SpaceId);
+    AcpiEvExecuteRegMethods (Node, SpaceId, ACPI_REG_CONNECT);
 
 
 UnlockAndExit:
@@ -306,8 +274,8 @@ AcpiRemoveAddressSpaceHandler (
 
     /* Find the address handler the user requested */
 
-    HandlerObj = ObjDesc->Device.Handler;
-    LastObjPtr = &ObjDesc->Device.Handler;
+    HandlerObj = ObjDesc->CommonNotify.Handler;
+    LastObjPtr = &ObjDesc->CommonNotify.Handler;
     while (HandlerObj)
     {
         /* We have a handler, see if user requested this one */
index d4f7087..06aca94 100644 (file)
@@ -254,9 +254,9 @@ AcpiExLoadTableOp (
     /* Find the ACPI table in the RSDT/XSDT */
 
     Status = AcpiTbFindTable (
-                Operand[0]->String.Pointer,
-                Operand[1]->String.Pointer,
-                Operand[2]->String.Pointer, &TableIndex);
+        Operand[0]->String.Pointer,
+        Operand[1]->String.Pointer,
+        Operand[2]->String.Pointer, &TableIndex);
     if (ACPI_FAILURE (Status))
     {
         if (Status != AE_NOT_FOUND)
@@ -290,7 +290,7 @@ AcpiExLoadTableOp (
          * location within the namespace where the table will be loaded.
          */
         Status = AcpiNsGetNode (StartNode, Operand[3]->String.Pointer,
-                    ACPI_NS_SEARCH_PARENT, &ParentNode);
+            ACPI_NS_SEARCH_PARENT, &ParentNode);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
@@ -314,7 +314,7 @@ AcpiExLoadTableOp (
         /* Find the node referenced by the ParameterPathString */
 
         Status = AcpiNsGetNode (StartNode, Operand[4]->String.Pointer,
-                    ACPI_NS_SEARCH_PARENT, &ParameterNode);
+            ACPI_NS_SEARCH_PARENT, &ParameterNode);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
@@ -336,8 +336,7 @@ AcpiExLoadTableOp (
         /* Store the parameter data into the optional parameter object */
 
         Status = AcpiExStore (Operand[5],
-                    ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParameterNode),
-                    WalkState);
+            ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParameterNode), WalkState);
         if (ACPI_FAILURE (Status))
         {
             (void) AcpiExUnloadTable (DdbHandle);
@@ -359,7 +358,7 @@ AcpiExLoadTableOp (
     if (AcpiGbl_TableHandler)
     {
         (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
-                    AcpiGbl_TableHandlerContext);
+            AcpiGbl_TableHandlerContext);
     }
 
     *ReturnDesc = DdbHandle;
@@ -399,7 +398,7 @@ AcpiExRegionRead (
     for (i = 0; i < Length; i++)
     {
         Status = AcpiEvAddressSpaceDispatch (ObjDesc, NULL, ACPI_READ,
-                    RegionOffset, 8, &Value);
+            RegionOffset, 8, &Value);
         if (ACPI_FAILURE (Status))
         {
             return (Status);
@@ -469,8 +468,8 @@ AcpiExLoadOp (
         }
 
         /*
-         * If the Region Address and Length have not been previously evaluated,
-         * evaluate them now and save the results.
+         * If the Region Address and Length have not been previously
+         * evaluated, evaluate them now and save the results.
          */
         if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID))
         {
@@ -490,7 +489,7 @@ AcpiExLoadOp (
         }
 
         Status = AcpiExRegionRead (ObjDesc, sizeof (ACPI_TABLE_HEADER),
-                    ACPI_CAST_PTR (UINT8, TableHeader));
+            ACPI_CAST_PTR (UINT8, TableHeader));
         Length = TableHeader->Length;
         ACPI_FREE (TableHeader);
 
@@ -533,7 +532,7 @@ AcpiExLoadOp (
         /* Read the entire table */
 
         Status = AcpiExRegionRead (ObjDesc, Length,
-                    ACPI_CAST_PTR (UINT8, Table));
+            ACPI_CAST_PTR (UINT8, Table));
         if (ACPI_FAILURE (Status))
         {
             ACPI_FREE (Table);
@@ -555,7 +554,8 @@ AcpiExLoadOp (
 
         /* Get the actual table length from the table header */
 
-        TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
+        TableHeader = ACPI_CAST_PTR (
+            ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
         Length = TableHeader->Length;
 
         /* Table cannot extend beyond the buffer */
@@ -570,8 +570,8 @@ AcpiExLoadOp (
         }
 
         /*
-         * Copy the table from the buffer because the buffer could be modified
-         * or even deleted in the future
+         * Copy the table from the buffer because the buffer could be
+         * modified or even deleted in the future
          */
         Table = ACPI_ALLOCATE (Length);
         if (!Table)
@@ -593,8 +593,8 @@ AcpiExLoadOp (
     (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
 
     Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
-                ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
-                &TableIndex);
+        ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
+        &TableIndex);
 
     (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
     if (ACPI_FAILURE (Status))
@@ -609,7 +609,8 @@ AcpiExLoadOp (
      * Note: Now table is "INSTALLED", it must be validated before
      * loading.
      */
-    Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
+    Status = AcpiTbValidateTable (
+        &AcpiGbl_RootTableList.Tables[TableIndex]);
     if (ACPI_FAILURE (Status))
     {
         return_ACPI_STATUS (Status);
@@ -652,7 +653,7 @@ AcpiExLoadOp (
     if (AcpiGbl_TableHandler)
     {
         (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
-                    AcpiGbl_TableHandlerContext);
+            AcpiGbl_TableHandlerContext);
     }
 
     return_ACPI_STATUS (Status);
@@ -729,7 +730,7 @@ AcpiExUnloadTable (
         if (ACPI_SUCCESS (Status))
         {
             (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table,
-                        AcpiGbl_TableHandlerContext);
+                AcpiGbl_TableHandlerContext);
         }
     }
 
index 019a490..dc5fd9f 100644 (file)
@@ -323,9 +323,7 @@ AcpiExConvertToBuffer (
         /* Copy the integer to the buffer, LSB first */
 
         NewBuf = ReturnDesc->Buffer.Pointer;
-        memcpy (NewBuf,
-                        &ObjDesc->Integer.Value,
-                        AcpiGbl_IntegerByteWidth);
+        memcpy (NewBuf, &ObjDesc->Integer.Value, AcpiGbl_IntegerByteWidth);
         break;
 
     case ACPI_TYPE_STRING:
@@ -338,8 +336,8 @@ AcpiExConvertToBuffer (
          * ASL/AML code that depends on the null being transferred to the new
          * buffer.
          */
-        ReturnDesc = AcpiUtCreateBufferObject (
-                        (ACPI_SIZE) ObjDesc->String.Length + 1);
+        ReturnDesc = AcpiUtCreateBufferObject ((ACPI_SIZE)
+            ObjDesc->String.Length + 1);
         if (!ReturnDesc)
         {
             return_ACPI_STATUS (AE_NO_MEMORY);
@@ -462,7 +460,8 @@ AcpiExConvertToAscii (
         {
             /* Get one hex digit, most significant digits first */
 
-            String[k] = (UINT8) AcpiUtHexToAsciiChar (Integer, ACPI_MUL_4 (j));
+            String[k] = (UINT8)
+                AcpiUtHexToAsciiChar (Integer, ACPI_MUL_4 (j));
             k++;
         }
         break;
@@ -563,8 +562,8 @@ AcpiExConvertToString (
 
         /* Convert integer to string */
 
-        StringLength = AcpiExConvertToAscii (ObjDesc->Integer.Value, Base,
-                            NewBuf, AcpiGbl_IntegerByteWidth);
+        StringLength = AcpiExConvertToAscii (
+            ObjDesc->Integer.Value, Base, NewBuf, AcpiGbl_IntegerByteWidth);
 
         /* Null terminate at the correct place */
 
@@ -653,8 +652,7 @@ AcpiExConvertToString (
         for (i = 0; i < ObjDesc->Buffer.Length; i++)
         {
             NewBuf += AcpiExConvertToAscii (
-                        (UINT64) ObjDesc->Buffer.Pointer[i], Base,
-                        NewBuf, 1);
+                (UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1);
             *NewBuf++ = Separator; /* each separated by a comma or space */
         }
 
@@ -757,8 +755,7 @@ AcpiExConvertToTargetType (
              * These types require an Integer operand. We can convert
              * a Buffer or a String to an Integer if necessary.
              */
-            Status = AcpiExConvertToInteger (SourceDesc, ResultDesc,
-                        16);
+            Status = AcpiExConvertToInteger (SourceDesc, ResultDesc, 16);
             break;
 
         case ACPI_TYPE_STRING:
@@ -767,7 +764,7 @@ AcpiExConvertToTargetType (
              * Integer or Buffer if necessary
              */
             Status = AcpiExConvertToString (SourceDesc, ResultDesc,
-                        ACPI_IMPLICIT_CONVERT_HEX);
+                ACPI_IMPLICIT_CONVERT_HEX);
             break;
 
         case ACPI_TYPE_BUFFER:
@@ -780,7 +777,8 @@ AcpiExConvertToTargetType (
 
         default:
 
-            ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X",
+            ACPI_ERROR ((AE_INFO,
+                "Bad destination type during conversion: 0x%X",
                 DestinationType));
             Status = AE_AML_INTERNAL;
             break;
index 9c7ffc1..f3c2004 100644 (file)
@@ -220,7 +220,7 @@ AcpiExCreateAlias (
          * target node or the alias Node
          */
         Status = AcpiNsAttachObject (AliasNode,
-                    AcpiNsGetAttachedObject (TargetNode), TargetNode->Type);
+            AcpiNsGetAttachedObject (TargetNode), TargetNode->Type);
         break;
     }
 
@@ -265,7 +265,7 @@ AcpiExCreateEvent (
      * that the event is created in an unsignalled state
      */
     Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT, 0,
-                &ObjDesc->Event.OsSemaphore);
+        &ObjDesc->Event.OsSemaphore);
     if (ACPI_FAILURE (Status))
     {
         goto Cleanup;
@@ -273,8 +273,9 @@ AcpiExCreateEvent (
 
     /* Attach object to the Node */
 
-    Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0],
-                ObjDesc, ACPI_TYPE_EVENT);
+    Status = AcpiNsAttachObject (
+        (ACPI_NAMESPACE_NODE *) WalkState->Operands[0],
+        ObjDesc, ACPI_TYPE_EVENT);
 
 Cleanup:
     /*
@@ -333,7 +334,8 @@ AcpiExCreateMutex (
     ObjDesc->Mutex.SyncLevel = (UINT8) WalkState->Operands[1]->Integer.Value;
     ObjDesc->Mutex.Node = (ACPI_NAMESPACE_NODE *) WalkState->Operands[0];
 
-    Status = AcpiNsAttachObject (ObjDesc->Mutex.Node, ObjDesc, ACPI_TYPE_MUTEX);
+    Status = AcpiNsAttachObject (
+        ObjDesc->Mutex.Node, ObjDesc, ACPI_TYPE_MUTEX);
 
 
 Cleanup:
@@ -401,7 +403,8 @@ AcpiExCreateRegion (
          * a table load for this exception. Instead, if the region is
          * actually used at runtime, abort the executing method.
          */
-        ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
+        ACPI_ERROR ((AE_INFO,
+            "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
     }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n",
@@ -420,9 +423,10 @@ AcpiExCreateRegion (
      * Remember location in AML stream of address & length
      * operands since they need to be evaluated at run time.
      */
-    RegionObj2 = ObjDesc->Common.NextObject;
+    RegionObj2 = AcpiNsGetSecondaryObject (ObjDesc);
     RegionObj2->Extra.AmlStart = AmlStart;
     RegionObj2->Extra.AmlLength = AmlLength;
+    RegionObj2->Extra.Method_REG = NULL;
     if (WalkState->ScopeInfo)
     {
         RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node;
@@ -438,6 +442,10 @@ AcpiExCreateRegion (
     ObjDesc->Region.Address = 0;
     ObjDesc->Region.Length = 0;
     ObjDesc->Region.Node = Node;
+    ObjDesc->Region.Handler = NULL;
+    ObjDesc->Common.Flags &=
+        ~(AOPOBJ_SETUP_COMPLETE | AOPOBJ_REG_CONNECTED |
+          AOPOBJ_OBJECT_INITIALIZED);
 
     /* Install the new region object in the parent Node */
 
@@ -496,7 +504,7 @@ AcpiExCreateProcessor (
     /* Install the processor object in the parent Node */
 
     Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0],
-                    ObjDesc, ACPI_TYPE_PROCESSOR);
+        ObjDesc, ACPI_TYPE_PROCESSOR);
 
     /* Remove local reference to the object */
 
@@ -547,7 +555,7 @@ AcpiExCreatePowerResource (
     /* Install the  power resource object in the parent Node */
 
     Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0],
-                    ObjDesc, ACPI_TYPE_POWER);
+        ObjDesc, ACPI_TYPE_POWER);
 
     /* Remove local reference to the object */
 
@@ -606,7 +614,8 @@ AcpiExCreateMethod (
      * flag, and SyncLevel for efficiency.
      */
     MethodFlags = (UINT8) Operand[1]->Integer.Value;
-    ObjDesc->Method.ParamCount = (UINT8) (MethodFlags & AML_METHOD_ARG_COUNT);
+    ObjDesc->Method.ParamCount = (UINT8)
+        (MethodFlags & AML_METHOD_ARG_COUNT);
 
     /*
      * Get the SyncLevel. If method is serialized, a mutex will be
@@ -627,7 +636,7 @@ AcpiExCreateMethod (
     /* Attach the new object to the method Node */
 
     Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0],
-                    ObjDesc, ACPI_TYPE_METHOD);
+        ObjDesc, ACPI_TYPE_METHOD);
 
     /* Remove local reference to the object */
 
index 00ec43f..9c2c107 100644 (file)
 
 #include "acpi.h"
 #include "accommon.h"
-#include "acnamesp.h"
 #include "acinterp.h"
-#include "acparser.h"
 
 
 #define _COMPONENT          ACPI_EXECUTER
         ACPI_MODULE_NAME    ("exdebug")
 
 
-static ACPI_OPERAND_OBJECT  *AcpiGbl_TraceMethodObject = NULL;
-
-/* Local prototypes */
-
-#ifdef ACPI_DEBUG_OUTPUT
-static const char *
-AcpiExGetTraceEventName (
-    ACPI_TRACE_EVENT_TYPE   Type);
-#endif
-
-
 #ifndef ACPI_NO_ERROR_MESSAGES
 /*******************************************************************************
  *
@@ -181,13 +168,20 @@ AcpiExDoDebugObject (
         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;
+    /* Null string or newline -- don't emit the line header */
+
+    if (SourceDesc &&
+        (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) &&
+        (SourceDesc->Common.Type == ACPI_TYPE_STRING))
+    {
+        if ((SourceDesc->String.Length == 0) ||
+                ((SourceDesc->String.Length == 1) &&
+                (*SourceDesc->String.Pointer == '\n')))
+        {
+            AcpiOsPrintf ("\n");
+            return_VOID;
+        }
+    }
 
     /*
      * Print line header as long as we are not in the middle of an
@@ -195,14 +189,31 @@ AcpiExDoDebugObject (
      */
     if (!((Level > 0) && Index == 0))
     {
-        AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
+        if (AcpiGbl_DisplayDebugTimer)
+        {
+            /*
+             * 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.
+             *
+             * Convert 100 nanosecond units to microseconds
+             */
+            Timer = ((UINT32) AcpiOsGetTimer () / 10);
+            Timer &= 0x03FFFFFF;
+
+            AcpiOsPrintf ("[ACPI Debug T=0x%8.8X] %*s", Timer, Level, " ");
+        }
+        else
+        {
+            AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
+        }
     }
 
     /* Display the index for package output only */
 
     if (Index > 0)
     {
-       AcpiOsPrintf ("(%.2u) ", Index-1);
+       AcpiOsPrintf ("(%.2u) ", Index - 1);
     }
 
     if (!SourceDesc)
@@ -213,7 +224,13 @@ AcpiExDoDebugObject (
 
     if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND)
     {
-        AcpiOsPrintf ("%s ", AcpiUtGetObjectTypeName (SourceDesc));
+        /* No object type prefix needed for integers and strings */
+
+        if ((SourceDesc->Common.Type != ACPI_TYPE_INTEGER) &&
+            (SourceDesc->Common.Type != ACPI_TYPE_STRING))
+        {
+            AcpiOsPrintf ("%s  ", AcpiUtGetObjectTypeName (SourceDesc));
+        }
 
         if (!AcpiUtValidInternalObject (SourceDesc))
         {
@@ -223,9 +240,9 @@ AcpiExDoDebugObject (
     }
     else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED)
     {
-        AcpiOsPrintf ("%s: %p\n",
+        AcpiOsPrintf ("%s  (Node %p)\n",
             AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type),
-            SourceDesc);
+                SourceDesc);
         return_VOID;
     }
     else
@@ -263,13 +280,12 @@ AcpiExDoDebugObject (
 
     case ACPI_TYPE_STRING:
 
-        AcpiOsPrintf ("[0x%.2X] \"%s\"\n",
-            SourceDesc->String.Length, SourceDesc->String.Pointer);
+        AcpiOsPrintf ("\"%s\"\n", SourceDesc->String.Pointer);
         break;
 
     case ACPI_TYPE_PACKAGE:
 
-        AcpiOsPrintf ("[Contains 0x%.2X Elements]\n",
+        AcpiOsPrintf ("(Contains 0x%.2X Elements):\n",
             SourceDesc->Package.Count);
 
         /* Output the entire contents of the package */
@@ -277,7 +293,7 @@ AcpiExDoDebugObject (
         for (i = 0; i < SourceDesc->Package.Count; i++)
         {
             AcpiExDoDebugObject (SourceDesc->Package.Elements[i],
-                Level+4, i+1);
+                Level + 4, i + 1);
         }
         break;
 
@@ -313,7 +329,7 @@ AcpiExDoDebugObject (
         if (SourceDesc->Reference.Node)
         {
             if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) !=
-                    ACPI_DESC_TYPE_NAMED)
+                ACPI_DESC_TYPE_NAMED)
             {
                 AcpiOsPrintf (" %p - Not a valid namespace node\n",
                     SourceDesc->Reference.Node);
@@ -338,7 +354,7 @@ AcpiExDoDebugObject (
                 default:
 
                     AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
-                        Level+4, 0);
+                        Level + 4, 0);
                     break;
                 }
             }
@@ -346,11 +362,13 @@ AcpiExDoDebugObject (
         else if (SourceDesc->Reference.Object)
         {
             if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) ==
-                    ACPI_DESC_TYPE_NAMED)
+                ACPI_DESC_TYPE_NAMED)
             {
-                AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *)
-                    SourceDesc->Reference.Object)->Object,
-                    Level+4, 0);
+                /* Reference object is a namespace node */
+
+                AcpiExDoDebugObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT,
+                    SourceDesc->Reference.Object),
+                    Level + 4, 0);
             }
             else
             {
@@ -375,8 +393,15 @@ AcpiExDoDebugObject (
                 case ACPI_TYPE_PACKAGE:
 
                     AcpiOsPrintf ("Package[%u] = ", Value);
-                    AcpiExDoDebugObject (*SourceDesc->Reference.Where,
-                        Level+4, 0);
+                    if (!(*SourceDesc->Reference.Where))
+                    {
+                        AcpiOsPrintf ("[Uninitialized Package Element]\n");
+                    }
+                    else
+                    {
+                        AcpiExDoDebugObject (*SourceDesc->Reference.Where,
+                            Level+4, 0);
+                    }
                     break;
 
                 default:
@@ -391,7 +416,7 @@ AcpiExDoDebugObject (
 
     default:
 
-        AcpiOsPrintf ("%p\n", SourceDesc);
+        AcpiOsPrintf ("(Descriptor %p)\n", SourceDesc);
         break;
     }
 
@@ -399,362 +424,3 @@ AcpiExDoDebugObject (
     return_VOID;
 }
 #endif
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiExInterpreterTraceEnabled
- *
- * PARAMETERS:  Name                - Whether method name should be matched,
- *                                    this should be checked before starting
- *                                    the tracer
- *
- * RETURN:      TRUE if interpreter trace is enabled.
- *
- * DESCRIPTION: Check whether interpreter trace is enabled
- *
- ******************************************************************************/
-
-static BOOLEAN
-AcpiExInterpreterTraceEnabled (
-    char                    *Name)
-{
-
-    /* Check if tracing is enabled */
-
-    if (!(AcpiGbl_TraceFlags & ACPI_TRACE_ENABLED))
-    {
-        return (FALSE);
-    }
-
-    /*
-     * Check if tracing is filtered:
-     *
-     * 1. If the tracer is started, AcpiGbl_TraceMethodObject should have
-     *    been filled by the trace starter
-     * 2. If the tracer is not started, AcpiGbl_TraceMethodName should be
-     *    matched if it is specified
-     * 3. If the tracer is oneshot style, AcpiGbl_TraceMethodName should
-     *    not be cleared by the trace stopper during the first match
-     */
-    if (AcpiGbl_TraceMethodObject)
-    {
-        return (TRUE);
-    }
-    if (Name &&
-        (AcpiGbl_TraceMethodName &&
-         strcmp (AcpiGbl_TraceMethodName, Name)))
-    {
-        return (FALSE);
-    }
-    if ((AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT) &&
-        !AcpiGbl_TraceMethodName)
-    {
-        return (FALSE);
-    }
-
-    return (TRUE);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiExGetTraceEventName
- *
- * PARAMETERS:  Type            - Trace event type
- *
- * RETURN:      Trace event name.
- *
- * DESCRIPTION: Used to obtain the full trace event name.
- *
- ******************************************************************************/
-
-#ifdef ACPI_DEBUG_OUTPUT
-
-static const char *
-AcpiExGetTraceEventName (
-    ACPI_TRACE_EVENT_TYPE   Type)
-{
-    switch (Type)
-    {
-    case ACPI_TRACE_AML_METHOD:
-
-        return "Method";
-
-    case ACPI_TRACE_AML_OPCODE:
-
-        return "Opcode";
-
-    case ACPI_TRACE_AML_REGION:
-
-        return "Region";
-
-    default:
-
-        return "";
-    }
-}
-
-#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiExTracePoint
- *
- * PARAMETERS:  Type                - Trace event type
- *              Begin               - TRUE if before execution
- *              Aml                 - Executed AML address
- *              Pathname            - Object path
- *
- * RETURN:      None
- *
- * DESCRIPTION: Internal interpreter execution trace.
- *
- ******************************************************************************/
-
-void
-AcpiExTracePoint (
-    ACPI_TRACE_EVENT_TYPE   Type,
-    BOOLEAN                 Begin,
-    UINT8                   *Aml,
-    char                    *Pathname)
-{
-
-    ACPI_FUNCTION_NAME (ExTracePoint);
-
-
-    if (Pathname)
-    {
-        ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
-                "%s %s [0x%p:%s] execution.\n",
-                AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
-                Aml, Pathname));
-    }
-    else
-    {
-        ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
-                "%s %s [0x%p] execution.\n",
-                AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
-                Aml));
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiExStartTraceMethod
- *
- * PARAMETERS:  MethodNode          - Node of the method
- *              ObjDesc             - The method object
- *              WalkState           - current state, NULL if not yet executing
- *                                    a method.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Start control method execution trace
- *
- ******************************************************************************/
-
-void
-AcpiExStartTraceMethod (
-    ACPI_NAMESPACE_NODE     *MethodNode,
-    ACPI_OPERAND_OBJECT     *ObjDesc,
-    ACPI_WALK_STATE         *WalkState)
-{
-    ACPI_STATUS             Status;
-    char                    *Pathname = NULL;
-    BOOLEAN                 Enabled = FALSE;
-
-
-    ACPI_FUNCTION_NAME (ExStartTraceMethod);
-
-
-    if (MethodNode)
-    {
-        Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
-    }
-
-    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
-    if (ACPI_FAILURE (Status))
-    {
-        goto Exit;
-    }
-
-    Enabled = AcpiExInterpreterTraceEnabled (Pathname);
-    if (Enabled && !AcpiGbl_TraceMethodObject)
-    {
-        AcpiGbl_TraceMethodObject = ObjDesc;
-        AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
-        AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
-        AcpiDbgLevel = ACPI_TRACE_LEVEL_ALL;
-        AcpiDbgLayer = ACPI_TRACE_LAYER_ALL;
-
-        if (AcpiGbl_TraceDbgLevel)
-        {
-            AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
-        }
-        if (AcpiGbl_TraceDbgLayer)
-        {
-            AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
-        }
-    }
-    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
-Exit:
-    if (Enabled)
-    {
-        ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, TRUE,
-                ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
-    }
-    if (Pathname)
-    {
-        ACPI_FREE (Pathname);
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiExStopTraceMethod
- *
- * PARAMETERS:  MethodNode          - Node of the method
- *              ObjDesc             - The method object
- *              WalkState           - current state, NULL if not yet executing
- *                                    a method.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Stop control method execution trace
- *
- ******************************************************************************/
-
-void
-AcpiExStopTraceMethod (
-    ACPI_NAMESPACE_NODE     *MethodNode,
-    ACPI_OPERAND_OBJECT     *ObjDesc,
-    ACPI_WALK_STATE         *WalkState)
-{
-    ACPI_STATUS             Status;
-    char                    *Pathname = NULL;
-    BOOLEAN                 Enabled;
-
-
-    ACPI_FUNCTION_NAME (ExStopTraceMethod);
-
-
-    if (MethodNode)
-    {
-        Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
-    }
-
-    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
-    if (ACPI_FAILURE (Status))
-    {
-        goto ExitPath;
-    }
-
-    Enabled = AcpiExInterpreterTraceEnabled (NULL);
-
-    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
-    if (Enabled)
-    {
-        ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,
-                ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
-    }
-
-    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
-    if (ACPI_FAILURE (Status))
-    {
-        goto ExitPath;
-    }
-
-    /* Check whether the tracer should be stopped */
-
-    if (AcpiGbl_TraceMethodObject == ObjDesc)
-    {
-        /* Disable further tracing if type is one-shot */
-
-        if (AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT)
-        {
-            AcpiGbl_TraceMethodName = NULL;
-        }
-
-        AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
-        AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
-        AcpiGbl_TraceMethodObject = NULL;
-    }
-
-    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
-ExitPath:
-    if (Pathname)
-    {
-        ACPI_FREE (Pathname);
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiExStartTraceOpcode
- *
- * PARAMETERS:  Op                  - The parser opcode object
- *              WalkState           - current state, NULL if not yet executing
- *                                    a method.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Start opcode execution trace
- *
- ******************************************************************************/
-
-void
-AcpiExStartTraceOpcode (
-    ACPI_PARSE_OBJECT       *Op,
-    ACPI_WALK_STATE         *WalkState)
-{
-
-    ACPI_FUNCTION_NAME (ExStartTraceOpcode);
-
-
-    if (AcpiExInterpreterTraceEnabled (NULL) &&
-        (AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
-    {
-        ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, TRUE,
-                Op->Common.Aml, Op->Common.AmlOpName);
-    }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiExStopTraceOpcode
- *
- * PARAMETERS:  Op                  - The parser opcode object
- *              WalkState           - current state, NULL if not yet executing
- *                                    a method.
- *
- * RETURN:      None
- *
- * DESCRIPTION: Stop opcode execution trace
- *
- ******************************************************************************/
-
-void
-AcpiExStopTraceOpcode (
-    ACPI_PARSE_OBJECT       *Op,
-    ACPI_WALK_STATE         *WalkState)
-{
-
-    ACPI_FUNCTION_NAME (ExStopTraceOpcode);
-
-
-    if (AcpiExInterpreterTraceEnabled (NULL) &&
-        (AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
-    {
-        ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, FALSE,
-                Op->Common.Aml, Op->Common.AmlOpName);
-    }
-}
index c682777..2f2836e 100644 (file)
@@ -525,7 +525,8 @@ AcpiExDumpObject (
 
         case ACPI_EXD_BUFFER:
 
-            ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);
+            ACPI_DUMP_BUFFER (
+                ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);
             break;
 
         case ACPI_EXD_PACKAGE:
@@ -544,7 +545,8 @@ AcpiExDumpObject (
         case ACPI_EXD_REFERENCE:
 
             ReferenceName = AcpiUtGetReferenceName (ObjDesc);
-            AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName));
+            AcpiExOutString (
+                "Class Name", ACPI_CAST_PTR (char, ReferenceName));
             AcpiExDumpReferenceObj (ObjDesc);
             break;
 
@@ -573,7 +575,8 @@ AcpiExDumpObject (
 
                     if ((Next == Start) || (Next == Data))
                     {
-                        AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
+                        AcpiOsPrintf (
+                            "\n**** Error: Object list appears to be circular linked");
                         break;
                     }
                 }
@@ -591,7 +594,8 @@ AcpiExDumpObject (
             if (Next)
             {
                 AcpiOsPrintf ("(%s %2.2X)",
-                    AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+                    AcpiUtGetObjectTypeName (Next),
+                    Next->AddressSpace.SpaceId);
 
                 while (Next->AddressSpace.Next)
                 {
@@ -603,11 +607,13 @@ AcpiExDumpObject (
 
                     Next = Next->AddressSpace.Next;
                     AcpiOsPrintf ("->%p(%s %2.2X)", Next,
-                        AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+                        AcpiUtGetObjectTypeName (Next),
+                        Next->AddressSpace.SpaceId);
 
                     if ((Next == Start) || (Next == Data))
                     {
-                        AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
+                        AcpiOsPrintf (
+                            "\n**** Error: Handler list appears to be circular linked");
                         break;
                     }
                 }
@@ -641,7 +647,8 @@ AcpiExDumpObject (
 
                     if ((Next == Start) || (Next == Data))
                     {
-                        AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
+                        AcpiOsPrintf (
+                            "\n**** Error: Region list appears to be circular linked");
                         break;
                     }
                 }
@@ -749,7 +756,8 @@ AcpiExDumpOperand (
     {
     case ACPI_TYPE_LOCAL_REFERENCE:
 
-        AcpiOsPrintf ("Reference: [%s] ", AcpiUtGetReferenceName (ObjDesc));
+        AcpiOsPrintf ("Reference: [%s] ",
+            AcpiUtGetReferenceName (ObjDesc));
 
         switch (ObjDesc->Reference.Class)
         {
@@ -777,7 +785,8 @@ AcpiExDumpOperand (
 
         case ACPI_REFCLASS_NAME:
 
-            AcpiOsPrintf ("- [%4.4s]\n", ObjDesc->Reference.Node->Name.Ascii);
+            AcpiOsPrintf ("- [%4.4s]\n",
+                ObjDesc->Reference.Node->Name.Ascii);
             break;
 
         case ACPI_REFCLASS_ARG:
@@ -808,8 +817,8 @@ AcpiExDumpOperand (
                 Length = 128;
             }
 
-            AcpiOsPrintf ("Buffer Contents: (displaying length 0x%.2X)\n",
-                Length);
+            AcpiOsPrintf (
+                "Buffer Contents: (displaying length 0x%.2X)\n", Length);
             ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, Length);
         }
         break;
@@ -835,7 +844,8 @@ AcpiExDumpOperand (
         {
             for (Index = 0; Index < ObjDesc->Package.Count; Index++)
             {
-                AcpiExDumpOperand (ObjDesc->Package.Elements[Index], Depth+1);
+                AcpiExDumpOperand (
+                    ObjDesc->Package.Elements[Index], Depth + 1);
             }
         }
         break;
@@ -888,7 +898,7 @@ AcpiExDumpOperand (
             ObjDesc->Field.BaseByteOffset,
             ObjDesc->Field.StartFieldBitOffset);
 
-        AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth+1);
+        AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth + 1);
         break;
 
     case ACPI_TYPE_LOCAL_INDEX_FIELD:
@@ -908,13 +918,13 @@ AcpiExDumpOperand (
             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL*\n"));
         }
         else if ((ObjDesc->BufferField.BufferObj)->Common.Type !=
-                    ACPI_TYPE_BUFFER)
+            ACPI_TYPE_BUFFER)
         {
             AcpiOsPrintf ("*not a Buffer*\n");
         }
         else
         {
-            AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth+1);
+            AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth + 1);
         }
         break;
 
@@ -1214,7 +1224,8 @@ AcpiExDumpPackageObj (
         AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
         if (ObjDesc->Buffer.Length)
         {
-            AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
+            AcpiUtDebugDumpBuffer (
+                ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
                 ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
         }
         else
@@ -1230,7 +1241,8 @@ AcpiExDumpPackageObj (
 
         for (i = 0; i < ObjDesc->Package.Count; i++)
         {
-            AcpiExDumpPackageObj (ObjDesc->Package.Elements[i], Level+1, i);
+            AcpiExDumpPackageObj (
+                ObjDesc->Package.Elements[i], Level + 1, i);
         }
         break;
 
@@ -1328,7 +1340,8 @@ DumpObject:
         ObjDesc = ObjDesc->Common.NextObject;
         if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
         {
-            AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
+            AcpiOsPrintf (
+                "Secondary object is not a known object type: %2.2X\n",
                 ObjDesc->Common.Type);
 
             return_VOID;
index dbd294b..b70e080 100644 (file)
@@ -256,28 +256,31 @@ AcpiExReadDataFromField (
               ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
     {
         /*
-         * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold
-         * the data and then directly access the region handler.
+         * This is an SMBus, GSBus or IPMI read. We must create a buffer to
+         * hold the data and then directly access the region handler.
          *
-         * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function
+         * Note: SMBus and GSBus protocol value is passed in upper 16-bits
+         * of Function
          */
-        if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
+        if (ObjDesc->Field.RegionObj->Region.SpaceId ==
+            ACPI_ADR_SPACE_SMBUS)
         {
             Length = ACPI_SMBUS_BUFFER_SIZE;
             Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
         }
-        else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
+        else if (ObjDesc->Field.RegionObj->Region.SpaceId ==
+            ACPI_ADR_SPACE_GSBUS)
         {
             AccessorType = ObjDesc->Field.Attribute;
-            Length = AcpiExGetSerialAccessLength (AccessorType,
-                ObjDesc->Field.AccessLength);
+            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)
+             *     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);
@@ -301,8 +304,8 @@ AcpiExReadDataFromField (
         /* Call the region handler for the read */
 
         Status = AcpiExAccessRegion (ObjDesc, 0,
-                    ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer),
-                    Function);
+            ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), Function);
+
         AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
         goto Exit;
     }
@@ -317,7 +320,9 @@ AcpiExReadDataFromField (
      *
      * Note: Field.length is in bits.
      */
-    Length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->Field.BitLength);
+    Length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (
+        ObjDesc->Field.BitLength);
+
     if (Length > AcpiGbl_IntegerByteWidth)
     {
         /* Field is too large for an Integer, create a Buffer instead */
@@ -362,8 +367,9 @@ AcpiExReadDataFromField (
 
         /* Perform the write */
 
-        Status = AcpiExAccessRegion (ObjDesc, 0,
-                    (UINT64 *) Buffer, ACPI_READ);
+        Status = AcpiExAccessRegion (
+            ObjDesc, 0, (UINT64 *) Buffer, ACPI_READ);
+
         AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
         if (ACPI_FAILURE (Status))
         {
@@ -468,42 +474,47 @@ AcpiExWriteDataToField (
               ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
     {
         /*
-         * This is an SMBus, GSBus or IPMI write. We will bypass the entire field
-         * mechanism and handoff the buffer directly to the handler. For
-         * these address spaces, the buffer is bi-directional; on a write,
-         * return data is returned in the same buffer.
+         * This is an SMBus, GSBus or IPMI write. We will bypass the entire
+         * field mechanism and handoff the buffer directly to the handler.
+         * For these address spaces, the buffer is bi-directional; on a
+         * write, return data is returned in the same buffer.
          *
          * Source must be a buffer of sufficient size:
-         * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE.
+         * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or
+         * ACPI_IPMI_BUFFER_SIZE.
          *
-         * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function
+         * Note: SMBus and GSBus protocol type is passed in upper 16-bits
+         * of Function
          */
         if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
         {
             ACPI_ERROR ((AE_INFO,
-                "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s",
+                "SMBus/IPMI/GenericSerialBus write requires "
+                "Buffer, found type %s",
                 AcpiUtGetObjectTypeName (SourceDesc)));
 
             return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
         }
 
-        if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
+        if (ObjDesc->Field.RegionObj->Region.SpaceId ==
+            ACPI_ADR_SPACE_SMBUS)
         {
             Length = ACPI_SMBUS_BUFFER_SIZE;
             Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
         }
-        else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
+        else if (ObjDesc->Field.RegionObj->Region.SpaceId ==
+            ACPI_ADR_SPACE_GSBUS)
         {
             AccessorType = ObjDesc->Field.Attribute;
-            Length = AcpiExGetSerialAccessLength (AccessorType,
-                ObjDesc->Field.AccessLength);
+            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)
+             *     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);
@@ -517,7 +528,8 @@ AcpiExWriteDataToField (
         if (SourceDesc->Buffer.Length < Length)
         {
             ACPI_ERROR ((AE_INFO,
-                "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u",
+                "SMBus/IPMI/GenericSerialBus write requires "
+                "Buffer of length %u, found length %u",
                 Length, SourceDesc->Buffer.Length));
 
             return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);
@@ -542,8 +554,8 @@ AcpiExWriteDataToField (
          * Perform the write (returns status and perhaps data in the
          * same buffer)
          */
-        Status = AcpiExAccessRegion (ObjDesc, 0,
-                    (UINT64 *) Buffer, Function);
+        Status = AcpiExAccessRegion (
+            ObjDesc, 0, (UINT64 *) Buffer, Function);
         AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
 
         *ResultDesc = BufferDesc;
@@ -566,7 +578,7 @@ AcpiExWriteDataToField (
         }
 
         ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-            "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X  [TO]:  Pin %u Bits %u\n",
+            "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));
@@ -579,8 +591,8 @@ AcpiExWriteDataToField (
 
         /* Perform the write */
 
-        Status = AcpiExAccessRegion (ObjDesc, 0,
-                    (UINT64 *) Buffer, ACPI_WRITE);
+        Status = AcpiExAccessRegion (
+            ObjDesc, 0, (UINT64 *) Buffer, ACPI_WRITE);
         AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
         return_ACPI_STATUS (Status);
     }
index 39a0f37..106405a 100644 (file)
@@ -192,7 +192,8 @@ AcpiExSetupRegion (
 
     if (!AcpiIsValidSpaceId (SpaceId))
     {
-        ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
+        ACPI_ERROR ((AE_INFO,
+            "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
         return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
     }
 
@@ -242,8 +243,8 @@ AcpiExSetupRegion (
      * (Region length is specified in bytes)
      */
     if (RgnDesc->Region.Length <
-            (ObjDesc->CommonField.BaseByteOffset + FieldDatumByteOffset +
-            ObjDesc->CommonField.AccessByteWidth))
+        (ObjDesc->CommonField.BaseByteOffset + FieldDatumByteOffset +
+        ObjDesc->CommonField.AccessByteWidth))
     {
         if (AcpiGbl_EnableInterpreterSlack)
         {
@@ -270,7 +271,8 @@ AcpiExSetupRegion (
              * byte, and a field with Dword access specified.
              */
             ACPI_ERROR ((AE_INFO,
-                "Field [%4.4s] access width (%u bytes) too large for region [%4.4s] (length %u)",
+                "Field [%4.4s] access width (%u bytes) "
+                "too large for region [%4.4s] (length %u)",
                 AcpiUtGetNodeName (ObjDesc->CommonField.Node),
                 ObjDesc->CommonField.AccessByteWidth,
                 AcpiUtGetNodeName (RgnDesc->Region.Node),
@@ -282,7 +284,8 @@ AcpiExSetupRegion (
          * exceeds region length, indicate an error
          */
         ACPI_ERROR ((AE_INFO,
-            "Field [%4.4s] Base+Offset+Width %u+%u+%u is beyond end of region [%4.4s] (length %u)",
+            "Field [%4.4s] Base+Offset+Width %u+%u+%u "
+            "is beyond end of region [%4.4s] (length %u)",
             AcpiUtGetNodeName (ObjDesc->CommonField.Node),
             ObjDesc->CommonField.BaseByteOffset,
             FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth,
@@ -372,8 +375,8 @@ AcpiExAccessRegion (
     /* Invoke the appropriate AddressSpace/OpRegion handler */
 
     Status = AcpiEvAddressSpaceDispatch (RgnDesc, ObjDesc,
-                Function, RegionOffset,
-                ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value);
+        Function, RegionOffset,
+        ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value);
 
     if (ACPI_FAILURE (Status))
     {
@@ -584,8 +587,8 @@ AcpiExFieldDatumIo (
          * For simple RegionFields, we just directly access the owning
          * Operation Region.
          */
-        Status = AcpiExAccessRegion (ObjDesc, FieldDatumByteOffset, Value,
-                    ReadWrite);
+        Status = AcpiExAccessRegion (
+            ObjDesc, FieldDatumByteOffset, Value, ReadWrite);
         break;
 
     case ACPI_TYPE_LOCAL_INDEX_FIELD:
@@ -608,8 +611,7 @@ AcpiExFieldDatumIo (
             FieldDatumByteOffset));
 
         Status = AcpiExInsertIntoField (ObjDesc->IndexField.IndexObj,
-                    &FieldDatumByteOffset,
-                    sizeof (FieldDatumByteOffset));
+            &FieldDatumByteOffset, sizeof (FieldDatumByteOffset));
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
@@ -622,8 +624,8 @@ AcpiExFieldDatumIo (
             ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
                 "Read from Data Register\n"));
 
-            Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj,
-                        Value, sizeof (UINT64));
+            Status = AcpiExExtractFromField (
+                ObjDesc->IndexField.DataObj, Value, sizeof (UINT64));
         }
         else
         {
@@ -633,8 +635,8 @@ AcpiExFieldDatumIo (
                 "Write to Data Register: Value %8.8X%8.8X\n",
                 ACPI_FORMAT_UINT64 (*Value)));
 
-            Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj,
-                        Value, sizeof (UINT64));
+            Status = AcpiExInsertIntoField (
+                ObjDesc->IndexField.DataObj, Value, sizeof (UINT64));
         }
         break;
 
@@ -716,14 +718,14 @@ AcpiExWriteWithUpdateRule (
              * ones)  The left shift drops the bits we want to ignore.
              */
             if ((~Mask << (ACPI_MUL_8 (sizeof (Mask)) -
-                           ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth))) != 0)
+                   ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth))) != 0)
             {
                 /*
                  * Read the current contents of the byte/word/dword containing
                  * the field, and merge with the new field value.
                  */
-                Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset,
-                            &CurrentValue, ACPI_READ);
+                Status = AcpiExFieldDatumIo (
+                    ObjDesc, FieldDatumByteOffset, &CurrentValue, ACPI_READ);
                 if (ACPI_FAILURE (Status))
                 {
                     return_ACPI_STATUS (Status);
@@ -751,13 +753,15 @@ AcpiExWriteWithUpdateRule (
 
             ACPI_ERROR ((AE_INFO,
                 "Unknown UpdateRule value: 0x%X",
-                (ObjDesc->CommonField.FieldFlags & AML_FIELD_UPDATE_RULE_MASK)));
+                (ObjDesc->CommonField.FieldFlags &
+                    AML_FIELD_UPDATE_RULE_MASK)));
             return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
         }
     }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-        "Mask %8.8X%8.8X, DatumOffset %X, Width %X, Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
+        "Mask %8.8X%8.8X, DatumOffset %X, Width %X, "
+        "Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
         ACPI_FORMAT_UINT64 (Mask),
         FieldDatumByteOffset,
         ObjDesc->CommonField.AccessByteWidth,
@@ -766,8 +770,8 @@ AcpiExWriteWithUpdateRule (
 
     /* Write the merged value */
 
-    Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset,
-                &MergedValue, ACPI_WRITE);
+    Status = AcpiExFieldDatumIo (
+        ObjDesc, FieldDatumByteOffset, &MergedValue, ACPI_WRITE);
 
     return_ACPI_STATUS (Status);
 }
@@ -878,8 +882,8 @@ AcpiExExtractFromField (
         /* Get next input datum from the field */
 
         FieldOffset += ObjDesc->CommonField.AccessByteWidth;
-        Status = AcpiExFieldDatumIo (ObjDesc, FieldOffset,
-                    &RawDatum, ACPI_READ);
+        Status = AcpiExFieldDatumIo (
+            ObjDesc, FieldOffset, &RawDatum, ACPI_READ);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
@@ -976,7 +980,8 @@ AcpiExInsertIntoField (
 
     NewBuffer = NULL;
     RequiredLength = ACPI_ROUND_BITS_UP_TO_BYTES (
-                        ObjDesc->CommonField.BitLength);
+        ObjDesc->CommonField.BitLength);
+
     /*
      * We must have a buffer that is at least as long as the field
      * we are writing to. This is because individual fields are
@@ -1054,8 +1059,8 @@ AcpiExInsertIntoField (
         /* Write merged datum to the target field */
 
         MergedDatum &= Mask;
-        Status = AcpiExWriteWithUpdateRule (ObjDesc, Mask,
-                    MergedDatum, FieldOffset);
+        Status = AcpiExWriteWithUpdateRule (
+            ObjDesc, Mask, MergedDatum, FieldOffset);
         if (ACPI_FAILURE (Status))
         {
             goto Exit;
@@ -1112,8 +1117,8 @@ AcpiExInsertIntoField (
     /* Write the last datum to the field */
 
     MergedDatum &= Mask;
-    Status = AcpiExWriteWithUpdateRule (ObjDesc,
-                Mask, MergedDatum, FieldOffset);
+    Status = AcpiExWriteWithUpdateRule (
+        ObjDesc, Mask, MergedDatum, FieldOffset);
 
 Exit:
     /* Free temporary buffer if we used one */
index f678670..cde2279 100644 (file)
@@ -180,9 +180,9 @@ AcpiExGetObjectReference (
 
         default:
 
-            ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X",
+            ACPI_ERROR ((AE_INFO, "Invalid Reference Class 0x%2.2X",
                 ObjDesc->Reference.Class));
-            return_ACPI_STATUS (AE_AML_INTERNAL);
+            return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
         }
         break;
 
@@ -338,6 +338,7 @@ AcpiExDoConcatenate (
     ACPI_OPERAND_OBJECT     *LocalOperand1 = Operand1;
     ACPI_OPERAND_OBJECT     *ReturnDesc;
     char                    *NewBuf;
+    const char              *TypeString;
     ACPI_STATUS             Status;
 
 
@@ -359,9 +360,42 @@ AcpiExDoConcatenate (
         break;
 
     case ACPI_TYPE_STRING:
+        /*
+         * Per the ACPI spec, Concatenate only supports int/str/buf.
+         * However, we support all objects here as an extension.
+         * This improves the usefulness of the Printf() macro.
+         * 12/2015.
+         */
+        switch (Operand1->Common.Type)
+        {
+        case ACPI_TYPE_INTEGER:
+        case ACPI_TYPE_STRING:
+        case ACPI_TYPE_BUFFER:
 
-        Status = AcpiExConvertToString (Operand1, &LocalOperand1,
-                    ACPI_IMPLICIT_CONVERT_HEX);
+            Status = AcpiExConvertToString (
+                Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX);
+            break;
+
+        default:
+            /*
+             * Just emit a string containing the object type.
+             */
+            TypeString = AcpiUtGetTypeName (Operand1->Common.Type);
+
+            LocalOperand1 = AcpiUtCreateStringObject (
+                ((ACPI_SIZE) strlen (TypeString) + 9)); /* 9 For "[Object]" */
+            if (!LocalOperand1)
+            {
+                Status = AE_NO_MEMORY;
+                goto Cleanup;
+            }
+
+            strcpy (LocalOperand1->String.Pointer, "[");
+            strcat (LocalOperand1->String.Pointer, TypeString);
+            strcat (LocalOperand1->String.Pointer, " Object]");
+            Status = AE_OK;
+            break;
+        }
         break;
 
     case ACPI_TYPE_BUFFER:
@@ -401,8 +435,8 @@ AcpiExDoConcatenate (
         /* Result of two Integers is a Buffer */
         /* Need enough buffer space for two integers */
 
-        ReturnDesc = AcpiUtCreateBufferObject ((ACPI_SIZE)
-                            ACPI_MUL_2 (AcpiGbl_IntegerByteWidth));
+        ReturnDesc = AcpiUtCreateBufferObject (
+            (ACPI_SIZE) ACPI_MUL_2 (AcpiGbl_IntegerByteWidth));
         if (!ReturnDesc)
         {
             Status = AE_NO_MEMORY;
@@ -414,13 +448,12 @@ AcpiExDoConcatenate (
         /* Copy the first integer, LSB first */
 
         memcpy (NewBuf, &Operand0->Integer.Value,
-                        AcpiGbl_IntegerByteWidth);
+            AcpiGbl_IntegerByteWidth);
 
         /* Copy the second integer (LSB first) after the first */
 
         memcpy (NewBuf + AcpiGbl_IntegerByteWidth,
-                        &LocalOperand1->Integer.Value,
-                        AcpiGbl_IntegerByteWidth);
+            &LocalOperand1->Integer.Value, AcpiGbl_IntegerByteWidth);
         break;
 
     case ACPI_TYPE_STRING:
@@ -428,8 +461,8 @@ AcpiExDoConcatenate (
         /* Result of two Strings is a String */
 
         ReturnDesc = AcpiUtCreateStringObject (
-                        ((ACPI_SIZE) Operand0->String.Length +
-                        LocalOperand1->String.Length));
+            ((ACPI_SIZE) Operand0->String.Length +
+            LocalOperand1->String.Length));
         if (!ReturnDesc)
         {
             Status = AE_NO_MEMORY;
@@ -441,8 +474,7 @@ AcpiExDoConcatenate (
         /* Concatenate the strings */
 
         strcpy (NewBuf, Operand0->String.Pointer);
-        strcpy (NewBuf + Operand0->String.Length,
-                        LocalOperand1->String.Pointer);
+        strcat (NewBuf, LocalOperand1->String.Pointer);
         break;
 
     case ACPI_TYPE_BUFFER:
@@ -450,8 +482,8 @@ AcpiExDoConcatenate (
         /* Result of two Buffers is a Buffer */
 
         ReturnDesc = AcpiUtCreateBufferObject (
-                        ((ACPI_SIZE) Operand0->Buffer.Length +
-                        LocalOperand1->Buffer.Length));
+            ((ACPI_SIZE) Operand0->Buffer.Length +
+            LocalOperand1->Buffer.Length));
         if (!ReturnDesc)
         {
             Status = AE_NO_MEMORY;
@@ -463,10 +495,10 @@ AcpiExDoConcatenate (
         /* Concatenate the buffers */
 
         memcpy (NewBuf, Operand0->Buffer.Pointer,
-                        Operand0->Buffer.Length);
+            Operand0->Buffer.Length);
         memcpy (NewBuf + Operand0->Buffer.Length,
-                        LocalOperand1->Buffer.Pointer,
-                        LocalOperand1->Buffer.Length);
+            LocalOperand1->Buffer.Pointer,
+            LocalOperand1->Buffer.Length);
         break;
 
     default:
@@ -708,8 +740,8 @@ AcpiExDoLogicalOp (
 
     case ACPI_TYPE_STRING:
 
-        Status = AcpiExConvertToString (Operand1, &LocalOperand1,
-                    ACPI_IMPLICIT_CONVERT_HEX);
+        Status = AcpiExConvertToString (
+            Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX);
         break;
 
     case ACPI_TYPE_BUFFER:
@@ -786,8 +818,8 @@ AcpiExDoLogicalOp (
         /* Lexicographic compare: compare the data bytes */
 
         Compare = memcmp (Operand0->Buffer.Pointer,
-                    LocalOperand1->Buffer.Pointer,
-                    (Length0 > Length1) ? Length1 : Length0);
+            LocalOperand1->Buffer.Pointer,
+            (Length0 > Length1) ? Length1 : Length0);
 
         switch (Opcode)
         {
index c688a50..f3cf1bb 100644 (file)
@@ -281,8 +281,7 @@ AcpiExAcquireMutexObject (
     }
     else
     {
-        Status = AcpiExSystemWaitMutex (ObjDesc->Mutex.OsMutex,
-                    Timeout);
+        Status = AcpiExSystemWaitMutex (ObjDesc->Mutex.OsMutex, Timeout);
     }
 
     if (ACPI_FAILURE (Status))
@@ -345,33 +344,48 @@ AcpiExAcquireMutex (
     }
 
     /*
-     * Current sync level must be less than or equal to the sync level of the
-     * mutex. This mechanism provides some deadlock prevention
+     * Current sync level must be less than or equal to the sync level
+     * of the mutex. This mechanism provides some deadlock prevention.
      */
     if (WalkState->Thread->CurrentSyncLevel > ObjDesc->Mutex.SyncLevel)
     {
         ACPI_ERROR ((AE_INFO,
-            "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%u)",
+            "Cannot acquire Mutex [%4.4s], "
+            "current SyncLevel is too large (%u)",
             AcpiUtGetNodeName (ObjDesc->Mutex.Node),
             WalkState->Thread->CurrentSyncLevel));
         return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
     }
 
+    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+        "Acquiring: Mutex SyncLevel %u, Thread SyncLevel %u, "
+        "Depth %u TID %p\n",
+        ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
+        ObjDesc->Mutex.AcquisitionDepth, WalkState->Thread));
+
     Status = AcpiExAcquireMutexObject ((UINT16) TimeDesc->Integer.Value,
-                ObjDesc, WalkState->Thread->ThreadId);
+        ObjDesc, WalkState->Thread->ThreadId);
+
     if (ACPI_SUCCESS (Status) && ObjDesc->Mutex.AcquisitionDepth == 1)
     {
         /* Save Thread object, original/current sync levels */
 
         ObjDesc->Mutex.OwnerThread = WalkState->Thread;
-        ObjDesc->Mutex.OriginalSyncLevel = WalkState->Thread->CurrentSyncLevel;
-        WalkState->Thread->CurrentSyncLevel = ObjDesc->Mutex.SyncLevel;
+        ObjDesc->Mutex.OriginalSyncLevel =
+            WalkState->Thread->CurrentSyncLevel;
+        WalkState->Thread->CurrentSyncLevel =
+            ObjDesc->Mutex.SyncLevel;
 
         /* Link the mutex to the current thread for force-unlock at method exit */
 
         AcpiExLinkMutex (ObjDesc, WalkState->Thread);
     }
 
+    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+        "Acquired: Mutex SyncLevel %u, Thread SyncLevel %u, Depth %u\n",
+        ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
+        ObjDesc->Mutex.AcquisitionDepth));
+
     return_ACPI_STATUS (Status);
 }
 
@@ -467,9 +481,9 @@ AcpiExReleaseMutex (
     ACPI_OPERAND_OBJECT     *ObjDesc,
     ACPI_WALK_STATE         *WalkState)
 {
-    ACPI_STATUS             Status = AE_OK;
     UINT8                   PreviousSyncLevel;
     ACPI_THREAD_STATE       *OwnerThread;
+    ACPI_STATUS             Status = AE_OK;
 
 
     ACPI_FUNCTION_TRACE (ExReleaseMutex);
@@ -527,7 +541,8 @@ AcpiExReleaseMutex (
     if (ObjDesc->Mutex.SyncLevel != OwnerThread->CurrentSyncLevel)
     {
         ACPI_ERROR ((AE_INFO,
-            "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %u current %u",
+            "Cannot release Mutex [%4.4s], SyncLevel mismatch: "
+            "mutex %u current %u",
             AcpiUtGetNodeName (ObjDesc->Mutex.Node),
             ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel));
         return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
@@ -541,6 +556,13 @@ AcpiExReleaseMutex (
     PreviousSyncLevel =
         OwnerThread->AcquiredMutexList->Mutex.OriginalSyncLevel;
 
+    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+        "Releasing: Object SyncLevel %u, Thread SyncLevel %u, "
+        "Prev SyncLevel %u, Depth %u TID %p\n",
+        ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
+        PreviousSyncLevel, ObjDesc->Mutex.AcquisitionDepth,
+        WalkState->Thread));
+
     Status = AcpiExReleaseMutexObject (ObjDesc);
     if (ACPI_FAILURE (Status))
     {
@@ -554,6 +576,12 @@ AcpiExReleaseMutex (
         OwnerThread->CurrentSyncLevel = PreviousSyncLevel;
     }
 
+    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+        "Released: Object SyncLevel %u, Thread SyncLevel, %u, "
+        "Prev SyncLevel %u, Depth %u\n",
+        ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
+        PreviousSyncLevel, ObjDesc->Mutex.AcquisitionDepth));
+
     return_ACPI_STATUS (Status);
 }
 
@@ -584,7 +612,7 @@ AcpiExReleaseAllMutexes (
     ACPI_OPERAND_OBJECT     *ObjDesc;
 
 
-    ACPI_FUNCTION_NAME (ExReleaseAllMutexes);
+    ACPI_FUNCTION_TRACE (ExReleaseAllMutexes);
 
 
     /* Traverse the list of owned mutexes, releasing each one */
@@ -592,14 +620,10 @@ AcpiExReleaseAllMutexes (
     while (Next)
     {
         ObjDesc = Next;
-        Next = ObjDesc->Mutex.Next;
-
-        ObjDesc->Mutex.Prev = NULL;
-        ObjDesc->Mutex.Next = NULL;
-        ObjDesc->Mutex.AcquisitionDepth = 0;
-
         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-            "Force-releasing held mutex: %p\n", ObjDesc));
+            "Mutex [%4.4s] force-release, SyncLevel %u Depth %u\n",
+            ObjDesc->Mutex.Node->Name.Ascii, ObjDesc->Mutex.SyncLevel,
+            ObjDesc->Mutex.AcquisitionDepth));
 
         /* Release the mutex, special case for Global Lock */
 
@@ -614,13 +638,20 @@ AcpiExReleaseAllMutexes (
             AcpiOsReleaseMutex (ObjDesc->Mutex.OsMutex);
         }
 
+        /* Update Thread SyncLevel (Last mutex is the important one) */
+
+        Thread->CurrentSyncLevel = ObjDesc->Mutex.OriginalSyncLevel;
+
         /* Mark mutex unowned */
 
+        Next = ObjDesc->Mutex.Next;
+
+        ObjDesc->Mutex.Prev = NULL;
+        ObjDesc->Mutex.Next = NULL;
+        ObjDesc->Mutex.AcquisitionDepth = 0;
         ObjDesc->Mutex.OwnerThread = NULL;
         ObjDesc->Mutex.ThreadId = 0;
-
-        /* Update Thread SyncLevel (Last mutex is the important one) */
-
-        Thread->CurrentSyncLevel = ObjDesc->Mutex.OriginalSyncLevel;
     }
+
+    return_VOID;
 }
index 38ceba0..d222a21 100644 (file)
@@ -232,6 +232,7 @@ AcpiExAllocateNameString (
     return_PTR (NameString);
 }
 
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiExNameSegment
@@ -261,8 +262,8 @@ AcpiExNameSegment (
 
 
     /*
-     * If first character is a digit, then we know that we aren't looking at a
-     * valid name segment
+     * If first character is a digit, then we know that we aren't looking
+     * at a valid name segment
      */
     CharBuf[0] = *AmlAddress;
 
@@ -466,7 +467,8 @@ AcpiExGetNameString (
             AmlAddress++;
             NumSegments = *AmlAddress;
 
-            NameString = AcpiExAllocateNameString (PrefixCount, NumSegments);
+            NameString = AcpiExAllocateNameString (
+                PrefixCount, NumSegments);
             if (!NameString)
             {
                 Status = AE_NO_MEMORY;
index c7addbd..965de2d 100644 (file)
@@ -403,7 +403,7 @@ AcpiExOpcode_1A_1T_1R (
              * endian unsigned value, so this boundary condition is valid.
              */
             for (Temp32 = 0; ReturnDesc->Integer.Value &&
-                             Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
+                    Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
             {
                 ReturnDesc->Integer.Value >>= 1;
             }
@@ -420,7 +420,7 @@ AcpiExOpcode_1A_1T_1R (
              * endian unsigned value, so this boundary condition is valid.
              */
             for (Temp32 = 0; ReturnDesc->Integer.Value &&
-                             Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
+                     Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
             {
                 ReturnDesc->Integer.Value <<= 1;
             }
@@ -526,7 +526,7 @@ AcpiExOpcode_1A_1T_1R (
             /* Get the object reference, store it, and remove our reference */
 
             Status = AcpiExGetObjectReference (Operand[0],
-                        &ReturnDesc2, WalkState);
+                &ReturnDesc2, WalkState);
             if (ACPI_FAILURE (Status))
             {
                 goto Cleanup;
@@ -581,28 +581,30 @@ AcpiExOpcode_1A_1T_1R (
      */
     case AML_COPY_OP:               /* Copy (Source, Target) */
 
-        Status = AcpiUtCopyIobjectToIobject (Operand[0], &ReturnDesc,
-                    WalkState);
+        Status = AcpiUtCopyIobjectToIobject (
+            Operand[0], &ReturnDesc, WalkState);
         break;
 
     case AML_TO_DECSTRING_OP:       /* ToDecimalString (Data, Result) */
 
-        Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
-                    ACPI_EXPLICIT_CONVERT_DECIMAL);
+        Status = AcpiExConvertToString (
+            Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_DECIMAL);
         if (ReturnDesc == Operand[0])
         {
             /* No conversion performed, add ref to handle return value */
+
             AcpiUtAddReference (ReturnDesc);
         }
         break;
 
     case AML_TO_HEXSTRING_OP:       /* ToHexString (Data, Result) */
 
-        Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
-                    ACPI_EXPLICIT_CONVERT_HEX);
+        Status = AcpiExConvertToString (
+            Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_HEX);
         if (ReturnDesc == Operand[0])
         {
             /* No conversion performed, add ref to handle return value */
+
             AcpiUtAddReference (ReturnDesc);
         }
         break;
@@ -613,17 +615,19 @@ AcpiExOpcode_1A_1T_1R (
         if (ReturnDesc == Operand[0])
         {
             /* No conversion performed, add ref to handle return value */
+
             AcpiUtAddReference (ReturnDesc);
         }
         break;
 
     case AML_TO_INTEGER_OP:         /* ToInteger (Data, Result) */
 
-        Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc,
-                    ACPI_ANY_BASE);
+        Status = AcpiExConvertToInteger (
+            Operand[0], &ReturnDesc, ACPI_ANY_BASE);
         if (ReturnDesc == Operand[0])
         {
             /* No conversion performed, add ref to handle return value */
+
             AcpiUtAddReference (ReturnDesc);
         }
         break;
@@ -774,11 +778,11 @@ AcpiExOpcode_1A_0T_1R (
          */
         if (WalkState->Opcode == AML_INCREMENT_OP)
         {
-            ReturnDesc->Integer.Value = TempDesc->Integer.Value +1;
+            ReturnDesc->Integer.Value = TempDesc->Integer.Value + 1;
         }
         else
         {
-            ReturnDesc->Integer.Value = TempDesc->Integer.Value -1;
+            ReturnDesc->Integer.Value = TempDesc->Integer.Value - 1;
         }
 
         /* Finished with this Integer object */
@@ -792,7 +796,7 @@ AcpiExOpcode_1A_0T_1R (
         Status = AcpiExStore (ReturnDesc, Operand[0], WalkState);
         break;
 
-    case AML_TYPE_OP:               /* ObjectType (SourceObject) */
+    case AML_OBJECT_TYPE_OP:            /* ObjectType (SourceObject) */
         /*
          * Note: The operand is not resolved at this point because we want to
          * get the associated object, not its value. For example, we don't
@@ -826,8 +830,8 @@ AcpiExOpcode_1A_0T_1R (
 
         /* Get the base object */
 
-        Status = AcpiExResolveMultiple (WalkState,
-                    Operand[0], &Type, &TempDesc);
+        Status = AcpiExResolveMultiple (
+            WalkState, Operand[0], &Type, &TempDesc);
         if (ACPI_FAILURE (Status))
         {
             goto Cleanup;
@@ -873,8 +877,10 @@ AcpiExOpcode_1A_0T_1R (
         default:
 
             ACPI_ERROR ((AE_INFO,
-                "Operand must be Buffer/Integer/String/Package - found type %s",
+                "Operand must be Buffer/Integer/String/Package"
+                " - found type %s",
                 AcpiUtGetTypeName (Type)));
+
             Status = AE_AML_OPERAND_TYPE;
             goto Cleanup;
         }
@@ -899,7 +905,8 @@ AcpiExOpcode_1A_0T_1R (
 
     case AML_REF_OF_OP:             /* RefOf (SourceObject) */
 
-        Status = AcpiExGetObjectReference (Operand[0], &ReturnDesc, WalkState);
+        Status = AcpiExGetObjectReference (
+            Operand[0], &ReturnDesc, WalkState);
         if (ACPI_FAILURE (Status))
         {
             goto Cleanup;
@@ -946,9 +953,9 @@ AcpiExOpcode_1A_0T_1R (
                     /* Set Operand[0] to the value of the local/arg */
 
                     Status = AcpiDsMethodDataGetValue (
-                                Operand[0]->Reference.Class,
-                                Operand[0]->Reference.Value,
-                                WalkState, &TempDesc);
+                        Operand[0]->Reference.Class,
+                        Operand[0]->Reference.Value,
+                        WalkState, &TempDesc);
                     if (ACPI_FAILURE (Status))
                     {
                         goto Cleanup;
@@ -1002,19 +1009,19 @@ AcpiExOpcode_1A_0T_1R (
                  *    Field, so we need to resolve the node to a value.
                  */
                 Status = AcpiNsGetNode (WalkState->ScopeInfo->Scope.Node,
-                            Operand[0]->String.Pointer,
-                            ACPI_NS_SEARCH_PARENT,
-                            ACPI_CAST_INDIRECT_PTR (
-                                ACPI_NAMESPACE_NODE, &ReturnDesc));
+                    Operand[0]->String.Pointer,
+                    ACPI_NS_SEARCH_PARENT,
+                    ACPI_CAST_INDIRECT_PTR (
+                        ACPI_NAMESPACE_NODE, &ReturnDesc));
                 if (ACPI_FAILURE (Status))
                 {
                     goto Cleanup;
                 }
 
                 Status = AcpiExResolveNodeToValue (
-                            ACPI_CAST_INDIRECT_PTR (
-                                ACPI_NAMESPACE_NODE, &ReturnDesc),
-                            WalkState);
+                    ACPI_CAST_INDIRECT_PTR (
+                        ACPI_NAMESPACE_NODE, &ReturnDesc),
+                    WalkState);
                 goto Cleanup;
             }
         }
@@ -1030,7 +1037,7 @@ AcpiExOpcode_1A_0T_1R (
              * dereferenced above.
              */
             ReturnDesc = AcpiNsGetAttachedObject (
-                            (ACPI_NAMESPACE_NODE *) Operand[0]);
+                (ACPI_NAMESPACE_NODE *) Operand[0]);
             AcpiUtAddReference (ReturnDesc);
         }
         else
@@ -1097,6 +1104,7 @@ AcpiExOpcode_1A_0T_1R (
                     ACPI_ERROR ((AE_INFO,
                         "Unknown Index TargetType 0x%X in reference object %p",
                         Operand[0]->Reference.TargetType, Operand[0]));
+
                     Status = AE_AML_OPERAND_TYPE;
                     goto Cleanup;
                 }
@@ -1127,8 +1135,8 @@ AcpiExOpcode_1A_0T_1R (
                     case ACPI_TYPE_LOCAL_BANK_FIELD:
                     case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
-                        Status = AcpiExReadDataFromField (WalkState,
-                            ReturnDesc, &TempDesc);
+                        Status = AcpiExReadDataFromField (
+                            WalkState, ReturnDesc, &TempDesc);
                         if (ACPI_FAILURE (Status))
                         {
                             goto Cleanup;
@@ -1163,6 +1171,7 @@ AcpiExOpcode_1A_0T_1R (
 
         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
             WalkState->Opcode));
+
         Status = AE_AML_BAD_OPCODE;
         goto Cleanup;
     }
index f1ab706..29b41a5 100644 (file)
@@ -275,10 +275,11 @@ AcpiExOpcode_2A_2T_1R (
 
         /* Quotient to ReturnDesc1, remainder to ReturnDesc2 */
 
-        Status = AcpiUtDivide (Operand[0]->Integer.Value,
-                               Operand[1]->Integer.Value,
-                               &ReturnDesc1->Integer.Value,
-                               &ReturnDesc2->Integer.Value);
+        Status = AcpiUtDivide (
+            Operand[0]->Integer.Value,
+            Operand[1]->Integer.Value,
+            &ReturnDesc1->Integer.Value,
+            &ReturnDesc2->Integer.Value);
         if (ACPI_FAILURE (Status))
         {
             goto Cleanup;
@@ -289,6 +290,7 @@ AcpiExOpcode_2A_2T_1R (
 
         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
             WalkState->Opcode));
+
         Status = AE_AML_BAD_OPCODE;
         goto Cleanup;
     }
@@ -373,9 +375,10 @@ AcpiExOpcode_2A_1T_1R (
             goto Cleanup;
         }
 
-        ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode,
-                                                Operand[0]->Integer.Value,
-                                                Operand[1]->Integer.Value);
+        ReturnDesc->Integer.Value = AcpiExDoMathOp (
+            WalkState->Opcode,
+            Operand[0]->Integer.Value,
+            Operand[1]->Integer.Value);
         goto StoreResultToTarget;
     }
 
@@ -392,16 +395,17 @@ AcpiExOpcode_2A_1T_1R (
 
         /* ReturnDesc will contain the remainder */
 
-        Status = AcpiUtDivide (Operand[0]->Integer.Value,
-                               Operand[1]->Integer.Value,
-                               NULL,
-                               &ReturnDesc->Integer.Value);
+        Status = AcpiUtDivide (
+            Operand[0]->Integer.Value,
+            Operand[1]->Integer.Value,
+            NULL,
+            &ReturnDesc->Integer.Value);
         break;
 
     case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
 
-        Status = AcpiExDoConcatenate (Operand[0], Operand[1],
-                    &ReturnDesc, WalkState);
+        Status = AcpiExDoConcatenate (
+            Operand[0], Operand[1], &ReturnDesc, WalkState);
         break;
 
     case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */
@@ -448,8 +452,8 @@ AcpiExOpcode_2A_1T_1R (
 
         /* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */
 
-        Status = AcpiExConcatTemplate (Operand[0], Operand[1],
-                    &ReturnDesc, WalkState);
+        Status = AcpiExConcatTemplate (
+            Operand[0], Operand[1], &ReturnDesc, WalkState);
         break;
 
     case AML_INDEX_OP:              /* Index (Source Index Result) */
@@ -632,8 +636,8 @@ AcpiExOpcode_2A_0T_1R (
         /* LogicalOp  (Operand0, Operand1) */
 
         Status = AcpiExDoLogicalNumericOp (WalkState->Opcode,
-                        Operand[0]->Integer.Value, Operand[1]->Integer.Value,
-                        &LogicalResult);
+            Operand[0]->Integer.Value, Operand[1]->Integer.Value,
+            &LogicalResult);
         goto StoreLogicalResult;
     }
     else if (WalkState->OpInfo->Flags & AML_LOGICAL)
@@ -641,7 +645,7 @@ AcpiExOpcode_2A_0T_1R (
         /* LogicalOp  (Operand0, Operand1) */
 
         Status = AcpiExDoLogicalOp (WalkState->Opcode, Operand[0],
-                    Operand[1], &LogicalResult);
+            Operand[1], &LogicalResult);
         goto StoreLogicalResult;
     }
 
@@ -672,6 +676,7 @@ AcpiExOpcode_2A_0T_1R (
 
         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
             WalkState->Opcode));
+
         Status = AE_AML_BAD_OPCODE;
         goto Cleanup;
     }
index b2c49be..aa52392 100644 (file)
@@ -178,7 +178,8 @@ AcpiExOpcode_3A_0T_0R (
     case AML_FATAL_OP:          /* Fatal (FatalType  FatalCode  FatalArg) */
 
         ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-            "FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
+            "FatalOp: Type %X Code %X Arg %X "
+            "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
             (UINT32) Operand[0]->Integer.Value,
             (UINT32) Operand[1]->Integer.Value,
             (UINT32) Operand[2]->Integer.Value));
@@ -186,8 +187,8 @@ AcpiExOpcode_3A_0T_0R (
         Fatal = ACPI_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
         if (Fatal)
         {
-            Fatal->Type     = (UINT32) Operand[0]->Integer.Value;
-            Fatal->Code     = (UINT32) Operand[1]->Integer.Value;
+            Fatal->Type = (UINT32) Operand[0]->Integer.Value;
+            Fatal->Code = (UINT32) Operand[1]->Integer.Value;
             Fatal->Argument = (UINT32) Operand[2]->Integer.Value;
         }
 
@@ -215,6 +216,7 @@ AcpiExOpcode_3A_0T_0R (
 
         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
             WalkState->Opcode));
+
         Status = AE_AML_BAD_OPCODE;
         goto Cleanup;
     }
@@ -262,7 +264,7 @@ AcpiExOpcode_3A_1T_1R (
          * either a String or a Buffer, so just use its type.
          */
         ReturnDesc = AcpiUtCreateInternalObject (
-                        (Operand[0])->Common.Type);
+            (Operand[0])->Common.Type);
         if (!ReturnDesc)
         {
             Status = AE_NO_MEMORY;
@@ -287,8 +289,8 @@ AcpiExOpcode_3A_1T_1R (
 
         else if ((Index + Length) > Operand[0]->String.Length)
         {
-            Length = (ACPI_SIZE) Operand[0]->String.Length -
-                        (ACPI_SIZE) Index;
+            Length =
+                (ACPI_SIZE) Operand[0]->String.Length - (ACPI_SIZE) Index;
         }
 
         /* Strings always have a sub-pointer, not so for buffers */
@@ -334,8 +336,8 @@ AcpiExOpcode_3A_1T_1R (
         {
             /* We have a buffer, copy the portion requested */
 
-            memcpy (Buffer, Operand[0]->String.Pointer + Index,
-                         Length);
+            memcpy (Buffer,
+                Operand[0]->String.Pointer + Index, Length);
         }
 
         /* Set the length of the new String/Buffer */
@@ -352,6 +354,7 @@ AcpiExOpcode_3A_1T_1R (
 
         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
             WalkState->Opcode));
+
         Status = AE_AML_BAD_OPCODE;
         goto Cleanup;
     }
@@ -369,12 +372,12 @@ Cleanup:
         AcpiUtRemoveReference (ReturnDesc);
         WalkState->ResultObj = NULL;
     }
-
-    /* Set the return object and exit */
-
     else
     {
+        /* Set the return object and exit */
+
         WalkState->ResultObj = ReturnDesc;
     }
+
     return_ACPI_STATUS (Status);
 }
index a7d76d6..6423334 100644 (file)
@@ -205,8 +205,8 @@ AcpiExDoMatch (
          * True if equal: (P[i] == M)
          * Change to:     (M == P[i])
          */
-        Status = AcpiExDoLogicalOp (AML_LEQUAL_OP, MatchObj, PackageObj,
-                    &LogicalResult);
+        Status = AcpiExDoLogicalOp (
+            AML_LEQUAL_OP, MatchObj, PackageObj, &LogicalResult);
         if (ACPI_FAILURE (Status))
         {
             return (FALSE);
@@ -218,8 +218,8 @@ AcpiExDoMatch (
          * True if less than or equal: (P[i] <= M) (P[i] NotGreater than M)
          * Change to:                  (M >= P[i]) (M NotLess than P[i])
          */
-        Status = AcpiExDoLogicalOp (AML_LLESS_OP, MatchObj, PackageObj,
-                    &LogicalResult);
+        Status = AcpiExDoLogicalOp (
+            AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
         if (ACPI_FAILURE (Status))
         {
             return (FALSE);
@@ -232,8 +232,8 @@ AcpiExDoMatch (
          * True if less than: (P[i] < M)
          * Change to:         (M > P[i])
          */
-        Status = AcpiExDoLogicalOp (AML_LGREATER_OP, MatchObj, PackageObj,
-                    &LogicalResult);
+        Status = AcpiExDoLogicalOp (
+            AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
         if (ACPI_FAILURE (Status))
         {
             return (FALSE);
@@ -245,8 +245,8 @@ AcpiExDoMatch (
          * True if greater than or equal: (P[i] >= M) (P[i] NotLess than M)
          * Change to:                     (M <= P[i]) (M NotGreater than P[i])
          */
-        Status = AcpiExDoLogicalOp (AML_LGREATER_OP, MatchObj, PackageObj,
-                    &LogicalResult);
+        Status = AcpiExDoLogicalOp (
+            AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
         if (ACPI_FAILURE (Status))
         {
             return (FALSE);
@@ -259,8 +259,8 @@ AcpiExDoMatch (
          * True if greater than: (P[i] > M)
          * Change to:            (M < P[i])
          */
-        Status = AcpiExDoLogicalOp (AML_LLESS_OP, MatchObj, PackageObj,
-                    &LogicalResult);
+        Status = AcpiExDoLogicalOp (
+            AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
         if (ACPI_FAILURE (Status))
         {
             return (FALSE);
@@ -376,13 +376,13 @@ AcpiExOpcode_6A_0T_1R (
              * non-match.
              */
             if (!AcpiExDoMatch ((UINT32) Operand[1]->Integer.Value,
-                                ThisElement, Operand[2]))
+                    ThisElement, Operand[2]))
             {
                 continue;
             }
 
             if (!AcpiExDoMatch ((UINT32) Operand[3]->Integer.Value,
-                                ThisElement, Operand[4]))
+                    ThisElement, Operand[4]))
             {
                 continue;
             }
@@ -403,6 +403,7 @@ AcpiExOpcode_6A_0T_1R (
 
         ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
             WalkState->Opcode));
+
         Status = AE_AML_BAD_OPCODE;
         goto Cleanup;
     }
index d84ccc3..91ee2b8 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
+ * Module Name: exprep - ACPI AML field prep utilities
  *
  *****************************************************************************/
 
@@ -141,6 +141,7 @@ AcpiExGenerateAccess (
     UINT32                  FieldBitLength,
     UINT32                  RegionLength);
 
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiExGenerateAccess
@@ -185,10 +186,13 @@ AcpiExGenerateAccess (
 
     /* Round Field start offset and length to "minimal" byte boundaries */
 
-    FieldByteOffset    = ACPI_DIV_8 (ACPI_ROUND_DOWN (FieldBitOffset, 8));
-    FieldByteEndOffset = ACPI_DIV_8 (ACPI_ROUND_UP   (FieldBitLength +
-                                                      FieldBitOffset, 8));
-    FieldByteLength    = FieldByteEndOffset - FieldByteOffset;
+    FieldByteOffset = ACPI_DIV_8 (
+        ACPI_ROUND_DOWN (FieldBitOffset, 8));
+
+    FieldByteEndOffset = ACPI_DIV_8 (
+        ACPI_ROUND_UP (FieldBitLength + FieldBitOffset, 8));
+
+    FieldByteLength = FieldByteEndOffset - FieldByteOffset;
 
     ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
         "Bit length %u, Bit offset %u\n",
@@ -213,7 +217,8 @@ AcpiExGenerateAccess (
          *    are done. (This does not optimize for the perfectly aligned
          *    case yet).
          */
-        if (ACPI_ROUND_UP (FieldByteEndOffset, AccessByteWidth) <= RegionLength)
+        if (ACPI_ROUND_UP (FieldByteEndOffset, AccessByteWidth) <=
+            RegionLength)
         {
             FieldStartOffset =
                 ACPI_ROUND_DOWN (FieldByteOffset, AccessByteWidth) /
@@ -237,7 +242,8 @@ AcpiExGenerateAccess (
             if (Accesses <= 1)
             {
                 ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-                    "Entire field can be accessed with one operation of size %u\n",
+                    "Entire field can be accessed "
+                    "with one operation of size %u\n",
                     AccessByteWidth));
                 return_VALUE (AccessByteWidth);
             }
@@ -248,14 +254,15 @@ AcpiExGenerateAccess (
              */
             if (Accesses < MinimumAccesses)
             {
-                MinimumAccesses    = Accesses;
+                MinimumAccesses = Accesses;
                 MinimumAccessWidth = AccessByteWidth;
             }
         }
         else
         {
             ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-                "AccessWidth %u end is NOT within region\n", AccessByteWidth));
+                "AccessWidth %u end is NOT within region\n",
+                AccessByteWidth));
             if (AccessByteWidth == 1)
             {
                 ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
@@ -283,6 +290,7 @@ AcpiExGenerateAccess (
      */
     ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
         "Cannot access field in one operation, using width 8\n"));
+
     return_VALUE (8);
 }
 #endif /* ACPI_UNDER_DEVELOPMENT */
@@ -367,6 +375,7 @@ AcpiExDecodeFieldAccess (
         ACPI_ERROR ((AE_INFO,
             "Unknown field access type 0x%X",
             Access));
+
         return_UINT32 (0);
     }
 
@@ -446,8 +455,8 @@ AcpiExPrepCommonFieldObject (
      * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
      * the same (equivalent) as the ByteAlignment.
      */
-    AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags,
-                        &ByteAlignment);
+    AccessBitWidth = AcpiExDecodeFieldAccess (
+        ObjDesc, FieldFlags, &ByteAlignment);
     if (!AccessBitWidth)
     {
         return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
@@ -543,8 +552,8 @@ AcpiExPrepFieldValue (
 
     ObjDesc->CommonField.Node = Info->FieldNode;
     Status = AcpiExPrepCommonFieldObject (ObjDesc,
-                Info->FieldFlags, Info->Attribute,
-                Info->FieldBitPosition, Info->FieldBitLength);
+        Info->FieldFlags, Info->Attribute,
+        Info->FieldBitPosition, Info->FieldBitLength);
     if (ACPI_FAILURE (Status))
     {
         AcpiUtDeleteObjectDesc (ObjDesc);
@@ -576,8 +585,10 @@ AcpiExPrepFieldValue (
                 }
             }
 
-            ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer;
-            ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length;
+            ObjDesc->Field.ResourceBuffer =
+                SecondDesc->Buffer.Pointer;
+            ObjDesc->Field.ResourceLength =
+                (UINT16) SecondDesc->Buffer.Length;
         }
         else if (Info->ResourceBuffer)
         {
@@ -599,7 +610,8 @@ AcpiExPrepFieldValue (
 
             if (AccessByteWidth < 256)
             {
-                ObjDesc->CommonField.AccessByteWidth = (UINT8) AccessByteWidth;
+                ObjDesc->CommonField.AccessByteWidth =
+                    (UINT8) AccessByteWidth;
             }
         }
 
@@ -609,8 +621,10 @@ AcpiExPrepFieldValue (
 
         ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
             "RegionField: BitOff %X, Off %X, Gran %X, Region %p\n",
-            ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset,
-            ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj));
+            ObjDesc->Field.StartFieldBitOffset,
+            ObjDesc->Field.BaseByteOffset,
+            ObjDesc->Field.AccessByteWidth,
+            ObjDesc->Field.RegionObj));
         break;
 
     case ACPI_TYPE_LOCAL_BANK_FIELD:
@@ -690,7 +704,8 @@ AcpiExPrepFieldValue (
             ObjDesc->IndexField.AccessByteWidth);
 
         ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
-            "IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n",
+            "IndexField: BitOff %X, Off %X, Value %X, "
+            "Gran %X, Index %p, Data %p\n",
             ObjDesc->IndexField.StartFieldBitOffset,
             ObjDesc->IndexField.BaseByteOffset,
             ObjDesc->IndexField.Value,
@@ -710,10 +725,11 @@ AcpiExPrepFieldValue (
      * Store the constructed descriptor (ObjDesc) into the parent Node,
      * preserving the current type of that NamedObj.
      */
-    Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc,
-                AcpiNsGetType (Info->FieldNode));
+    Status = AcpiNsAttachObject (
+        Info->FieldNode, ObjDesc, AcpiNsGetType (Info->FieldNode));
 
-    ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set NamedObj %p [%4.4s], ObjDesc %p\n",
+    ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+        "Set NamedObj %p [%4.4s], ObjDesc %p\n",
         Info->FieldNode, AcpiUtGetNodeName (Info->FieldNode), ObjDesc));
 
     /* Remove local reference to the object */
index cf60500..23c04dc 100644 (file)
@@ -489,7 +489,8 @@ AcpiExPciConfigSpaceHandler (
     PciRegister = (UINT16) (UINT32) Address;
 
     ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-        "Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
+        "Pci-Config %u (%u) Seg(%04x) Bus(%04x) "
+        "Dev(%04x) Func(%04x) Reg(%04x)\n",
         Function, BitWidth, PciId->Segment, PciId->Bus, PciId->Device,
         PciId->Function, PciRegister));
 
@@ -498,14 +499,14 @@ AcpiExPciConfigSpaceHandler (
     case ACPI_READ:
 
         *Value = 0;
-        Status = AcpiOsReadPciConfiguration (PciId, PciRegister,
-                    Value, BitWidth);
+        Status = AcpiOsReadPciConfiguration (
+            PciId, PciRegister, Value, BitWidth);
         break;
 
     case ACPI_WRITE:
 
-        Status = AcpiOsWritePciConfiguration (PciId, PciRegister,
-                    *Value, BitWidth);
+        Status = AcpiOsWritePciConfiguration (
+            PciId, PciRegister, *Value, BitWidth);
         break;
 
     default:
index 6967bbb..4c334f6 100644 (file)
@@ -170,9 +170,9 @@ AcpiExResolveNodeToValue (
      * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the
      * object that is attached to the Node.
      */
-    Node       = *ObjectPtr;
+    Node = *ObjectPtr;
     SourceDesc = AcpiNsGetAttachedObject (Node);
-    EntryType  = AcpiNsGetType ((ACPI_HANDLE) Node);
+    EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
 
     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]\n",
          Node, SourceDesc, AcpiUtGetTypeName (EntryType)));
@@ -182,15 +182,15 @@ AcpiExResolveNodeToValue (
     {
         /* There is always exactly one level of indirection */
 
-        Node       = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Node->Object);
+        Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Node->Object);
         SourceDesc = AcpiNsGetAttachedObject (Node);
-        EntryType  = AcpiNsGetType ((ACPI_HANDLE) Node);
+        EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
         *ObjectPtr = Node;
     }
 
     /*
      * Several object types require no further processing:
-     * 1) Device/Thermal objects don't have a "real" subobject, return the Node
+     * 1) Device/Thermal objects don't have a "real" subobject, return Node
      * 2) Method locals and arguments have a pseudo-Node
      * 3) 10/2007: Added method type to assist with Package construction.
      */
index a273a71..6628e93 100644 (file)
@@ -191,8 +191,8 @@ AcpiExResolveToValue (
     if (ACPI_GET_DESCRIPTOR_TYPE (*StackPtr) == ACPI_DESC_TYPE_NAMED)
     {
         Status = AcpiExResolveNodeToValue (
-                        ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, StackPtr),
-                        WalkState);
+            ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, StackPtr),
+            WalkState);
         if (ACPI_FAILURE (Status))
         {
             return_ACPI_STATUS (Status);
@@ -251,7 +251,7 @@ AcpiExResolveObjectToValue (
              * Note: this increments the local's object reference count
              */
             Status = AcpiDsMethodDataGetValue (RefType,
-                            StackDesc->Reference.Value, WalkState, &ObjDesc);
+                StackDesc->Reference.Value, WalkState, &ObjDesc);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -307,7 +307,8 @@ AcpiExResolveObjectToValue (
                      * the package, can't dereference it
                      */
                     ACPI_ERROR ((AE_INFO,
-                        "Attempt to dereference an Index to NULL package element Idx=%p",
+                        "Attempt to dereference an Index to "
+                        "NULL package element Idx=%p",
                         StackDesc));
                     Status = AE_AML_UNINITIALIZED_ELEMENT;
                 }
@@ -358,7 +359,8 @@ AcpiExResolveObjectToValue (
         default:
 
             ACPI_ERROR ((AE_INFO,
-                "Unknown Reference type 0x%X in %p", RefType, StackDesc));
+                "Unknown Reference type 0x%X in %p",
+                RefType, StackDesc));
             Status = AE_AML_INTERNAL;
             break;
         }
@@ -379,7 +381,8 @@ AcpiExResolveObjectToValue (
     case ACPI_TYPE_LOCAL_BANK_FIELD:
     case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead SourceDesc=%p Type=%X\n",
+        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+            "FieldRead SourceDesc=%p Type=%X\n",
             StackDesc, StackDesc->Common.Type));
 
         Status = AcpiExReadDataFromField (WalkState, StackDesc, &ObjDesc);
@@ -450,7 +453,8 @@ AcpiExResolveMultiple (
         if (Type == ACPI_TYPE_LOCAL_ALIAS)
         {
             Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
-            ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
+            ObjDesc = AcpiNsGetAttachedObject (
+                (ACPI_NAMESPACE_NODE *) ObjDesc);
         }
 
         if (!ObjDesc)
@@ -564,7 +568,7 @@ AcpiExResolveMultiple (
             if (ReturnDesc)
             {
                 Status = AcpiDsMethodDataGetValue (ObjDesc->Reference.Class,
-                            ObjDesc->Reference.Value, WalkState, &ObjDesc);
+                    ObjDesc->Reference.Value, WalkState, &ObjDesc);
                 if (ACPI_FAILURE (Status))
                 {
                     return_ACPI_STATUS (Status);
@@ -574,7 +578,7 @@ AcpiExResolveMultiple (
             else
             {
                 Status = AcpiDsMethodDataGetNode (ObjDesc->Reference.Class,
-                            ObjDesc->Reference.Value, WalkState, &Node);
+                    ObjDesc->Reference.Value, WalkState, &Node);
                 if (ACPI_FAILURE (Status))
                 {
                     return_ACPI_STATUS (Status);
@@ -599,7 +603,8 @@ AcpiExResolveMultiple (
         default:
 
             ACPI_ERROR ((AE_INFO,
-                "Unknown Reference Class 0x%2.2X", ObjDesc->Reference.Class));
+                "Unknown Reference Class 0x%2.2X",
+                ObjDesc->Reference.Class));
             return_ACPI_STATUS (AE_AML_INTERNAL);
         }
     }
index 3cfe472..214e6de 100644 (file)
@@ -171,7 +171,8 @@ AcpiExCheckObjectType (
          * specification, a store to a constant is a noop.)
          */
         if ((ThisType == ACPI_TYPE_INTEGER) &&
-            (((ACPI_OPERAND_OBJECT *) Object)->Common.Flags & AOPOBJ_AML_CONSTANT))
+            (((ACPI_OPERAND_OBJECT *) Object)->Common.Flags &
+                AOPOBJ_AML_CONSTANT))
         {
             return (AE_OK);
         }
@@ -288,7 +289,8 @@ AcpiExResolveOperands (
              */
             if (ObjectType == ACPI_TYPE_LOCAL_ALIAS)
             {
-                ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
+                ObjDesc = AcpiNsGetAttachedObject (
+                    (ACPI_NAMESPACE_NODE *) ObjDesc);
                 *StackPtr = ObjDesc;
                 ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
             }
@@ -369,7 +371,8 @@ AcpiExResolveOperands (
         {
         case ARGI_REF_OR_STRING:        /* Can be a String or Reference */
 
-            if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND) &&
+            if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) ==
+                ACPI_DESC_TYPE_OPERAND) &&
                 (ObjDesc->Common.Type == ACPI_TYPE_STRING))
             {
                 /*
@@ -403,8 +406,8 @@ AcpiExResolveOperands (
                 goto NextOperand;
             }
 
-            Status = AcpiExCheckObjectType (ACPI_TYPE_LOCAL_REFERENCE,
-                            ObjectType, ObjDesc);
+            Status = AcpiExCheckObjectType (
+                ACPI_TYPE_LOCAL_REFERENCE, ObjectType, ObjDesc);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -555,8 +558,8 @@ AcpiExResolveOperands (
              * But we can implicitly convert from a BUFFER or INTEGER
              * Aka - "Implicit Source Operand Conversion"
              */
-            Status = AcpiExConvertToString (ObjDesc, StackPtr,
-                        ACPI_IMPLICIT_CONVERT_HEX);
+            Status = AcpiExConvertToString (
+                ObjDesc, StackPtr, ACPI_IMPLICIT_CONVERT_HEX);
             if (ACPI_FAILURE (Status))
             {
                 if (Status == AE_TYPE)
@@ -689,8 +692,10 @@ AcpiExResolveOperands (
 
         case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
 
-            /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */
-
+         &nbs