diff options
Diffstat (limited to 'sys/contrib/dev/acpica/dmopcode.c')
-rw-r--r-- | sys/contrib/dev/acpica/dmopcode.c | 99 |
1 files changed, 61 insertions, 38 deletions
diff --git a/sys/contrib/dev/acpica/dmopcode.c b/sys/contrib/dev/acpica/dmopcode.c index 5e074b7..bdb9eef 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.90 $ + * $Revision: 1.101 $ * ******************************************************************************/ @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. * All rights reserved. * * 2. License @@ -202,16 +202,16 @@ AcpiDmFieldFlags ( UINT32 Flags; - /* The next Op contains the flags */ + /* The next peer Op (not child op) contains the flags */ - Op = AcpiPsGetDepthNext (NULL, Op); + Op = Op->Common.Next; Flags = (UINT8) Op->Common.Value.Integer; /* Mark the Op as completed */ Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; - AcpiOsPrintf ("%s, ", AcpiGbl_AccessTypes [Flags & 0x0F]); + AcpiOsPrintf ("%s, ", AcpiGbl_AccessTypes [Flags & 0x07]); 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_NUM_MATCH_OPS) + if (((UINT32) Op->Common.Value.Integer) > ACPI_MAX_MATCH_OPCODE) { AcpiOsPrintf ("/* Unknown Match Keyword encoding */"); } else { - AcpiOsPrintf ("%s", (char *) - AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer]); + AcpiOsPrintf ("%s", ACPI_CAST_PTR (char, + AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer])); } } @@ -375,6 +375,8 @@ AcpiDmDisassembleOneOp ( const ACPI_OPCODE_INFO *OpInfo = NULL; UINT32 Offset; UINT32 Length; + ACPI_PARSE_OBJECT *Child; + ACPI_STATUS Status; if (!Op) @@ -390,38 +392,52 @@ AcpiDmDisassembleOneOp ( AcpiDmMatchKeyword (Op); return; - default: - break; - } - - /* The op and arguments */ - - switch (Op->Common.AmlOpcode) - { - case AML_ZERO_OP: - - AcpiOsPrintf ("Zero"); - break; + 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_ONE_OP: + case AML_LLESS_OP: + AcpiOsPrintf ("LGreaterEqual"); + break; + } + Op->Common.DisasmOpcode = 0; + Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + return; - AcpiOsPrintf ("One"); + default: break; + } - case AML_ONES_OP: - - AcpiOsPrintf ("Ones"); - break; + OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); + /* The op and arguments */ - case AML_REVISION_OP: + switch (Op->Common.AmlOpcode) + { + case AML_LNOT_OP: - AcpiOsPrintf ("Revision"); + 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); @@ -481,12 +497,19 @@ AcpiDmDisassembleOneOp ( * types of buffers, we have to closely look at the data in the * buffer to determine the type. */ - if (AcpiDmIsResourceTemplate (Op)) + Status = AcpiDmIsResourceTemplate (Op); + if (ACPI_SUCCESS (Status)) { Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE; AcpiOsPrintf ("ResourceTemplate"); + break; } - else if (AcpiDmIsUnicodeBuffer (Op)) + 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 ("); @@ -543,7 +566,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 { @@ -556,8 +579,8 @@ AcpiDmDisassembleOneOp ( case AML_INT_ACCESSFIELD_OP: - AcpiOsPrintf ("AccessAs (%s, ", - AcpiGbl_AccessTypes [(UINT32) Op->Common.Value.Integer >> 8]); + AcpiOsPrintf (" AccessAs (%s, ", + AcpiGbl_AccessTypes [(UINT32) (Op->Common.Value.Integer >> 8) & 0x7]); AcpiDmDecodeAttribute ((UINT8) Op->Common.Value.Integer); AcpiOsPrintf (")"); @@ -573,7 +596,6 @@ AcpiDmDisassembleOneOp ( case AML_INT_METHODCALL_OP: - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); Op = AcpiPsGetDepthNext (NULL, Op); Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; @@ -585,7 +607,6 @@ AcpiDmDisassembleOneOp ( /* Just get the opcode name and print it */ - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); AcpiOsPrintf ("%s", OpInfo->Name); @@ -594,13 +615,15 @@ AcpiDmDisassembleOneOp ( if ((Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) && (WalkState) && (WalkState->Results) && - (WalkState->Results->Results.NumResults)) + (WalkState->ResultCount)) { AcpiDmDecodeInternalObject ( WalkState->Results->Results.ObjDesc [ - WalkState->Results->Results.NumResults-1]); + (WalkState->ResultCount - 1) % + ACPI_RESULTS_FRAME_OBJ_NUM]); } #endif + break; } } |