您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AcpiNsGetAttachedObject函数代码示例

51自学网 2021-06-01 19:39:34
  C++
这篇教程C++ AcpiNsGetAttachedObject函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AcpiNsGetAttachedObject函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiNsGetAttachedObject函数的具体用法?C++ AcpiNsGetAttachedObject怎么用?C++ AcpiNsGetAttachedObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AcpiNsGetAttachedObject函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AcpiEvInitializeRegion

ACPI_STATUSAcpiEvInitializeRegion (    ACPI_OPERAND_OBJECT     *RegionObj,    BOOLEAN                 AcpiNsLocked){    ACPI_OPERAND_OBJECT     *HandlerObj;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_ADR_SPACE_TYPE     SpaceId;    ACPI_NAMESPACE_NODE     *Node;    ACPI_STATUS             Status;    ACPI_NAMESPACE_NODE     *MethodNode;    ACPI_NAME               *RegNamePtr = (ACPI_NAME *) METHOD_NAME__REG;    ACPI_OPERAND_OBJECT     *RegionObj2;    ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked);    if (!RegionObj)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED)    {        return_ACPI_STATUS (AE_OK);    }    RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);    if (!RegionObj2)    {        return_ACPI_STATUS (AE_NOT_EXIST);    }    Node = AcpiNsGetParentNode (RegionObj->Region.Node);    SpaceId = RegionObj->Region.SpaceId;    /* Setup defaults */    RegionObj->Region.Handler = NULL;    RegionObj2->Extra.Method_REG = NULL;    RegionObj->Common.Flags &= ~(AOPOBJ_SETUP_COMPLETE);    RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;    /* Find any "_REG" method associated with this region definition */    Status = AcpiNsSearchOneScope (                *RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);    if (ACPI_SUCCESS (Status))    {        /*         * The _REG method is optional and there can be only one per region         * definition. This will be executed when the handler is attached         * or removed         */        RegionObj2->Extra.Method_REG = MethodNode;    }    /*     * The following loop depends upon the root Node having no parent     * ie: AcpiGbl_RootNode->ParentEntry 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:                HandlerObj = ObjDesc->Device.Handler;                break;            case ACPI_TYPE_PROCESSOR:                HandlerObj = ObjDesc->Processor.Handler;                break;            case ACPI_TYPE_THERMAL:                HandlerObj = ObjDesc->ThermalZone.Handler;                break;            default:                /* Ignore other objects */                break;            }            while (HandlerObj)            {                /* Is this handler of the correct type? */                if (HandlerObj->AddressSpace.SpaceId == SpaceId)                {//.........这里部分代码省略.........
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:101,


示例2: AcpiDsCallControlMethod

ACPI_STATUSAcpiDsCallControlMethod (    ACPI_THREAD_STATE       *Thread,    ACPI_WALK_STATE         *ThisWalkState,    ACPI_PARSE_OBJECT       *Op){    ACPI_STATUS             Status;    ACPI_NAMESPACE_NODE     *MethodNode;    ACPI_WALK_STATE         *NextWalkState = NULL;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_EVALUATE_INFO      *Info;    UINT32                  i;    ACPI_FUNCTION_TRACE_PTR (DsCallControlMethod, ThisWalkState);    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Calling method %p, currentstate=%p/n",        ThisWalkState->PrevOp, ThisWalkState));    /*     * Get the namespace entry for the control method we are about to call     */    MethodNode = ThisWalkState->MethodCallNode;    if (!MethodNode)    {        return_ACPI_STATUS (AE_NULL_ENTRY);    }    ObjDesc = AcpiNsGetAttachedObject (MethodNode);    if (!ObjDesc)    {        return_ACPI_STATUS (AE_NULL_OBJECT);    }    /* Init for new method, possibly wait on method mutex */    Status = AcpiDsBeginMethodExecution (MethodNode, ObjDesc,                ThisWalkState);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Begin method parse/execution. Create a new walk state */    NextWalkState = AcpiDsCreateWalkState (ObjDesc->Method.OwnerId,                        NULL, ObjDesc, Thread);    if (!NextWalkState)    {        Status = AE_NO_MEMORY;        goto Cleanup;    }    /*     * The resolved arguments were put on the previous walk state's operand     * stack. Operands on the previous walk state stack always     * start at index 0. Also, null terminate the list of arguments     */    ThisWalkState->Operands [ThisWalkState->NumOperands] = NULL;    /*     * Allocate and initialize the evaluation information block     * TBD: this is somewhat inefficient, should change interface to     * DsInitAmlWalk. For now, keeps this struct off the CPU stack     */    Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));    if (!Info)    {        return_ACPI_STATUS (AE_NO_MEMORY);    }    Info->Parameters = &ThisWalkState->Operands[0];    Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode,                ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,                Info, ACPI_IMODE_EXECUTE);    ACPI_FREE (Info);    if (ACPI_FAILURE (Status))    {        goto Cleanup;    }    /*     * Delete the operands on the previous walkstate operand stack     * (they were copied to new objects)     */    for (i = 0; i < ObjDesc->Method.ParamCount; i++)    {        AcpiUtRemoveReference (ThisWalkState->Operands [i]);        ThisWalkState->Operands [i] = NULL;    }    /* Clear the operand stack */    ThisWalkState->NumOperands = 0;    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,        "**** Begin nested execution of [%4.4s] **** WalkState=%p/n",        MethodNode->Name.Ascii, NextWalkState));//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:libuinet,代码行数:101,


示例3: AcpiInstallNotifyHandler

ACPI_STATUSAcpiInstallNotifyHandler (    ACPI_HANDLE             Device,    UINT32                  HandlerType,    ACPI_NOTIFY_HANDLER     Handler,    void                    *Context){    ACPI_NAMESPACE_NODE     *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Device);    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *HandlerObj;    ACPI_STATUS             Status;    UINT32                  i;    ACPI_FUNCTION_TRACE (AcpiInstallNotifyHandler);    /* Parameter validation */    if ((!Device) || (!Handler) || (!HandlerType) ||        (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /*     * Root Object:     * Registering a notify handler on the root object indicates that the     * caller wishes to receive notifications for all objects. Note that     * only one global handler can be registered per notify type.     * Ensure that a handler is not already installed.     */    if (Device == ACPI_ROOT_OBJECT)    {        for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)        {            if (HandlerType & (i+1))            {                if (AcpiGbl_GlobalNotify[i].Handler)                {                    Status = AE_ALREADY_EXISTS;                    goto UnlockAndExit;                }                AcpiGbl_GlobalNotify[i].Handler = Handler;                AcpiGbl_GlobalNotify[i].Context = Context;            }        }        goto UnlockAndExit; /* Global notify handler installed, all done */    }    /*     * All Other Objects:     * Caller will only receive notifications specific to the target     * object. Note that only certain object types are allowed to     * receive notifications.     */    /* Are Notifies allowed on this object? */    if (!AcpiEvIsNotifyObject (Node))    {        Status = AE_TYPE;        goto UnlockAndExit;    }    /* Check for an existing internal object, might not exist */    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        /* Create a new object */        ObjDesc = AcpiUtCreateInternalObject (Node->Type);        if (!ObjDesc)        {            Status = AE_NO_MEMORY;            goto UnlockAndExit;        }        /* Attach new object to the Node, remove local reference */        Status = AcpiNsAttachObject (Device, ObjDesc, Node->Type);        AcpiUtRemoveReference (ObjDesc);        if (ACPI_FAILURE (Status))        {            goto UnlockAndExit;        }    }    /* Ensure that the handler is not already installed in the lists */    for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)//.........这里部分代码省略.........
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:101,


示例4: AcpiDbIntegrityWalk

static ACPI_STATUSAcpiDbIntegrityWalk (    ACPI_HANDLE             ObjHandle,    UINT32                  NestingLevel,    void                    *Context,    void                    **ReturnValue){    ACPI_INTEGRITY_INFO     *Info = (ACPI_INTEGRITY_INFO *) Context;    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;    ACPI_OPERAND_OBJECT     *Object;    BOOLEAN                 Alias = TRUE;    Info->Nodes++;    /* Verify the NS node, and dereference aliases */    while (Alias)    {        if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)        {            AcpiOsPrintf ("Invalid Descriptor Type for Node %p [%s] - is %2.2X should be %2.2X/n",                Node, AcpiUtGetDescriptorName (Node), ACPI_GET_DESCRIPTOR_TYPE (Node),                ACPI_DESC_TYPE_NAMED);            return (AE_OK);        }        if ((Node->Type == ACPI_TYPE_LOCAL_ALIAS)  ||            (Node->Type == ACPI_TYPE_LOCAL_METHOD_ALIAS))        {            Node = (ACPI_NAMESPACE_NODE *) Node->Object;        }        else        {            Alias = FALSE;        }    }    if (Node->Type > ACPI_TYPE_LOCAL_MAX)    {        AcpiOsPrintf ("Invalid Object Type for Node %p, Type = %X/n",            Node, Node->Type);        return (AE_OK);    }    if (!AcpiUtValidAcpiName (Node->Name.Integer))    {        AcpiOsPrintf ("Invalid AcpiName for Node %p/n", Node);        return (AE_OK);    }    Object = AcpiNsGetAttachedObject (Node);    if (Object)    {        Info->Objects++;        if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)        {            AcpiOsPrintf ("Invalid Descriptor Type for Object %p [%s]/n",                Object, AcpiUtGetDescriptorName (Object));        }    }    return (AE_OK);}
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:64,


