Skip to content

Commit

Permalink
Disassembler: Cleanup AcpiGbl_DbOpt_Verbose acpiexec usage.
Browse files Browse the repository at this point in the history
When AcpiGbl_DbOpt_Verbose is used in AcpiDmDescendingOp() (invoked by
AcpiDmDisassemble()), it is actually exported by the disassembler but used
by the debugger to distinguish the output of the disassembler for different
debugger commands. It is by default TRUE but is set to FALSE for control
method disassembly command - "disassemble". So it's initialization should
be a part of the ACPI_DISASSEMBLER conditioned code. This patch uses
ACPI_INIT_GLOBAL to achieve a clean manner so that when ACPI_DISASSEMBLER
is not defined, ACPI_DEBUGGER conditioned code needn't link to this option.
Since it is a disassembler exported variable, it is renamed to
AcpiGbl_DmOpt_Verbose in this patch.

As VERBOSE_PRINT() macro has only one user, this patch also removes the
definition of this macro. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
  • Loading branch information
Lv Zheng committed Aug 14, 2015
1 parent 4ba3d51 commit 42d7ad7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions source/components/debugger/dbmethod.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ AcpiDbDisassembleMethod (

/* Now we can disassemble the method */

AcpiGbl_DbOpt_Verbose = FALSE;
AcpiGbl_DmOpt_Verbose = FALSE;
AcpiDmDisassemble (NULL, Op, 0);
AcpiGbl_DbOpt_Verbose = TRUE;
AcpiGbl_DmOpt_Verbose = TRUE;
#endif

AcpiPsDeleteParseTree (Op);
Expand Down
1 change: 0 additions & 1 deletion source/components/debugger/dbxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ AcpiInitializeDebugger (
AcpiGbl_DbConsoleDebugLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;

AcpiGbl_DbOpt_Verbose = TRUE;
AcpiGbl_DbOpt_NoIniMethods = FALSE;

AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE);
Expand Down
13 changes: 8 additions & 5 deletions source/components/disassembler/dmwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,13 @@ AcpiDmDescendingOp (
{
AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
Info->WalkState->ParserState.AmlStart);
VERBOSE_PRINT ((DB_FULL_OP_INFO,
(Info->WalkState->MethodNode ?
Info->WalkState->MethodNode->Name.Ascii : " "),
AmlOffset, (UINT32) Op->Common.AmlOpcode));
if (AcpiGbl_DmOpt_Verbose)
{
AcpiOsPrintf (DB_FULL_OP_INFO,
(Info->WalkState->MethodNode ?
Info->WalkState->MethodNode->Name.Ascii : " "),
AmlOffset, (UINT32) Op->Common.AmlOpcode);
}
}

if (Op->Common.AmlOpcode == AML_SCOPE_OP)
Expand Down Expand Up @@ -673,7 +676,7 @@ AcpiDmDescendingOp (

if (Op->Common.AmlOpcode != AML_INT_NAMEDFIELD_OP)
{
if (AcpiGbl_DbOpt_Verbose)
if (AcpiGbl_DmOpt_Verbose)
{
(void) AcpiPsDisplayObjectPathname (NULL, Op);
}
Expand Down
3 changes: 0 additions & 3 deletions source/include/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ typedef struct acpi_db_execute_walk


#define PARAM_LIST(pl) pl
#define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_Verbose)
#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
AcpiOsPrintf PARAM_LIST(fp);}

#define EX_NO_SINGLE_STEP 1
#define EX_SINGLE_STEP 2
Expand Down
2 changes: 1 addition & 1 deletion source/include/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
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_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Verbose);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods);
ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods);
ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList);
Expand Down

0 comments on commit 42d7ad7

Please sign in to comment.