From 42d7ad7bfb1cfb95183c1386c77509f2036f521d Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Fri, 14 Aug 2015 08:54:15 +0800 Subject: [PATCH] Disassembler: Cleanup AcpiGbl_DbOpt_Verbose acpiexec usage. 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 --- source/components/debugger/dbmethod.c | 4 ++-- source/components/debugger/dbxface.c | 1 - source/components/disassembler/dmwalk.c | 13 ++++++++----- source/include/acdebug.h | 3 --- source/include/acglobal.h | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index bfa99ac792..b126f394bf 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -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); diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c index 03ee257508..c9679a52e3 100644 --- a/source/components/debugger/dbxface.c +++ b/source/components/debugger/dbxface.c @@ -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); diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index be28afe557..e9e7491367 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -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) @@ -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); } diff --git a/source/include/acdebug.h b/source/include/acdebug.h index 156660f229..cc02999462 100644 --- a/source/include/acdebug.h +++ b/source/include/acdebug.h @@ -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 diff --git a/source/include/acglobal.h b/source/include/acglobal.h index 95bec6ebdd..2d8bd88cbe 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -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);