Print this page
acpica-unix2-20130823
PANKOVs restructure
*** 3,13 ****
* Module Name: dmwalk - AML disassembly tree walk
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
--- 3,13 ----
* Module Name: dmwalk - AML disassembly tree walk
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2013, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*** 439,449 ****
--- 439,473 ----
{
/*
* This is a first-level element of a term list,
* indent a new line
*/
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_NOOP_OP:
+ /*
+ * Optionally just ignore this opcode. Some tables use
+ * NoOp opcodes for "padding" out packages that the BIOS
+ * changes dynamically. This can leave hundreds or
+ * thousands of NoOp opcodes that if disassembled,
+ * cannot be compiled because they are syntactically
+ * incorrect.
+ */
+ if (AcpiGbl_IgnoreNoopOperator)
+ {
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ return (AE_OK);
+ }
+
+ /* Fallthrough */
+
+ default:
+
AcpiDmIndent (Level);
+ break;
+ }
+
Info->LastLevel = Level;
Info->Count = 0;
}
/*
*** 451,461 ****
* too long. When the limit is hit, start a new line at the previous
* indent plus one. A better but more expensive mechanism would be to
* keep track of the current column.
*/
Info->Count++;
! if (Info->Count /*+Info->LastLevel*/ > 10)
{
Info->Count = 0;
AcpiOsPrintf ("\n");
AcpiDmIndent (Info->LastLevel + 1);
}
--- 475,485 ----
* too long. When the limit is hit, start a new line at the previous
* indent plus one. A better but more expensive mechanism would be to
* keep track of the current column.
*/
Info->Count++;
! if (Info->Count /* +Info->LastLevel */ > 10)
{
Info->Count = 0;
AcpiOsPrintf ("\n");
AcpiDmIndent (Info->LastLevel + 1);
}
*** 462,472 ****
/* Print the opcode name */
AcpiDmDisassembleOneOp (NULL, Info, Op);
! if (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_PREFIX)
{
return (AE_OK);
}
if ((Op->Common.AmlOpcode == AML_NAME_OP) ||
--- 486,497 ----
/* Print the opcode name */
AcpiDmDisassembleOneOp (NULL, Info, Op);
! if ((Op->Common.DisasmOpcode == ACPI_DASM_LNOT_PREFIX) ||
! (Op->Common.AmlOpcode == AML_INT_CONNECTION_OP))
{
return (AE_OK);
}
if ((Op->Common.AmlOpcode == AML_NAME_OP) ||
*** 530,539 ****
--- 555,568 ----
{
case AML_METHOD_OP:
AcpiDmMethodFlags (Op);
AcpiOsPrintf (")");
+
+ /* Emit description comment for Method() with a predefined ACPI name */
+
+ AcpiDmPredefinedDescription (Op);
break;
case AML_NAME_OP:
*** 600,610 ****
break;
default:
! AcpiOsPrintf ("*** Unhandled named opcode %X\n", Op->Common.AmlOpcode);
break;
}
}
else switch (Op->Common.AmlOpcode)
--- 629,640 ----
break;
default:
! AcpiOsPrintf ("*** Unhandled named opcode %X\n",
! Op->Common.AmlOpcode);
break;
}
}
else switch (Op->Common.AmlOpcode)
*** 641,651 ****
* eliminates newline in the output.
*/
NextOp = NextOp->Common.Next;
Info->Flags = ACPI_PARSEOP_PARAMLIST;
! AcpiDmWalkParseTree (NextOp, AcpiDmDescendingOp, AcpiDmAscendingOp, Info);
Info->Flags = 0;
Info->Level = Level;
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
AcpiOsPrintf (", ");
--- 671,682 ----
* eliminates newline in the output.
*/
NextOp = NextOp->Common.Next;
Info->Flags = ACPI_PARSEOP_PARAMLIST;
! AcpiDmWalkParseTree (NextOp, AcpiDmDescendingOp,
! AcpiDmAscendingOp, Info);
Info->Flags = 0;
Info->Level = Level;
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
AcpiOsPrintf (", ");
*** 667,677 ****
}
AcpiDmFieldFlags (NextOp);
break;
-
case AML_BUFFER_OP:
/* The next op is the size parameter */
NextOp = AcpiPsGetDepthNext (NULL, Op);
--- 698,707 ----
*** 688,698 ****
* We have a resource list. Don't need to output
* the buffer size Op. Open up a new block
*/
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
NextOp = NextOp->Common.Next;
! AcpiOsPrintf (")\n");
AcpiDmIndent (Info->Level);
AcpiOsPrintf ("{\n");
return (AE_OK);
}
--- 718,734 ----
* We have a resource list. Don't need to output
* the buffer size Op. Open up a new block
*/
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
NextOp = NextOp->Common.Next;
! AcpiOsPrintf (")");
!
! /* Emit description comment for Name() with a predefined ACPI name */
!
! AcpiDmPredefinedDescription (Op->Asl.Parent);
!
! AcpiOsPrintf ("\n");
AcpiDmIndent (Info->Level);
AcpiOsPrintf ("{\n");
return (AE_OK);
}
*** 699,709 ****
/* Normal Buffer, mark size as in the parameter list */
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
return (AE_OK);
-
case AML_VAR_PACKAGE_OP:
case AML_IF_OP:
case AML_WHILE_OP:
/* The next op is the size or predicate parameter */
--- 735,744 ----
*** 713,741 ****
{
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
}
return (AE_OK);
-
case AML_PACKAGE_OP:
! /* The next op is the size or predicate parameter */
NextOp = AcpiPsGetDepthNext (NULL, Op);
if (NextOp)
{
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
}
return (AE_OK);
-
case AML_MATCH_OP:
AcpiDmMatchOp (Op);
break;
-
default:
break;
}
--- 748,773 ----
{
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
}
return (AE_OK);
case AML_PACKAGE_OP:
! /* The next op is the size parameter */
NextOp = AcpiPsGetDepthNext (NULL, Op);
if (NextOp)
{
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
}
return (AE_OK);
case AML_MATCH_OP:
AcpiDmMatchOp (Op);
break;
default:
break;
}
*** 769,778 ****
--- 801,811 ----
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_OP_WALK_INFO *Info = Context;
+ ACPI_PARSE_OBJECT *ParentOp;
if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE)
{
/* Ignore this op -- it was handled elsewhere */
*** 794,803 ****
--- 827,849 ----
/* Completed an op that has arguments, add closing paren */
AcpiOsPrintf (")");
+ if (Op->Common.AmlOpcode == AML_NAME_OP)
+ {
+ /* Emit description comment for Name() with a predefined ACPI name */
+
+ AcpiDmPredefinedDescription (Op);
+ }
+ else
+ {
+ /* For Create* operators, attempt to emit resource tag description */
+
+ AcpiDmFieldPredefinedDescription (Op);
+ }
+
/* Could be a nested operator, check if comma required */
if (!AcpiDmCommaIfListMember (Op))
{
if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) &&
*** 814,824 ****
}
}
}
break;
-
case BLOCK_BRACE:
case (BLOCK_BRACE | BLOCK_PAREN):
/* Completed an op that has a term list, add closing brace */
--- 860,869 ----
*** 854,864 ****
AcpiOsPrintf ("\n");
}
}
break;
-
case BLOCK_NONE:
default:
/* Could be a nested operator, check if comma required */
--- 899,908 ----
*** 908,918 ****
* Just completed a parameter node for something like "Buffer (param)".
* Close the paren and open up the term list block with a brace
*/
if (Op->Common.Next)
{
! AcpiOsPrintf (")\n");
AcpiDmIndent (Level - 1);
AcpiOsPrintf ("{\n");
}
else
{
--- 952,975 ----
* Just completed a parameter node for something like "Buffer (param)".
* Close the paren and open up the term list block with a brace
*/
if (Op->Common.Next)
{
! AcpiOsPrintf (")");
!
! /* Emit description comment for Name() with a predefined ACPI name */
!
! ParentOp = Op->Common.Parent;
! if (ParentOp)
! {
! ParentOp = ParentOp->Common.Parent;
! if (ParentOp && ParentOp->Asl.AmlOpcode == AML_NAME_OP)
! {
! AcpiDmPredefinedDescription (ParentOp);
! }
! }
! AcpiOsPrintf ("\n");
AcpiDmIndent (Level - 1);
AcpiOsPrintf ("{\n");
}
else
{