示例5: AcpiDsExecEndOp

//.........这里部分代码省略.........            Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);            break;        case AML_TYPE_CREATE_OBJECT:            ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,                "Executing CreateObject (Buffer/Package) Op=%p/n", Op));            switch (Op->Common.Parent->Common.AmlOpcode)            {            case AML_NAME_OP:                /*                 * Put the Node on the object stack (Contains the ACPI Name                 * of this object)                 */                WalkState->Operands[0] = (void *)                    Op->Common.Parent->Common.Node;                WalkState->NumOperands = 1;                Status = AcpiDsCreateNode (WalkState,                    Op->Common.Parent->Common.Node, Op->Common.Parent);                if (ACPI_FAILURE (Status))                {                    break;                }                /* Fall through */                /*lint -fallthrough */            case AML_INT_EVAL_SUBTREE_OP:                Status = AcpiDsEvalDataObjectOperands (WalkState, Op,                    AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));                break;            default:                Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);                break;            }            /*             * If a result object was returned from above, push it on the             * current result stack             */            if (WalkState->ResultObj)            {                Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);            }            break;        case AML_TYPE_NAMED_FIELD:        case AML_TYPE_NAMED_COMPLEX:        case AML_TYPE_NAMED_SIMPLE:        case AML_TYPE_NAMED_NO_OBJ:            Status = AcpiDsLoad2EndOp (WalkState);            if (ACPI_FAILURE (Status))            {                break;            }            if (Op->Common.AmlOpcode == AML_REGION_OP)            {                ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
开发者ID:AmirAbrams,项目名称:haiku,代码行数:67,


示例6: AcpiEvQueueNotifyRequest

ACPI_STATUSAcpiEvQueueNotifyRequest (    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), Node));    Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,        Info);    if (ACPI_FAILURE (Status))    {        AcpiUtDeleteGenericState (Info);    }    return (Status);}
开发者ID:rodero95,项目名称:sys,代码行数:86,


示例7: AcpiInstallNotifyHandler

ACPI_STATUSAcpiInstallNotifyHandler (    ACPI_HANDLE             Device,    UINT32                  HandlerType,    ACPI_NOTIFY_HANDLER     Handler,    void                    *Context){    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *NotifyObj;    ACPI_NAMESPACE_NODE     *Node;    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE (AcpiInstallNotifyHandler);    /* Parameter validation */    if ((!Device)  ||        (!Handler) ||        (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Convert and validate the device handle */    Node = AcpiNsMapHandleToNode (Device);    if (!Node)    {        Status = AE_BAD_PARAMETER;        goto UnlockAndExit;    }    /*     * Root Object:     * Registering a notify handler on the root object indicates that the     * caller wishes to receive notifications for all objects.  Note that     * only one <external> global handler can be regsitered (per notify type).     */    if (Device == ACPI_ROOT_OBJECT)    {        /* Make sure the handler is not already installed */        if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&                AcpiGbl_SystemNotify.Handler)       ||            ((HandlerType & ACPI_DEVICE_NOTIFY) &&                AcpiGbl_DeviceNotify.Handler))        {            Status = AE_ALREADY_EXISTS;            goto UnlockAndExit;        }        if (HandlerType & ACPI_SYSTEM_NOTIFY)        {            AcpiGbl_SystemNotify.Node    = Node;            AcpiGbl_SystemNotify.Handler = Handler;            AcpiGbl_SystemNotify.Context = Context;        }        if (HandlerType & ACPI_DEVICE_NOTIFY)        {            AcpiGbl_DeviceNotify.Node    = Node;            AcpiGbl_DeviceNotify.Handler = Handler;            AcpiGbl_DeviceNotify.Context = Context;        }        /* Global notify handler installed */    }    /*     * All Other Objects:     * Caller will only receive notifications specific to the target object.     * Note that only certain object types can receive notifications.     */    else    {        /* Notifies allowed on this object? */        if (!AcpiEvIsNotifyObject (Node))        {            Status = AE_TYPE;            goto UnlockAndExit;        }        /* Check for an existing internal object */        ObjDesc = AcpiNsGetAttachedObject (Node);        if (ObjDesc)        {            /* Object exists - make sure there's no handler */            if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&                    ObjDesc->CommonNotify.SystemNotify)   ||//.........这里部分代码省略.........
开发者ID:oza,项目名称:FreeBSD-7.3-dyntick,代码行数:101,


示例8: AcpiNsEvaluate

ACPI_STATUSAcpiNsEvaluate (    ACPI_EVALUATE_INFO      *Info){    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE (NsEvaluate);    if (!Info)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    if (!Info->Node)    {        /*         * Get the actual namespace node for the target object if we         * need to. Handles these cases:         *         * 1) Null node, valid pathname from root (absolute path)         * 2) Node and valid pathname (path relative to Node)         * 3) Node, Null pathname         */        Status = AcpiNsGetNode (Info->PrefixNode, Info->RelativePathname,            ACPI_NS_NO_UPSEARCH, &Info->Node);        if (ACPI_FAILURE (Status))        {            return_ACPI_STATUS (Status);        }    }    /*     * For a method alias, we must grab the actual method node so that     * proper scoping context will be established before execution.     */    if (AcpiNsGetType (Info->Node) == ACPI_TYPE_LOCAL_METHOD_ALIAS)    {        Info->Node = ACPI_CAST_PTR (            ACPI_NAMESPACE_NODE, Info->Node->Object);    }    /* Complete the info block initialization */    Info->ReturnObject = NULL;    Info->NodeFlags = Info->Node->Flags;    Info->ObjDesc = AcpiNsGetAttachedObject (Info->Node);    ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p/n",        Info->RelativePathname, Info->Node,        AcpiNsGetAttachedObject (Info->Node)));    /* Get info if we have a predefined name (_HID, etc.) */    Info->Predefined = AcpiUtMatchPredefinedMethod (Info->Node->Name.Ascii);    /* Get the full pathname to the object, for use in warning messages */    Info->FullPathname = AcpiNsGetExternalPathname (Info->Node);    if (!Info->FullPathname)    {        return_ACPI_STATUS (AE_NO_MEMORY);    }    /* Count the number of arguments being passed in */    Info->ParamCount = 0;    if (Info->Parameters)    {        while (Info->Parameters[Info->ParamCount])        {            Info->ParamCount++;        }        /* Warn on impossible argument count */        if (Info->ParamCount > ACPI_METHOD_NUM_ARGS)        {            ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, ACPI_WARN_ALWAYS,                "Excess arguments (%u) - using only %u",                Info->ParamCount, ACPI_METHOD_NUM_ARGS));            Info->ParamCount = ACPI_METHOD_NUM_ARGS;        }    }    /*     * For predefined names: Check that the declared argument count     * matches the ACPI spec -- otherwise this is a BIOS error.     */    AcpiNsCheckAcpiCompliance (Info->FullPathname, Info->Node,        Info->Predefined);    /*     * For all names: Check that the incoming argument count for     * this method/object matches the actual ASL/AML definition.     */    AcpiNsCheckArgumentCount (Info->FullPathname, Info->Node,        Info->ParamCount, Info->Predefined);//.........这里部分代码省略.........
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:101,


示例9: AcpiNsExecModuleCode

static voidAcpiNsExecModuleCode (    ACPI_OPERAND_OBJECT     *MethodObj,    ACPI_EVALUATE_INFO      *Info){    ACPI_OPERAND_OBJECT     *ParentObj;    ACPI_NAMESPACE_NODE     *ParentNode;    ACPI_OBJECT_TYPE        Type;    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE (NsExecModuleCode);    /*     * Get the parent node. We cheat by using the NextObject field     * of the method object descriptor.     */    ParentNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,                    MethodObj->Method.NextObject);    Type = AcpiNsGetType (ParentNode);    /*     * Get the region handler and save it in the method object. We may need     * this if an operation region declaration causes a _REG method to be run.     *     * We can't do this in AcpiPsLinkModuleCode because     * AcpiGbl_RootNode->Object is NULL at PASS1.     */    if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object)    {        MethodObj->Method.Dispatch.Handler =            ParentNode->Object->Device.Handler;    }    /* Must clear NextObject (AcpiNsAttachObject needs the field) */    MethodObj->Method.NextObject = NULL;    /* Initialize the evaluation information block */    ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO));    Info->PrefixNode = ParentNode;    /*     * Get the currently attached parent object. Add a reference, because the     * ref count will be decreased when the method object is installed to     * the parent node.     */    ParentObj = AcpiNsGetAttachedObject (ParentNode);    if (ParentObj)    {        AcpiUtAddReference (ParentObj);    }    /* Install the method (module-level code) in the parent node */    Status = AcpiNsAttachObject (ParentNode, MethodObj,                ACPI_TYPE_METHOD);    if (ACPI_FAILURE (Status))    {        goto Exit;    }    /* Execute the parent node as a control method */    Status = AcpiNsEvaluate (Info);    ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p/n",        MethodObj->Method.AmlStart));    /* Delete a possible implicit return value (in slack mode) */    if (Info->ReturnObject)    {        AcpiUtRemoveReference (Info->ReturnObject);    }    /* Detach the temporary method object */    AcpiNsDetachObject (ParentNode);    /* Restore the original parent object */    if (ParentObj)    {        Status = AcpiNsAttachObject (ParentNode, ParentObj, Type);    }    else    {        ParentNode->Type = (UINT8) Type;    }Exit:    if (ParentObj)    {        AcpiUtRemoveReference (ParentObj);    }    return_VOID;}
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:100,


