本文整理汇总了C++中AcpiUtDeleteGenericState函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiUtDeleteGenericState函数的具体用法?C++ AcpiUtDeleteGenericState怎么用?C++ AcpiUtDeleteGenericState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AcpiUtDeleteGenericState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AcpiPsCleanupScope
void
AcpiPsCleanupScope (
ACPI_PARSE_STATE *ParserState)
{
ACPI_GENERIC_STATE *Scope;
ACPI_FUNCTION_TRACE_PTR (PsCleanupScope, ParserState);
if (!ParserState)
{
return_VOID;
}
/* Delete anything on the scope stack */
while (ParserState->Scope)
{
Scope = AcpiUtPopGenericState (&ParserState->Scope);
AcpiUtDeleteGenericState (Scope);
}
return_VOID;
}
示例2: AcpiEvNotifyDispatch
static void ACPI_SYSTEM_XFACE
AcpiEvNotifyDispatch (
void *Context)
{
ACPI_GENERIC_STATE *NotifyInfo = (ACPI_GENERIC_STATE *) Context;
ACPI_NOTIFY_HANDLER GlobalHandler = NULL;
void *GlobalContext = NULL;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_FUNCTION_ENTRY ();
/*
* We will invoke a global notify handler if installed. This is done
* _before_ we invoke the per-device handler attached to the device.
*/
if (NotifyInfo->Notify.Value <= ACPI_MAX_SYS_NOTIFY)
{
/* Global system notification handler */
if (AcpiGbl_SystemNotify.Handler)
{
GlobalHandler = AcpiGbl_SystemNotify.Handler;
GlobalContext = AcpiGbl_SystemNotify.Context;
}
}
else
{
/* Global driver notification handler */
if (AcpiGbl_DeviceNotify.Handler)
{
GlobalHandler = AcpiGbl_DeviceNotify.Handler;
GlobalContext = AcpiGbl_DeviceNotify.Context;
}
}
/* Invoke the system handler first, if present */
if (GlobalHandler)
{
GlobalHandler (NotifyInfo->Notify.Node, NotifyInfo->Notify.Value,
GlobalContext);
}
/* Now invoke the per-device handler, if present */
HandlerObj = NotifyInfo->Notify.HandlerObj;
if (HandlerObj)
{
HandlerObj->Notify.Handler (NotifyInfo->Notify.Node,
NotifyInfo->Notify.Value,
HandlerObj->Notify.Context);
}
/* All done with the info object */
AcpiUtDeleteGenericState (NotifyInfo);
}
示例3: AcpiDsScopeStackPop
ACPI_STATUS
AcpiDsScopeStackPop (
ACPI_WALK_STATE *WalkState)
{
ACPI_GENERIC_STATE *ScopeInfo;
ACPI_GENERIC_STATE *NewScopeInfo;
ACPI_FUNCTION_TRACE ("DsScopeStackPop");
/*
* Pop scope info object off the stack.
*/
ScopeInfo = AcpiUtPopGenericState (&WalkState->ScopeInfo);
if (!ScopeInfo)
{
return_ACPI_STATUS (AE_STACK_UNDERFLOW);
}
WalkState->ScopeDepth--;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"[%.2d] Popped scope [%4.4s] (%10s), New scope -> ",
(UINT32) WalkState->ScopeDepth,
ScopeInfo->Scope.Node->Name.Ascii,
AcpiUtGetTypeName (ScopeInfo->Common.Value)));
NewScopeInfo = WalkState->ScopeInfo;
if (NewScopeInfo)
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[%4.4s] (%s)\n",
NewScopeInfo->Scope.Node->Name.Ascii,
AcpiUtGetTypeName (NewScopeInfo->Common.Value)));
}
else
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[\\___] (ROOT)\n"));
}
AcpiUtDeleteGenericState (ScopeInfo);
return_ACPI_STATUS (AE_OK);
}
示例4: AcpiPsPopScope
void
AcpiPsPopScope (
ACPI_PARSE_STATE *ParserState,
ACPI_PARSE_OBJECT **Op,
UINT32 *ArgList,
UINT32 *ArgCount)
{
ACPI_GENERIC_STATE *Scope = ParserState->Scope;
ACPI_FUNCTION_TRACE (PsPopScope);
/* Only pop the scope if there is in fact a next scope */
if (Scope->Common.Next)
{
Scope = AcpiUtPopGenericState (&ParserState->Scope);
/* Return to parsing previous op */
*Op = Scope->ParseScope.Op;
*ArgList = Scope->ParseScope.ArgList;
*ArgCount = Scope->ParseScope.ArgCount;
ParserState->PkgEnd = Scope->ParseScope.PkgEnd;
/* All done with this scope state structure */
AcpiUtDeleteGenericState (Scope);
}
else
{
/* Empty parse stack, prepare to fetch next opcode */
*Op = NULL;
*ArgList = 0;
*ArgCount = 0;
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Popped Op %p Args %X\n", *Op, *ArgCount));
return_VOID;
}
示例5: AcpiDsScopeStackClear
void
AcpiDsScopeStackClear (
ACPI_WALK_STATE *WalkState)
{
ACPI_GENERIC_STATE *ScopeInfo;
ACPI_FUNCTION_NAME ("DsScopeStackClear");
while (WalkState->ScopeInfo)
{
/* Pop a scope off the stack */
ScopeInfo = WalkState->ScopeInfo;
WalkState->ScopeInfo = ScopeInfo->Scope.Next;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Popped object type (%s)\n", AcpiUtGetTypeName (ScopeInfo->Common.Value)));
AcpiUtDeleteGenericState (ScopeInfo);
}
}
示例6: AcpiDsResultStackPop
static ACPI_STATUS
AcpiDsResultStackPop (
ACPI_WALK_STATE *WalkState)
{
ACPI_GENERIC_STATE *State;
ACPI_FUNCTION_NAME (DsResultStackPop);
/* Check for stack underflow */
if (WalkState->Results == NULL)
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Result stack underflow - State=%p\n",
WalkState));
return (AE_AML_NO_OPERAND);
}
if (WalkState->ResultSize < ACPI_RESULTS_FRAME_OBJ_NUM)
{
ACPI_ERROR ((AE_INFO, "Insufficient result stack size"));
return (AE_AML_INTERNAL);
}
State = AcpiUtPopGenericState (&WalkState->Results);
AcpiUtDeleteGenericState (State);
/* Decrease the length of result stack by the length of frame */
WalkState->ResultSize -= ACPI_RESULTS_FRAME_OBJ_NUM;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Result=%p RemainingResults=%X State=%p\n",
State, WalkState->ResultCount, WalkState));
return (AE_OK);
}
示例7: AcpiEvNotifyDispatch
static void ACPI_SYSTEM_XFACE
AcpiEvNotifyDispatch (
void *Context)
{
ACPI_GENERIC_STATE *Info = (ACPI_GENERIC_STATE *) Context;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_FUNCTION_ENTRY ();
/* Invoke a global notify handler if installed */
if (Info->Notify.Global->Handler)
{
Info->Notify.Global->Handler (Info->Notify.Node,
Info->Notify.Value,
Info->Notify.Global->Context);
}
/* Now invoke the local notify handler(s) if any are installed */
HandlerObj = Info->Notify.HandlerListHead;
while (HandlerObj)
{
HandlerObj->Notify.Handler (Info->Notify.Node,
Info->Notify.Value,
HandlerObj->Notify.Context);
HandlerObj = HandlerObj->Notify.Next[Info->Notify.HandlerListId];
}
/* All done with the info object */
AcpiUtDeleteGenericState (Info);
}
示例8: AcpiEvQueueNotifyRequest
ACPI_STATUS
AcpiEvQueueNotifyRequest (
ACPI_NAMESPACE_NODE *Node,
UINT32 NotifyValue)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *HandlerListHead = NULL;
ACPI_GENERIC_STATE *Info;
UINT8 HandlerListId = 0;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_NAME (EvQueueNotifyRequest);
/* Are Notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
return (AE_TYPE);
}
/* Get the correct notify list type (System or Device) */
if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
HandlerListId = ACPI_SYSTEM_HANDLER_LIST;
}
else
{
HandlerListId = ACPI_DEVICE_HANDLER_LIST;
}
/* Get the notify object attached to the namespace Node */
ObjDesc = AcpiNsGetAttachedObject (Node);
if (ObjDesc)
{
/* We have an attached object, Get the correct handler list */
HandlerListHead = ObjDesc->CommonNotify.NotifyList[HandlerListId];
}
/*
* If there is no notify handler (Global or Local)
* for this object, just ignore the notify
*/
if (!AcpiGbl_GlobalNotify[HandlerListId].Handler && !HandlerListHead)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"No notify handler for Notify, ignoring (%4.4s, %X) node %p\n",
AcpiUtGetNodeName (Node), NotifyValue, Node));
return (AE_OK);
}
/* Setup notify info and schedule the notify dispatcher */
Info = AcpiUtCreateGenericState ();
if (!Info)
{
return (AE_NO_MEMORY);
}
Info->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
Info->Notify.Node = Node;
Info->Notify.Value = (UINT16) NotifyValue;
Info->Notify.HandlerListId = HandlerListId;
Info->Notify.HandlerListHead = HandlerListHead;
Info->Notify.Global = &AcpiGbl_GlobalNotify[HandlerListId];
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n",
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
Info);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteGenericState (Info);
}
return (Status);
}
示例9: AcpiPsParseAml
//.........这里部分代码省略.........
{
if (ACPI_SUCCESS (Status))
{
/*
* There is another walk state, restart it.
* If the method return value is not used by the parent,
* The object is deleted
*/
if (!PreviousWalkState->ReturnDesc)
{
/*
* In slack mode execution, if there is no return value
* we should implicitly return zero (0) as a default value.
*/
if (AcpiGbl_EnableInterpreterSlack &&
!PreviousWalkState->ImplicitReturnObj)
{
PreviousWalkState->ImplicitReturnObj =
AcpiUtCreateIntegerObject ((UINT64) 0);
if (!PreviousWalkState->ImplicitReturnObj)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
}
/* Restart the calling control method */
Status = AcpiDsRestartControlMethod (WalkState,
PreviousWalkState->ImplicitReturnObj);
}
else
{
/*
* We have a valid return value, delete any implicit
* return value.
*/
AcpiDsClearImplicitReturn (PreviousWalkState);
Status = AcpiDsRestartControlMethod (WalkState,
PreviousWalkState->ReturnDesc);
}
if (ACPI_SUCCESS (Status))
{
WalkState->WalkType |= ACPI_WALK_METHOD_RESTART;
}
}
else
{
/* On error, delete any return object or implicit return */
AcpiUtRemoveReference (PreviousWalkState->ReturnDesc);
AcpiDsClearImplicitReturn (PreviousWalkState);
}
}
/*
* Just completed a 1st-level method, save the final internal return
* value (if any)
*/
else if (PreviousWalkState->CallerReturnDesc)
{
if (PreviousWalkState->ImplicitReturnObj)
{
*(PreviousWalkState->CallerReturnDesc) =
PreviousWalkState->ImplicitReturnObj;
}
else
{
/* NULL if no return value */
*(PreviousWalkState->CallerReturnDesc) =
PreviousWalkState->ReturnDesc;
}
}
else
{
if (PreviousWalkState->ReturnDesc)
{
/* Caller doesn't want it, must delete it */
AcpiUtRemoveReference (PreviousWalkState->ReturnDesc);
}
if (PreviousWalkState->ImplicitReturnObj)
{
/* Caller doesn't want it, must delete it */
AcpiUtRemoveReference (PreviousWalkState->ImplicitReturnObj);
}
}
AcpiDsDeleteWalkState (PreviousWalkState);
}
/* Normal exit */
AcpiExReleaseAllMutexes (Thread);
AcpiUtDeleteGenericState (ACPI_CAST_PTR (ACPI_GENERIC_STATE, Thread));
AcpiGbl_CurrentWalkList = PrevWalkList;
return_ACPI_STATUS (Status);
}
示例10: AcpiDsDeleteWalkState
void
AcpiDsDeleteWalkState (
ACPI_WALK_STATE *WalkState)
{
ACPI_GENERIC_STATE *State;
ACPI_FUNCTION_TRACE_PTR (DsDeleteWalkState, WalkState);
if (!WalkState)
{
return;
}
if (WalkState->DescriptorType != ACPI_DESC_TYPE_WALK)
{
ACPI_ERROR ((AE_INFO, "%p is not a valid walk state",
WalkState));
return;
}
/* There should not be any open scopes */
if (WalkState->ParserState.Scope)
{
ACPI_ERROR ((AE_INFO, "%p walk still has a scope list",
WalkState));
AcpiPsCleanupScope (&WalkState->ParserState);
}
/* Always must free any linked control states */
while (WalkState->ControlState)
{
State = WalkState->ControlState;
WalkState->ControlState = State->Common.Next;
AcpiUtDeleteGenericState (State);
}
/* Always must free any linked parse states */
while (WalkState->ScopeInfo)
{
State = WalkState->ScopeInfo;
WalkState->ScopeInfo = State->Common.Next;
AcpiUtDeleteGenericState (State);
}
/* Always must free any stacked result states */
while (WalkState->Results)
{
State = WalkState->Results;
WalkState->Results = State->Common.Next;
AcpiUtDeleteGenericState (State);
}
ACPI_FREE (WalkState);
return_VOID;
}
示例11: AcpiDsExecEndControlOp
ACPI_STATUS
AcpiDsExecEndControlOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
{
ACPI_STATUS Status = AE_OK;
ACPI_GENERIC_STATE *ControlState;
ACPI_FUNCTION_NAME (DsExecEndControlOp);
switch (Op->Common.AmlOpcode)
{
case AML_IF_OP:
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[IF_OP] Op=%p\n", Op));
/*
* Save the result of the predicate in case there is an
* ELSE to come
*/
WalkState->LastPredicate =
(BOOLEAN) WalkState->ControlState->Common.Value;
/*
* Pop the control state that was created at the start
* of the IF and free it
*/
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
AcpiUtDeleteGenericState (ControlState);
break;
case AML_ELSE_OP:
break;
case AML_WHILE_OP:
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op));
ControlState = WalkState->ControlState;
if (ControlState->Common.Value)
{
/* Predicate was true, the body of the loop was just executed */
/*
* This infinite loop detection mechanism allows the interpreter
* to escape possibly infinite loops. This can occur in poorly
* written AML when the hardware does not respond within a while
* loop and the loop does not implement a timeout.
*/
if (ACPI_TIME_AFTER (AcpiOsGetTimer (),
ControlState->Control.LoopTimeout))
{
Status = AE_AML_LOOP_TIMEOUT;
break;
}
/*
* Go back and evaluate the predicate and maybe execute the loop
* another time
*/
Status = AE_CTRL_PENDING;
WalkState->AmlLastWhile =
ControlState->Control.AmlPredicateStart;
break;
}
/* Predicate was false, terminate this while loop */
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"[WHILE_OP] termination! Op=%p\n",Op));
/* Pop this control state and free it */
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
AcpiUtDeleteGenericState (ControlState);
break;
case AML_RETURN_OP:
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"[RETURN_OP] Op=%p Arg=%p\n",Op, Op->Common.Value.Arg));
/*
* One optional operand -- the return value
* It can be either an immediate operand or a result that
* has been bubbled up the tree
*/
if (Op->Common.Value.Arg)
{
/* Since we have a real Return(), delete any implicit return */
AcpiDsClearImplicitReturn (WalkState);
/* Return statement has an immediate operand */
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
if (ACPI_FAILURE (Status))
//.........这里部分代码省略.........
示例12: AcpiUtWalkPackageTree
ACPI_STATUS
AcpiUtWalkPackageTree (
ACPI_OPERAND_OBJECT *SourceObject,
void *TargetObject,
ACPI_PKG_CALLBACK WalkCallback,
void *Context)
{
ACPI_STATUS Status = AE_OK;
ACPI_GENERIC_STATE *StateList = NULL;
ACPI_GENERIC_STATE *State;
UINT32 ThisIndex;
ACPI_OPERAND_OBJECT *ThisSourceObj;
ACPI_FUNCTION_TRACE (UtWalkPackageTree);
State = AcpiUtCreatePkgState (SourceObject, TargetObject, 0);
if (!State)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
while (State)
{
/* Get one element of the package */
ThisIndex = State->Pkg.Index;
ThisSourceObj = (ACPI_OPERAND_OBJECT *)
State->Pkg.SourceObject->Package.Elements[ThisIndex];
/*
* Check for:
* 1) An uninitialized package element. It is completely
* legal to declare a package and leave it uninitialized
* 2) Not an internal object - can be a namespace node instead
* 3) Any type other than a package. Packages are handled in else
* case below.
*/
if ((!ThisSourceObj) ||
(ACPI_GET_DESCRIPTOR_TYPE (ThisSourceObj) != ACPI_DESC_TYPE_OPERAND) ||
(ThisSourceObj->Common.Type != ACPI_TYPE_PACKAGE))
{
Status = WalkCallback (ACPI_COPY_TYPE_SIMPLE, ThisSourceObj,
State, Context);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
State->Pkg.Index++;
while (State->Pkg.Index >= State->Pkg.SourceObject->Package.Count)
{
/*
* We've handled all of the objects at this level, This means
* that we have just completed a package. That package may
* have contained one or more packages itself.
*
* Delete this state and pop the previous state (package).
*/
AcpiUtDeleteGenericState (State);
State = AcpiUtPopGenericState (&StateList);
/* Finished when there are no more states */
if (!State)
{
/*
* We have handled all of the objects in the top level
* package just add the length of the package objects
* and exit
*/
return_ACPI_STATUS (AE_OK);
}
/*
* Go back up a level and move the index past the just
* completed package object.
*/
State->Pkg.Index++;
}
}
else
{
/* This is a subobject of type package */
Status = WalkCallback (ACPI_COPY_TYPE_PACKAGE, ThisSourceObj,
State, Context);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* Push the current state and create a new one
* The callback above returned a new target package object.
*/
AcpiUtPushGenericState (&StateList, State);
State = AcpiUtCreatePkgState (ThisSourceObj,
State->Pkg.ThisTargetObj, 0);
//.........这里部分代码省略.........
示例13: AcpiUtUpdateObjectReference
//.........这里部分代码省略.........
Status = AcpiUtCreateUpdateStateAndPush (
Object->Package.Elements[i], Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
}
break;
case ACPI_TYPE_BUFFER_FIELD:
NextObject = Object->BufferField.BufferObj;
break;
case ACPI_TYPE_LOCAL_REGION_FIELD:
NextObject = Object->Field.RegionObj;
break;
case ACPI_TYPE_LOCAL_BANK_FIELD:
NextObject = Object->BankField.BankObj;
Status = AcpiUtCreateUpdateStateAndPush (
Object->BankField.RegionObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
break;
case ACPI_TYPE_LOCAL_INDEX_FIELD:
NextObject = Object->IndexField.IndexObj;
Status = AcpiUtCreateUpdateStateAndPush (
Object->IndexField.DataObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
break;
case ACPI_TYPE_LOCAL_REFERENCE:
/*
* The target of an Index (a package, string, or buffer) or a named
* reference must track changes to the ref count of the index or
* target object.
*/
if ((Object->Reference.Class == ACPI_REFCLASS_INDEX) ||
(Object->Reference.Class== ACPI_REFCLASS_NAME))
{
NextObject = Object->Reference.Object;
}
break;
case ACPI_TYPE_REGION:
default:
break; /* No subobjects for all other types */
}
/*
* Now we can update the count in the main object. This can only
* happen after we update the sub-objects in case this causes the
* main object to be deleted.
*/
AcpiUtUpdateRefCount (Object, Action);
Object = NULL;
/* Move on to the next object to be updated */
if (NextObject)
{
Object = NextObject;
NextObject = NULL;
}
else if (StateList)
{
State = AcpiUtPopGenericState (&StateList);
Object = State->Update.Object;
AcpiUtDeleteGenericState (State);
}
}
return_ACPI_STATUS (AE_OK);
ErrorExit:
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not update object reference count"));
/* Free any stacked Update State objects */
while (StateList)
{
State = AcpiUtPopGenericState (&StateList);
AcpiUtDeleteGenericState (State);
}
return_ACPI_STATUS (Status);
}
示例14: AcpiEvQueueNotifyRequest
ACPI_STATUS
AcpiEvQueueNotifyRequest (
ACPI_NAMESPACE_NODE *Node,
UINT32 NotifyValue)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *HandlerObj = NULL;
ACPI_GENERIC_STATE *NotifyInfo;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_NAME (EvQueueNotifyRequest);
/*
* For value 3 (Ejection Request), some device method may need to be run.
* For value 2 (Device Wake) if _PRW exists, the _PS0 method may need
* to be run.
* For value 0x80 (Status Change) on the power button or sleep button,
* initiate soft-off or sleep operation?
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n",
AcpiUtGetNodeName (Node), Node, NotifyValue,
AcpiUtGetNotifyName (NotifyValue)));
/* Get the notify object attached to the NS Node */
ObjDesc = AcpiNsGetAttachedObject (Node);
if (ObjDesc)
{
/* We have the notify object, Get the right handler */
switch (Node->Type)
{
/* Notify allowed only on these types */
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_PROCESSOR:
if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
HandlerObj = ObjDesc->CommonNotify.SystemNotify;
}
else
{
HandlerObj = ObjDesc->CommonNotify.DeviceNotify;
}
break;
default:
/* All other types are not supported */
return (AE_TYPE);
}
}
/*
* If there is any handler to run, schedule the dispatcher.
* Check for:
* 1) Global system notify handler
* 2) Global device notify handler
* 3) Per-device notify handler
*/
if ((AcpiGbl_SystemNotify.Handler &&
(NotifyValue <= ACPI_MAX_SYS_NOTIFY)) ||
(AcpiGbl_DeviceNotify.Handler &&
(NotifyValue > ACPI_MAX_SYS_NOTIFY)) ||
HandlerObj)
{
NotifyInfo = AcpiUtCreateGenericState ();
if (!NotifyInfo)
{
return (AE_NO_MEMORY);
}
if (!HandlerObj)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Executing system notify handler for Notify (%4.4s, %X) "
"node %p\n",
AcpiUtGetNodeName (Node), NotifyValue, Node));
}
NotifyInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
NotifyInfo->Notify.Node = Node;
NotifyInfo->Notify.Value = (UINT16) NotifyValue;
NotifyInfo->Notify.HandlerObj = HandlerObj;
Status = AcpiOsExecute (
OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch, NotifyInfo);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteGenericState (NotifyInfo);
}
}
else
{
//.........这里部分代码省略.........
示例15: AcpiUtUpdateObjectReference
//.........这里部分代码省略.........
goto ErrorExit;
}
break;
}
}
NextObject = NULL;
break;
case ACPI_TYPE_BUFFER_FIELD:
NextObject = Object->BufferField.BufferObj;
break;
case ACPI_TYPE_LOCAL_REGION_FIELD:
NextObject = Object->Field.RegionObj;
break;
case ACPI_TYPE_LOCAL_BANK_FIELD:
NextObject = Object->BankField.BankObj;
Status = AcpiUtCreateUpdateStateAndPush (
Object->BankField.RegionObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
break;
case ACPI_TYPE_LOCAL_INDEX_FIELD:
NextObject = Object->IndexField.IndexObj;
Status = AcpiUtCreateUpdateStateAndPush (
Object->IndexField.DataObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
break;
case ACPI_TYPE_LOCAL_REFERENCE:
/*
* The target of an Index (a package, string, or buffer) or a named
* reference must track changes to the ref count of the index or
* target object.
*/
if ((Object->Reference.Class == ACPI_REFCLASS_INDEX) ||
(Object->Reference.Class== ACPI_REFCLASS_NAME))
{
NextObject = Object->Reference.Object;
}
break;
case ACPI_TYPE_REGION:
default:
break; /* No subobjects for all other types */
}
/*
* Now we can update the count in the main object. This can only
* happen after we update the sub-objects in case this causes the
* main object to be deleted.
*/
AcpiUtUpdateRefCount (Object, Action);
Object = NULL;
/* Move on to the next object to be updated */
if (NextObject)
{
Object = NextObject;
NextObject = NULL;
}
else if (StateList)
{
State = AcpiUtPopGenericState (&StateList);
Object = State->Update.Object;
AcpiUtDeleteGenericState (State);
}
}
return (AE_OK);
ErrorExit:
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not update object reference count"));
/* Free any stacked Update State objects */
while (StateList)
{
State = AcpiUtPopGenericState (&StateList);
AcpiUtDeleteGenericState (State);
}
return (Status);
}