diff options
Diffstat (limited to 'sys/contrib/dev/acpica/dmopcode.c')
-rw-r--r-- | sys/contrib/dev/acpica/dmopcode.c | 99 |
1 files changed, 38 insertions, 61 deletions
diff --git a/sys/contrib/dev/acpica/dmopcode.c b/sys/contrib/dev/acpica/dmopcode.c index bdb9eef..934d4ba 100644 --- a/sys/contrib/dev/acpica/dmopcode.c +++ b/sys/contrib/dev/acpica/dmopcode.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dmopcode - AML disassembler, specific AML opcodes - * $Revision: 1.101 $ + * $Revision: 85 $ * ******************************************************************************/ @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. * All rights reserved. * * 2. License @@ -202,16 +202,16 @@ AcpiDmFieldFlags ( UINT32 Flags; - /* The next peer Op (not child op) contains the flags */ + /* The next Op contains the flags */ - Op = Op->Common.Next; + Op = AcpiPsGetDepthNext (NULL, Op); Flags = (UINT8) Op->Common.Value.Integer; /* Mark the Op as completed */ Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; - AcpiOsPrintf ("%s, ", AcpiGbl_AccessTypes [Flags & 0x07]); + AcpiOsPrintf ("%s, ", AcpiGbl_AccessTypes [Flags & 0x0F]); AcpiOsPrintf ("%s, ", AcpiGbl_LockRule [(Flags & 0x10) >> 4]); AcpiOsPrintf ("%s)", AcpiGbl_UpdateRules [(Flags & 0x60) >> 5]); } @@ -340,14 +340,14 @@ AcpiDmMatchKeyword ( { - if (((UINT32) Op->Common.Value.Integer) > ACPI_MAX_MATCH_OPCODE) + if (((UINT32) Op->Common.Value.Integer) >= ACPI_NUM_MATCH_OPS) { AcpiOsPrintf ("/* Unknown Match Keyword encoding */"); } else { - AcpiOsPrintf ("%s", ACPI_CAST_PTR (char, - AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer])); + AcpiOsPrintf ("%s", (char *) (uintptr_t) + AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]); } } @@ -375,8 +375,6 @@ AcpiDmDisassembleOneOp ( const ACPI_OPCODE_INFO *OpInfo = NULL; UINT32 Offset; UINT32 Length; - ACPI_PARSE_OBJECT *Child; - ACPI_STATUS Status; if (!Op) @@ -392,52 +390,38 @@ AcpiDmDisassembleOneOp ( 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; - } - 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: + case AML_ZERO_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); - } + AcpiOsPrintf ("Zero"); break; + + case AML_ONE_OP: + + AcpiOsPrintf ("One"); + break; + + + case AML_ONES_OP: + + AcpiOsPrintf ("Ones"); + break; + + + case AML_REVISION_OP: + + AcpiOsPrintf ("Revision"); + break; + + case AML_BYTE_OP: AcpiOsPrintf ("0x%2.2X", (UINT32) Op->Common.Value.Integer); @@ -497,19 +481,12 @@ AcpiDmDisassembleOneOp ( * 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)) + if (AcpiDmIsResourceTemplate (Op)) { 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)) + else if (AcpiDmIsUnicodeBuffer (Op)) { Op->Common.DisasmOpcode = ACPI_DASM_UNICODE; AcpiOsPrintf ("Unicode ("); @@ -566,7 +543,7 @@ AcpiDmDisassembleOneOp ( if (Info->BitOffset % 8 == 0) { - AcpiOsPrintf (" Offset (0x%.2X)", ACPI_DIV_8 (Info->BitOffset)); + AcpiOsPrintf ("Offset (0x%.2X)", ACPI_DIV_8 (Info->BitOffset)); } else { @@ -579,8 +556,8 @@ AcpiDmDisassembleOneOp ( case AML_INT_ACCESSFIELD_OP: - AcpiOsPrintf (" AccessAs (%s, ", - AcpiGbl_AccessTypes [(UINT32) (Op->Common.Value.Integer >> 8) & 0x7]); + AcpiOsPrintf ("AccessAs (%s, ", + AcpiGbl_AccessTypes [(UINT32) Op->Common.Value.Integer >> 8]); AcpiDmDecodeAttribute ((UINT8) Op->Common.Value.Integer); AcpiOsPrintf (")"); @@ -596,6 +573,7 @@ AcpiDmDisassembleOneOp ( case AML_INT_METHODCALL_OP: + OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); Op = AcpiPsGetDepthNext (NULL, Op); Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; @@ -607,6 +585,7 @@ AcpiDmDisassembleOneOp ( /* Just get the opcode name and print it */ + OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); AcpiOsPrintf ("%s", OpInfo->Name); @@ -615,15 +594,13 @@ AcpiDmDisassembleOneOp ( if ((Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) && (WalkState) && (WalkState->Results) && - (WalkState->ResultCount)) + (WalkState->Results->Results.NumResults)) { AcpiDmDecodeInternalObject ( WalkState->Results->Results.ObjDesc [ - (WalkState->ResultCount - 1) % - ACPI_RESULTS_FRAME_OBJ_NUM]); + WalkState->Results->Results.NumResults-1]); } #endif - break; } } |