summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/components/disassembler/dmopcode.c94
-rw-r--r--source/components/disassembler/dmwalk.c2
-rw-r--r--source/include/acdisasm.h4
3 files changed, 100 insertions, 0 deletions
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index e5c1d6292..db30c00a1 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -119,6 +119,7 @@
#include "amlcode.h"
#include "acdisasm.h"
#include "acinterp.h"
+#include "acnamesp.h"
#ifdef ACPI_DISASSEMBLER
@@ -134,6 +135,99 @@ AcpiDmMatchKeyword (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDisplayTargetPathname
+ *
+ * PARAMETERS: Op - Parse object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: For AML opcodes that have a target operand, display the full
+ * pathname for the target, in a comment field. Handles Return()
+ * statements also.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDisplayTargetPathname (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *NextOp;
+ ACPI_PARSE_OBJECT *PrevOp = NULL;
+ char *Pathname;
+ const ACPI_OPCODE_INFO *OpInfo;
+
+
+ if (Op->Common.AmlOpcode == AML_RETURN_OP)
+ {
+ PrevOp = Op->Asl.Value.Arg;
+ }
+ else
+ {
+ OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+ if (!(OpInfo->Flags & AML_HAS_TARGET))
+ {
+ return;
+ }
+
+ /* Target is the last Op in the arg list */
+
+ NextOp = Op->Asl.Value.Arg;
+ while (NextOp)
+ {
+ PrevOp = NextOp;
+ NextOp = PrevOp->Asl.Next;
+ }
+ }
+
+ if (!PrevOp)
+ {
+ return;
+ }
+
+ /* We must have a namepath AML opcode */
+
+ if (PrevOp->Asl.AmlOpcode != AML_INT_NAMEPATH_OP)
+ {
+ return;
+ }
+
+ /* A null string is the "no target specified" case */
+
+ if (!PrevOp->Asl.Value.String)
+ {
+ return;
+ }
+
+ /* No node means "unresolved external reference" */
+
+ if (!PrevOp->Asl.Node)
+ {
+ AcpiOsPrintf (" /* External reference */");
+ return;
+ }
+
+ /* Ignore if path is already from the root */
+
+ if (*PrevOp->Asl.Value.String == '\\')
+ {
+ return;
+ }
+
+ /* Now: we can get the full pathname */
+
+ Pathname = AcpiNsGetExternalPathname (PrevOp->Asl.Node);
+ if (!Pathname)
+ {
+ return;
+ }
+
+ AcpiOsPrintf (" /* %s */", Pathname);
+ ACPI_FREE (Pathname);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmNotifyDescription
*
* PARAMETERS: Op - Name() parse object
diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c
index 49c9cdfb8..ff72620a2 100644
--- a/source/components/disassembler/dmwalk.c
+++ b/source/components/disassembler/dmwalk.c
@@ -921,6 +921,8 @@ AcpiDmAscendingOp (
AcpiDmNotifyDescription (Op);
}
+ AcpiDmDisplayTargetPathname (Op);
+
/* Could be a nested operator, check if comma required */
if (!AcpiDmCommaIfListMember (Op))
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index 206280437..df8d2e795 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -624,6 +624,10 @@ AcpiDmMethodFlags (
ACPI_PARSE_OBJECT *Op);
void
+AcpiDmDisplayTargetPathname (
+ ACPI_PARSE_OBJECT *Op);
+
+void
AcpiDmNotifyDescription (
ACPI_PARSE_OBJECT *Op);