summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/dbxface.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/dbxface.c')
-rw-r--r--sys/contrib/dev/acpica/dbxface.c180
1 files changed, 121 insertions, 59 deletions
diff --git a/sys/contrib/dev/acpica/dbxface.c b/sys/contrib/dev/acpica/dbxface.c
index 39a0702..74542bd 100644
--- a/sys/contrib/dev/acpica/dbxface.c
+++ b/sys/contrib/dev/acpica/dbxface.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbxface - AML Debugger external interfaces
- * $Revision: 65 $
+ * $Revision: 70 $
*
******************************************************************************/
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -129,6 +129,113 @@
/*******************************************************************************
*
+ * FUNCTION: AcpiDbStartCommand
+ *
+ * PARAMETERS: WalkState - Current walk
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Enter debugger command loop
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDbStartCommand (
+ ACPI_WALK_STATE *WalkState,
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_STATUS Status;
+
+
+ /* TBD: [Investigate] what are the namespace locking issues here */
+
+ /* AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); */
+
+ /* Go into the command loop and await next user command */
+
+
+ AcpiGbl_MethodExecuting = TRUE;
+ Status = AE_CTRL_TRUE;
+ while (Status == AE_CTRL_TRUE)
+ {
+ if (AcpiGbl_DebuggerConfiguration == DEBUGGER_MULTI_THREADED)
+ {
+ /* Handshake with the front-end that gets user command lines */
+
+ Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ }
+ else
+ {
+ /* Single threaded, we must get a command line ourselves */
+
+ /* Force output to console until a command is entered */
+
+ AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
+
+ /* Different prompt if method is executing */
+
+ if (!AcpiGbl_MethodExecuting)
+ {
+ AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT);
+ }
+ else
+ {
+ AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT);
+ }
+
+ /* Get the user input line */
+
+ (void) AcpiOsGetLine (AcpiGbl_DbLineBuf);
+ }
+
+ Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, WalkState, Op);
+ }
+
+ /* AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); */
+
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbMethodEnd
+ *
+ * PARAMETERS: WalkState - Current walk
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION:
+ *
+ ******************************************************************************/
+
+void
+AcpiDbMethodEnd (
+ ACPI_WALK_STATE *WalkState)
+{
+
+ if (!AcpiGbl_CmSingleStep)
+ {
+ return;
+ }
+
+ AcpiOsPrintf ("<Method Terminating>\n");
+
+ AcpiDbStartCommand (WalkState, NULL);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDbSingleStep
*
* PARAMETERS: WalkState - Current walk
@@ -156,6 +263,15 @@ AcpiDbSingleStep (
ACPI_FUNCTION_ENTRY ();
+
+ /* Check the abort flag */
+
+ if (AcpiGbl_AbortMethod)
+ {
+ AcpiGbl_AbortMethod = FALSE;
+ return (AE_ABORT_METHOD);
+ }
+
/* Check for single-step breakpoint */
if (WalkState->MethodBreakpoint &&
@@ -181,7 +297,6 @@ AcpiDbSingleStep (
WalkState->MethodBreakpoint = 0;
}
-
/*
* Check if this is an opcode that we are interested in --
* namely, opcodes that have arguments
@@ -283,7 +398,6 @@ AcpiDbSingleStep (
AcpiOsPrintf ("Predicate = [False], Skipping IF block\n");
}
}
-
else if (Op->Common.AmlOpcode == AML_ELSE_OP)
{
AcpiOsPrintf ("Predicate = [False], ELSE block was executed\n");
@@ -340,60 +454,7 @@ AcpiDbSingleStep (
}
- /* TBD: [Investigate] what are the namespace locking issues here */
-
- /* AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); */
-
- /* Go into the command loop and await next user command */
-
- AcpiGbl_MethodExecuting = TRUE;
- Status = AE_CTRL_TRUE;
- while (Status == AE_CTRL_TRUE)
- {
- if (AcpiGbl_DebuggerConfiguration == DEBUGGER_MULTI_THREADED)
- {
- /* Handshake with the front-end that gets user command lines */
-
- Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- }
-
- else
- {
- /* Single threaded, we must get a command line ourselves */
-
- /* Force output to console until a command is entered */
-
- AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
-
- /* Different prompt if method is executing */
-
- if (!AcpiGbl_MethodExecuting)
- {
- AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT);
- }
- else
- {
- AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT);
- }
-
- /* Get the user input line */
-
- (void) AcpiOsGetLine (AcpiGbl_DbLineBuf);
- }
-
- Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, WalkState, Op);
- }
-
- /* AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); */
+ Status = AcpiDbStartCommand (WalkState, Op);
/* User commands complete, continue execution of the interrupted method */
@@ -426,7 +487,7 @@ AcpiDbInitialize (void)
AcpiGbl_DbOutputToFile = FALSE;
AcpiGbl_DbDebugLevel = ACPI_LV_VERBOSITY2;
- AcpiGbl_DbConsoleDebugLevel = NORMAL_DEFAULT | ACPI_LV_TABLES;
+ AcpiGbl_DbConsoleDebugLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
AcpiGbl_DbOpt_tables = FALSE;
@@ -463,6 +524,7 @@ AcpiDbInitialize (void)
AcpiOsPrintf ("Could not get debugger mutex\n");
return (Status);
}
+
Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
if (ACPI_FAILURE (Status))
{
OpenPOWER on IntegriCloud