这篇教程C++ AcpiExExitInterpreter函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AcpiExExitInterpreter函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiExExitInterpreter函数的具体用法?C++ AcpiExExitInterpreter怎么用?C++ AcpiExExitInterpreter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AcpiExExitInterpreter函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AcpiExSystemDoSleepACPI_STATUSAcpiExSystemDoSleep ( UINT64 HowLong){ ACPI_FUNCTION_ENTRY (); /* Since this thread will sleep, we must release the interpreter */ AcpiExExitInterpreter (); /* * For compatibility with other ACPI implementations and to prevent * accidental deep sleeps, limit the sleep time to something reasonable. */ if (HowLong > ACPI_MAX_SLEEP) { HowLong = ACPI_MAX_SLEEP; } AcpiOsSleep (HowLong); /* And now we must get the interpreter again */ AcpiExEnterInterpreter (); return (AE_OK);}
开发者ID:ChaiSoft,项目名称:ChaiOS,代码行数:27,
示例2: AcpiAcquireGlobalLockACPI_STATUSAcpiAcquireGlobalLock ( UINT16 Timeout, UINT32 *Handle){ ACPI_STATUS Status; if (!Handle) { return (AE_BAD_PARAMETER); } /* Must lock interpreter to prevent race conditions */ AcpiExEnterInterpreter (); Status = AcpiExAcquireMutexObject (Timeout, AcpiGbl_GlobalLockMutex, AcpiOsGetThreadId ()); if (ACPI_SUCCESS (Status)) { /* Return the global lock handle (updated in AcpiEvAcquireGlobalLock) */ *Handle = AcpiGbl_GlobalLockHandle; } AcpiExExitInterpreter (); return (Status);}
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:30,
示例3: AcpiExSystemWaitMutexACPI_STATUSAcpiExSystemWaitMutex ( ACPI_MUTEX Mutex, UINT16 Timeout){ ACPI_STATUS Status; ACPI_FUNCTION_TRACE (ExSystemWaitMutex); Status = AcpiOsAcquireMutex (Mutex, ACPI_DO_NOT_WAIT); if (ACPI_SUCCESS (Status)) { return_ACPI_STATUS (Status); } if (Status == AE_TIME) { /* We must wait, so unlock the interpreter */ AcpiExExitInterpreter (); Status = AcpiOsAcquireMutex (Mutex, Timeout); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*** Thread awake after blocking, %s/n", AcpiFormatException (Status))); /* Reacquire the interpreter */ AcpiExEnterInterpreter (); } return_ACPI_STATUS (Status);}
开发者ID:ChaiSoft,项目名称:ChaiOS,代码行数:35,
示例4: AcpiNsExecuteControlMethodACPI_STATUSAcpiNsExecuteControlMethod ( ACPI_NAMESPACE_NODE *MethodNode, ACPI_OPERAND_OBJECT **Params, ACPI_OPERAND_OBJECT **ReturnObjDesc){ ACPI_STATUS Status; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_FUNCTION_TRACE ("NsExecuteControlMethod"); /* Verify that there is a method associated with this object */ ObjDesc = AcpiNsGetAttachedObject (MethodNode); if (!ObjDesc) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object/n")); (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (AE_NULL_OBJECT); } ACPI_DUMP_PATHNAME (MethodNode, "Execute Method:", ACPI_LV_INFO, _COMPONENT); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X/n", ObjDesc->Method.AmlStart + 1, ObjDesc->Method.AmlLength - 1)); /* * Unlock the namespace before execution. This allows namespace access * via the external Acpi* interfaces while a method is being executed. * However, any namespace deletion must acquire both the namespace and * interpreter locks to ensure that no thread is using the portion of the * namespace that is being deleted. */ Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * Execute the method via the interpreter. The interpreter is locked * here before calling into the AML parser */ Status = AcpiExEnterInterpreter (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } Status = AcpiPsxExecute (MethodNode, Params, ReturnObjDesc); AcpiExExitInterpreter (); return_ACPI_STATUS (Status);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:58,
示例5: AeDoOneOverridestatic voidAeDoOneOverride ( char *Pathname, char *ValueString, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState){ ACPI_HANDLE Handle; ACPI_STATUS Status; UINT64 Value; AcpiOsPrintf ("Value Override: %s, ", Pathname); /* * Get the namespace node associated with the override * pathname from the init file. */ Status = AcpiGetHandle (NULL, Pathname, &Handle); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s/n", AcpiFormatException (Status)); return; } /* Extract the 64-bit integer */ Status = AcpiUtStrtoul64 (ValueString, (ACPI_STRTOUL_BASE16 | ACPI_STRTOUL_64BIT), &Value); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s %s/n", ValueString, AcpiFormatException (Status)); return; } ObjDesc->Integer.Value = Value; /* * At the point this function is called, the namespace is fully * built and initialized. We can simply store the new object to * the target node. */ AcpiExEnterInterpreter (); Status = AcpiExStore (ObjDesc, Handle, WalkState); AcpiExExitInterpreter (); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s/n", AcpiFormatException (Status)); return; } AcpiOsPrintf ("New value: 0x%8.8X%8.8X/n", ACPI_FORMAT_UINT64 (Value));}
开发者ID:ColinIanKing,项目名称:acpica,代码行数:56,
示例6: AcpiDsMethodErrorACPI_STATUSAcpiDsMethodError ( ACPI_STATUS Status, ACPI_WALK_STATE *WalkState){ UINT32 AmlOffset; ACPI_FUNCTION_ENTRY (); /* Ignore AE_OK and control exception codes */ if (ACPI_SUCCESS (Status) || (Status & AE_CODE_CONTROL)) { return (Status); } /* Invoke the global exception handler */ if (AcpiGbl_ExceptionHandler) { /* Exit the interpreter, allow handler to execute methods */ AcpiExExitInterpreter (); /* * Handler can map the exception code to anything it wants, including * AE_OK, in which case the executing method will not be aborted. */ AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml, WalkState->ParserState.AmlStart); Status = AcpiGbl_ExceptionHandler (Status, WalkState->MethodNode ? WalkState->MethodNode->Name.Integer : 0, WalkState->Opcode, AmlOffset, NULL); AcpiExEnterInterpreter (); } AcpiDsClearImplicitReturn (WalkState); if (ACPI_FAILURE (Status)) { AcpiDsDumpMethodStack (Status, WalkState, WalkState->Op); /* Display method locals/args if debugger is present */#ifdef ACPI_DEBUGGER AcpiDbDumpMethodInfo (Status, WalkState);#endif } return (Status);}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:56,
示例7: AcpiExAddTablestatic ACPI_STATUSAcpiExAddTable ( UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode, ACPI_OPERAND_OBJECT **DdbHandle){ ACPI_STATUS Status; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_FUNCTION_TRACE (ExAddTable); /* Create an object to be the table handle */ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_REFERENCE); if (!ObjDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Init the table handle */ ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID; ObjDesc->Reference.Class = ACPI_REFCLASS_TABLE; *DdbHandle = ObjDesc; /* Install the new table into the local data structures */ ObjDesc->Reference.Value = TableIndex; /* Add the table to the namespace */ Status = AcpiNsLoadTable (TableIndex, ParentNode); if (ACPI_FAILURE (Status)) { AcpiUtRemoveReference (ObjDesc); *DdbHandle = NULL; return_ACPI_STATUS (Status); } /* Execute any module-level code that was found in the table */ AcpiExExitInterpreter (); AcpiNsExecModuleCodeList (); AcpiExEnterInterpreter (); return_ACPI_STATUS (Status);}
开发者ID:mmanley,项目名称:Antares,代码行数:49,
示例8: AcpiDsMethodErrorACPI_STATUSAcpiDsMethodError ( ACPI_STATUS Status, ACPI_WALK_STATE *WalkState){ ACPI_FUNCTION_ENTRY (); /* Ignore AE_OK and control exception codes */ if (ACPI_SUCCESS (Status) || (Status & AE_CODE_CONTROL)) { return (Status); } /* Invoke the global exception handler */ if (AcpiGbl_ExceptionHandler) { /* Exit the interpreter, allow handler to execute methods */ AcpiExExitInterpreter (); /* * Handler can map the exception code to anything it wants, including * AE_OK, in which case the executing method will not be aborted. */ Status = AcpiGbl_ExceptionHandler (Status, WalkState->MethodNode ? WalkState->MethodNode->Name.Integer : 0, WalkState->Opcode, WalkState->AmlOffset, NULL); AcpiExEnterInterpreter (); } AcpiDsClearImplicitReturn (WalkState);#ifdef ACPI_DISASSEMBLER if (ACPI_FAILURE (Status)) { /* Display method locals/args if disassembler is present */ AcpiDmDumpMethodInfo (Status, WalkState, WalkState->Op); }#endif return (Status);}
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:48,
示例9: AcpiEvAddressSpaceDispatchACPI_STATUSAcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *RegionObj, ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, UINT64 *Value){ ACPI_STATUS Status; ACPI_ADR_SPACE_HANDLER Handler; ACPI_ADR_SPACE_SETUP RegionSetup; ACPI_OPERAND_OBJECT *HandlerDesc; ACPI_OPERAND_OBJECT *RegionObj2; void *RegionContext = NULL; ACPI_CONNECTION_INFO *Context; ACPI_PHYSICAL_ADDRESS Address; ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch); RegionObj2 = AcpiNsGetSecondaryObject (RegionObj); if (!RegionObj2) { return_ACPI_STATUS (AE_NOT_EXIST); } /* Ensure that there is a handler associated with this region */ HandlerDesc = RegionObj->Region.Handler; if (!HandlerDesc) { ACPI_ERROR ((AE_INFO, "No handler for Region [%4.4s] (%p) [%s]", AcpiUtGetNodeName (RegionObj->Region.Node), RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (AE_NOT_EXIST); } Context = HandlerDesc->AddressSpace.Context; /* * It may be the case that the region has never been initialized. * Some types of regions require special init code */ if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)) { /* This region has not been initialized yet, do it */ RegionSetup = HandlerDesc->AddressSpace.Setup; if (!RegionSetup) { /* No initialization routine, exit with error */ ACPI_ERROR ((AE_INFO, "No init routine for region(%p) [%s]", RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (AE_NOT_EXIST); } /* * We must exit the interpreter because the region setup will * potentially execute control methods (for example, the _REG method * for this region) */ AcpiExExitInterpreter (); Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE, Context, &RegionContext); /* Re-enter the interpreter */ AcpiExEnterInterpreter (); /* Check for failure of the Region Setup */ if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "During region initialization: [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (Status); } /* Region initialization may have been completed by RegionSetup */ if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)) { RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE; /* * Save the returned context for use in all accesses to * the handler for this particular region */ if (!(RegionObj2->Extra.RegionContext)) { RegionObj2->Extra.RegionContext = RegionContext; }//.........这里部分代码省略.........
开发者ID:JasonFord53,项目名称:freebsd,代码行数:101,
示例10: AcpiNsLoadTableACPI_STATUSAcpiNsLoadTable ( UINT32 TableIndex, ACPI_NAMESPACE_NODE *Node){ ACPI_STATUS Status; ACPI_FUNCTION_TRACE (NsLoadTable); /* If table already loaded into namespace, just return */ if (AcpiTbIsTableLoaded (TableIndex)) { Status = AE_ALREADY_EXISTS; goto Unlock; } ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Loading table into namespace ****/n")); Status = AcpiTbAllocateOwnerId (TableIndex); if (ACPI_FAILURE (Status)) { goto Unlock; } /* * Parse the table and load the namespace with all named * objects found within. Control methods are NOT parsed * at this time. In fact, the control methods cannot be * parsed until the entire namespace is loaded, because * if a control method makes a forward reference (call) * to another control method, we can't continue parsing * because we don't know how many arguments to parse next! */ Status = AcpiNsParseTable (TableIndex, Node); if (ACPI_SUCCESS (Status)) { AcpiTbSetTableLoadedFlag (TableIndex, TRUE); } else { /* * On error, delete any namespace objects created by this table. * We cannot initialize these objects, so delete them. There are * a couple of expecially bad cases: * AE_ALREADY_EXISTS - namespace collision. * AE_NOT_FOUND - the target of a Scope operator does not * exist. This target of Scope must already exist in the * namespace, as per the ACPI specification. */ AcpiNsDeleteNamespaceByOwner ( AcpiGbl_RootTableList.Tables[TableIndex].OwnerId); AcpiTbReleaseOwnerId (TableIndex); return_ACPI_STATUS (Status); }Unlock: if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * Now we can parse the control methods. We always parse * them here for a sanity check, and if configured for * just-in-time parsing, we delete the control method * parse trees. */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Begin Table Object Initialization/n")); AcpiExEnterInterpreter (); Status = AcpiDsInitializeObjects (TableIndex, Node); AcpiExExitInterpreter (); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Completed Table Object Initialization/n")); /* * This case handles the legacy option that groups all module-level * code blocks together and defers execution until all of the tables * are loaded. Execute all of these blocks at this time. * Execute any module-level code that was detected during the table * load phase. * * Note: this option is deprecated and will be eliminated in the * future. Use of this option can cause problems with AML code that * depends upon in-order immediate execution of module-level code. */ AcpiNsExecModuleCodeList (); return_ACPI_STATUS (Status);}
开发者ID:malattia,项目名称:acpica-tools,代码行数:96,
示例11: AcpiEvUpdateGpesvoidAcpiEvUpdateGpes ( ACPI_OWNER_ID TableOwnerId){ ACPI_GPE_XRUPT_INFO *GpeXruptInfo; ACPI_GPE_BLOCK_INFO *GpeBlock; ACPI_GPE_WALK_INFO WalkInfo; ACPI_STATUS Status = AE_OK; UINT32 NewWakeGpeCount = 0; /* We will examine only _PRW/_Lxx/_Exx methods owned by this table */ WalkInfo.OwnerId = TableOwnerId; WalkInfo.ExecuteByOwnerId = TRUE; WalkInfo.Count = 0; if (AcpiGbl_LeaveWakeGpesDisabled) { /* * 1) Run any newly-loaded _PRW methods to find any GPEs that * can now be marked as CAN_WAKE GPEs. Note: We must run the * _PRW methods before we process the _Lxx/_Exx methods because * we will enable all runtime GPEs associated with the new * _Lxx/_Exx methods at the time we process those methods. * * Unlock interpreter so that we can run the _PRW methods. */ WalkInfo.GpeBlock = NULL; WalkInfo.GpeDevice = NULL; AcpiExExitInterpreter (); Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, AcpiEvMatchPrwAndGpe, NULL, &WalkInfo, NULL); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "While executing _PRW methods")); } AcpiExEnterInterpreter (); NewWakeGpeCount = WalkInfo.Count; } /* * 2) Find any _Lxx/_Exx GPE methods that have just been loaded. * * Any GPEs that correspond to new _Lxx/_Exx methods and are not * marked as CAN_WAKE are immediately enabled. * * Examine the namespace underneath each GpeDevice within the * GpeBlock lists. */ Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); if (ACPI_FAILURE (Status)) { return; } WalkInfo.Count = 0; WalkInfo.EnableThisGpe = TRUE; /* Walk the interrupt level descriptor list */ GpeXruptInfo = AcpiGbl_GpeXruptListHead; while (GpeXruptInfo) { /* Walk all Gpe Blocks attached to this interrupt level */ GpeBlock = GpeXruptInfo->GpeBlockListHead; while (GpeBlock) { WalkInfo.GpeBlock = GpeBlock; WalkInfo.GpeDevice = GpeBlock->Node; Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, WalkInfo.GpeDevice, ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "While decoding _Lxx/_Exx methods")); } GpeBlock = GpeBlock->Next; } GpeXruptInfo = GpeXruptInfo->Next; } if (WalkInfo.Count || NewWakeGpeCount) { ACPI_INFO ((AE_INFO, "Enabled %u new runtime GPEs, added %u new wakeup GPEs", WalkInfo.Count, NewWakeGpeCount)); }//.........这里部分代码省略.........
开发者ID:0xffea,项目名称:MINIX3,代码行数:101,
示例12: AcpiEvaluateObject//.........这里部分代码省略......... Status = AcpiNsEvaluate (Info); } /* * If we are expecting a return value, and all went well above, * copy the return value to an external object. */ if (ReturnBuffer) { if (!Info->ReturnObject) { ReturnBuffer->Length = 0; } else { if (ACPI_GET_DESCRIPTOR_TYPE (Info->ReturnObject) == ACPI_DESC_TYPE_NAMED) { /* * If we received a NS Node as a return object, this means that * the object we are evaluating has nothing interesting to * return (such as a mutex, etc.) We return an error because * these types are essentially unsupported by this interface. * We don't check up front because this makes it easier to add * support for various types at a later date if necessary. */ Status = AE_TYPE; Info->ReturnObject = NULL; /* No need to delete a NS Node */ ReturnBuffer->Length = 0; } if (ACPI_SUCCESS (Status)) { /* Dereference Index and RefOf references */ AcpiNsResolveReferences (Info); /* Get the size of the returned object */ Status = AcpiUtGetObjectSize (Info->ReturnObject, &BufferSpaceNeeded); if (ACPI_SUCCESS (Status)) { /* Validate/Allocate/Clear caller buffer */ Status = AcpiUtInitializeBuffer (ReturnBuffer, BufferSpaceNeeded); if (ACPI_FAILURE (Status)) { /* * Caller's buffer is too small or a new one can't * be allocated */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Needed buffer size %X, %s/n", (UINT32) BufferSpaceNeeded, AcpiFormatException (Status))); } else { /* We have enough space for the object, build it */ Status = AcpiUtCopyIobjectToEobject (Info->ReturnObject, ReturnBuffer); } } } } } if (Info->ReturnObject) { /* * Delete the internal return object. NOTE: Interpreter must be * locked to avoid race condition. */ AcpiExEnterInterpreter (); /* Remove one reference on the return object (should delete it) */ AcpiUtRemoveReference (Info->ReturnObject); AcpiExExitInterpreter (); }Cleanup: /* Free the input parameter list (if we created one) */ if (Info->Parameters) { /* Free the allocated parameter block */ AcpiUtDeleteInternalObjectList (Info->Parameters); } ACPI_FREE (Info); return_ACPI_STATUS (Status);}
开发者ID:ExpressOS,项目名称:third_party-l4re,代码行数:101,
示例13: AcpiNsLoadTableACPI_STATUSAcpiNsLoadTable ( UINT32 TableIndex, ACPI_NAMESPACE_NODE *Node){ ACPI_STATUS Status; ACPI_FUNCTION_TRACE (NsLoadTable); /* If table already loaded into namespace, just return */ if (AcpiTbIsTableLoaded (TableIndex)) { Status = AE_ALREADY_EXISTS; goto Unlock; } ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Loading table into namespace ****/n")); Status = AcpiTbAllocateOwnerId (TableIndex); if (ACPI_FAILURE (Status)) { goto Unlock; } /* * Parse the table and load the namespace with all named * objects found within. Control methods are NOT parsed * at this time. In fact, the control methods cannot be * parsed until the entire namespace is loaded, because * if a control method makes a forward reference (call) * to another control method, we can't continue parsing * because we don't know how many arguments to parse next! */ Status = AcpiNsParseTable (TableIndex, Node); if (ACPI_SUCCESS (Status)) { AcpiTbSetTableLoadedFlag (TableIndex, TRUE); } else { /* * On error, delete any namespace objects created by this table. * We cannot initialize these objects, so delete them. There are * a couple of expecially bad cases: * AE_ALREADY_EXISTS - namespace collision. * AE_NOT_FOUND - the target of a Scope operator does not * exist. This target of Scope must already exist in the * namespace, as per the ACPI specification. */ AcpiNsDeleteNamespaceByOwner ( AcpiGbl_RootTableList.Tables[TableIndex].OwnerId); AcpiTbReleaseOwnerId (TableIndex); return_ACPI_STATUS (Status); }Unlock: if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * Now we can parse the control methods. We always parse * them here for a sanity check, and if configured for * just-in-time parsing, we delete the control method * parse trees. */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Begin Table Object Initialization/n")); AcpiExEnterInterpreter (); Status = AcpiDsInitializeObjects (TableIndex, Node); AcpiExExitInterpreter (); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Completed Table Object Initialization/n")); /* * Execute any module-level code that was detected during the table load * phase. Although illegal since ACPI 2.0, there are many machines that * contain this type of code. Each block of detected executable AML code * outside of any control method is wrapped with a temporary control * method object and placed on a global list. The methods on this list * are executed below. * * This case executes the module-level code for each table immediately * after the table has been loaded. This provides compatibility with * other ACPI implementations. Optionally, the execution can be deferred * until later, see AcpiInitializeObjects. */ if (!AcpiGbl_ParseTableAsTermList && !AcpiGbl_GroupModuleLevelCode) { AcpiNsExecModuleCodeList (); }//.........这里部分代码省略.........
开发者ID:kwitaszczyk,项目名称:freebsd,代码行数:101,
示例14: AcpiNsEvaluate//.........这里部分代码省略......... goto Cleanup; case ACPI_TYPE_METHOD: /* * 2) Object is a control method - execute it */ /* Verify that there is a method object associated with this node */ if (!Info->ObjDesc) { ACPI_ERROR ((AE_INFO, "%s: Method has no attached sub-object", Info->FullPathname)); Status = AE_NULL_OBJECT; goto Cleanup; } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "**** Execute method [%s] at AML address %p length %X/n", Info->FullPathname, Info->ObjDesc->Method.AmlStart + 1, Info->ObjDesc->Method.AmlLength - 1)); /* * Any namespace deletion must acquire both the namespace and * interpreter locks to ensure that no thread is using the portion of * the namespace that is being deleted. * * Execute the method via the interpreter. The interpreter is locked * here before calling into the AML parser */ AcpiExEnterInterpreter (); Status = AcpiPsExecuteMethod (Info); AcpiExExitInterpreter (); break; default: /* * 3) All other non-method objects -- get the current object value */ /* * Some objects require additional resolution steps (e.g., the Node * may be a field that must be read, etc.) -- we can't just grab * the object out of the node. * * Use ResolveNodeToValue() to get the associated value. * * NOTE: we can get away with passing in NULL for a walk state because * the Node is guaranteed to not be a reference to either a method * local or a method argument (because this interface is never called * from a running method.) * * Even though we do not directly invoke the interpreter for object * resolution, we must lock it because we could access an OpRegion. * The OpRegion access code assumes that the interpreter is locked. */ AcpiExEnterInterpreter (); /* TBD: ResolveNodeToValue has a strange interface, fix */ Info->ReturnObject = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Info->Node); Status = AcpiExResolveNodeToValue (ACPI_CAST_INDIRECT_PTR ( ACPI_NAMESPACE_NODE, &Info->ReturnObject), NULL); AcpiExExitInterpreter ();
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:67,
示例15: AcpiNsEvaluate//.........这里部分代码省略......... /* Count the number of arguments being passed to the method */ if (Info->Parameters) { while (Info->Parameters[Info->ParamCount]) { if (Info->ParamCount > ACPI_METHOD_MAX_ARG) { return_ACPI_STATUS (AE_LIMIT); } Info->ParamCount++; } } ACPI_DUMP_PATHNAME (Info->ResolvedNode, "ACPI: Execute Method", ACPI_LV_INFO, _COMPONENT); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X/n", Info->ObjDesc->Method.AmlStart + 1, Info->ObjDesc->Method.AmlLength - 1)); /* * Any namespace deletion must acquire both the namespace and * interpreter locks to ensure that no thread is using the portion of * the namespace that is being deleted. * * Execute the method via the interpreter. The interpreter is locked * here before calling into the AML parser */ AcpiExEnterInterpreter (); Status = AcpiPsExecuteMethod (Info); AcpiExExitInterpreter (); } else { /* * 2) Object is not a method, return its current value * * Disallow certain object types. For these, "evaluation" is undefined. */ switch (Info->ResolvedNode->Type) { case ACPI_TYPE_DEVICE: case ACPI_TYPE_EVENT: case ACPI_TYPE_MUTEX: case ACPI_TYPE_REGION: case ACPI_TYPE_THERMAL: case ACPI_TYPE_LOCAL_SCOPE: ACPI_ERROR ((AE_INFO, "[%4.4s] Evaluation of object type [%s] is not supported", Info->ResolvedNode->Name.Ascii, AcpiUtGetTypeName (Info->ResolvedNode->Type))); return_ACPI_STATUS (AE_TYPE); default: break; } /* * Objects require additional resolution steps (e.g., the Node may be * a field that must be read, etc.) -- we can't just grab the object * out of the node.
开发者ID:cloudius-systems,项目名称:acpica,代码行数:67,
示例16: AcpiEvAddressSpaceDispatchACPI_STATUSAcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, UINT64 *Value){ ACPI_STATUS Status; ACPI_ADR_SPACE_HANDLER Handler; ACPI_ADR_SPACE_SETUP RegionSetup; ACPI_OPERAND_OBJECT *HandlerDesc; ACPI_OPERAND_OBJECT *RegionObj2; void *RegionContext = NULL; ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch); RegionObj2 = AcpiNsGetSecondaryObject (RegionObj); if (!RegionObj2) { return_ACPI_STATUS (AE_NOT_EXIST); } /* Ensure that there is a handler associated with this region */ HandlerDesc = RegionObj->Region.Handler; if (!HandlerDesc) { ACPI_ERROR ((AE_INFO, "No handler for Region [%4.4s] (%p) [%s]", AcpiUtGetNodeName (RegionObj->Region.Node), RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (AE_NOT_EXIST); } /* * It may be the case that the region has never been initialized. * Some types of regions require special init code */ if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)) { /* This region has not been initialized yet, do it */ RegionSetup = HandlerDesc->AddressSpace.Setup; if (!RegionSetup) { /* No initialization routine, exit with error */ ACPI_ERROR ((AE_INFO, "No init routine for region(%p) [%s]", RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (AE_NOT_EXIST); } /* * We must exit the interpreter because the region setup will * potentially execute control methods (for example, the _REG method * for this region) */ AcpiExExitInterpreter (); Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE, HandlerDesc->AddressSpace.Context, &RegionContext); /* Re-enter the interpreter */ AcpiExEnterInterpreter (); /* Check for failure of the Region Setup */ if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "During region initialization: [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (Status); } /* Region initialization may have been completed by RegionSetup */ if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)) { RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE; if (RegionObj2->Extra.RegionContext) { /* The handler for this region was already installed */ ACPI_FREE (RegionContext); } else { /* * Save the returned context for use in all accesses to * this particular region */ RegionObj2->Extra.RegionContext = RegionContext;//.........这里部分代码省略.........
开发者ID:animotron,项目名称:animos,代码行数:101,
示例17: AcpiExAddTablestatic ACPI_STATUSAcpiExAddTable ( UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode, ACPI_OPERAND_OBJECT **DdbHandle){ ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STATUS Status; ACPI_OWNER_ID OwnerId; ACPI_FUNCTION_TRACE (ExAddTable); /* Create an object to be the table handle */ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_REFERENCE); if (!ObjDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Init the table handle */ ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID; ObjDesc->Reference.Class = ACPI_REFCLASS_TABLE; *DdbHandle = ObjDesc; /* Install the new table into the local data structures */ ObjDesc->Reference.Value = TableIndex; /* Add the table to the namespace */ Status = AcpiNsLoadTable (TableIndex, ParentNode); if (ACPI_FAILURE (Status)) { AcpiUtRemoveReference (ObjDesc); *DdbHandle = NULL; return_ACPI_STATUS (Status); } /* Execute any module-level code that was found in the table */ AcpiExExitInterpreter (); AcpiNsExecModuleCodeList (); AcpiExEnterInterpreter (); /* * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is * responsible for discovering any new wake GPEs by running _PRW methods * that may have been loaded by this table. */ Status = AcpiTbGetOwnerId (TableIndex, &OwnerId); if (ACPI_SUCCESS (Status)) { AcpiEvUpdateGpes (OwnerId); } return_ACPI_STATUS (AE_OK);}
开发者ID:RyanLucchese,项目名称:rumpkernel-netbsd-src,代码行数:61,
示例18: AcpiPsExecuteTableACPI_STATUSAcpiPsExecuteTable ( ACPI_EVALUATE_INFO *Info){ ACPI_STATUS Status; ACPI_PARSE_OBJECT *Op = NULL; ACPI_WALK_STATE *WalkState = NULL; ACPI_FUNCTION_TRACE (PsExecuteTable); /* Create and init a Root Node */ Op = AcpiPsCreateScopeOp (Info->ObjDesc->Method.AmlStart); if (!Op) { Status = AE_NO_MEMORY; goto Cleanup; } /* Create and initialize a new walk state */ WalkState = AcpiDsCreateWalkState ( Info->ObjDesc->Method.OwnerId, NULL, NULL, NULL); if (!WalkState) { Status = AE_NO_MEMORY; goto Cleanup; } Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node, Info->ObjDesc->Method.AmlStart, Info->ObjDesc->Method.AmlLength, Info, Info->PassNumber); if (ACPI_FAILURE (Status)) { goto Cleanup; } if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) { WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL; } /* Info->Node is the default location to load the table */ if (Info->Node && Info->Node != AcpiGbl_RootNode) { Status = AcpiDsScopeStackPush ( Info->Node, ACPI_TYPE_METHOD, WalkState); if (ACPI_FAILURE (Status)) { goto Cleanup; } } /* * Parse the AML, WalkState will be deleted by ParseAml */ AcpiExEnterInterpreter (); Status = AcpiPsParseAml (WalkState); AcpiExExitInterpreter (); WalkState = NULL;Cleanup: if (WalkState) { AcpiDsDeleteWalkState (WalkState); } if (Op) { AcpiPsDeleteParseTree (Op); } return_ACPI_STATUS (Status);}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:75,
示例19: AcpiNsOneCompleteParseACPI_STATUSAcpiNsOneCompleteParse ( UINT32 PassNumber, UINT32 TableIndex, ACPI_NAMESPACE_NODE *StartNode){ ACPI_PARSE_OBJECT *ParseRoot; ACPI_STATUS Status; UINT32 AmlLength; UINT8 *AmlStart; ACPI_WALK_STATE *WalkState; ACPI_TABLE_HEADER *Table; ACPI_OWNER_ID OwnerId; ACPI_FUNCTION_TRACE (NsOneCompleteParse); Status = AcpiGetTableByIndex (TableIndex, &Table); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Table must consist of at least a complete header */ if (Table->Length < sizeof (ACPI_TABLE_HEADER)) { return_ACPI_STATUS (AE_BAD_HEADER); } AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER); AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER); Status = AcpiTbGetOwnerId (TableIndex, &OwnerId); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Create and init a Root Node */ ParseRoot = AcpiPsCreateScopeOp (AmlStart); if (!ParseRoot) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Create and initialize a new walk state */ WalkState = AcpiDsCreateWalkState (OwnerId, NULL, NULL, NULL); if (!WalkState) { AcpiPsFreeOp (ParseRoot); return_ACPI_STATUS (AE_NO_MEMORY); } Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL, AmlStart, AmlLength, NULL, (UINT8) PassNumber); if (ACPI_FAILURE (Status)) { AcpiDsDeleteWalkState (WalkState); goto Cleanup; } /* Found OSDT table, enable the namespace override feature */ if (ACPI_COMPARE_NAME(Table->Signature, ACPI_SIG_OSDT) && PassNumber == ACPI_IMODE_LOAD_PASS1) { WalkState->NamespaceOverride = TRUE; } /* StartNode is the default location to load the table */ if (StartNode && StartNode != AcpiGbl_RootNode) { Status = AcpiDsScopeStackPush ( StartNode, ACPI_TYPE_METHOD, WalkState); if (ACPI_FAILURE (Status)) { AcpiDsDeleteWalkState (WalkState); goto Cleanup; } } /* Parse the AML */ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %u parse/n", PassNumber)); AcpiExEnterInterpreter (); Status = AcpiPsParseAml (WalkState); AcpiExExitInterpreter ();Cleanup: AcpiPsDeleteParseTree (ParseRoot); return_ACPI_STATUS (Status);}
开发者ID:malattia,项目名称:acpica-tools,代码行数:98,
示例20: AcpiEvInitializeRegionACPI_STATUSAcpiEvInitializeRegion ( ACPI_OPERAND_OBJECT *RegionObj){ ACPI_OPERAND_OBJECT *HandlerObj; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_ADR_SPACE_TYPE SpaceId; ACPI_NAMESPACE_NODE *Node; ACPI_FUNCTION_TRACE (EvInitializeRegion); if (!RegionObj) { return_ACPI_STATUS (AE_BAD_PARAMETER); } if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED) { return_ACPI_STATUS (AE_OK); } RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED; Node = RegionObj->Region.Node->Parent; SpaceId = RegionObj->Region.SpaceId; /* * The following loop depends upon the root Node having no parent * ie: AcpiGbl_RootNode->Parent being set to NULL */ while (Node) { /* Check to see if a handler exists */ HandlerObj = NULL; ObjDesc = AcpiNsGetAttachedObject (Node); if (ObjDesc) { /* Can only be a handler if the object exists */ switch (Node->Type) { case ACPI_TYPE_DEVICE: case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: HandlerObj = ObjDesc->CommonNotify.Handler; break; case ACPI_TYPE_METHOD: /* * If we are executing module level code, the original * Node's object was replaced by this Method object and we * saved the handler in the method object. * * See AcpiNsExecModuleCode */ if (!AcpiGbl_ParseTableAsTermList && ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) { HandlerObj = ObjDesc->Method.Dispatch.Handler; } break; default: /* Ignore other objects */ break; } HandlerObj = AcpiEvFindRegionHandler (SpaceId, HandlerObj); if (HandlerObj) { /* Found correct handler */ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Found handler %p for region %p in obj %p/n", HandlerObj, RegionObj, ObjDesc)); (void) AcpiEvAttachRegion (HandlerObj, RegionObj, FALSE); /* * Tell all users that this region is usable by * running the _REG method */ AcpiExExitInterpreter (); (void) AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT); AcpiExEnterInterpreter (); return_ACPI_STATUS (AE_OK); } } /* This node does not have the handler we need; Pop up one level */ Node = Node->Parent; }//.........这里部分代码省略.........
开发者ID:2trill2spill,项目名称:freebsd,代码行数:101,
示例21: AcpiNsGetObjectValueACPI_STATUSAcpiNsGetObjectValue ( ACPI_NAMESPACE_NODE *Node, ACPI_OPERAND_OBJECT **ReturnObjDesc){ ACPI_STATUS Status = AE_OK; ACPI_NAMESPACE_NODE *ResolvedNode = Node; ACPI_FUNCTION_TRACE ("NsGetObjectValue"); /* * Objects require additional resolution steps (e.g., the * Node may be a field that must be read, etc.) -- we can't just grab * the object out of the node. */ /* * Use ResolveNodeToValue() to get the associated value. This call * always deletes ObjDesc (allocated above). * * NOTE: we can get away with passing in NULL for a walk state * because ObjDesc is guaranteed to not be a reference to either * a method local or a method argument (because this interface can only be * called from the AcpiEvaluate external interface, never called from * a running control method.) * * Even though we do not directly invoke the interpreter * for this, we must enter it because we could access an opregion. * The opregion access code assumes that the interpreter * is locked. * * We must release the namespace lock before entering the * intepreter. */ Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } Status = AcpiExEnterInterpreter (); if (ACPI_SUCCESS (Status)) { Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL); /* * If AcpiExResolveNodeToValue() succeeded, the return value was * placed in ResolvedNode. */ AcpiExExitInterpreter (); if (ACPI_SUCCESS (Status)) { Status = AE_CTRL_RETURN_VALUE; *ReturnObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ResolvedNode); ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning object %p [%s]/n", *ReturnObjDesc, AcpiUtGetObjectTypeName (*ReturnObjDesc))); } } /* Namespace is unlocked */ return_ACPI_STATUS (Status);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:65,
示例22: AcpiEvAddressSpaceDispatchACPI_STATUSAcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, void *Value){ ACPI_STATUS Status; ACPI_STATUS Status2; ACPI_ADR_SPACE_HANDLER Handler; ACPI_ADR_SPACE_SETUP RegionSetup; ACPI_OPERAND_OBJECT *HandlerDesc; ACPI_OPERAND_OBJECT *RegionObj2; void *RegionContext = NULL; ACPI_FUNCTION_TRACE ("EvAddressSpaceDispatch"); RegionObj2 = AcpiNsGetSecondaryObject (RegionObj); if (!RegionObj2) { return_ACPI_STATUS (AE_NOT_EXIST); } /* * Ensure that there is a handler associated with this region */ HandlerDesc = RegionObj->Region.AddrHandler; if (!HandlerDesc) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "no handler for region(%p) [%s]/n", RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (AE_NOT_EXIST); } /* * It may be the case that the region has never been initialized * Some types of regions require special init code */ if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)) { /* * This region has not been initialized yet, do it */ RegionSetup = HandlerDesc->AddrHandler.Setup; if (!RegionSetup) { /* * Bad news, no init routine and not init'd */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No init routine for region(%p) [%s]/n", RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (AE_UNKNOWN_STATUS); } /* * We must exit the interpreter because the region setup will potentially * execute control methods */ AcpiExExitInterpreter (); Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE, HandlerDesc->AddrHandler.Context, &RegionContext); /* Re-enter the interpreter */ Status2 = AcpiExEnterInterpreter (); if (ACPI_FAILURE (Status2)) { return_ACPI_STATUS (Status2); } /* * Init routine may fail */ if (ACPI_FAILURE (Status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region Init: %s [%s]/n", AcpiFormatException (Status), AcpiUtGetRegionName (RegionObj->Region.SpaceId))); return_ACPI_STATUS (Status); } RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE; /* * Save the returned context for use in all accesses to * this particular region. */ RegionObj2->Extra.RegionContext = RegionContext; } /* * We have everything we need, begin the process */ Handler = HandlerDesc->AddrHandler.Handler;//.........这里部分代码省略.........
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:101,
示例23: AcpiEvaluateObject//.........这里部分代码省略......... /* Now we can evaluate the object */ Status = AcpiNsEvaluate (Info); /* * If we are expecting a return value, and all went well above, * copy the return value to an external object. */ if (ReturnBuffer) { if (!Info->ReturnObject) { ReturnBuffer->Length = 0; } else { if (ACPI_GET_DESCRIPTOR_TYPE (Info->ReturnObject) == ACPI_DESC_TYPE_NAMED) { /* * If we received a NS Node as a return object, this means that * the object we are evaluating has nothing interesting to * return (such as a mutex, etc.) We return an error because * these types are essentially unsupported by this interface. * We don't check up front because this makes it easier to add * support for various types at a later date if necessary. */ Status = AE_TYPE; Info->ReturnObject = NULL; /* No need to delete a NS Node */ ReturnBuffer->Length = 0; } if (ACPI_SUCCESS (Status)) { /* Dereference Index and RefOf references */ AcpiNsResolveReferences (Info); /* Get the size of the returned object */ Status = AcpiUtGetObjectSize (Info->ReturnObject, &BufferSpaceNeeded); if (ACPI_SUCCESS (Status)) { /* Validate/Allocate/Clear caller buffer */ Status = AcpiUtInitializeBuffer (ReturnBuffer, BufferSpaceNeeded); if (ACPI_FAILURE (Status)) { /* * Caller's buffer is too small or a new one can't * be allocated */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Needed buffer size %X, %s/n", (UINT32) BufferSpaceNeeded, AcpiFormatException (Status))); } else { /* We have enough space for the object, build it */ Status = AcpiUtCopyIobjectToEobject ( Info->ReturnObject, ReturnBuffer); } } } } } if (Info->ReturnObject) { /* * Delete the internal return object. NOTE: Interpreter must be * locked to avoid race condition. */ AcpiExEnterInterpreter (); /* Remove one reference on the return object (should delete it) */ AcpiUtRemoveReference (Info->ReturnObject); AcpiExExitInterpreter (); }Cleanup: /* Free the input parameter list (if we created one) */ if (Info->Parameters) { /* Free the allocated parameter block */ AcpiUtDeleteInternalObjectList (Info->Parameters); } ACPI_FREE (Info); return_ACPI_STATUS (Status);}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:101,
示例24: AcpiDsTerminateControlMethodvoidAcpiDsTerminateControlMethod ( ACPI_OPERAND_OBJECT *MethodDesc, ACPI_WALK_STATE *WalkState){ ACPI_FUNCTION_TRACE_PTR (DsTerminateControlMethod, WalkState); /* MethodDesc is required, WalkState is optional */ if (!MethodDesc) { return_VOID; } if (WalkState) { /* 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) { 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 * case we want make the objects permanent. * 2) There are other threads executing the method, in which case we * will wait until the last thread has completed. */ if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) && (MethodDesc->Method.ThreadCount == 1)) { /* Delete any direct children of (created by) this method */ (void) AcpiExExitInterpreter (); AcpiNsDeleteNamespaceSubtree (WalkState->MethodNode); (void) AcpiExEnterInterpreter (); /* * Delete any objects that were created by this method * elsewhere in the namespace (if any were created). * Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the * deletion such that we don't have to perform an entire * namespace walk for every control method execution. */ if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE) { (void) AcpiExExitInterpreter (); AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId); (void) AcpiExEnterInterpreter (); MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_MODIFIED_NAMESPACE; } } } /* Decrement the thread count on the method */ if (MethodDesc->Method.ThreadCount) { MethodDesc->Method.ThreadCount--; } else { ACPI_ERROR ((AE_INFO, "Invalid zero thread count in method")); } /* Are there any other threads currently executing this method? */ if (MethodDesc->Method.ThreadCount) { /* * Additional threads. Do not release the OwnerId in this case, * we immediately reuse it for the next thread executing this method */ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "*** Completed execution of one thread, %u threads remaining/n", MethodDesc->Method.ThreadCount));//.........这里部分代码省略.........
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:101,
示例25: AcpiNsInitOneObject//.........这里部分代码省略......... case ACPI_TYPE_REGION: Info->OpRegionCount++; break; case ACPI_TYPE_BUFFER_FIELD: Info->FieldCount++; break; case ACPI_TYPE_LOCAL_BANK_FIELD: Info->FieldCount++; break; case ACPI_TYPE_BUFFER: Info->BufferCount++; break; case ACPI_TYPE_PACKAGE: Info->PackageCount++; break; default: /* No init required, just exit now */ return (AE_OK); } /* If the object is already initialized, nothing else to do */ if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) { return (AE_OK); } /* Must lock the interpreter before executing AML code */ AcpiExEnterInterpreter (); /* * Each of these types can contain executable AML code within the * declaration. */ switch (Type) { case ACPI_TYPE_REGION: Info->OpRegionInit++; Status = AcpiDsGetRegionArguments (ObjDesc); break; case ACPI_TYPE_BUFFER_FIELD: Info->FieldInit++; Status = AcpiDsGetBufferFieldArguments (ObjDesc); break; case ACPI_TYPE_LOCAL_BANK_FIELD: Info->FieldInit++; Status = AcpiDsGetBankFieldArguments (ObjDesc); break; case ACPI_TYPE_BUFFER: Info->BufferInit++; Status = AcpiDsGetBufferArguments (ObjDesc); break; case ACPI_TYPE_PACKAGE: Info->PackageInit++; Status = AcpiDsGetPackageArguments (ObjDesc); break; default: /* No other types can get here */ break; } if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Could not execute arguments for [%4.4s] (%s)", AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Type))); } /* * We ignore errors from above, and always return OK, since we don't want * to abort the walk on any single error. */ AcpiExExitInterpreter (); return (AE_OK);}
开发者ID:CSharpLover,项目名称:MosquitOS,代码行数:101,
示例26: AcpiDsAutoSerializeMethodACPI_STATUSAcpiDsAutoSerializeMethod ( ACPI_NAMESPACE_NODE *Node, ACPI_OPERAND_OBJECT *ObjDesc){ ACPI_STATUS Status; ACPI_PARSE_OBJECT *Op = NULL; ACPI_WALK_STATE *WalkState; ACPI_FUNCTION_TRACE_PTR (DsAutoSerializeMethod, Node); ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "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; } AcpiPsSetName (Op, Node->Name.Integer); Op->Common.Node = Node; /* Create and initialize a new walk state */ WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL); if (!WalkState) { AcpiPsFreeOp (Op); Status = AE_NO_MEMORY; goto Unlock; } Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, 0); if (ACPI_FAILURE (Status)) { AcpiDsDeleteWalkState (WalkState); AcpiPsFreeOp (Op); return_ACPI_STATUS (Status); } WalkState->DescendingCallback = AcpiDsDetectNamedOpcodes; /* Parse the method, scan for creation of named objects */ Status = AcpiPsParseAml (WalkState); AcpiPsDeleteParseTree (Op);Unlock: AcpiExExitInterpreter (); return_ACPI_STATUS (Status);}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:61,
注:本文中的AcpiExExitInterpreter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AcpiExResolveToValue函数代码示例 C++ AcpiExEnterInterpreter函数代码示例 |