diff options
Diffstat (limited to 'source/components/disassembler')
-rw-r--r-- | source/components/disassembler/dmbuffer.c | 21 | ||||
-rw-r--r-- | source/components/disassembler/dmcstyle.c | 4 | ||||
-rw-r--r-- | source/components/disassembler/dmnames.c | 9 | ||||
-rw-r--r-- | source/components/disassembler/dmopcode.c | 4 | ||||
-rw-r--r-- | source/components/disassembler/dmresrc.c | 3 | ||||
-rw-r--r-- | source/components/disassembler/dmresrcl.c | 4 | ||||
-rw-r--r-- | source/components/disassembler/dmresrcl2.c | 4 | ||||
-rw-r--r-- | source/components/disassembler/dmresrcs.c | 4 | ||||
-rw-r--r-- | source/components/disassembler/dmutils.c | 3 | ||||
-rw-r--r-- | source/components/disassembler/dmwalk.c | 65 |
10 files changed, 50 insertions, 71 deletions
diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c index 2291bb2c8d224..7bab89fe4140e 100644 --- a/source/components/disassembler/dmbuffer.c +++ b/source/components/disassembler/dmbuffer.c @@ -50,8 +50,6 @@ #include "acinterp.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmbuffer") @@ -773,22 +771,19 @@ AcpiDmPldBuffer ( AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Reference", PldInfo->Reference); AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Rotation", PldInfo->Rotation); - if (ByteCount < ACPI_PLD_REV1_BUFFER_SIZE) - { - AcpiOsPrintf (ACPI_PLD_OUTPUT08P, "PLD_Order", PldInfo->Order); - } - else + if (ByteCount >= ACPI_PLD_REV2_BUFFER_SIZE) { AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Order", PldInfo->Order); - } - /* Fifth 32-bit dword */ + /* Fifth 32-bit dword */ - if (ByteCount >= ACPI_PLD_REV1_BUFFER_SIZE) - { - AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_VerticalOffset", PldInfo->VerticalOffset); + AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_VerticalOffset", PldInfo->VerticalOffset); AcpiOsPrintf (ACPI_PLD_OUTPUT16P, "PLD_HorizontalOffset", PldInfo->HorizontalOffset); } + else /* Rev 1 buffer */ + { + AcpiOsPrintf (ACPI_PLD_OUTPUT08P, "PLD_Order", PldInfo->Order); + } ACPI_FREE (PldInfo); } @@ -1030,5 +1025,3 @@ AcpiDmDecompressEisaId ( AcpiOsPrintf (" /* %s */", Info->Description); } } - -#endif diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c index a6ec689e157ee..04436a846c033 100644 --- a/source/components/disassembler/dmcstyle.c +++ b/source/components/disassembler/dmcstyle.c @@ -45,10 +45,8 @@ #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 ("dmcstyle") @@ -826,5 +824,3 @@ AcpiDmIsTargetAnOperand ( } return (TRUE); } - -#endif diff --git a/source/components/disassembler/dmnames.c b/source/components/disassembler/dmnames.c index fc6a2cc6c3818..99ca38e20fe77 100644 --- a/source/components/disassembler/dmnames.c +++ b/source/components/disassembler/dmnames.c @@ -48,8 +48,6 @@ #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmnames") @@ -414,6 +412,8 @@ AcpiDmValidateName ( char *Name, ACPI_PARSE_OBJECT *Op) { + ACPI_PARSE_OBJECT *TargetOp; + if ((!Name) || (!Op->Common.Parent)) @@ -427,9 +427,6 @@ AcpiDmValidateName ( " /**** Name not found or not accessible from this scope ****/ "); } - ACPI_PARSE_OBJECT *TargetOp; - - if ((!Name) || (!Op->Common.Parent)) { @@ -450,5 +447,3 @@ AcpiDmValidateName ( } } #endif - -#endif diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index 35f9eef8251de..1d52cd794c3d0 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -45,12 +45,10 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" -#include "acdisasm.h" #include "acinterp.h" #include "acnamesp.h" #include "acdebug.h" -#ifdef ACPI_DISASSEMBLER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmopcode") @@ -978,5 +976,3 @@ AcpiDmDisassembleOneOp ( break; } } - -#endif /* ACPI_DISASSEMBLER */ diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c index d1c3abc6f60bc..a12f0a95b7bdb 100644 --- a/source/components/disassembler/dmresrc.c +++ b/source/components/disassembler/dmresrc.c @@ -46,7 +46,6 @@ #include "amlcode.h" #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrc") @@ -444,5 +443,3 @@ AcpiDmIsResourceTemplate ( */ return (AE_OK); } - -#endif diff --git a/source/components/disassembler/dmresrcl.c b/source/components/disassembler/dmresrcl.c index 9cdb24c35bfc4..9a02058f3eebe 100644 --- a/source/components/disassembler/dmresrcl.c +++ b/source/components/disassembler/dmresrcl.c @@ -46,8 +46,6 @@ #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrcl") @@ -1079,5 +1077,3 @@ AcpiDmVendorLargeDescriptor ( ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_LARGE_HEADER)), Length, Level); } - -#endif diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c index a43a605c8327f..76ef29975e394 100644 --- a/source/components/disassembler/dmresrcl2.c +++ b/source/components/disassembler/dmresrcl2.c @@ -46,8 +46,6 @@ #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrcl2") @@ -726,5 +724,3 @@ AcpiDmSerialBusDescriptor ( SerialBusResourceDispatch [Resource->CommonSerialBus.Type] ( Info, Resource, Length, Level); } - -#endif diff --git a/source/components/disassembler/dmresrcs.c b/source/components/disassembler/dmresrcs.c index 8924cf9dfc0e5..d1165b16c2978 100644 --- a/source/components/disassembler/dmresrcs.c +++ b/source/components/disassembler/dmresrcs.c @@ -46,8 +46,6 @@ #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrcs") @@ -368,5 +366,3 @@ AcpiDmVendorSmallDescriptor ( ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)), Length, Level); } - -#endif diff --git a/source/components/disassembler/dmutils.c b/source/components/disassembler/dmutils.c index cf8cf4a9f346e..8958e06010127 100644 --- a/source/components/disassembler/dmutils.c +++ b/source/components/disassembler/dmutils.c @@ -50,7 +50,6 @@ #include <acnamesp.h> #endif -#ifdef ACPI_DISASSEMBLER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmutils") @@ -329,5 +328,3 @@ AcpiDmCommaIfFieldMember ( AcpiOsPrintf (", "); } } - -#endif 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 */ |