1 /*******************************************************************************
3 * Module Name: dbinput - user front-end to the AML debugger
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2014, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
52 #define _COMPONENT ACPI_CA_DEBUGGER
53 ACPI_MODULE_NAME ("dbinput")
55 /* Local prototypes */
70 AcpiDbDisplayCommandInfo (
79 AcpiDbMatchCommandHelp (
81 const ACPI_DB_COMMAND_HELP *Help);
85 * Top-level debugger commands.
87 * This list of commands must match the string table below it
89 enum AcpiExDebuggerCommands
157 #define CMD_FIRST_VALID 2
160 /* Second parameter is the required argument count */
162 static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
232 * Help for all debugger commands. First argument is the number of lines
233 * of help to output for the command.
235 static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
237 {0, "\nGeneral-Purpose Commands:", "\n"},
238 {1, " Allocations", "Display list of current memory allocations\n"},
239 {2, " Dump <Address>|<Namepath>", "\n"},
240 {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"},
241 {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"},
242 {1, " Handlers", "Info about global handlers\n"},
243 {1, " Help [Command]", "This help screen or individual command\n"},
244 {1, " History", "Display command history buffer\n"},
245 {1, " Level <DebugLevel>] [console]", "Get/Set debug level for file or console\n"},
246 {1, " Locks", "Current status of internal mutexes\n"},
247 {1, " Osi [Install|Remove <name>]", "Display or modify global _OSI list\n"},
248 {1, " Quit or Exit", "Exit this command\n"},
249 {8, " Stats <SubCommand>", "Display namespace and memory statistics\n"},
250 {1, " Allocations", "Display list of current memory allocations\n"},
251 {1, " Memory", "Dump internal memory lists\n"},
252 {1, " Misc", "Namespace search and mutex stats\n"},
253 {1, " Objects", "Summary of namespace objects\n"},
254 {1, " Sizes", "Sizes for each of the internal objects\n"},
255 {1, " Stack", "Display CPU stack usage\n"},
256 {1, " Tables", "Info about current ACPI table(s)\n"},
257 {1, " Tables", "Display info about loaded ACPI tables\n"},
258 {1, " Unload <Namepath>", "Unload an ACPI table via namespace object\n"},
259 {1, " ! <CommandNumber>", "Execute command from history buffer\n"},
260 {1, " !!", "Execute last command again\n"},
262 {0, "\nNamespace Access Commands:", "\n"},
263 {1, " Businfo", "Display system bus info\n"},
264 {1, " Disassemble <Method>", "Disassemble a control method\n"},
265 {1, " Find <AcpiName> (? is wildcard)", "Find ACPI name(s) with wildcards\n"},
266 {1, " Integrity", "Validate namespace integrity\n"},
267 {1, " Methods", "Display list of loaded control methods\n"},
268 {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"},
269 {1, " Notify <Object> <Value>", "Send a notification on Object\n"},
270 {1, " Objects <ObjectType>", "Display all objects of the given type\n"},
271 {1, " Owner <OwnerId> [Depth]", "Display loaded namespace by object owner\n"},
272 {1, " Paths", "Display full pathnames of namespace objects\n"},
273 {1, " Predefined", "Check all predefined names\n"},
274 {1, " Prefix [<NamePath>]", "Set or Get current execution prefix\n"},
275 {1, " References <Addr>", "Find all references to object at addr\n"},
276 {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"},
277 {1, " Set N <NamedObject> <Value>", "Set value for named integer\n"},
278 {1, " Template <Object>", "Format/dump a Buffer/ResourceTemplate\n"},
279 {1, " Terminate", "Delete namespace and all internal objects\n"},
280 {1, " Type <Object>", "Display object type\n"},
282 {0, "\nControl Method Execution Commands:","\n"},
283 {1, " Arguments (or Args)", "Display method arguments\n"},
284 {1, " Breakpoint <AmlOffset>", "Set an AML execution breakpoint\n"},
285 {1, " Call", "Run to next control method invocation\n"},
286 {1, " Debug <Namepath> [Arguments]", "Single Step a control method\n"},
287 {6, " Evaluate", "Synonym for Execute\n"},
288 {5, " Execute <Namepath> [Arguments]", "Execute control method\n"},
289 {1, " Hex Integer", "Integer method argument\n"},
290 {1, " \"Ascii String\"", "String method argument\n"},
291 {1, " (Hex Byte List)", "Buffer method argument\n"},
292 {1, " [Package Element List]", "Package method argument\n"},
293 {1, " Go", "Allow method to run to completion\n"},
294 {1, " Information", "Display info about the current method\n"},
295 {1, " Into", "Step into (not over) a method call\n"},
296 {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"},
297 {1, " Locals", "Display method local variables\n"},
298 {1, " Results", "Display method result stack\n"},
299 {1, " Set <A|L> <#> <Value>", "Set method data (Arguments/Locals)\n"},
300 {1, " Stop", "Terminate control method\n"},
301 {1, " Thread <Threads><Loops><NamePath>", "Spawn threads to execute method(s)\n"},
302 {1, " Trace <method name>", "Trace method execution\n"},
303 {1, " Tree", "Display control method calling tree\n"},
304 {1, " <Enter>", "Single step next AML opcode (over calls)\n"},
306 {0, "\nHardware Related Commands:", "\n"},
307 {1, " Event <F|G> <Value>", "Generate AcpiEvent (Fixed/GPE)\n"},
308 {1, " Gpe <GpeNum> <GpeBlock>", "Simulate a GPE\n"},
309 {1, " Gpes", "Display info on all GPEs\n"},
310 {1, " Sci", "Generate an SCI\n"},
311 {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"},
313 {0, "\nFile I/O Commands:", "\n"},
314 {1, " Close", "Close debug output file\n"},
315 {1, " Load <Input Filename>", "Load ACPI table from a file\n"},
316 {1, " Open <Output Filename>", "Open a file for debug output\n"},
318 {0, "\nDebug Test Commands:", "\n"},
319 {3, " Test <TestName>", "Invoke a debug test\n"},
320 {1, " Objects", "Read/write/compare all namespace data objects\n"},
321 {1, " Predefined", "Execute all ACPI predefined names (_STA, etc.)\n"},
326 /*******************************************************************************
328 * FUNCTION: AcpiDbMatchCommandHelp
330 * PARAMETERS: Command - Command string to match
331 * Help - Help table entry to attempt match
333 * RETURN: TRUE if command matched, FALSE otherwise
335 * DESCRIPTION: Attempt to match a command in the help table in order to
336 * print help information for a single command.
338 ******************************************************************************/
341 AcpiDbMatchCommandHelp (
343 const ACPI_DB_COMMAND_HELP *Help)
345 char *Invocation = Help->Invocation;
349 /* Valid commands in the help table begin with a couple of spaces */
351 if (*Invocation != ' ')
356 while (*Invocation == ' ')
361 /* Match command name (full command or substring) */
363 while ((*Command) && (*Invocation) && (*Invocation != ' '))
365 if (ACPI_TOLOWER (*Command) != ACPI_TOLOWER (*Invocation))
374 /* Print the appropriate number of help lines */
376 LineCount = Help->LineCount;
379 AcpiOsPrintf ("%-38s : %s", Help->Invocation, Help->Description);
388 /*******************************************************************************
390 * FUNCTION: AcpiDbDisplayCommandInfo
392 * PARAMETERS: Command - Command string to match
393 * DisplayAll - Display all matching commands, or just
394 * the first one (substring match)
398 * DESCRIPTION: Display help information for a Debugger command.
400 ******************************************************************************/
403 AcpiDbDisplayCommandInfo (
407 const ACPI_DB_COMMAND_HELP *Next;
411 Next = AcpiGbl_DbCommandHelp;
412 while (Next->Invocation)
414 Matched = AcpiDbMatchCommandHelp (Command, Next);
415 if (!DisplayAll && Matched)
425 /*******************************************************************************
427 * FUNCTION: AcpiDbDisplayHelp
429 * PARAMETERS: Command - Optional command string to display help.
430 * if not specified, all debugger command
431 * help strings are displayed
435 * DESCRIPTION: Display help for a single debugger command, or all of them.
437 ******************************************************************************/
443 const ACPI_DB_COMMAND_HELP *Next = AcpiGbl_DbCommandHelp;
448 /* No argument to help, display help for all commands */
450 while (Next->Invocation)
452 AcpiOsPrintf ("%-38s%s", Next->Invocation, Next->Description);
458 /* Display help for all commands that match the subtring */
460 AcpiDbDisplayCommandInfo (Command, TRUE);
465 /*******************************************************************************
467 * FUNCTION: AcpiDbGetNextToken
469 * PARAMETERS: String - Command buffer
470 * Next - Return value, end of next token
472 * RETURN: Pointer to the start of the next token.
474 * DESCRIPTION: Command line parsing. Get the next token on the command line
476 ******************************************************************************/
482 ACPI_OBJECT_TYPE *ReturnType)
486 ACPI_OBJECT_TYPE Type = ACPI_TYPE_INTEGER;
489 /* At end of buffer? */
491 if (!String || !(*String))
496 /* Remove any spaces at the beginning */
500 while (*String && (*String == ' '))
515 /* This is a quoted string, scan until closing quote */
519 Type = ACPI_TYPE_STRING;
521 /* Find end of string */
523 while (*String && (*String != '"'))
531 /* This is the start of a buffer, scan until closing paren */
535 Type = ACPI_TYPE_BUFFER;
537 /* Find end of buffer */
539 while (*String && (*String != ')'))
547 /* This is the start of a package, scan until closing bracket */
552 Type = ACPI_TYPE_PACKAGE;
554 /* Find end of package (closing bracket) */
558 /* Handle String package elements */
562 /* Find end of string */
565 while (*String && (*String != '"'))
574 else if (*String == '[')
576 Depth++; /* A nested package declaration */
578 else if (*String == ']')
581 if (Depth == 0) /* Found final package closing bracket */
595 /* Find end of token */
597 while (*String && (*String != ' '))
619 /*******************************************************************************
621 * FUNCTION: AcpiDbGetLine
623 * PARAMETERS: InputBuffer - Command line buffer
625 * RETURN: Count of arguments to the command
627 * DESCRIPTION: Get the next command line from the user. Gets entire line
628 * up to the next newline
630 ******************************************************************************/
642 if (AcpiUtSafeStrcpy (AcpiGbl_DbParsedBuf, sizeof (AcpiGbl_DbParsedBuf),
645 AcpiOsPrintf ("Buffer overflow while parsing input line (max %u characters)\n",
646 sizeof (AcpiGbl_DbParsedBuf));
650 This = AcpiGbl_DbParsedBuf;
651 for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
653 AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
654 &AcpiGbl_DbArgTypes[i]);
655 if (!AcpiGbl_DbArgs[i])
663 /* Uppercase the actual command */
665 if (AcpiGbl_DbArgs[0])
667 AcpiUtStrupr (AcpiGbl_DbArgs[0]);
673 Count--; /* Number of args only */
680 /*******************************************************************************
682 * FUNCTION: AcpiDbMatchCommand
684 * PARAMETERS: UserCommand - User command line
686 * RETURN: Index into command array, -1 if not found
688 * DESCRIPTION: Search command array for a command match
690 ******************************************************************************/
699 if (!UserCommand || UserCommand[0] == 0)
704 for (i = CMD_FIRST_VALID; AcpiGbl_DbCommands[i].Name; i++)
706 if (ACPI_STRSTR (AcpiGbl_DbCommands[i].Name, UserCommand) ==
707 AcpiGbl_DbCommands[i].Name)
713 /* Command not recognized */
715 return (CMD_NOT_FOUND);
719 /*******************************************************************************
721 * FUNCTION: AcpiDbCommandDispatch
723 * PARAMETERS: InputBuffer - Command line buffer
724 * WalkState - Current walk
725 * Op - Current (executing) parse op
729 * DESCRIPTION: Command dispatcher.
731 ******************************************************************************/
734 AcpiDbCommandDispatch (
736 ACPI_WALK_STATE *WalkState,
737 ACPI_PARSE_OBJECT *Op)
743 ACPI_STATUS Status = AE_CTRL_TRUE;
746 /* If AcpiTerminate has been called, terminate this thread */
748 if (AcpiGbl_DbTerminateThreads)
750 return (AE_CTRL_TERMINATE);
754 /* Add all commands that come here to the history buffer */
756 AcpiDbAddToHistory (InputBuffer);
758 ParamCount = AcpiDbGetLine (InputBuffer);
759 CommandIndex = AcpiDbMatchCommand (AcpiGbl_DbArgs[0]);
762 /* Verify that we have the minimum number of params */
764 if (ParamCount < AcpiGbl_DbCommands[CommandIndex].MinArgs)
766 AcpiOsPrintf ("%u parameters entered, [%s] requires %u parameters\n",
767 ParamCount, AcpiGbl_DbCommands[CommandIndex].Name,
768 AcpiGbl_DbCommands[CommandIndex].MinArgs);
770 AcpiDbDisplayCommandInfo (AcpiGbl_DbCommands[CommandIndex].Name, FALSE);
771 return (AE_CTRL_TRUE);
774 /* Decode and dispatch the command */
776 switch (CommandIndex)
786 case CMD_ALLOCATIONS:
788 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
789 AcpiUtDumpAllocations ((UINT32) -1, NULL);
796 AcpiDbDisplayArguments ();
801 AcpiDbSetMethodBreakpoint (AcpiGbl_DbArgs[1], WalkState, Op);
811 AcpiDbSetMethodCallBreakpoint (Op);
817 AcpiDbCloseDebugFile ();
822 AcpiDbExecute (AcpiGbl_DbArgs[1],
823 &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_SINGLE_STEP);
826 case CMD_DISASSEMBLE:
829 (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]);
834 AcpiDbDecodeAndDisplayObject (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
838 #if (!ACPI_REDUCED_HARDWARE)
840 Status = AcpiEnable();
841 if (ACPI_FAILURE(Status))
843 AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status);
846 #endif /* !ACPI_REDUCED_HARDWARE */
851 AcpiOsPrintf ("Event command not implemented\n");
857 AcpiDbExecute (AcpiGbl_DbArgs[1],
858 &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP);
863 Status = AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]);
868 AcpiGbl_CmSingleStep = FALSE;
873 AcpiDbGenerateGpe (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
878 AcpiDbDisplayGpes ();
883 AcpiDbDisplayHandlers ();
889 AcpiDbDisplayHelp (AcpiGbl_DbArgs[1]);
894 AcpiDbDisplayHistory ();
897 case CMD_HISTORY_EXE: /* ! command */
899 CommandLine = AcpiDbGetFromHistory (AcpiGbl_DbArgs[1]);
902 return (AE_CTRL_TRUE);
905 Status = AcpiDbCommandDispatch (CommandLine, WalkState, Op);
908 case CMD_HISTORY_LAST: /* !! command */
910 CommandLine = AcpiDbGetFromHistory (NULL);
913 return (AE_CTRL_TRUE);
916 Status = AcpiDbCommandDispatch (CommandLine, WalkState, Op);
919 case CMD_INFORMATION:
921 AcpiDbDisplayMethodInfo (Op);
926 AcpiDbCheckIntegrity ();
933 AcpiGbl_CmSingleStep = TRUE;
942 AcpiOsPrintf ("Current debug level for file output is: %8.8lX\n",
943 AcpiGbl_DbDebugLevel);
944 AcpiOsPrintf ("Current debug level for console output is: %8.8lX\n",
945 AcpiGbl_DbConsoleDebugLevel);
947 else if (ParamCount == 2)
949 Temp = AcpiGbl_DbConsoleDebugLevel;
950 AcpiGbl_DbConsoleDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1],
953 "Debug Level for console output was %8.8lX, now %8.8lX\n",
954 Temp, AcpiGbl_DbConsoleDebugLevel);
958 Temp = AcpiGbl_DbDebugLevel;
959 AcpiGbl_DbDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1], NULL, 16);
961 "Debug Level for file output was %8.8lX, now %8.8lX\n",
962 Temp, AcpiGbl_DbDebugLevel);
968 AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op);
973 Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL);
978 AcpiDbDisplayLocks ();
983 AcpiDbDisplayLocals ();
988 Status = AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]);
993 AcpiDbDumpNamespace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
998 Temp = ACPI_STRTOUL (AcpiGbl_DbArgs[2], NULL, 0);
999 AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp);
1004 AcpiUtStrupr (AcpiGbl_DbArgs[1]);
1005 Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
1010 AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]);
1015 AcpiDbDisplayInterfaces (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
1020 AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
1025 AcpiDbDumpNamespacePaths ();
1028 case CMD_PREDEFINED:
1030 AcpiDbCheckPredefinedNames ();
1035 AcpiDbSetScope (AcpiGbl_DbArgs[1]);
1038 case CMD_REFERENCES:
1040 AcpiDbFindReferences (AcpiGbl_DbArgs[1]);
1045 AcpiDbDisplayResources (AcpiGbl_DbArgs[1]);
1050 AcpiDbDisplayResults ();
1055 AcpiDbGenerateSci ();
1060 AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
1066 Status = AcpiDbSleep (AcpiGbl_DbArgs[1]);
1071 Status = AcpiDbDisplayStatistics (AcpiGbl_DbArgs[1]);
1076 return (AE_NOT_IMPLEMENTED);
1080 AcpiDbDisplayTableInfo (AcpiGbl_DbArgs[1]);
1085 AcpiDbDisplayTemplate (AcpiGbl_DbArgs[1]);
1090 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1091 AcpiUtSubsystemShutdown ();
1094 * TBD: [Restructure] Need some way to re-initialize without
1095 * re-creating the semaphores!
1098 /* AcpiInitialize (NULL); */
1103 AcpiDbExecuteTest (AcpiGbl_DbArgs[1]);
1108 AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
1114 (void) AcpiDebugTrace (AcpiGbl_DbArgs[1],0,0,1);
1119 AcpiDbDisplayCallingTree ();
1124 AcpiDbDisplayObjectType (AcpiGbl_DbArgs[1]);
1129 AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]);
1137 AcpiOsPrintf ("Method execution terminated\n");
1138 return (AE_CTRL_TERMINATE);
1141 if (!AcpiGbl_DbOutputToFile)
1143 AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
1146 AcpiDbCloseDebugFile ();
1147 AcpiGbl_DbTerminateThreads = TRUE;
1148 return (AE_CTRL_TERMINATE);
1153 AcpiOsPrintf ("%s: unknown command\n", AcpiGbl_DbArgs[0]);
1154 return (AE_CTRL_TRUE);
1157 if (ACPI_SUCCESS (Status))
1159 Status = AE_CTRL_TRUE;
1166 /*******************************************************************************
1168 * FUNCTION: AcpiDbExecuteThread
1170 * PARAMETERS: Context - Not used
1174 * DESCRIPTION: Debugger execute thread. Waits for a command line, then
1175 * simply dispatches it.
1177 ******************************************************************************/
1179 void ACPI_SYSTEM_XFACE
1180 AcpiDbExecuteThread (
1183 ACPI_STATUS Status = AE_OK;
1184 ACPI_STATUS MStatus;
1187 while (Status != AE_CTRL_TERMINATE)
1189 AcpiGbl_MethodExecuting = FALSE;
1190 AcpiGbl_StepToNextCall = FALSE;
1192 MStatus = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);
1193 if (ACPI_FAILURE (MStatus))
1198 Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL);
1200 MStatus = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
1201 if (ACPI_FAILURE (MStatus))
1209 /*******************************************************************************
1211 * FUNCTION: AcpiDbSingleThread
1217 * DESCRIPTION: Debugger execute thread. Waits for a command line, then
1218 * simply dispatches it.
1220 ******************************************************************************/
1223 AcpiDbSingleThread (
1227 AcpiGbl_MethodExecuting = FALSE;
1228 AcpiGbl_StepToNextCall = FALSE;
1230 (void) AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL);
1234 /*******************************************************************************
1236 * FUNCTION: AcpiDbUserCommands
1238 * PARAMETERS: Prompt - User prompt (depends on mode)
1239 * Op - Current executing parse op
1243 * DESCRIPTION: Command line execution for the AML debugger. Commands are
1244 * matched and dispatched here.
1246 ******************************************************************************/
1249 AcpiDbUserCommands (
1251 ACPI_PARSE_OBJECT *Op)
1253 ACPI_STATUS Status = AE_OK;
1256 AcpiOsPrintf ("\n");
1258 /* TBD: [Restructure] Need a separate command line buffer for step mode */
1260 while (!AcpiGbl_DbTerminateThreads)
1262 /* Force output to console until a command is entered */
1264 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1266 /* Different prompt if method is executing */
1268 if (!AcpiGbl_MethodExecuting)
1270 AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT);
1274 AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT);
1277 /* Get the user input line */
1279 Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,
1280 ACPI_DB_LINE_BUFFER_SIZE, NULL);
1281 if (ACPI_FAILURE (Status))
1283 ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
1287 /* Check for single or multithreaded debug */
1289 if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED)
1292 * Signal the debug thread that we have a command to execute,
1293 * and wait for the command to complete.
1295 Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_READY);
1296 if (ACPI_FAILURE (Status))
1301 Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);
1302 if (ACPI_FAILURE (Status))
1309 /* Just call to the command line interpreter */
1311 AcpiDbSingleThread ();
1316 * Only this thread (the original thread) should actually terminate the
1317 * subsystem, because all the semaphores are deleted during termination
1319 Status = AcpiTerminate ();
1323 #endif /* ACPI_DEBUGGER */