本文整理汇总了C++中AcpiExExitInterpreter函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiExExitInterpreter函数的具体用法?C++ AcpiExExitInterpreter怎么用?C++ AcpiExExitInterpreter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AcpiExExitInterpreter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: AcpiExSystemDoSleep
ACPI_STATUS
AcpiExSystemDoSleep (
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,代码来源:exsystem.c
示例2: AcpiAcquireGlobalLock
ACPI_STATUS
AcpiAcquireGlobalLock (
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,代码来源:evxface.c
示例3: AcpiExSystemWaitMutex
ACPI_STATUS
AcpiExSystemWaitMutex (
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,代码来源:exsystem.c
示例4: AcpiNsExecuteControlMethod
ACPI_STATUS
AcpiNsExecuteControlMethod (
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,代码来源:nseval.c
示例5: AeDoOneOverride
static void
AeDoOneOverride (
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,代码来源:aeinitfile.c
示例6: AcpiDsMethodError
ACPI_STATUS
AcpiDsMethodError (
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,代码来源:dsmethod.c
示例7: AcpiExAddTable
static ACPI_STATUS
AcpiExAddTable (
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,代码来源:exconfig.c
示例8: AcpiDsMethodError
ACPI_STATUS
AcpiDsMethodError (
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,代码来源:dsmethod.c
示例9: AcpiEvAddressSpaceDispatch
ACPI_STATUS
AcpiEvAddressSpaceDispatch (
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,代码来源:evregion.c
示例10: AcpiNsLoadTable
ACPI_STATUS
AcpiNsLoadTable (
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,代码来源:nsload.c
示例11: AcpiEvUpdateGpes
void
AcpiEvUpdateGpes (
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,代码来源:evgpeinit.c
示例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,代码来源:nsxfeval.c
示例13: AcpiNsLoadTable
ACPI_STATUS
AcpiNsLoadTable (
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,代码来源:nsload.c
示例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,代码来源:nseval.c
示例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,代码来源:nseval.c
示例16: AcpiEvAddressSpaceDispatch
ACPI_STATUS
AcpiEvAddressSpaceDispatch (
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,代码来源:evregion.c
示例17: AcpiExAddTable
static ACPI_STATUS
AcpiExAddTable (
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,代码来源:exconfig.c
示例18: AcpiPsExecuteTable
ACPI_STATUS
AcpiPsExecuteTable (
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,代码来源:psxface.c
示例19: AcpiNsOneCompleteParse
ACPI_STATUS
AcpiNsOneCompleteParse (
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,
|
请发表评论