aboutsummaryrefslogtreecommitdiff
path: root/source/components/debugger/dbinput.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/debugger/dbinput.c')
-rw-r--r--source/components/debugger/dbinput.c111
1 files changed, 20 insertions, 91 deletions
diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c
index e2fa43274d34..eb8747069972 100644
--- a/source/components/debugger/dbinput.c
+++ b/source/components/debugger/dbinput.c
@@ -64,10 +64,6 @@ AcpiDbMatchCommand (
char *UserCommand);
static void
-AcpiDbSingleThread (
- void);
-
-static void
AcpiDbDisplayCommandInfo (
const char *Command,
BOOLEAN DisplayAll);
@@ -1231,61 +1227,17 @@ void ACPI_SYSTEM_XFACE
AcpiDbExecuteThread (
void *Context)
{
- ACPI_STATUS Status = AE_OK;
- ACPI_STATUS MStatus;
-
-
- while (Status != AE_CTRL_TERMINATE && !AcpiGbl_DbTerminateLoop)
- {
- AcpiGbl_MethodExecuting = FALSE;
- AcpiGbl_StepToNextCall = FALSE;
- MStatus = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady,
- ACPI_WAIT_FOREVER);
- if (ACPI_FAILURE (MStatus))
- {
- return;
- }
-
- Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL);
-
- AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete);
- }
+ (void) AcpiDbUserCommands ();
AcpiGbl_DbThreadsTerminated = TRUE;
}
/*******************************************************************************
*
- * FUNCTION: AcpiDbSingleThread
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Debugger execute thread. Waits for a command line, then
- * simply dispatches it.
- *
- ******************************************************************************/
-
-static void
-AcpiDbSingleThread (
- void)
-{
-
- AcpiGbl_MethodExecuting = FALSE;
- AcpiGbl_StepToNextCall = FALSE;
-
- (void) AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiDbUserCommands
*
- * PARAMETERS: Prompt - User prompt (depends on mode)
- * Op - Current executing parse op
+ * PARAMETERS: None
*
* RETURN: None
*
@@ -1296,8 +1248,7 @@ AcpiDbSingleThread (
ACPI_STATUS
AcpiDbUserCommands (
- char Prompt,
- ACPI_PARSE_OBJECT *Op)
+ void)
{
ACPI_STATUS Status = AE_OK;
@@ -1308,55 +1259,33 @@ AcpiDbUserCommands (
while (!AcpiGbl_DbTerminateLoop)
{
- /* Force output to console until a command is entered */
-
- AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
-
- /* Different prompt if method is executing */
+ /* Wait the readiness of the command */
- if (!AcpiGbl_MethodExecuting)
- {
- AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT);
- }
- else
+ Status = AcpiOsWaitCommandReady ();
+ if (ACPI_FAILURE (Status))
{
- AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT);
+ break;
}
- /* Get the user input line */
+ /* Just call to the command line interpreter */
- Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,
- ACPI_DB_LINE_BUFFER_SIZE, NULL);
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
- return (Status);
- }
+ AcpiGbl_MethodExecuting = FALSE;
+ AcpiGbl_StepToNextCall = FALSE;
- /* Check for single or multithreaded debug */
+ (void) AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL);
- if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED)
- {
- /*
- * Signal the debug thread that we have a command to execute,
- * and wait for the command to complete.
- */
- AcpiOsReleaseMutex (AcpiGbl_DbCommandReady);
-
- Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete,
- ACPI_WAIT_FOREVER);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- }
- else
- {
- /* Just call to the command line interpreter */
+ /* Notify the completion of the command */
- AcpiDbSingleThread ();
+ Status = AcpiOsNotifyCommandComplete ();
+ if (ACPI_FAILURE (Status))
+ {
+ break;
}
}
+ if (ACPI_FAILURE (Status) && Status != AE_CTRL_TERMINATE)
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
+ }
return (Status);
}