示例10: AcpiEvInstallSpaceHandler

ACPI_STATUSAcpiEvInstallSpaceHandler (    ACPI_NAMESPACE_NODE     *Node,    ACPI_ADR_SPACE_TYPE     SpaceId,    ACPI_ADR_SPACE_HANDLER  Handler,    ACPI_ADR_SPACE_SETUP    Setup,    void                    *Context){    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *HandlerObj;    ACPI_STATUS             Status = AE_OK;    ACPI_OBJECT_TYPE        Type;    UINT8                   Flags = 0;    ACPI_FUNCTION_TRACE (EvInstallSpaceHandler);    /*     * This registration is valid for only the types below and the root.     * The root node is where the default handlers get installed.     */    if ((Node->Type != ACPI_TYPE_DEVICE)     &&            (Node->Type != ACPI_TYPE_PROCESSOR)  &&            (Node->Type != ACPI_TYPE_THERMAL)    &&            (Node != AcpiGbl_RootNode))    {        Status = AE_BAD_PARAMETER;        goto UnlockAndExit;    }    if (Handler == ACPI_DEFAULT_HANDLER)    {        Flags = ACPI_ADDR_HANDLER_DEFAULT_INSTALLED;        switch (SpaceId)        {        case ACPI_ADR_SPACE_SYSTEM_MEMORY:            Handler = AcpiExSystemMemorySpaceHandler;            Setup   = AcpiEvSystemMemoryRegionSetup;            break;        case ACPI_ADR_SPACE_SYSTEM_IO:            Handler = AcpiExSystemIoSpaceHandler;            Setup   = AcpiEvIoSpaceRegionSetup;            break;        case ACPI_ADR_SPACE_PCI_CONFIG:            Handler = AcpiExPciConfigSpaceHandler;            Setup   = AcpiEvPciConfigRegionSetup;            break;        case ACPI_ADR_SPACE_CMOS:            Handler = AcpiExCmosSpaceHandler;            Setup   = AcpiEvCmosRegionSetup;            break;        case ACPI_ADR_SPACE_PCI_BAR_TARGET:            Handler = AcpiExPciBarSpaceHandler;            Setup   = AcpiEvPciBarRegionSetup;            break;        case ACPI_ADR_SPACE_DATA_TABLE:            Handler = AcpiExDataTableSpaceHandler;            Setup   = NULL;            break;        default:            Status = AE_BAD_PARAMETER;            goto UnlockAndExit;        }    }    /* If the caller hasn't specified a setup routine, use the default */    if (!Setup)    {        Setup = AcpiEvDefaultRegionSetup;    }    /* Check for an existing internal object */    ObjDesc = AcpiNsGetAttachedObject (Node);    if (ObjDesc)    {        /*         * The attached device object already exists. Now make sure         * the handler is not already installed.         */        HandlerObj = AcpiEvFindRegionHandler (SpaceId,                                              ObjDesc->CommonNotify.Handler);        if (HandlerObj)//.........这里部分代码省略.........
开发者ID:tomtor,项目名称:freebsd,代码行数:101,


示例11: AcpiEvInstallHandler

static ACPI_STATUSAcpiEvInstallHandler (    ACPI_HANDLE             ObjHandle,    UINT32                  Level,    void                    *Context,    void                    **ReturnValue){    ACPI_OPERAND_OBJECT     *HandlerObj;    ACPI_OPERAND_OBJECT     *NextHandlerObj;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_NAMESPACE_NODE     *Node;    ACPI_STATUS             Status;    ACPI_FUNCTION_NAME (EvInstallHandler);    HandlerObj = (ACPI_OPERAND_OBJECT  *) Context;    /* Parameter validation */    if (!HandlerObj)    {        return (AE_OK);    }    /* Convert and validate the device handle */    Node = AcpiNsValidateHandle (ObjHandle);    if (!Node)    {        return (AE_BAD_PARAMETER);    }    /*     * We only care about regions and objects that are allowed to have     * address space handlers     */    if ((Node->Type != ACPI_TYPE_DEVICE) &&            (Node->Type != ACPI_TYPE_REGION) &&            (Node != AcpiGbl_RootNode))    {        return (AE_OK);    }    /* Check for an existing internal object */    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        /* No object, just exit */        return (AE_OK);    }    /* Devices are handled different than regions */    if (ObjDesc->Common.Type == ACPI_TYPE_DEVICE)    {        /* Check if this Device already has a handler for this address space */        NextHandlerObj = AcpiEvFindRegionHandler (                             HandlerObj->AddressSpace.SpaceId, ObjDesc->CommonNotify.Handler);        if (NextHandlerObj)        {            /* Found a handler, is it for the same address space? */            ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,                               "Found handler for region [%s] in device %p(%p) handler %p/n",                               AcpiUtGetRegionName (HandlerObj->AddressSpace.SpaceId),                               ObjDesc, NextHandlerObj, HandlerObj));            /*             * Since the object we found it on was a device, then it means             * that someone has already installed a handler for the branch             * of the namespace from this device on. Just bail out telling             * the walk routine to not traverse this branch. This preserves             * the scoping rule for handlers.             */            return (AE_CTRL_DEPTH);        }        /*         * As long as the device didn't have a handler for this space we         * don't care about it. We just ignore it and proceed.         */        return (AE_OK);    }    /* Object is a Region */    if (ObjDesc->Region.SpaceId != HandlerObj->AddressSpace.SpaceId)    {        /* This region is for a different address space, just ignore it */        return (AE_OK);    }    /*     * Now we have a region and it is for the handler's address space type.//.........这里部分代码省略.........
开发者ID:tomtor,项目名称:freebsd,代码行数:101,


示例12: AcpiNsDumpOneObject

ACPI_STATUSAcpiNsDumpOneObject (    ACPI_HANDLE             ObjHandle,    UINT32                  Level,    void                    *Context,    void                    **ReturnValue){    ACPI_WALK_INFO          *Info = (ACPI_WALK_INFO *) Context;    ACPI_NAMESPACE_NODE     *ThisNode;    ACPI_OPERAND_OBJECT     *ObjDesc = NULL;    ACPI_OBJECT_TYPE        ObjType;    ACPI_OBJECT_TYPE        Type;    UINT32                  BytesToDump;    UINT32                  DbgLevel;    UINT32                  i;    ACPI_FUNCTION_NAME (NsDumpOneObject);    /* Is output enabled? */    if (!(AcpiDbgLevel & Info->DebugLevel))    {        return (AE_OK);    }    if (!ObjHandle)    {        ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle/n"));        return (AE_OK);    }    ThisNode = AcpiNsValidateHandle (ObjHandle);    if (!ThisNode)    {        ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p/n",            ObjHandle));        return (AE_OK);    }    Type = ThisNode->Type;    /* Check if the owner matches */    if ((Info->OwnerId != ACPI_OWNER_ID_MAX) &&        (Info->OwnerId != ThisNode->OwnerId))    {        return (AE_OK);    }    if (!(Info->DisplayType & ACPI_DISPLAY_SHORT))    {        /* Indent the object according to the level */        AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");        /* Check the node type and name */        if (Type > ACPI_TYPE_LOCAL_MAX)        {            ACPI_WARNING ((AE_INFO,                "Invalid ACPI Object Type 0x%08X", Type));        }        AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode));    }    /* Now we can print out the pertinent information */    AcpiOsPrintf (" %-12s %p %2.2X ",        AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);    DbgLevel = AcpiDbgLevel;    AcpiDbgLevel = 0;    ObjDesc = AcpiNsGetAttachedObject (ThisNode);    AcpiDbgLevel = DbgLevel;    /* Temp nodes are those nodes created by a control method */    if (ThisNode->Flags & ANOBJ_TEMPORARY)    {        AcpiOsPrintf ("(T) ");    }    switch (Info->DisplayType & ACPI_DISPLAY_MASK)    {    case ACPI_DISPLAY_SUMMARY:        if (!ObjDesc)        {            /* No attached object. Some types should always have an object */            switch (Type)            {            case ACPI_TYPE_INTEGER:            case ACPI_TYPE_PACKAGE:            case ACPI_TYPE_BUFFER:            case ACPI_TYPE_STRING:            case ACPI_TYPE_METHOD://.........这里部分代码省略.........
开发者ID:RehabMan,项目名称:Intel-iasl,代码行数:101,


示例13: AcpiDsEvalTableRegionOperands

ACPI_STATUSAcpiDsEvalTableRegionOperands (    ACPI_WALK_STATE         *WalkState,    ACPI_PARSE_OBJECT       *Op){    ACPI_STATUS             Status;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     **Operand;    ACPI_NAMESPACE_NODE     *Node;    ACPI_PARSE_OBJECT       *NextOp;    UINT32                  TableIndex;    ACPI_TABLE_HEADER       *Table;    ACPI_FUNCTION_TRACE_PTR (DsEvalTableRegionOperands, Op);    /*     * This is where we evaluate the Signature string, OemId string,     * and OemTableId string of the Data Table Region declaration     */    Node =  Op->Common.Node;    /* NextOp points to Signature string op */    NextOp = Op->Common.Value.Arg;    /*     * Evaluate/create the Signature string, OemId string,     * and OemTableId string operands     */    Status = AcpiDsCreateOperands (WalkState, NextOp);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /*     * Resolve the Signature string, OemId string,     * and OemTableId string operands     */    Status = AcpiExResolveOperands (Op->Common.AmlOpcode,                                    ACPI_WALK_OPERANDS, WalkState);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    Operand = &WalkState->Operands[0];    /* Find the ACPI table */    Status = AcpiTbFindTable (Operand[0]->String.Pointer,                              Operand[1]->String.Pointer, Operand[2]->String.Pointer,                              &TableIndex);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    AcpiUtRemoveReference (Operand[0]);    AcpiUtRemoveReference (Operand[1]);    AcpiUtRemoveReference (Operand[2]);    Status = AcpiGetTableByIndex (TableIndex, &Table);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        return_ACPI_STATUS (AE_NOT_EXIST);    }    ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) ACPI_TO_INTEGER (Table);    ObjDesc->Region.Length = Table->Length;    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X/n",                       ObjDesc,                       ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),                       ObjDesc->Region.Length));    /* Now the address and length are valid for this opregion */    ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;    return_ACPI_STATUS (Status);}
开发者ID:michas2,项目名称:l4re-snapshot,代码行数:90,


