summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-07-14 17:27:26 +0800
committerLv Zheng <lv.zheng@intel.com>2015-08-14 08:54:13 +0800
commit7a3f22baab000b186779dac64ad71d9776b8f432 (patch)
tree2d1956501ef8867af5e084d51e2ed00e751523ab /source
parent89cfe111fedb022d44809f8640718bfe36eae81e (diff)
downloadacpica-7a3f22baab000b186779dac64ad71d9776b8f432.tar.gz
Debugger: Split debugger initialization/termination APIs.
It is likely that the debugger is enabled only when a userspace program explicitly tells a kernel to do so, so it shouldn't be initialized as early as current implementation. The only tool requiring ACPI_DEBUGGER is acpiexec, so acpiexec need to call the new APIs by itself. And BSD developers may also get notified to invoke the APIs for DDB enabling. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Diffstat (limited to 'source')
-rw-r--r--source/components/debugger/dbinput.c4
-rw-r--r--source/components/debugger/dbxface.c14
-rw-r--r--source/components/utilities/utxface.c8
-rw-r--r--source/components/utilities/utxfinit.c11
-rw-r--r--source/include/acdebug.h8
-rw-r--r--source/include/acpixf.h8
-rw-r--r--source/tools/acpiexec/aemain.c16
7 files changed, 37 insertions, 32 deletions
diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c
index 45f8c565a..d1389b93e 100644
--- a/source/components/debugger/dbinput.c
+++ b/source/components/debugger/dbinput.c
@@ -1399,6 +1399,10 @@ AcpiDbUserCommands (
}
}
+ /* Shut down the debugger */
+
+ AcpiTerminateDebugger ();
+
/*
* Only this thread (the original thread) should actually terminate the
* subsystem, because all the semaphores are deleted during termination
diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c
index 5aba4713a..6cd1bb1de 100644
--- a/source/components/debugger/dbxface.c
+++ b/source/components/debugger/dbxface.c
@@ -473,7 +473,7 @@ AcpiDbSingleStep (
/*******************************************************************************
*
- * FUNCTION: AcpiDbInitialize
+ * FUNCTION: AcpiInitializeDebugger
*
* PARAMETERS: None
*
@@ -484,13 +484,13 @@ AcpiDbSingleStep (
******************************************************************************/
ACPI_STATUS
-AcpiDbInitialize (
+AcpiInitializeDebugger (
void)
{
ACPI_STATUS Status;
- ACPI_FUNCTION_TRACE (DbInitialize);
+ ACPI_FUNCTION_TRACE (AcpiInitializeDebugger);
/* Init globals */
@@ -558,10 +558,12 @@ AcpiDbInitialize (
return_ACPI_STATUS (AE_OK);
}
+ACPI_EXPORT_SYMBOL (AcpiInitializeDebugger)
+
/*******************************************************************************
*
- * FUNCTION: AcpiDbTerminate
+ * FUNCTION: AcpiTerminateDebugger
*
* PARAMETERS: None
*
@@ -572,7 +574,7 @@ AcpiDbInitialize (
******************************************************************************/
void
-AcpiDbTerminate (
+AcpiTerminateDebugger (
void)
{
@@ -587,6 +589,8 @@ AcpiDbTerminate (
AcpiGbl_DbOutputFlags = ACPI_DB_DISABLE_OUTPUT;
}
+ACPI_EXPORT_SYMBOL (AcpiTerminateDebugger)
+
#ifdef ACPI_OBSOLETE_FUNCTIONS
/*******************************************************************************
diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c
index a68c8eec7..a34970e9b 100644
--- a/source/components/utilities/utxface.c
+++ b/source/components/utilities/utxface.c
@@ -171,14 +171,6 @@ AcpiTerminate (
AcpiUtMutexTerminate ();
-
-#ifdef ACPI_DEBUGGER
-
- /* Shut down the debugger */
-
- AcpiDbTerminate ();
-#endif
-
/* Now we can shutdown the OS-dependent layer */
Status = AcpiOsTerminate ();
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
index 0d3cfdd21..4703dc18c 100644
--- a/source/components/utilities/utxfinit.c
+++ b/source/components/utilities/utxfinit.c
@@ -204,17 +204,6 @@ AcpiInitializeSubsystem (
return_ACPI_STATUS (Status);
}
- /* If configured, initialize the AML debugger */
-
-#ifdef ACPI_DEBUGGER
- Status = AcpiDbInitialize ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Debugger initialization"));
- return_ACPI_STATUS (Status);
- }
-#endif
-
return_ACPI_STATUS (AE_OK);
}
diff --git a/source/include/acdebug.h b/source/include/acdebug.h
index 909c8319c..156660f22 100644
--- a/source/include/acdebug.h
+++ b/source/include/acdebug.h
@@ -161,14 +161,6 @@ typedef struct acpi_db_execute_walk
* dbxface - external debugger interfaces
*/
ACPI_STATUS
-AcpiDbInitialize (
- void);
-
-void
-AcpiDbTerminate (
- void);
-
-ACPI_STATUS
AcpiDbSingleStep (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
diff --git a/source/include/acpixf.h b/source/include/acpixf.h
index 791aa646e..53b740160 100644
--- a/source/include/acpixf.h
+++ b/source/include/acpixf.h
@@ -1280,4 +1280,12 @@ AcpiLogError (
const char *Format,
...))
+ACPI_STATUS
+AcpiInitializeDebugger (
+ void);
+
+void
+AcpiTerminateDebugger (
+ void);
+
#endif /* __ACXFACE_H__ */
diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c
index bbab2f5de..1799953be 100644
--- a/source/tools/acpiexec/aemain.c
+++ b/source/tools/acpiexec/aemain.c
@@ -546,6 +546,15 @@ main (
AcpiGbl_MaxLoopIterations = 400;
+ /* Initialize the AML debugger */
+
+ Status = AcpiInitializeDebugger ();
+ AE_CHECK_OK (AcpiInitializeDebugger, Status);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
printf (ACPI_COMMON_SIGNON (ACPIEXEC_NAME));
if (argc < 2)
{
@@ -715,6 +724,10 @@ EnterDebugger:
case AE_MODE_BATCH_SINGLE:
AcpiDbExecute (BatchBuffer, NULL, NULL, EX_NO_SINGLE_STEP);
+
+ /* Shut down the debugger */
+
+ AcpiTerminateDebugger ();
Status = AcpiTerminate ();
break;
}
@@ -779,6 +792,9 @@ AcpiDbRunBatchMode (
}
}
+ /* Shut down the debugger */
+
+ AcpiTerminateDebugger ();
Status = AcpiTerminate ();
return (Status);
}