Skip to content

Commit

Permalink
Disassembler: Add option to emit embedded External operators/opcodes
Browse files Browse the repository at this point in the history
Opcode 0x15 was added in ACPI 6.0 for disassemblers.
The disassembler by default does not emit the actual opcodes, they
are used internally. Option added for internal debugging only.
  • Loading branch information
acpibob committed May 24, 2016
1 parent 622063b commit 152a8ca
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
6 changes: 5 additions & 1 deletion source/compiler/asloptions.c
Expand Up @@ -613,9 +613,13 @@ AslDoOptions (

case 'e':

/* Disable External opcode generation */
/* iASL: Disable External opcode generation */

Gbl_DoExternals = FALSE;

/* Disassembler: Emit embedded external operators */

AcpiGbl_DmEmitExternalOpcodes = TRUE;
break;

case 'f':
Expand Down
11 changes: 10 additions & 1 deletion source/components/disassembler/dmopcode.c
Expand Up @@ -1043,7 +1043,16 @@ AcpiDmDisassembleOneOp (

case AML_EXTERNAL_OP:

break;
if (AcpiGbl_DmEmitExternalOpcodes)
{
AcpiOsPrintf ("/* Opcode 0x15 */ ");

/* Fallthrough */
}
else
{
break;
}

default:

Expand Down
29 changes: 17 additions & 12 deletions source/components/disassembler/dmwalk.c
Expand Up @@ -534,21 +534,26 @@ AcpiDmDescendingOp (
{
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;

/*
* A Zero predicate indicates the possibility of one or more
* External() opcodes within the If() block.
*/
if (NextOp->Common.AmlOpcode == AML_ZERO_OP)
{
NextOp2 = NextOp->Common.Next;
/* Don't emit the actual embedded externals unless asked */

if (NextOp2 &&
(NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP))
if (!AcpiGbl_DmEmitExternalOpcodes)
{
/*
* A Zero predicate indicates the possibility of one or more
* External() opcodes within the If() block.
*/
if (NextOp->Common.AmlOpcode == AML_ZERO_OP)
{
/* Ignore the If 0 block and all children */
NextOp2 = NextOp->Common.Next;

if (NextOp2 &&
(NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP))
{
/* Ignore the If 0 block and all children */

Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
return (AE_CTRL_DEPTH);
Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
return (AE_CTRL_DEPTH);
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions source/include/acglobal.h
Expand Up @@ -393,6 +393,7 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmEmitExternalOpcodes, FALSE);

ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing);
Expand Down

0 comments on commit 152a8ca

Please sign in to comment.