diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-08-25 19:41:12 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-08-25 19:41:12 +0000 |
commit | c25a97c7b4f09b4c9efa992434d341f5b89629ff (patch) | |
tree | 2fa9d2167f719968f73daa4ec16528a068d308ad /source/components/disassembler/dmwalk.c | |
parent | 136eac2a0638d3c751b1987603f71a9ae26879fd (diff) |
Notes
Diffstat (limited to 'source/components/disassembler/dmwalk.c')
-rw-r--r-- | source/components/disassembler/dmwalk.c | 65 |
1 files changed, 41 insertions, 24 deletions
diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 8ae0dc8d86d23..8cbc1c3f9a7e3 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -45,12 +45,9 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" -#include "acdisasm.h" #include "acdebug.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmwalk") @@ -117,10 +114,11 @@ AcpiDmDisassemble ( return; } - Info.Flags = 0; - Info.Level = 0; - Info.Count = 0; + memset (&Info, 0, sizeof (ACPI_OP_WALK_INFO)); Info.WalkState = WalkState; + Info.StartAml = Op->Common.Aml - sizeof (ACPI_TABLE_HEADER); + Info.AmlOffset = Op->Common.Aml - Info.StartAml; + AcpiDmWalkParseTree (Op, AcpiDmDescendingOp, AcpiDmAscendingOp, &Info); return; } @@ -415,20 +413,40 @@ AcpiDmDescendingOp ( UINT32 AmlOffset; - if (AcpiGbl_DbOpt_Verbose && AcpiGbl_PreviousOp) + OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); + + /* Listing support to dump the AML code after the ASL statement */ + + if (AcpiGbl_DmOpt_Listing) { - /* Dump the entire statement in AML byte code */ + /* We only care about these classes of objects */ - if (Op->Common.Aml > AcpiGbl_PreviousOp->Common.Aml) + if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) || + (OpInfo->Class == AML_CLASS_CONTROL) || + (OpInfo->Class == AML_CLASS_CREATE) || + ((OpInfo->Class == AML_CLASS_EXECUTE) && (!Op->Common.Next))) { - AcpiOsPrintf ("\n"); - AcpiUtDumpBuffer (AcpiGbl_PreviousOp->Common.Aml, - (Op->Common.Aml - AcpiGbl_PreviousOp->Common.Aml), - DB_BYTE_DISPLAY, 0); - AcpiDmIndent (Level); + if (AcpiGbl_DmOpt_Listing && Info->PreviousAml) + { + /* Dump the AML byte code for the previous Op */ + + if (Op->Common.Aml > Info->PreviousAml) + { + AcpiOsPrintf ("\n"); + AcpiUtDumpBuffer ( + (Info->StartAml + Info->AmlOffset), + (Op->Common.Aml - Info->PreviousAml), + DB_BYTE_DISPLAY, + Info->AmlOffset); + AcpiOsPrintf ("\n"); + } + + Info->AmlOffset = (Op->Common.Aml - Info->StartAml); + } + + Info->PreviousAml = Op->Common.Aml; } } - AcpiGbl_PreviousOp = Op; if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE) { @@ -447,10 +465,13 @@ AcpiDmDescendingOp ( { AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml, Info->WalkState->ParserState.AmlStart); - VERBOSE_PRINT ((DB_FULL_OP_INFO, - (Info->WalkState->MethodNode ? - Info->WalkState->MethodNode->Name.Ascii : " "), - AmlOffset, (UINT32) Op->Common.AmlOpcode)); + if (AcpiGbl_DmOpt_Verbose) + { + AcpiOsPrintf (DB_FULL_OP_INFO, + (Info->WalkState->MethodNode ? + Info->WalkState->MethodNode->Name.Ascii : " "), + AmlOffset, (UINT32) Op->Common.AmlOpcode); + } } if (Op->Common.AmlOpcode == AML_SCOPE_OP) @@ -541,8 +562,6 @@ AcpiDmDescendingOp ( /* Start the opcode argument list if necessary */ - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - if ((OpInfo->Flags & AML_HAS_ARGS) || (Op->Common.AmlOpcode == AML_EVENT_OP)) { @@ -582,7 +601,7 @@ AcpiDmDescendingOp ( if (Op->Common.AmlOpcode != AML_INT_NAMEDFIELD_OP) { - if (AcpiGbl_DbOpt_Verbose) + if (AcpiGbl_DmOpt_Verbose) { (void) AcpiPsDisplayObjectPathname (NULL, Op); } @@ -1046,5 +1065,3 @@ AcpiDmAscendingOp ( return (AE_OK); } - -#endif /* ACPI_DISASSEMBLER */ |