⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exresolv.c

📁 acpi tools for linux include acpiexec and acpixtract
💻 C
📖 第 1 页 / 共 2 页
字号:
                ACPI_ERROR ((AE_INFO,                    "Unknown TargetType %X in Index/Reference object %p",                    StackDesc->Reference.TargetType, StackDesc));                Status = AE_AML_INTERNAL;                break;            }            break;        case AML_REF_OF_OP:        case AML_DEBUG_OP:        case AML_LOAD_OP:            /* Just leave the object as-is, do not dereference */            break;        case AML_INT_NAMEPATH_OP:   /* Reference to a named object */            /* Dereference the name */            if ((StackDesc->Reference.Node->Type == ACPI_TYPE_DEVICE) ||                (StackDesc->Reference.Node->Type == ACPI_TYPE_THERMAL))            {                /* These node types do not have 'real' subobjects */                *StackPtr = (void *) StackDesc->Reference.Node;            }            else            {                /* Get the object pointed to by the namespace node */                *StackPtr = (StackDesc->Reference.Node)->Object;                AcpiUtAddReference (*StackPtr);            }            AcpiUtRemoveReference (StackDesc);            break;        default:            ACPI_ERROR ((AE_INFO,                "Unknown Reference opcode %X (%s) in %p",                Opcode, AcpiPsGetOpcodeName (Opcode), StackDesc));            Status = AE_AML_INTERNAL;            break;        }        break;    case ACPI_TYPE_BUFFER:        Status = AcpiDsGetBufferArguments (StackDesc);        break;    case ACPI_TYPE_PACKAGE:        Status = AcpiDsGetPackageArguments (StackDesc);        break;    case ACPI_TYPE_BUFFER_FIELD:    case ACPI_TYPE_LOCAL_REGION_FIELD:    case ACPI_TYPE_LOCAL_BANK_FIELD:    case ACPI_TYPE_LOCAL_INDEX_FIELD:        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead SourceDesc=%p Type=%X\n",            StackDesc, ACPI_GET_OBJECT_TYPE (StackDesc)));        Status = AcpiExReadDataFromField (WalkState, StackDesc, &ObjDesc);        /* Remove a reference to the original operand, then override */        AcpiUtRemoveReference (*StackPtr);        *StackPtr = (void *) ObjDesc;        break;    default:        break;    }    return_ACPI_STATUS (Status);}/******************************************************************************* * * FUNCTION:    AcpiExResolveMultiple * * PARAMETERS:  WalkState           - Current state (contains AML opcode) *              Operand             - Starting point for resolution *              ReturnType          - Where the object type is returned *              ReturnDesc          - Where the resolved object is returned * * RETURN:      Status * * DESCRIPTION: Return the base object and type.  Traverse a reference list if *              necessary to get to the base object. * ******************************************************************************/ACPI_STATUSAcpiExResolveMultiple (    ACPI_WALK_STATE         *WalkState,    ACPI_OPERAND_OBJECT     *Operand,    ACPI_OBJECT_TYPE        *ReturnType,    ACPI_OPERAND_OBJECT     **ReturnDesc){    ACPI_OPERAND_OBJECT     *ObjDesc = (void *) Operand;    ACPI_NAMESPACE_NODE     *Node;    ACPI_OBJECT_TYPE        Type;    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE (AcpiExResolveMultiple);    /* Operand can be either a namespace node or an operand descriptor */    switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))    {    case ACPI_DESC_TYPE_OPERAND:        Type = ObjDesc->Common.Type;        break;    case ACPI_DESC_TYPE_NAMED:        Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;        ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);        /* If we had an Alias node, use the attached object for type info */        if (Type == ACPI_TYPE_LOCAL_ALIAS)        {            Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;            ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);        }        break;    default:        return_ACPI_STATUS (AE_AML_OPERAND_TYPE);    }    /* If type is anything other than a reference, we are done */    if (Type != ACPI_TYPE_LOCAL_REFERENCE)    {        goto Exit;    }    /*     * For reference objects created via the RefOf, Index, or Load/LoadTable     * operators, we need to get to the base object (as per the ACPI     * specification of the ObjectType and SizeOf operators). This means     * traversing the list of possibly many nested references.     */    while (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_LOCAL_REFERENCE)    {        switch (ObjDesc->Reference.Opcode)        {        case AML_REF_OF_OP:        case AML_INT_NAMEPATH_OP:            /* Dereference the reference pointer */            if (ObjDesc->Reference.Opcode == AML_REF_OF_OP)            {                Node = ObjDesc->Reference.Object;            }            else /* AML_INT_NAMEPATH_OP */            {                Node = ObjDesc->Reference.Node;            }            /* All "References" point to a NS node */            if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)            {                ACPI_ERROR ((AE_INFO,                    "Not a NS node %p [%s]",                    Node, AcpiUtGetDescriptorName (Node)));                return_ACPI_STATUS (AE_AML_INTERNAL);            }            /* Get the attached object */            ObjDesc = AcpiNsGetAttachedObject (Node);            if (!ObjDesc)            {                /* No object, use the NS node type */                Type = AcpiNsGetType (Node);                goto Exit;            }            /* Check for circular references */            if (ObjDesc == Operand)            {                return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE);            }            break;        case AML_INDEX_OP:            /* Get the type of this reference (index into another object) */            Type = ObjDesc->Reference.TargetType;            if (Type != ACPI_TYPE_PACKAGE)            {                goto Exit;            }            /*             * The main object is a package, we want to get the type             * of the individual package element that is referenced by             * the index.             *             * This could of course in turn be another reference object.             */            ObjDesc = *(ObjDesc->Reference.Where);            if (!ObjDesc)            {                /* NULL package elements are allowed */                Type = 0; /* Uninitialized */                goto Exit;            }            break;        case AML_LOAD_OP:            Type = ACPI_TYPE_DDB_HANDLE;            goto Exit;        case AML_LOCAL_OP:        case AML_ARG_OP:            if (ReturnDesc)            {                Status = AcpiDsMethodDataGetValue (ObjDesc->Reference.Opcode,                            ObjDesc->Reference.Offset, WalkState, &ObjDesc);                if (ACPI_FAILURE (Status))                {                    return_ACPI_STATUS (Status);                }                AcpiUtRemoveReference (ObjDesc);            }            else            {                Status = AcpiDsMethodDataGetNode (ObjDesc->Reference.Opcode,                            ObjDesc->Reference.Offset, WalkState, &Node);                if (ACPI_FAILURE (Status))                {                    return_ACPI_STATUS (Status);                }                ObjDesc = AcpiNsGetAttachedObject (Node);                if (!ObjDesc)                {                    Type = ACPI_TYPE_ANY;                    goto Exit;                }            }            break;        case AML_DEBUG_OP:            /* The Debug Object is of type "DebugObject" */            Type = ACPI_TYPE_DEBUG_OBJECT;            goto Exit;        default:            ACPI_ERROR ((AE_INFO,                "Unknown Reference subtype %X",                ObjDesc->Reference.Opcode));            return_ACPI_STATUS (AE_AML_INTERNAL);        }    }    /*     * Now we are guaranteed to have an object that has not been created     * via the RefOf or Index operators.     */    Type = ACPI_GET_OBJECT_TYPE (ObjDesc);Exit:    /* Convert internal types to external types */    switch (Type)    {    case ACPI_TYPE_LOCAL_REGION_FIELD:    case ACPI_TYPE_LOCAL_BANK_FIELD:    case ACPI_TYPE_LOCAL_INDEX_FIELD:        Type = ACPI_TYPE_FIELD_UNIT;        break;    case ACPI_TYPE_LOCAL_SCOPE:        /* Per ACPI Specification, Scope is untyped */        Type = ACPI_TYPE_ANY;        break;    default:        /* No change to Type required */        break;    }    *ReturnType = Type;    if (ReturnDesc)    {        *ReturnDesc = ObjDesc;    }    return_ACPI_STATUS (AE_OK);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -