summaryrefslogtreecommitdiff
path: root/source/components/disassembler/dmcstyle.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/disassembler/dmcstyle.c')
-rw-r--r--source/components/disassembler/dmcstyle.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c
index 32ab5be75352..2f61dea20846 100644
--- a/source/components/disassembler/dmcstyle.c
+++ b/source/components/disassembler/dmcstyle.c
@@ -215,6 +215,7 @@ AcpiDmCheckForSymbolicOpcode (
Child1->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX;
Op->Common.DisasmOpcode = ACPI_DASM_LNOT_PREFIX;
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT;
/* Save symbol string in the next child (not peer) */
@@ -378,7 +379,7 @@ AcpiDmCheckForSymbolicOpcode (
/* Convert operator to compound assignment */
- Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND;
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT;
Child1->Common.OperatorSymbol = NULL;
return (TRUE);
}
@@ -406,7 +407,7 @@ AcpiDmCheckForSymbolicOpcode (
/* Convert operator to compound assignment */
- Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND;
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT;
Child1->Common.OperatorSymbol = NULL;
return (TRUE);
}
@@ -522,6 +523,19 @@ AcpiDmCheckForSymbolicOpcode (
break;
}
+ /*
+ * Nodes marked with ACPI_PARSEOP_PARAMLIST don't need a parens
+ * output here. We also need to check the parent to see if this op
+ * is part of a compound test (!=, >=, <=).
+ */
+ if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) ||
+ ((Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) &&
+ (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX)))
+ {
+ /* Do Nothing. Paren already generated */
+ return (TRUE);
+ }
+
/* All other operators, emit an open paren */
AcpiOsPrintf ("(");
@@ -547,6 +561,7 @@ void
AcpiDmCloseOperator (
ACPI_PARSE_OBJECT *Op)
{
+ BOOLEAN IsCStyleOp = FALSE;
/* Always emit paren if ASL+ disassembly disabled */
@@ -578,7 +593,7 @@ AcpiDmCloseOperator (
/* Emit paren only if this is not a compound assignment */
- if (Op->Common.DisasmFlags & ACPI_PARSEOP_COMPOUND)
+ if (Op->Common.DisasmFlags & ACPI_PARSEOP_COMPOUND_ASSIGNMENT)
{
return;
}
@@ -589,6 +604,8 @@ AcpiDmCloseOperator (
{
AcpiOsPrintf (")");
}
+
+ IsCStyleOp = TRUE;
break;
case AML_INDEX_OP:
@@ -616,7 +633,21 @@ AcpiDmCloseOperator (
break;
}
+ /*
+ * Nodes marked with ACPI_PARSEOP_PARAMLIST don't need a parens
+ * output here. We also need to check the parent to see if this op
+ * is part of a compound test (!=, >=, <=).
+ */
+ if (IsCStyleOp &&
+ ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) ||
+ ((Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) &&
+ (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX))))
+ {
+ return;
+ }
+
AcpiOsPrintf (")");
+ return;
}