summaryrefslogtreecommitdiff
path: root/source/components/disassembler
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/disassembler')
-rw-r--r--source/components/disassembler/dmbuffer.c4
-rw-r--r--source/components/disassembler/dmdeferred.c6
-rw-r--r--source/components/disassembler/dmopcode.c424
-rw-r--r--source/components/disassembler/dmresrc.c17
-rw-r--r--source/components/disassembler/dmresrcl2.c466
-rw-r--r--source/components/disassembler/dmwalk.c25
6 files changed, 498 insertions, 444 deletions
diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c
index 75cc09632134c..27ea16b46e952 100644
--- a/source/components/disassembler/dmbuffer.c
+++ b/source/components/disassembler/dmbuffer.c
@@ -261,7 +261,7 @@ AcpiDmDisasmByteList (
/* Dump the ASCII equivalents within a comment */
- AcpiOsPrintf (" /* ");
+ AcpiOsPrintf (" // ");
for (j = 0; j < ACPI_BUFFER_BYTES_PER_LINE; j++)
{
CurrentIndex = i + j;
@@ -283,7 +283,7 @@ AcpiDmDisasmByteList (
/* Finished with this line */
- AcpiOsPrintf (" */\n");
+ AcpiOsPrintf ("\n");
}
}
diff --git a/source/components/disassembler/dmdeferred.c b/source/components/disassembler/dmdeferred.c
index 8123e2524a776..0368b0a6c8eda 100644
--- a/source/components/disassembler/dmdeferred.c
+++ b/source/components/disassembler/dmdeferred.c
@@ -190,7 +190,7 @@ AcpiDmParseDeferredOps (
ACPI_STATUS Status;
- ACPI_FUNCTION_ENTRY ();
+ ACPI_FUNCTION_TRACE (DmParseDeferredOps);
/* Traverse the entire parse tree */
@@ -217,7 +217,7 @@ AcpiDmParseDeferredOps (
Op, Op->Named.Data, Op->Named.Length);
if (ACPI_FAILURE (Status))
{
- return (Status);
+ return_ACPI_STATUS (Status);
}
break;
@@ -245,7 +245,7 @@ AcpiDmParseDeferredOps (
Op = AcpiPsGetDepthNext (Root, Op);
}
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index af1f96447c481..8d9b532a795e7 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -177,15 +177,6 @@ static void
AcpiDmPromoteSubtree (
ACPI_PARSE_OBJECT *StartOp);
-static BOOLEAN
-AcpiDmIsSwitchBlock (
- ACPI_PARSE_OBJECT *Op,
- char *Temp);
-
-static BOOLEAN
-AcpiDmIsCaseBlock (
- ACPI_PARSE_OBJECT *Op);
-
/*******************************************************************************
*
* FUNCTION: AcpiDmDisplayTargetPathname
@@ -1127,9 +1118,7 @@ AcpiDmDisassembleOneOp (
if (AcpiGbl_DmEmitExternalOpcodes)
{
- AcpiDmEmitExternal (AcpiPsGetArg(Op, 0),
- AcpiPsGetArg(Op, 1));
- break;
+ AcpiDmEmitExternal (Op, AcpiPsGetArg(Op, 0));
}
break;
@@ -1367,414 +1356,3 @@ AcpiDmPromoteSubtree (
Op = Op->Common.Next;
}
}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDmIsTempName
- *
- * PARAMETERS: Op - Object to be examined
- *
- * RETURN: TRUE if object is a temporary (_T_x) name for a matching While
- * loop that can be converted to a Switch.
- *
- * DESCRIPTION: _T_X objects are only used for Switch statements. If a temporary
- * name exists, search the siblings for a matching While (One) loop
- * that can be converted to a Switch. Return TRUE if a match was
- * found, FALSE otherwise.
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiDmIsTempName (
- ACPI_PARSE_OBJECT *Op)
-{
- ACPI_PARSE_OBJECT *CurrentOp;
- char *Temp;
-
- if (Op->Common.AmlOpcode != AML_NAME_OP)
- {
- return (FALSE);
- }
-
- Temp = (char *)(Op->Common.Aml);
- ++Temp;
-
- if (strncmp(Temp, "_T_", 3))
- {
- return (FALSE);
- }
-
- CurrentOp = Op->Common.Next;
- while (CurrentOp)
- {
- if (CurrentOp->Common.AmlOpcode == AML_WHILE_OP &&
- AcpiDmIsSwitchBlock(CurrentOp, Temp))
- {
- Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
- CurrentOp->Common.DisasmOpcode = ACPI_DASM_SWITCH;
-
- return (TRUE);
- }
- CurrentOp = CurrentOp->Common.Next;
- }
-
- return (FALSE);
-}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDmIsSwitchBlock
- *
- * PARAMETERS: Op - While Object
- *
- * RETURN: TRUE if While block can be converted to a Switch/Case block
- *
- * DESCRIPTION: Determines if While block is a Switch/Case statement. Modifies
- * parse tree to allow for Switch/Case disassembly during walk.
- *
- * EXAMPLE: Example of parse tree to be converted
- *
- * While
- * One
- * Store
- * ByteConst
- * -NamePath-
- * If
- * LEqual
- * -NamePath-
- * Zero
- * Return
- * One
- * Else
- * Return
- * WordConst
- * Break
- *
- ******************************************************************************/
-
-static BOOLEAN
-AcpiDmIsSwitchBlock (
- ACPI_PARSE_OBJECT *Op,
- char *Temp)
-{
- ACPI_PARSE_OBJECT *OneOp;
- ACPI_PARSE_OBJECT *StoreOp;
- ACPI_PARSE_OBJECT *NamePathOp;
- ACPI_PARSE_OBJECT *PredicateOp;
- ACPI_PARSE_OBJECT *CurrentOp;
- ACPI_PARSE_OBJECT *TempOp;
-
- /* Check for One Op Predicate */
-
- OneOp = AcpiPsGetArg (Op, 0);
- if (!OneOp || (OneOp->Common.AmlOpcode != AML_ONE_OP))
- {
- return (FALSE);
- }
-
- /* Check for Store Op */
-
- StoreOp = OneOp->Common.Next;
- if (!StoreOp || (StoreOp->Common.AmlOpcode != AML_STORE_OP))
- {
- return (FALSE);
- }
-
- /* Check for Name Op with _T_ string */
-
- NamePathOp = AcpiPsGetArg (StoreOp, 1);
- if (!NamePathOp || (NamePathOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP))
- {
- return (FALSE);
- }
-
- if (strncmp((char *)(NamePathOp->Common.Aml), Temp, 4))
- {
- return (FALSE);
- }
-
- /* This is a Switch/Case control block */
-
- /* Ignore the One Op Predicate */
-
- OneOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
-
- /* Ignore the Store Op, but not the children */
-
- StoreOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE;
-
- /*
- * First arg of Store Op is the Switch condition.
- * Mark it as a Switch predicate and as a parameter list for paren
- * closing and correct indentation.
- */
- PredicateOp = AcpiPsGetArg (StoreOp, 0);
- PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE;
- PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
-
- /* Ignore the Name Op */
-
- NamePathOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE;
-
- /* Remaining opcodes are the Case statements (If/ElseIf's) */
-
- CurrentOp = StoreOp->Common.Next;
- while (AcpiDmIsCaseBlock (CurrentOp))
- {
- /* Block is a Case structure */
-
- if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
- {
- /* ElseIf */
-
- CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE;
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- }
-
- /* If */
-
- CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE;
-
- /*
- * Mark the parse tree for Case disassembly. There are two
- * types of Case statements. The first type of statement begins with
- * an LEqual. The second starts with an LNot and uses a Match statement
- * on a Package of constants.
- */
- TempOp = AcpiPsGetArg (CurrentOp, 0);
- switch (TempOp->Common.AmlOpcode)
- {
- case (AML_LOGICAL_EQUAL_OP):
-
- /* Ignore just the LEqual Op */
-
- TempOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE;
-
- /* Ignore the NamePath Op */
-
- TempOp = AcpiPsGetArg (TempOp, 0);
- TempOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE;
-
- /*
- * Second arg of LEqual will be the Case predicate.
- * Mark it as a predicate and also as a parameter list for paren
- * closing and correct indentation.
- */
- PredicateOp = TempOp->Common.Next;
- PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE;
- PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
-
- break;
-
- case (AML_LOGICAL_NOT_OP):
-
- /*
- * The Package will be the predicate of the Case statement.
- * It's under:
- * LNOT
- * LEQUAL
- * MATCH
- * PACKAGE
- */
-
- /* Get the LEqual Op from LNot */
-
- TempOp = AcpiPsGetArg (TempOp, 0);
-
- /* Get the Match Op from LEqual */
-
- TempOp = AcpiPsGetArg (TempOp, 0);
-
- /* Get the Package Op from Match */
-
- PredicateOp = AcpiPsGetArg (TempOp, 0);
-
- /* Mark as parameter list for paren closing */
-
- PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
-
- /*
- * The Package list would be too deeply indented if we
- * chose to simply ignore the all the parent opcodes, so
- * we rearrange the parse tree instead.
- */
-
- /*
- * Save the second arg of the If/Else Op which is the
- * block code of code for this Case statement.
- */
- TempOp = AcpiPsGetArg (CurrentOp, 1);
-
- /*
- * Move the Package Op to the child (predicate) of the
- * Case statement.
- */
- CurrentOp->Common.Value.Arg = PredicateOp;
- PredicateOp->Common.Parent = CurrentOp;
-
- /* Add the block code */
-
- PredicateOp->Common.Next = TempOp;
-
- break;
-
- default:
-
- /* Should never get here */
-
- break;
- }
-
- /* Advance to next Case block */
-
- CurrentOp = CurrentOp->Common.Next;
- }
-
- /* If CurrentOp is now an Else, then this is a Default block */
-
- if (CurrentOp && CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
- {
- CurrentOp->Common.DisasmOpcode = ACPI_DASM_DEFAULT;
- }
-
- /*
- * From the first If advance to the Break op. It's possible to
- * have an Else (Default) op here when there is only one Case
- * statement, so check for it.
- */
- CurrentOp = StoreOp->Common.Next->Common.Next;
- if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
- {
- CurrentOp = CurrentOp->Common.Next;
- }
-
- /* Ignore the Break Op */
-
- CurrentOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
-
- return (TRUE);
-}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDmIsCaseBlock
- *
- * PARAMETERS: Op - Object to test
- *
- * RETURN: TRUE if Object is beginning of a Case block.
- *
- * DESCRIPTION: Determines if an Object is the beginning of a Case block for a
- * Switch/Case statement. Parse tree must be one of the following
- * forms:
- *
- * Else (Optional)
- * If
- * LEqual
- * -NamePath- _T_x
- *
- * Else (Optional)
- * If
- * LNot
- * LEqual
- * Match
- * Package
- * ByteConst
- * -NamePath- _T_x
- *
- ******************************************************************************/
-
-static BOOLEAN
-AcpiDmIsCaseBlock (
- ACPI_PARSE_OBJECT *Op)
-{
- ACPI_PARSE_OBJECT *CurrentOp;
-
- if (!Op)
- {
- return (FALSE);
- }
-
- /* Look for an If or ElseIf */
-
- CurrentOp = Op;
- if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
- {
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp)
- {
- return (FALSE);
- }
- }
-
- if (!CurrentOp || CurrentOp->Common.AmlOpcode != AML_IF_OP)
- {
- return (FALSE);
- }
-
- /* Child must be LEqual or LNot */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp)
- {
- return (FALSE);
- }
-
- switch (CurrentOp->Common.AmlOpcode)
- {
- case (AML_LOGICAL_EQUAL_OP):
-
- /* Next child must be NamePath with string _T_ */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp || !CurrentOp->Common.Value.Name ||
- strncmp(CurrentOp->Common.Value.Name, "_T_", 3))
- {
- return (FALSE);
- }
-
- break;
-
- case (AML_LOGICAL_NOT_OP):
-
- /* Child of LNot must be LEqual op */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_LOGICAL_EQUAL_OP))
- {
- return (FALSE);
- }
-
- /* Child of LNot must be Match op */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_MATCH_OP))
- {
- return (FALSE);
- }
-
- /* First child of Match must be Package op */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_PACKAGE_OP))
- {
- return (FALSE);
- }
-
- /* Third child of Match must be NamePath with string _T_ */
-
- CurrentOp = AcpiPsGetArg (CurrentOp->Common.Parent, 2);
- if (!CurrentOp || !CurrentOp->Common.Value.Name ||
- strncmp(CurrentOp->Common.Value.Name, "_T_", 3))
- {
- return (FALSE);
- }
-
- break;
-
- default:
-
- return (FALSE);
- }
-
- return (TRUE);
-}
diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c
index bd8aa2dc62d3b..3c24855f97713 100644
--- a/source/components/disassembler/dmresrc.c
+++ b/source/components/disassembler/dmresrc.c
@@ -197,8 +197,12 @@ static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] =
AcpiDmQwordDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */
AcpiDmExtendedDescriptor, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
AcpiDmGpioDescriptor, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
- NULL, /* 0x0D, Reserved */
- AcpiDmSerialBusDescriptor /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS */
+ AcpiDmPinFunctionDescriptor, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */
+ AcpiDmSerialBusDescriptor, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS */
+ AcpiDmPinConfigDescriptor, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */
+ AcpiDmPinGroupDescriptor, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */
+ AcpiDmPinGroupFunctionDescriptor, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */
+ AcpiDmPinGroupConfigDescriptor, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
};
@@ -540,6 +544,15 @@ AcpiDmIsResourceTemplate (
* intialization byte list. Because the resource macros will create
* a buffer of the exact required length (buffer length will be equal
* to the actual length).
+ *
+ * NOTE (April 2017): Resource templates with this issue have been
+ * seen in the field. We still don't want to attempt to disassemble
+ * a buffer like this to a resource template because this output
+ * would not match the original input buffer (it would be shorter
+ * than the original when the disassembled code is recompiled).
+ * Basically, a buffer like this appears to be hand crafted in the
+ * first place, so just emitting a buffer object instead of a
+ * resource template more closely resembles the original ASL code.
*/
if (DeclaredBufferLength != BufferLength)
{
diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c
index 0c2c3360c2142..68737545c34c1 100644
--- a/source/components/disassembler/dmresrcl2.c
+++ b/source/components/disassembler/dmresrcl2.c
@@ -515,6 +515,112 @@ AcpiDmGpioDescriptor (
}
}
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinFunctionDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinFunction descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinFunctionDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinFunction (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinFunction.Flags)]);
+
+ if (Resource->PinFunction.PinConfig <= 3)
+ {
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_PpcDecode[Resource->PinFunction.PinConfig]);
+ }
+ else
+ {
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinFunction.PinConfig);
+ }
+
+ /* FunctionNumber */
+
+ AcpiOsPrintf ("0x%4.4X, ", Resource->PinFunction.FunctionNumber);
+
+ if (Resource->PinFunction.ResSourceOffset)
+ {
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinFunction.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+ }
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X,\n", Resource->PinFunction.ResSourceIndex);
+
+ AcpiDmIndent (Level + 1);
+
+ /* Always ResourceConsumer */
+ AcpiOsPrintf ("%s, ", AcpiGbl_ConsumeDecode [ACPI_CONSUMER]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinFunction.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinFunction.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinFunction.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = ((UINT32) (Resource->PinFunction.ResSourceOffset -
+ Resource->PinFunction.PinTableOffset)) /
+ sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinFunction.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
/*******************************************************************************
*
@@ -848,3 +954,363 @@ AcpiDmSerialBusDescriptor (
SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
Info, Resource, Length, Level);
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinConfig
+ *
+ * PARAMETERS: PinConfigType - Pin configuration type
+ * PinConfigValue - Pin configuration value
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Pretty prints PinConfig type and value.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmPinConfig(
+ UINT8 PinConfigType,
+ UINT32 PinConfigValue)
+{
+ if (PinConfigType <= 13)
+ {
+ AcpiOsPrintf ("0x%2.2X /* %s */, ", PinConfigType,
+ AcpiGbl_PtypDecode[PinConfigType]);
+ }
+ else
+ {
+ AcpiOsPrintf ("0x%2.2X, /* Vendor Defined */ ", PinConfigType);
+ }
+
+ /* PinConfigValue */
+
+ AcpiOsPrintf ("0x%4.4X,\n", PinConfigValue);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinConfigDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinConfig descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinConfigDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinConfig (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinConfig.Flags)]);
+
+ AcpiDmPinConfig (Resource->PinConfig.PinConfigType,
+ Resource->PinConfig.PinConfigValue);
+
+ AcpiDmIndent (Level + 1);
+
+ if (Resource->PinConfig.ResSourceOffset)
+ {
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinConfig.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+ }
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinConfig.ResSourceIndex);
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinConfig.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinConfig.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinConfig.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinConfig.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = ((UINT32) (Resource->PinConfig.ResSourceOffset -
+ Resource->PinConfig.PinTableOffset)) /
+ sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinConfig.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroup descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ char *Label;
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ /* Always producer */
+ AcpiOsPrintf ("PinGroup (");
+
+ Label = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroup.LabelOffset),
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroup.Flags)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroup.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroup.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroup.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = (Resource->PinGroup.LabelOffset -
+ Resource->PinGroup.PinTableOffset) / sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroup.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupFunctionDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroupFunction descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupFunctionDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ char *Label = NULL;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinGroupFunction (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupFunction.Flags)]);
+
+ /* FunctionNumber */
+
+ AcpiOsPrintf ("0x%4.4X, ", Resource->PinGroupFunction.FunctionNumber);
+
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroupFunction.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X,\n", Resource->PinGroupFunction.ResSourceIndex);
+
+ AcpiDmIndent (Level + 1);
+
+ Label = ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroupFunction.ResSourceLabelOffset);
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupFunction.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroupFunction.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroupFunction.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroupFunction.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupConfigDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroupConfig descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupConfigDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ char *Label = NULL;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinGroupConfig (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupConfig.Flags)]);
+
+ AcpiDmPinConfig(Resource->PinGroupConfig.PinConfigType,
+ Resource->PinGroupConfig.PinConfigValue);
+
+ AcpiDmIndent (Level + 1);
+
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroupConfig.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinGroupConfig.ResSourceIndex);
+
+ Label = ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroupConfig.ResSourceLabelOffset);
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupConfig.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroupConfig.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroupConfig.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroupConfig.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+}
diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c
index 77d24a18e99cf..750e639898aa1 100644
--- a/source/components/disassembler/dmwalk.c
+++ b/source/components/disassembler/dmwalk.c
@@ -161,8 +161,6 @@
ACPI_MODULE_NAME ("dmwalk")
-#define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: "
-
/* Stub for non-compiler code */
#ifndef ACPI_ASL_COMPILER
@@ -584,13 +582,6 @@ AcpiDmDescendingOp (
return (AE_CTRL_DEPTH);
}
- if (AcpiDmIsTempName(Op))
- {
- /* Ignore compiler generated temporary names */
-
- return (AE_CTRL_DEPTH);
- }
-
if (Op->Common.DisasmOpcode == ACPI_DASM_IGNORE_SINGLE)
{
/* Ignore this op, but not it's children */
@@ -642,10 +633,16 @@ AcpiDmDescendingOp (
Info->WalkState->ParserState.AmlStart);
if (AcpiGbl_DmOpt_Verbose)
{
- AcpiOsPrintf (DB_FULL_OP_INFO,
- (Info->WalkState->MethodNode ?
- Info->WalkState->MethodNode->Name.Ascii : " "),
- AmlOffset, (UINT32) Op->Common.AmlOpcode);
+ if (AcpiGbl_CmSingleStep)
+ {
+ AcpiOsPrintf ("%5.5X/%4.4X: ",
+ AmlOffset, (UINT32) Op->Common.AmlOpcode);
+ }
+ else
+ {
+ AcpiOsPrintf ("AML Offset %5.5X, Opcode %4.4X: ",
+ AmlOffset, (UINT32) Op->Common.AmlOpcode);
+ }
}
}
@@ -782,7 +779,7 @@ AcpiDmDescendingOp (
Name = AcpiPsGetName (Op);
if (Op->Named.Path)
{
- AcpiDmNamestring ((char *) Op->Named.Path);
+ AcpiDmNamestring (Op->Named.Path);
}
else
{