diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2016-11-17 18:06:08 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2016-11-17 18:06:08 +0000 | 
| commit | a56e3c255d5c5dfa4dd3a2fda4705a1607a6b7f3 (patch) | |
| tree | 830d95042126506cd52440fe9710bb4e6811cfde /source/components/dispatcher/dsmethod.c | |
| parent | 7600ac2283596bd000a29b9347e95346d3b740d7 (diff) | |
Diffstat (limited to 'source/components/dispatcher/dsmethod.c')
| -rw-r--r-- | source/components/dispatcher/dsmethod.c | 50 | 
1 files changed, 22 insertions, 28 deletions
| diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c index 4c4ff2270127d..92bdb2fc80f46 100644 --- a/source/components/dispatcher/dsmethod.c +++ b/source/components/dispatcher/dsmethod.c @@ -107,15 +107,12 @@ AcpiDsAutoSerializeMethod (          "Method auto-serialization parse [%4.4s] %p\n",          AcpiUtGetNodeName (Node), Node)); -    AcpiExEnterInterpreter (); -      /* Create/Init a root op for the method parse tree */      Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart);      if (!Op)      { -        Status = AE_NO_MEMORY; -        goto Unlock; +        return_ACPI_STATUS (AE_NO_MEMORY);      }      AcpiPsSetName (Op, Node->Name.Integer); @@ -127,8 +124,7 @@ AcpiDsAutoSerializeMethod (      if (!WalkState)      {          AcpiPsFreeOp (Op); -        Status = AE_NO_MEMORY; -        goto Unlock; +        return_ACPI_STATUS (AE_NO_MEMORY);      }      Status = AcpiDsInitAmlWalk (WalkState, Op, Node, @@ -147,8 +143,6 @@ AcpiDsAutoSerializeMethod (      Status = AcpiPsParseAml (WalkState);      AcpiPsDeleteParseTree (Op); -Unlock: -    AcpiExExitInterpreter ();      return_ACPI_STATUS (Status);  } @@ -784,26 +778,6 @@ AcpiDsTerminateControlMethod (          AcpiDsMethodDataDeleteAll (WalkState);          /* -         * If method is serialized, release the mutex and restore the -         * current sync level for this thread -         */ -        if (MethodDesc->Method.Mutex) -        { -            /* Acquisition Depth handles recursive calls */ - -            MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--; -            if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth) -            { -                WalkState->Thread->CurrentSyncLevel = -                    MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel; - -                AcpiOsReleaseMutex ( -                    MethodDesc->Method.Mutex->Mutex.OsMutex); -                MethodDesc->Method.Mutex->Mutex.ThreadId = 0; -            } -        } - -        /*           * Delete any namespace objects created anywhere within the           * namespace by the execution of this method. Unless:           * 1) This method is a module-level executable code method, in which @@ -836,6 +810,26 @@ AcpiDsTerminateControlMethod (                      ~ACPI_METHOD_MODIFIED_NAMESPACE;              }          } + +        /* +         * If method is serialized, release the mutex and restore the +         * current sync level for this thread +         */ +        if (MethodDesc->Method.Mutex) +        { +            /* Acquisition Depth handles recursive calls */ + +            MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--; +            if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth) +            { +                WalkState->Thread->CurrentSyncLevel = +                    MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel; + +                AcpiOsReleaseMutex ( +                    MethodDesc->Method.Mutex->Mutex.OsMutex); +                MethodDesc->Method.Mutex->Mutex.ThreadId = 0; +            } +        }      }      /* Decrement the thread count on the method */ | 
