summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/dbdisasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/dbdisasm.c')
-rw-r--r--sys/contrib/dev/acpica/dbdisasm.c205
1 files changed, 89 insertions, 116 deletions
diff --git a/sys/contrib/dev/acpica/dbdisasm.c b/sys/contrib/dev/acpica/dbdisasm.c
index 2ada95d..dc24edc 100644
--- a/sys/contrib/dev/acpica/dbdisasm.c
+++ b/sys/contrib/dev/acpica/dbdisasm.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbdisasm - parser op tree display routines
- * $Revision: 50 $
+ * $Revision: 53 $
*
******************************************************************************/
@@ -208,7 +208,6 @@ AcpiPsDisplayObjectPathname (
*/
AcpiOsPrintf (" **** Path not found in parse tree");
}
-
else
{
/* The target was found, print the name and complete path */
@@ -316,139 +315,135 @@ AcpiDbDisplayOp (
UINT32 j;
- if (Op)
+ if (!Op)
+ {
+ AcpiDbDisplayOpcode (WalkState, Op);
+ return;
+ }
+
+
+ while (Op)
{
- while (Op)
+ /* Indentation */
+
+ DepthCount = 0;
+ if (!AcpiGbl_DbOpt_verbose)
{
- /* indentation */
+ DepthCount++;
+ }
+
+ /* Determine the nesting depth of this argument */
- DepthCount = 0;
- if (!AcpiGbl_DbOpt_verbose)
+ for (depth = Op->Parent; depth; depth = depth->Parent)
+ {
+ arg = AcpiPsGetArg (depth, 0);
+ while (arg && arg != Origin)
{
- DepthCount++;
+ arg = arg->Next;
}
- /* Determine the nesting depth of this argument */
-
- for (depth = Op->Parent; depth; depth = depth->Parent)
+ if (arg)
{
- arg = AcpiPsGetArg (depth, 0);
- while (arg && arg != Origin)
- {
- arg = arg->Next;
- }
+ break;
+ }
- if (arg)
- {
- break;
- }
+ DepthCount++;
+ }
+
+ /* Open a new block if we are nested further than last time */
- DepthCount++;
+ if (DepthCount > LastDepth)
+ {
+ VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth));
+ for (i = 0; i < LastDepth; i++)
+ {
+ AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent);
}
+ if (AcpiDbBlockType (Op) == BLOCK_PAREN)
+ {
+ AcpiOsPrintf ("(\n");
+ }
+ else
+ {
+ AcpiOsPrintf ("{\n");
+ }
+ }
- /* Open a new block if we are nested further than last time */
+ /* Close a block if we are nested less than last time */
- if (DepthCount > LastDepth)
+ else if (DepthCount < LastDepth)
+ {
+ for (j = 0; j < (LastDepth - DepthCount); j++)
{
- VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth));
- for (i = 0; i < LastDepth; i++)
+ VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - j));
+ for (i = 0; i < (LastDepth - j - 1); i++)
{
AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent);
}
if (AcpiDbBlockType (Op) == BLOCK_PAREN)
{
- AcpiOsPrintf ("(\n");
+ AcpiOsPrintf (")\n");
}
else
{
- AcpiOsPrintf ("{\n");
+ AcpiOsPrintf ("}\n");
}
}
+ }
- /* Close a block if we are nested less than last time */
-
- else if (DepthCount < LastDepth)
- {
- for (j = 0; j < (LastDepth - DepthCount); j++)
- {
- VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - j));
- for (i = 0; i < (LastDepth - j - 1); i++)
- {
- AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent);
- }
-
- if (AcpiDbBlockType (Op) == BLOCK_PAREN)
- {
- AcpiOsPrintf (")\n");
- }
- else
- {
- AcpiOsPrintf ("}\n");
- }
- }
- }
-
- /* In verbose mode, print the AML offset, opcode and depth count */
-
- VERBOSE_PRINT ((DB_FULL_OP_INFO, (unsigned) Op->AmlOffset, Op->Opcode, DepthCount));
-
+ /* In verbose mode, print the AML offset, opcode and depth count */
- /* Indent the output according to the depth count */
+ VERBOSE_PRINT ((DB_FULL_OP_INFO, (unsigned) Op->AmlOffset, Op->Opcode, DepthCount));
- for (i = 0; i < DepthCount; i++)
- {
- AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent);
- }
+ /* Indent the output according to the depth count */
- /* Now print the opcode */
+ for (i = 0; i < DepthCount; i++)
+ {
+ AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent);
+ }
- AcpiDbDisplayOpcode (WalkState, Op);
+ /* Now print the opcode */
- /* Resolve a name reference */
+ AcpiDbDisplayOpcode (WalkState, Op);
- if ((Op->Opcode == AML_INT_NAMEPATH_OP && Op->Value.Name) &&
- (Op->Parent) &&
- (AcpiGbl_DbOpt_verbose))
- {
- AcpiPsDisplayObjectPathname (WalkState, Op);
- }
+ /* Resolve a name reference */
- AcpiOsPrintf ("\n");
+ if ((Op->Opcode == AML_INT_NAMEPATH_OP && Op->Value.Name) &&
+ (Op->Parent) &&
+ (AcpiGbl_DbOpt_verbose))
+ {
+ AcpiPsDisplayObjectPathname (WalkState, Op);
+ }
- /* Get the next node in the tree */
+ AcpiOsPrintf ("\n");
- Op = AcpiPsGetDepthNext (Origin, Op);
- LastDepth = DepthCount;
+ /* Get the next node in the tree */
- NumOpcodes--;
- if (!NumOpcodes)
- {
- Op = NULL;
- }
- }
-
- /* Close the last block(s) */
+ Op = AcpiPsGetDepthNext (Origin, Op);
+ LastDepth = DepthCount;
- DepthCount = LastDepth -1;
- for (i = 0; i < LastDepth; i++)
+ NumOpcodes--;
+ if (!NumOpcodes)
{
- VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - i));
- for (j = 0; j < DepthCount; j++)
- {
- AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent);
- }
- AcpiOsPrintf ("}\n");
- DepthCount--;
+ Op = NULL;
}
-
}
- else
+ /* Close the last block(s) */
+
+ DepthCount = LastDepth -1;
+ for (i = 0; i < LastDepth; i++)
{
- AcpiDbDisplayOpcode (WalkState, Op);
+ VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - i));
+ for (j = 0; j < DepthCount; j++)
+ {
+ AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent);
+ }
+ AcpiOsPrintf ("}\n");
+ DepthCount--;
}
}
@@ -557,7 +552,6 @@ AcpiDbDisplayPath (
return;
}
-
if (OpInfo->Flags & AML_CREATE)
{
/* Field creation - check for a fully qualified namepath */
@@ -630,7 +624,6 @@ AcpiDbDisplayPath (
AcpiOsPrintf ("%4.4s", NamePath->Value.String);
}
}
-
else
{
Name = AcpiPsGetName (Search);
@@ -678,24 +671,20 @@ AcpiDbDisplayOpcode (
AcpiOsPrintf ("<NULL OP PTR>");
}
-
/* op and arguments */
switch (Op->Opcode)
{
-
case AML_BYTE_OP:
if (AcpiGbl_DbOpt_verbose)
{
AcpiOsPrintf ("(UINT8) 0x%2.2X", Op->Value.Integer8);
}
-
else
{
AcpiOsPrintf ("0x%2.2X", Op->Value.Integer8);
}
-
break;
@@ -705,12 +694,10 @@ AcpiDbDisplayOpcode (
{
AcpiOsPrintf ("(UINT16) 0x%4.4X", Op->Value.Integer16);
}
-
else
{
AcpiOsPrintf ("0x%4.4X", Op->Value.Integer16);
}
-
break;
@@ -720,12 +707,10 @@ AcpiDbDisplayOpcode (
{
AcpiOsPrintf ("(UINT32) 0x%8.8X", Op->Value.Integer32);
}
-
else
{
AcpiOsPrintf ("0x%8.8X", Op->Value.Integer32);
}
-
break;
@@ -736,13 +721,11 @@ AcpiDbDisplayOpcode (
AcpiOsPrintf ("(UINT64) 0x%8.8X%8.8X", Op->Value.Integer64.Hi,
Op->Value.Integer64.Lo);
}
-
else
{
AcpiOsPrintf ("0x%8.8X%8.8X", Op->Value.Integer64.Hi,
Op->Value.Integer64.Lo);
}
-
break;
@@ -752,12 +735,10 @@ AcpiDbDisplayOpcode (
{
AcpiOsPrintf ("\"%s\"", Op->Value.String);
}
-
else
{
AcpiOsPrintf ("<\"NULL STRING PTR\">");
}
-
break;
@@ -767,12 +748,10 @@ AcpiDbDisplayOpcode (
{
AcpiOsPrintf ("\"%s\"", Op->Value.String);
}
-
else
{
AcpiOsPrintf ("\"<NULL STATIC STRING PTR>\"");
}
-
break;
@@ -806,7 +785,6 @@ AcpiDbDisplayOpcode (
{
AcpiOsPrintf ("ByteList (Length 0x%8.8X) ", Op->Value.Integer32);
}
-
else
{
AcpiOsPrintf ("0x%2.2X", Op->Value.Integer32);
@@ -819,7 +797,6 @@ AcpiDbDisplayOpcode (
AcpiOsPrintf (", 0x%2.2X", ByteData[i]);
}
}
-
break;
@@ -839,7 +816,6 @@ AcpiDbDisplayOpcode (
AcpiDbDecodeInternalObject (WalkState->Results->Results.ObjDesc [WalkState->Results->Results.NumResults-1]);
}
#endif
-
break;
}
@@ -862,15 +838,12 @@ AcpiDbDisplayOpcode (
Name = AcpiPsGetName (Op);
AcpiOsPrintf (" %4.4s", &Name);
- if (AcpiGbl_DbOpt_verbose)
+ if ((AcpiGbl_DbOpt_verbose) && (Op->Opcode != AML_INT_NAMEDFIELD_OP))
{
- AcpiOsPrintf (" (Path \\");
- AcpiDbDisplayPath (Op);
- AcpiOsPrintf (")");
+ AcpiPsDisplayObjectPathname (WalkState, Op);
}
}
}
-
#endif /* ENABLE_DEBUGGER */
OpenPOWER on IntegriCloud