示例14: AcpiRemoveNotifyHandler

ACPI_STATUSAcpiRemoveNotifyHandler (    ACPI_HANDLE             Device,    UINT32                  HandlerType,    ACPI_NOTIFY_HANDLER     Handler){    ACPI_OPERAND_OBJECT     *NotifyObj;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_NAMESPACE_NODE     *Node;    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE (AcpiRemoveNotifyHandler);    /* Parameter validation */    if ((!Device)  ||        (!Handler) ||        (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Convert and validate the device handle */    Node = AcpiNsMapHandleToNode (Device);    if (!Node)    {        Status = AE_BAD_PARAMETER;        goto UnlockAndExit;    }    /* Root Object */    if (Device == ACPI_ROOT_OBJECT)    {        ACPI_DEBUG_PRINT ((ACPI_DB_INFO,            "Removing notify handler for namespace root object/n"));        if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&              !AcpiGbl_SystemNotify.Handler)        ||            ((HandlerType & ACPI_DEVICE_NOTIFY) &&              !AcpiGbl_DeviceNotify.Handler))        {            Status = AE_NOT_EXIST;            goto UnlockAndExit;        }        if (HandlerType & ACPI_SYSTEM_NOTIFY)        {            AcpiGbl_SystemNotify.Node    = NULL;            AcpiGbl_SystemNotify.Handler = NULL;            AcpiGbl_SystemNotify.Context = NULL;        }        if (HandlerType & ACPI_DEVICE_NOTIFY)        {            AcpiGbl_DeviceNotify.Node    = NULL;            AcpiGbl_DeviceNotify.Handler = NULL;            AcpiGbl_DeviceNotify.Context = NULL;        }    }    /* All Other Objects */    else    {        /* Notifies allowed on this object? */        if (!AcpiEvIsNotifyObject (Node))        {            Status = AE_TYPE;            goto UnlockAndExit;        }        /* Check for an existing internal object */        ObjDesc = AcpiNsGetAttachedObject (Node);        if (!ObjDesc)        {            Status = AE_NOT_EXIST;            goto UnlockAndExit;        }        /* Object exists - make sure there's an existing handler */        if (HandlerType & ACPI_SYSTEM_NOTIFY)        {            NotifyObj = ObjDesc->CommonNotify.SystemNotify;            if (!NotifyObj)            {                Status = AE_NOT_EXIST;                goto UnlockAndExit;//.........这里部分代码省略.........
开发者ID:oza,项目名称:FreeBSD-7.3-dyntick,代码行数:101,


示例15: AcpiDsEvalBankFieldOperands

ACPI_STATUSAcpiDsEvalBankFieldOperands (    ACPI_WALK_STATE         *WalkState,    ACPI_PARSE_OBJECT       *Op){    ACPI_STATUS             Status;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *OperandDesc;    ACPI_NAMESPACE_NODE     *Node;    ACPI_PARSE_OBJECT       *NextOp;    ACPI_PARSE_OBJECT       *Arg;    ACPI_FUNCTION_TRACE_PTR (DsEvalBankFieldOperands, Op);    /*     * This is where we evaluate the BankValue field of the     * BankField declaration     */    /* NextOp points to the op that holds the Region */    NextOp = Op->Common.Value.Arg;    /* NextOp points to the op that holds the Bank Register */    NextOp = NextOp->Common.Next;    /* NextOp points to the op that holds the Bank Value */    NextOp = NextOp->Common.Next;    /*     * Set proper index into operand stack for AcpiDsObjStackPush     * invoked inside AcpiDsCreateOperand.     *     * We use WalkState->Operands[0] to store the evaluated BankValue     */    WalkState->OperandIndex = 0;    Status = AcpiDsCreateOperand (WalkState, NextOp, 0);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    Status = AcpiExResolveToValue (&WalkState->Operands[0], WalkState);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS,                        AcpiPsGetOpcodeName (Op->Common.AmlOpcode), 1);    /*     * Get the BankValue operand and save it     * (at Top of stack)     */    OperandDesc = WalkState->Operands[0];    /* Arg points to the start Bank Field */    Arg = AcpiPsGetArg (Op, 4);    while (Arg)    {        /* Ignore OFFSET and ACCESSAS terms here */        if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)        {            Node = Arg->Common.Node;            ObjDesc = AcpiNsGetAttachedObject (Node);            if (!ObjDesc)            {                return_ACPI_STATUS (AE_NOT_EXIST);            }            ObjDesc->BankField.Value = (UINT32) OperandDesc->Integer.Value;        }        /* Move to next field in the list */        Arg = Arg->Common.Next;    }    AcpiUtRemoveReference (OperandDesc);    return_ACPI_STATUS (Status);}
开发者ID:michas2,项目名称:l4re-snapshot,代码行数:89,


示例16: AcpiEvInitializeRegion

ACPI_STATUSAcpiEvInitializeRegion (    ACPI_OPERAND_OBJECT     *RegionObj,    BOOLEAN                 AcpiNsLocked){    ACPI_OPERAND_OBJECT     *HandlerObj;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_ADR_SPACE_TYPE     SpaceId;    ACPI_NAMESPACE_NODE     *Node;    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked);    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 (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));                Status = AcpiEvAttachRegion (HandlerObj, RegionObj,                    AcpiNsLocked);                /*                 * Tell all users that this region is usable by                 * running the _REG method                 */                if (AcpiNsLocked)                {                    Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);                    if (ACPI_FAILURE (Status))                    {                        return_ACPI_STATUS (Status);                    }                }                Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:freebsd,代码行数:101,


