diff options
Diffstat (limited to 'dispatcher/dsmethod.c')
-rw-r--r-- | dispatcher/dsmethod.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/dispatcher/dsmethod.c b/dispatcher/dsmethod.c index 0db4eae0da3f..d4127fd769e3 100644 --- a/dispatcher/dsmethod.c +++ b/dispatcher/dsmethod.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Module Name: dsmethod - Parser/Interpreter interface - control method parsing - * $Revision: 1.136 $ * *****************************************************************************/ @@ -9,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -117,7 +116,7 @@ #define __DSMETHOD_C__ #include "acpi.h" -#include "acparser.h" +#include "accommon.h" #include "amlcode.h" #include "acdispat.h" #include "acinterp.h" @@ -183,9 +182,11 @@ AcpiDsMethodError ( WalkState->MethodNode ? WalkState->MethodNode->Name.Integer : 0, WalkState->Opcode, WalkState->AmlOffset, NULL); - (void) AcpiExEnterInterpreter (); + AcpiExEnterInterpreter (); } + AcpiDsClearImplicitReturn (WalkState); + #ifdef ACPI_DISASSEMBLER if (ACPI_FAILURE (Status)) { @@ -384,6 +385,7 @@ AcpiDsBeginMethodExecution ( * reentered one more time (even if it is the same thread) */ ObjDesc->Method.ThreadCount++; + AcpiMethodCount++; return_ACPI_STATUS (Status); @@ -484,7 +486,6 @@ AcpiDsCallControlMethod ( } Info->Parameters = &ThisWalkState->Operands[0]; - Info->ParameterType = ACPI_PARAM_ARGS; Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode, ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, @@ -519,6 +520,10 @@ AcpiDsCallControlMethod ( if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) { Status = ObjDesc->Method.Implementation (NextWalkState); + if (Status == AE_OK) + { + Status = AE_CTRL_TERMINATE; + } } return_ACPI_STATUS (Status); @@ -651,8 +656,6 @@ AcpiDsTerminateControlMethod ( ACPI_OPERAND_OBJECT *MethodDesc, ACPI_WALK_STATE *WalkState) { - ACPI_STATUS Status; - ACPI_FUNCTION_TRACE_PTR (DsTerminateControlMethod, WalkState); @@ -669,29 +672,26 @@ AcpiDsTerminateControlMethod ( /* Delete all arguments and locals */ 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) + /* + * If method is serialized, release the mutex and restore the + * current sync level for this thread + */ + if (MethodDesc->Method.Mutex) { - WalkState->Thread->CurrentSyncLevel = - MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel; + /* 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; + AcpiOsReleaseMutex (MethodDesc->Method.Mutex->Mutex.OsMutex); + MethodDesc->Method.Mutex->Mutex.ThreadId = 0; + } } - } - if (WalkState) - { /* * Delete any namespace objects created anywhere within * the namespace by the execution of this method @@ -740,7 +740,7 @@ AcpiDsTerminateControlMethod ( if ((MethodDesc->Method.MethodFlags & AML_METHOD_SERIALIZED) && (!MethodDesc->Method.Mutex)) { - Status = AcpiDsCreateMethodMutex (MethodDesc); + (void) AcpiDsCreateMethodMutex (MethodDesc); } /* No more threads, we can free the OwnerId */ |