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

📄 dmopcode.c

📁 acpi tools for linux include acpiexec and acpixtract
💻 C
📖 第 1 页 / 共 2 页
字号:
    NextOp = NextOp->Common.Next;    NextOp->Common.DisasmOpcode = ACPI_DASM_MATCHOP;}/******************************************************************************* * * FUNCTION:    AcpiDmMatchKeyword * * PARAMETERS:  Op              - Match Object to be examined * * RETURN:      None * * DESCRIPTION: Decode Match opcode operands * ******************************************************************************/static voidAcpiDmMatchKeyword (    ACPI_PARSE_OBJECT       *Op){    if (((UINT32) Op->Common.Value.Integer) > ACPI_MAX_MATCH_OPCODE)    {        AcpiOsPrintf ("/* Unknown Match Keyword encoding */");    }    else    {        AcpiOsPrintf ("%s", ACPI_CAST_PTR (char,            AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]));    }}/******************************************************************************* * * FUNCTION:    AcpiDmDisassembleOneOp * * PARAMETERS:  WalkState           - Current walk info *              Info                - Parse tree walk info *              Op                  - Op that is to be printed * * RETURN:      None * * DESCRIPTION: Disassemble a single AML opcode * ******************************************************************************/voidAcpiDmDisassembleOneOp (    ACPI_WALK_STATE         *WalkState,    ACPI_OP_WALK_INFO       *Info,    ACPI_PARSE_OBJECT       *Op){    const ACPI_OPCODE_INFO  *OpInfo = NULL;    UINT32                  Offset;    UINT32                  Length;    ACPI_PARSE_OBJECT       *Child;    ACPI_STATUS             Status;    if (!Op)    {        AcpiOsPrintf ("<NULL OP PTR>");        return;    }    switch (Op->Common.DisasmOpcode)    {    case ACPI_DASM_MATCHOP:        AcpiDmMatchKeyword (Op);        return;    case ACPI_DASM_LNOT_SUFFIX:        switch (Op->Common.AmlOpcode)        {        case AML_LEQUAL_OP:            AcpiOsPrintf ("LNotEqual");            break;        case AML_LGREATER_OP:            AcpiOsPrintf ("LLessEqual");            break;        case AML_LLESS_OP:            AcpiOsPrintf ("LGreaterEqual");            break;        default:            break;        }        Op->Common.DisasmOpcode = 0;        Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;        return;    default:        break;    }    OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);    /* The op and arguments */    switch (Op->Common.AmlOpcode)    {    case AML_LNOT_OP:        Child = Op->Common.Value.Arg;        if ((Child->Common.AmlOpcode == AML_LEQUAL_OP) ||            (Child->Common.AmlOpcode == AML_LGREATER_OP) ||            (Child->Common.AmlOpcode == AML_LLESS_OP))        {            Child->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX;            Op->Common.DisasmOpcode = ACPI_DASM_LNOT_PREFIX;        }        else        {            AcpiOsPrintf ("%s", OpInfo->Name);        }        break;    case AML_BYTE_OP:        AcpiOsPrintf ("0x%2.2X", (UINT32) Op->Common.Value.Integer);        break;    case AML_WORD_OP:        if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID)        {            AcpiDmEisaId ((UINT32) Op->Common.Value.Integer);        }        else        {            AcpiOsPrintf ("0x%4.4X", (UINT32) Op->Common.Value.Integer);        }        break;    case AML_DWORD_OP:        if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID)        {            AcpiDmEisaId ((UINT32) Op->Common.Value.Integer);        }        else        {            AcpiOsPrintf ("0x%8.8X", (UINT32) Op->Common.Value.Integer);        }        break;    case AML_QWORD_OP:        AcpiOsPrintf ("0x%8.8X%8.8X", Op->Common.Value.Integer64.Hi,                                      Op->Common.Value.Integer64.Lo);        break;    case AML_STRING_OP:        AcpiUtPrintString (Op->Common.Value.String, ACPI_UINT8_MAX);        break;    case AML_BUFFER_OP:        /*         * Determine the type of buffer.  We can have one of the following:         *         * 1) ResourceTemplate containing Resource Descriptors.         * 2) Unicode String buffer         * 3) ASCII String buffer         * 4) Raw data buffer (if none of the above)         *         * Since there are no special AML opcodes to differentiate these         * types of buffers, we have to closely look at the data in the         * buffer to determine the type.         */        Status = AcpiDmIsResourceTemplate (Op);        if (ACPI_SUCCESS (Status))        {            Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;            AcpiOsPrintf ("ResourceTemplate");            break;        }        else if (Status == AE_AML_NO_RESOURCE_END_TAG)        {            AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ ");        }        if (AcpiDmIsUnicodeBuffer (Op))        {            Op->Common.DisasmOpcode = ACPI_DASM_UNICODE;            AcpiOsPrintf ("Unicode (");        }        else if (AcpiDmIsStringBuffer (Op))        {            Op->Common.DisasmOpcode = ACPI_DASM_STRING;            AcpiOsPrintf ("Buffer");        }        else        {            Op->Common.DisasmOpcode = ACPI_DASM_BUFFER;            AcpiOsPrintf ("Buffer");        }        break;    case AML_INT_STATICSTRING_OP:        if (Op->Common.Value.String)        {            AcpiOsPrintf ("%s", Op->Common.Value.String);        }        else        {            AcpiOsPrintf ("\"<NULL STATIC STRING PTR>\"");        }        break;    case AML_INT_NAMEPATH_OP:        AcpiDmNamestring (Op->Common.Value.Name);        break;    case AML_INT_NAMEDFIELD_OP:        Length = AcpiDmDumpName ((char *) &Op->Named.Name);        AcpiOsPrintf (",%*.s  %d", (int) (5 - Length), " ",            (UINT32) Op->Common.Value.Integer);        AcpiDmCommaIfFieldMember (Op);        Info->BitOffset += (UINT32) Op->Common.Value.Integer;        break;    case AML_INT_RESERVEDFIELD_OP:        /* Offset() -- Must account for previous offsets */        Offset = (UINT32) Op->Common.Value.Integer;        Info->BitOffset += Offset;        if (Info->BitOffset % 8 == 0)        {            AcpiOsPrintf ("        Offset (0x%.2X)", ACPI_DIV_8 (Info->BitOffset));        }        else        {            AcpiOsPrintf ("    ,   %d", Offset);        }        AcpiDmCommaIfFieldMember (Op);        break;    case AML_INT_ACCESSFIELD_OP:        AcpiOsPrintf ("        AccessAs (%s, ",            AcpiGbl_AccessTypes [(UINT32) (Op->Common.Value.Integer >> 8) & 0x7]);        AcpiDmDecodeAttribute ((UINT8) Op->Common.Value.Integer);        AcpiOsPrintf (")");        AcpiDmCommaIfFieldMember (Op);        break;    case AML_INT_BYTELIST_OP:        AcpiDmByteList (Info, Op);        break;    case AML_INT_METHODCALL_OP:        Op = AcpiPsGetDepthNext (NULL, Op);        Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;        AcpiDmNamestring (Op->Common.Value.Name);        break;    default:        /* Just get the opcode name and print it */        AcpiOsPrintf ("%s", OpInfo->Name);#ifdef ACPI_DEBUGGER        if ((Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) &&            (WalkState) &&            (WalkState->Results) &&            (WalkState->ResultCount))        {            AcpiDmDecodeInternalObject (                WalkState->Results->Results.ObjDesc [                    (WalkState->ResultCount - 1) %                        ACPI_RESULTS_FRAME_OBJ_NUM]);        }#endif        break;    }}#endif  /* ACPI_DISASSEMBLER */

⌨️ 快捷键说明

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