示例17: AcpiDbDisplayHandlers

voidAcpiDbDisplayHandlers (    void){    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *HandlerObj;    ACPI_ADR_SPACE_TYPE     SpaceId;    UINT32                  i;    /* Operation region handlers */    AcpiOsPrintf ("/nOperation Region Handlers at the namespace root:/n");    ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);    if (ObjDesc)    {        for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)        {            SpaceId = AcpiGbl_SpaceIdList[i];            HandlerObj = ObjDesc->Device.Handler;            AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,                AcpiUtGetRegionName ((UINT8) SpaceId), SpaceId);            while (HandlerObj)            {                if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId)                {                    AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,                        (HandlerObj->AddressSpace.HandlerFlags &                            ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",                        HandlerObj->AddressSpace.Handler);                    goto FoundHandler;                }                HandlerObj = HandlerObj->AddressSpace.Next;            }            /* There is no handler for this SpaceId */            AcpiOsPrintf ("None/n");        FoundHandler:;        }        /* Find all handlers for user-defined SpaceIDs */        HandlerObj = ObjDesc->Device.Handler;        while (HandlerObj)        {            if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN)            {                AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,                    "User-defined ID", HandlerObj->AddressSpace.SpaceId);                AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,                    (HandlerObj->AddressSpace.HandlerFlags &                        ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",                    HandlerObj->AddressSpace.Handler);            }            HandlerObj = HandlerObj->AddressSpace.Next;        }    }#if (!ACPI_REDUCED_HARDWARE)    /* Fixed event handlers */    AcpiOsPrintf ("/nFixed Event Handlers:/n");    for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)    {        AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, AcpiUtGetEventName (i), i);        if (AcpiGbl_FixedEventHandlers[i].Handler)        {            AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",                AcpiGbl_FixedEventHandlers[i].Handler);        }        else        {            AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None");        }    }#endif /* !ACPI_REDUCED_HARDWARE */    /* Miscellaneous global handlers */    AcpiOsPrintf ("/nMiscellaneous Global Handlers:/n");    for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)    {        AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name);        if (AcpiGbl_HandlerList[i].Handler)        {            AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",                AcpiGbl_HandlerList[i].Handler);        }        else//.........这里部分代码省略.........
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:101,


示例18: AcpiExStoreObjectToNode

ACPI_STATUSAcpiExStoreObjectToNode (    ACPI_OPERAND_OBJECT     *SourceDesc,    ACPI_NAMESPACE_NODE     *Node,    ACPI_WALK_STATE         *WalkState,    UINT8                   ImplicitConversion){    ACPI_STATUS             Status = AE_OK;    ACPI_OPERAND_OBJECT     *TargetDesc;    ACPI_OPERAND_OBJECT     *NewDesc;    ACPI_OBJECT_TYPE        TargetType;    ACPI_FUNCTION_TRACE_PTR (ExStoreObjectToNode, SourceDesc);    /* Get current type of the node, and object attached to Node */    TargetType = AcpiNsGetType (Node);    TargetDesc = AcpiNsGetAttachedObject (Node);    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)/n",        SourceDesc, AcpiUtGetObjectTypeName (SourceDesc),              Node, AcpiUtGetTypeName (TargetType)));    /*     * Resolve the source object to an actual value     * (If it is a reference object)     */    Status = AcpiExResolveObject (&SourceDesc, TargetType, WalkState);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Do the actual store operation */    switch (TargetType)    {    case ACPI_TYPE_INTEGER:    case ACPI_TYPE_STRING:    case ACPI_TYPE_BUFFER:        /*         * The simple data types all support implicit source operand         * conversion before the store.         */        if ((WalkState->Opcode == AML_COPY_OP) ||            !ImplicitConversion)        {            /*             * However, CopyObject and Stores to ArgX do not perform             * an implicit conversion, as per the ACPI specification.             * A direct store is performed instead.             */            Status = AcpiExStoreDirectToNode (SourceDesc, Node,                WalkState);            break;        }        /* Store with implicit source operand conversion support */        Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc,            &NewDesc, WalkState);        if (ACPI_FAILURE (Status))        {            return_ACPI_STATUS (Status);        }        if (NewDesc != TargetDesc)        {            /*             * Store the new NewDesc as the new value of the Name, and set             * the Name's type to that of the value being stored in it.             * SourceDesc reference count is incremented by AttachObject.             *             * Note: This may change the type of the node if an explicit             * store has been performed such that the node/object type             * has been changed.             */            Status = AcpiNsAttachObject (Node, NewDesc,                NewDesc->Common.Type);            ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,                "Store %s into %s via Convert/Attach/n",                AcpiUtGetObjectTypeName (SourceDesc),                AcpiUtGetObjectTypeName (NewDesc)));        }        break;    case ACPI_TYPE_BUFFER_FIELD:    case ACPI_TYPE_LOCAL_REGION_FIELD:    case ACPI_TYPE_LOCAL_BANK_FIELD:    case ACPI_TYPE_LOCAL_INDEX_FIELD:        /*         * For all fields, always write the source data to the target         * field. Any required implicit source operand conversion is         * performed in the function below as necessary. Note, field         * objects must retain their original type permanently.         *///.........这里部分代码省略.........
开发者ID:JasonFord53,项目名称:freebsd,代码行数:101,


示例19: AcpiRemoveNotifyHandler

ACPI_STATUSAcpiRemoveNotifyHandler (    ACPI_HANDLE             Device,    UINT32                  HandlerType,    ACPI_NOTIFY_HANDLER     Handler){    ACPI_NAMESPACE_NODE     *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Device);    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *HandlerObj;    ACPI_OPERAND_OBJECT     *PreviousHandlerObj;    ACPI_STATUS             Status = AE_OK;    UINT32                  i;    ACPI_FUNCTION_TRACE (AcpiRemoveNotifyHandler);    /* Parameter validation */    if ((!Device) || (!Handler) || (!HandlerType) ||        (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    /* Root Object. Global handlers are removed here */    if (Device == ACPI_ROOT_OBJECT)    {        for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)        {            if (HandlerType & (i+1))            {                Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);                if (ACPI_FAILURE (Status))                {                    return_ACPI_STATUS (Status);                }                if (!AcpiGbl_GlobalNotify[i].Handler ||                    (AcpiGbl_GlobalNotify[i].Handler != Handler))                {                    Status = AE_NOT_EXIST;                    goto UnlockAndExit;                }                ACPI_DEBUG_PRINT ((ACPI_DB_INFO,                    "Removing global notify handler/n"));                AcpiGbl_GlobalNotify[i].Handler = NULL;                AcpiGbl_GlobalNotify[i].Context = NULL;                (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);                /* Make sure all deferred notify tasks are completed */                AcpiOsWaitEventsComplete ();            }        }        return_ACPI_STATUS (AE_OK);    }    /* All other objects: Are Notifies allowed on this object? */    if (!AcpiEvIsNotifyObject (Node))    {        return_ACPI_STATUS (AE_TYPE);    }    /* Must have an existing internal object */    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        return_ACPI_STATUS (AE_NOT_EXIST);    }    /* Internal object exists. Find the handler and remove it */    for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)    {        if (HandlerType & (i+1))        {            Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);            if (ACPI_FAILURE (Status))            {                return_ACPI_STATUS (Status);            }            HandlerObj = ObjDesc->CommonNotify.NotifyList[i];            PreviousHandlerObj = NULL;            /* Attempt to find the handler in the handler list */            while (HandlerObj &&                  (HandlerObj->Notify.Handler != Handler))            {                PreviousHandlerObj = HandlerObj;                HandlerObj = HandlerObj->Notify.Next[i];//.........这里部分代码省略.........
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:101,


示例20: AcpiExResolveNodeToValue

ACPI_STATUSAcpiExResolveNodeToValue (    ACPI_NAMESPACE_NODE     **ObjectPtr,    ACPI_WALK_STATE         *WalkState){    ACPI_STATUS             Status = AE_OK;    ACPI_OPERAND_OBJECT     *SourceDesc;    ACPI_OPERAND_OBJECT     *ObjDesc = NULL;    ACPI_NAMESPACE_NODE     *Node;    ACPI_OBJECT_TYPE        EntryType;    ACPI_FUNCTION_TRACE (ExResolveNodeToValue);    /*     * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the     * object that is attached to the Node.     */    Node       = *ObjectPtr;    SourceDesc = AcpiNsGetAttachedObject (Node);    EntryType  = AcpiNsGetType ((ACPI_HANDLE) Node);    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]/n",         Node, SourceDesc, AcpiUtGetTypeName (EntryType)));    if ((EntryType == ACPI_TYPE_LOCAL_ALIAS) ||        (EntryType == ACPI_TYPE_LOCAL_METHOD_ALIAS))    {        /* There is always exactly one level of indirection */        Node       = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Node->Object);        SourceDesc = AcpiNsGetAttachedObject (Node);        EntryType  = AcpiNsGetType ((ACPI_HANDLE) Node);        *ObjectPtr = Node;    }    /*     * Several object types require no further processing:     * 1) Device/Thermal objects don't have a "real" subobject, return the Node     * 2) Method locals and arguments have a pseudo-Node     * 3) 10/2007: Added method type to assist with Package construction.     */    if ((EntryType == ACPI_TYPE_DEVICE)  ||        (EntryType == ACPI_TYPE_THERMAL) ||        (EntryType == ACPI_TYPE_METHOD)  ||        (Node->Flags & (ANOBJ_METHOD_ARG | ANOBJ_METHOD_LOCAL)))    {        return_ACPI_STATUS (AE_OK);    }    if (!SourceDesc)    {        ACPI_ERROR ((AE_INFO, "No object attached to node %p",            Node));        return_ACPI_STATUS (AE_AML_NO_OPERAND);    }    /*     * Action is based on the type of the Node, which indicates the type     * of the attached object or pointer     */    switch (EntryType)    {    case ACPI_TYPE_PACKAGE:        if (SourceDesc->Common.Type != ACPI_TYPE_PACKAGE)        {            ACPI_ERROR ((AE_INFO, "Object not a Package, type %s",                AcpiUtGetObjectTypeName (SourceDesc)));            return_ACPI_STATUS (AE_AML_OPERAND_TYPE);        }        Status = AcpiDsGetPackageArguments (SourceDesc);        if (ACPI_SUCCESS (Status))        {            /* Return an additional reference to the object */            ObjDesc = SourceDesc;            AcpiUtAddReference (ObjDesc);        }        break;    case ACPI_TYPE_BUFFER:        if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)        {            ACPI_ERROR ((AE_INFO, "Object not a Buffer, type %s",                AcpiUtGetObjectTypeName (SourceDesc)));            return_ACPI_STATUS (AE_AML_OPERAND_TYPE);        }        Status = AcpiDsGetBufferArguments (SourceDesc);        if (ACPI_SUCCESS (Status))        {            /* Return an additional reference to the object */            ObjDesc = SourceDesc;//.........这里部分代码省略.........
开发者ID:cloudius-systems,项目名称:acpica,代码行数:101,


示例21: AcpiDsInitAmlWalk

ACPI_STATUSAcpiDsInitAmlWalk (    ACPI_WALK_STATE         *WalkState,    ACPI_PARSE_OBJECT       *Op,    ACPI_NAMESPACE_NODE     *MethodNode,    UINT8                   *AmlStart,    UINT32                  AmlLength,    ACPI_EVALUATE_INFO      *Info,    UINT8                   PassNumber){    ACPI_STATUS             Status;    ACPI_PARSE_STATE        *ParserState = &WalkState->ParserState;    ACPI_PARSE_OBJECT       *ExtraOp;    ACPI_FUNCTION_TRACE (DsInitAmlWalk);    WalkState->ParserState.Aml =    WalkState->ParserState.AmlStart = AmlStart;    WalkState->ParserState.AmlEnd =    WalkState->ParserState.PkgEnd = AmlStart + AmlLength;    /* The NextOp of the NextWalk will be the beginning of the method */    WalkState->NextOp = NULL;    WalkState->PassNumber = PassNumber;    if (Info)    {        WalkState->Params = Info->Parameters;        WalkState->CallerReturnDesc = &Info->ReturnObject;    }    Status = AcpiPsInitScope (&WalkState->ParserState, Op);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    if (MethodNode)    {        WalkState->ParserState.StartNode = MethodNode;        WalkState->WalkType = ACPI_WALK_METHOD;        WalkState->MethodNode = MethodNode;        WalkState->MethodDesc = AcpiNsGetAttachedObject (MethodNode);        /* Push start scope on scope stack and make it current  */        Status = AcpiDsScopeStackPush (MethodNode, ACPI_TYPE_METHOD, WalkState);        if (ACPI_FAILURE (Status))        {            return_ACPI_STATUS (Status);        }        /* Init the method arguments */        Status = AcpiDsMethodDataInitArgs (WalkState->Params,                    ACPI_METHOD_NUM_ARGS, WalkState);        if (ACPI_FAILURE (Status))        {            return_ACPI_STATUS (Status);        }    }    else    {        /*         * Setup the current scope.         * Find a Named Op that has a namespace node associated with it.         * search upwards from this Op.  Current scope is the first         * Op with a namespace node.         */        ExtraOp = ParserState->StartOp;        while (ExtraOp && !ExtraOp->Common.Node)        {            ExtraOp = ExtraOp->Common.Parent;        }        if (!ExtraOp)        {            ParserState->StartNode = NULL;        }        else        {            ParserState->StartNode = ExtraOp->Common.Node;        }        if (ParserState->StartNode)        {            /* Push start scope on scope stack and make it current  */            Status = AcpiDsScopeStackPush (ParserState->StartNode,                            ParserState->StartNode->Type, WalkState);            if (ACPI_FAILURE (Status))            {                return_ACPI_STATUS (Status);            }        }    }//.........这里部分代码省略.........
开发者ID:0xffea,项目名称:MINIX3,代码行数:101,


示例22: AcpiNsInitOneObject

static ACPI_STATUSAcpiNsInitOneObject (    ACPI_HANDLE             ObjHandle,    UINT32                  Level,    void                    *Context,    void                    **ReturnValue){    ACPI_OBJECT_TYPE        Type;    ACPI_STATUS             Status = AE_OK;    ACPI_INIT_WALK_INFO     *Info = (ACPI_INIT_WALK_INFO *) Context;    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_FUNCTION_NAME (NsInitOneObject);    Info->ObjectCount++;    /* And even then, we are only interested in a few object types */    Type = AcpiNsGetType (ObjHandle);    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        return (AE_OK);    }    /* Increment counters for object types we are looking for */    switch (Type)    {    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://.........这里部分代码省略.........
开发者ID:Paradoxianer,项目名称:haiku,代码行数:101,


示例23: AcpiDsStoreObjectToLocal

ACPI_STATUSAcpiDsStoreObjectToLocal (    UINT8                   Type,    UINT32                  Index,    ACPI_OPERAND_OBJECT     *ObjDesc,    ACPI_WALK_STATE         *WalkState){    ACPI_STATUS             Status;    ACPI_NAMESPACE_NODE     *Node;    ACPI_OPERAND_OBJECT     *CurrentObjDesc;    ACPI_OPERAND_OBJECT     *NewObjDesc;    ACPI_FUNCTION_TRACE (DsStoreObjectToLocal);    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Type=%2.2X Index=%u Obj=%p/n",        Type, Index, ObjDesc));    /* Parameter validation */    if (!ObjDesc)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    /* Get the namespace node for the arg/local */    Status = AcpiDsMethodDataGetNode (Type, Index, WalkState, &Node);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    CurrentObjDesc = AcpiNsGetAttachedObject (Node);    if (CurrentObjDesc == ObjDesc)    {        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!/n",            ObjDesc));        return_ACPI_STATUS (Status);    }    /*     * If the reference count on the object is more than one, we must     * take a copy of the object before we store.  A reference count     * of exactly 1 means that the object was just created during the     * evaluation of an expression, and we can safely use it since it     * is not used anywhere else.     */    NewObjDesc = ObjDesc;    if (ObjDesc->Common.ReferenceCount > 1)    {        Status = AcpiUtCopyIobjectToIobject (ObjDesc, &NewObjDesc, WalkState);        if (ACPI_FAILURE (Status))        {            return_ACPI_STATUS (Status);        }    }    /*     * If there is an object already in this slot, we either     * have to delete it, or if this is an argument and there     * is an object reference stored there, we have to do     * an indirect store!     */    if (CurrentObjDesc)    {        /*         * Check for an indirect store if an argument         * contains an object reference (stored as an Node).         * We don't allow this automatic dereferencing for         * locals, since a store to a local should overwrite         * anything there, including an object reference.         *         * If both Arg0 and Local0 contain RefOf (Local4):         *         * Store (1, Arg0)             - Causes indirect store to local4         * Store (1, Local0)           - Stores 1 in local0, overwriting         *                                  the reference to local4         * Store (1, DeRefof (Local0)) - Causes indirect store to local4         *         * Weird, but true.         */        if (Type == ACPI_REFCLASS_ARG)        {            /*             * If we have a valid reference object that came from RefOf(),             * do the indirect store             */            if ((ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) == ACPI_DESC_TYPE_OPERAND) &&                (CurrentObjDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&                (CurrentObjDesc->Reference.Class == ACPI_REFCLASS_REFOF))            {                ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,                        "Arg (%p) is an ObjRef(Node), storing in node %p/n",                        NewObjDesc, CurrentObjDesc));                /*                 * Store this object to the Node (perform the indirect store)                 * NOTE: No implicit conversion is performed, as per the ACPI                 * specification rules on storing to Locals/Args.                 *///.........这里部分代码省略.........
开发者ID:ksashtekar,项目名称:Ganoid,代码行数:101,


示例24: AcpiDsEvalBufferFieldOperands

ACPI_STATUSAcpiDsEvalBufferFieldOperands (    ACPI_WALK_STATE         *WalkState,    ACPI_PARSE_OBJECT       *Op){    ACPI_STATUS             Status;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_NAMESPACE_NODE     *Node;    ACPI_PARSE_OBJECT       *NextOp;    ACPI_FUNCTION_TRACE_PTR (DsEvalBufferFieldOperands, Op);    /*     * This is where we evaluate the address and length fields of the     * CreateXxxField declaration     */    Node =  Op->Common.Node;    /* NextOp points to the op that holds the Buffer */    NextOp = Op->Common.Value.Arg;    /* Evaluate/create the address and length operands */    Status = AcpiDsCreateOperands (WalkState, NextOp);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        return_ACPI_STATUS (AE_NOT_EXIST);    }    /* Resolve the operands */    Status = AcpiExResolveOperands (Op->Common.AmlOpcode,                                    ACPI_WALK_OPERANDS, WalkState);    if (ACPI_FAILURE (Status))    {        ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X",                     AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Status));        return_ACPI_STATUS (Status);    }    /* Initialize the Buffer Field */    if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)    {        /* NOTE: Slightly different operands for this opcode */        Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,                                        WalkState->Operands[0], WalkState->Operands[1],                                        WalkState->Operands[2], WalkState->Operands[3]);    }    else    {        /* All other, CreateXxxField opcodes */        Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,                                        WalkState->Operands[0], WalkState->Operands[1],                                        NULL, WalkState->Operands[2]);    }    return_ACPI_STATUS (Status);}
开发者ID:michas2,项目名称:l4re-snapshot,代码行数:71,


示例25: AcpiDbDecodeAndDisplayObject

//.........这里部分代码省略.........            Node = ObjPtr;            goto DumpNte;        case ACPI_DESC_TYPE_OPERAND:            /* This is a ACPI OPERAND OBJECT */            if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))            {                AcpiOsPrintf ("Cannot read entire ACPI object at address %p/n", ObjPtr);                return;            }            AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);            AcpiExDumpObjectDescriptor (ObjPtr, 1);            break;        case ACPI_DESC_TYPE_PARSER:            /* This is a Parser Op object */            if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))            {                AcpiOsPrintf ("Cannot read entire Parser object at address %p/n", ObjPtr);                return;            }            AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, ACPI_UINT32_MAX);            AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);            break;        default:            /* Is not a recognizeable object */            Size = 16;            if (AcpiOsReadable (ObjPtr, 64))            {                Size = 64;            }            /* Just dump some memory */            AcpiUtDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);            break;        }        return;    }    /* The parameter is a name string that must be resolved to a Named obj */    Node = AcpiDbLocalNsLookup (Target);    if (!Node)    {        return;    }DumpNte:    /* Now dump the Named obj */    Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf);    if (ACPI_FAILURE (Status))    {        AcpiOsPrintf ("Could not convert name to pathname/n");    }    else    {        AcpiOsPrintf ("Object (%p) Pathname:  %s/n", Node, (char *) RetBuf.Pointer);    }    if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))    {        AcpiOsPrintf ("Invalid Named object at address %p/n", Node);        return;    }    AcpiUtDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE), Display, ACPI_UINT32_MAX);    AcpiExDumpNode (Node, 1);    ObjDesc = AcpiNsGetAttachedObject (Node);    if (ObjDesc)    {        AcpiOsPrintf ("/nAttached Object (%p):/n", ObjDesc);        if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))        {            AcpiOsPrintf ("Invalid internal ACPI Object at address %p/n", ObjDesc);            return;        }        AcpiUtDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);        AcpiExDumpObjectDescriptor (ObjDesc, 1);    }}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:101,


示例26: AcpiDsEvalRegionOperands

ACPI_STATUSAcpiDsEvalRegionOperands (    ACPI_WALK_STATE         *WalkState,    ACPI_PARSE_OBJECT       *Op){    ACPI_STATUS             Status;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *OperandDesc;    ACPI_NAMESPACE_NODE     *Node;    ACPI_PARSE_OBJECT       *NextOp;    ACPI_FUNCTION_TRACE_PTR (DsEvalRegionOperands, Op);    /*     * This is where we evaluate the address and length fields of the     * OpRegion declaration     */    Node =  Op->Common.Node;    /* NextOp points to the op that holds the SpaceID */    NextOp = Op->Common.Value.Arg;    /* NextOp points to address op */    NextOp = NextOp->Common.Next;    /* Evaluate/create the address and length operands */    Status = AcpiDsCreateOperands (WalkState, NextOp);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Resolve the length and address operands to numbers */    Status = AcpiExResolveOperands (Op->Common.AmlOpcode,                                    ACPI_WALK_OPERANDS, WalkState);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        return_ACPI_STATUS (AE_NOT_EXIST);    }    /*     * Get the length operand and save it     * (at Top of stack)     */    OperandDesc = WalkState->Operands[WalkState->NumOperands - 1];    ObjDesc->Region.Length = (UINT32) OperandDesc->Integer.Value;    AcpiUtRemoveReference (OperandDesc);    /*     * Get the address and save it     * (at top of stack - 1)     */    OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];    ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS)                              OperandDesc->Integer.Value;    AcpiUtRemoveReference (OperandDesc);    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X/n",                       ObjDesc,                       ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),                       ObjDesc->Region.Length));    /* Now the address and length are valid for this opregion */    ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;    return_ACPI_STATUS (Status);}
开发者ID:michas2,项目名称:l4re-snapshot,代码行数:82,


示例27: AcpiDsLoad1EndOp

//.........这里部分代码省略.........         */        if (!WalkState->MethodNode)        {            if (WalkState->Opcode == AML_FIELD_OP          ||                WalkState->Opcode == AML_BANK_FIELD_OP     ||                WalkState->Opcode == AML_INDEX_FIELD_OP)            {                Status = AcpiDsInitFieldObjects (Op, WalkState);            }        }        return_ACPI_STATUS (Status);    }    /*     * If we are executing a method, do not create any namespace objects     * during the load phase, only during execution.     */    if (!WalkState->MethodNode)    {        if (Op->Common.AmlOpcode == AML_REGION_OP)        {            Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,                        (ACPI_ADR_SPACE_TYPE) ((Op->Common.Value.Arg)->Common.Value.Integer),                        WalkState);            if (ACPI_FAILURE (Status))            {                return_ACPI_STATUS (Status);            }        }        else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)        {            Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,                        ACPI_ADR_SPACE_DATA_TABLE, WalkState);            if (ACPI_FAILURE (Status))            {                return_ACPI_STATUS (Status);            }        }    }#endif    if (Op->Common.AmlOpcode == AML_NAME_OP)    {        /* For Name opcode, get the object type from the argument */        if (Op->Common.Value.Arg)        {            ObjectType = (AcpiPsGetOpcodeInfo (                (Op->Common.Value.Arg)->Common.AmlOpcode))->ObjectType;            /* Set node type if we have a namespace node */            if (Op->Common.Node)            {                Op->Common.Node->Type = (UINT8) ObjectType;            }        }    }    /*     * If we are executing a method, do not create any namespace objects     * during the load phase, only during execution.     */    if (!WalkState->MethodNode)    {        if (Op->Common.AmlOpcode == AML_METHOD_OP)        {            /*             * MethodOp PkgLength NameString MethodFlags TermList             *             * Note: We must create the method node/object pair as soon as we             * see the method declaration. This allows later pass1 parsing             * of invocations of the method (need to know the number of             * arguments.)             */            ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,                "LOADING-Method: State=%p Op=%p NamedObj=%p/n",                WalkState, Op, Op->Named.Node));            if (!AcpiNsGetAttachedObject (Op->Named.Node))            {                WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);                WalkState->NumOperands = 1;                Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);                if (ACPI_SUCCESS (Status))                {                    Status = AcpiExCreateMethod (Op->Named.Data,                                        Op->Named.Length, WalkState);                }                WalkState->Operands[0] = NULL;                WalkState->NumOperands = 0;                if (ACPI_FAILURE (Status))                {                    return_ACPI_STATUS (Status);                }            }        }
开发者ID:victoredwardocallaghan,项目名称:DragonFlyBSD,代码行数:101,


示例28: AcpiExPrepFieldValue

ACPI_STATUSAcpiExPrepFieldValue (    ACPI_CREATE_FIELD_INFO  *Info){    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_OPERAND_OBJECT     *SecondDesc = NULL;    ACPI_STATUS             Status;    UINT32                  AccessByteWidth;    UINT32                  Type;    ACPI_FUNCTION_TRACE (ExPrepFieldValue);    /* Parameter validation */    if (Info->FieldType != ACPI_TYPE_LOCAL_INDEX_FIELD)    {        if (!Info->RegionNode)        {            ACPI_ERROR ((AE_INFO, "Null RegionNode"));            return_ACPI_STATUS (AE_AML_NO_OPERAND);        }        Type = AcpiNsGetType (Info->RegionNode);        if (Type != ACPI_TYPE_REGION)        {            ACPI_ERROR ((AE_INFO, "Needed Region, found type 0x%X (%s)",                Type, AcpiUtGetTypeName (Type)));            return_ACPI_STATUS (AE_AML_OPERAND_TYPE);        }    }    /* Allocate a new field object */    ObjDesc = AcpiUtCreateInternalObject (Info->FieldType);    if (!ObjDesc)    {        return_ACPI_STATUS (AE_NO_MEMORY);    }    /* Initialize areas of the object that are common to all fields */    ObjDesc->CommonField.Node = Info->FieldNode;    Status = AcpiExPrepCommonFieldObject (ObjDesc,                Info->FieldFlags, Info->Attribute,                Info->FieldBitPosition, Info->FieldBitLength);    if (ACPI_FAILURE (Status))    {        AcpiUtDeleteObjectDesc (ObjDesc);        return_ACPI_STATUS (Status);    }    /* Initialize areas of the object that are specific to the field type */    switch (Info->FieldType)    {    case ACPI_TYPE_LOCAL_REGION_FIELD:        ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode);        /* Fields specific to GenericSerialBus fields */        ObjDesc->Field.AccessLength = Info->AccessLength;        if (Info->ConnectionNode)        {            SecondDesc = Info->ConnectionNode->Object;            if (!(SecondDesc->Common.Flags & AOPOBJ_DATA_VALID))            {                Status = AcpiDsGetBufferArguments (SecondDesc);                if (ACPI_FAILURE (Status))                {                    AcpiUtDeleteObjectDesc (ObjDesc);                    return_ACPI_STATUS (Status);                }            }            ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer;            ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length;        }        else if (Info->ResourceBuffer)        {            ObjDesc->Field.ResourceBuffer = Info->ResourceBuffer;            ObjDesc->Field.ResourceLength = Info->ResourceLength;        }        /* Allow full data read from EC address space */        if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&            (ObjDesc->CommonField.BitLength > 8))        {            AccessByteWidth = ACPI_ROUND_BITS_UP_TO_BYTES (                ObjDesc->CommonField.BitLength);            /* Maximum byte width supported is 255 */            if (AccessByteWidth < 256)            {//.........这里部分代码省略.........
开发者ID:CSharpLover,项目名称:MosquitOS,代码行数:101,



注:本文中的AcpiNsGetAttachedObject函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ AcpiNsGetExternalPathname函数代码示例
C++ AcpiHwWrite函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。