1 /*******************************************************************************
3 * Module Name: dbinput - user front-end to the AML debugger
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2016, 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.
44 #include <contrib/dev/acpica/include/acpi.h>
45 #include <contrib/dev/acpica/include/accommon.h>
46 #include <contrib/dev/acpica/include/acdebug.h>
48 #ifdef ACPI_APPLICATION
49 #include <contrib/dev/acpica/include/acapps.h>
52 #define _COMPONENT ACPI_CA_DEBUGGER
53 ACPI_MODULE_NAME ("dbinput")
56 /* Local prototypes */
67 AcpiDbDisplayCommandInfo (
76 AcpiDbMatchCommandHelp (
78 const ACPI_DB_COMMAND_HELP *Help);
82 * Top-level debugger commands.
84 * This list of commands must match the string table below it
86 enum AcpiExDebuggerCommands
139 #ifdef ACPI_APPLICATION
159 #define CMD_FIRST_VALID 2
162 /* Second parameter is the required argument count */
164 static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
217 #ifdef ACPI_APPLICATION
239 * Help for all debugger commands. First argument is the number of lines
240 * of help to output for the command.
242 static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
244 {0, "\nGeneral-Purpose Commands:", "\n"},
245 {1, " Allocations", "Display list of current memory allocations\n"},
246 {2, " Dump <Address>|<Namepath>", "\n"},
247 {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"},
248 {1, " Handlers", "Info about global handlers\n"},
249 {1, " Help [Command]", "This help screen or individual command\n"},
250 {1, " History", "Display command history buffer\n"},
251 {1, " Level <DebugLevel>] [console]", "Get/Set debug level for file or console\n"},
252 {1, " Locks", "Current status of internal mutexes\n"},
253 {1, " Osi [Install|Remove <name>]", "Display or modify global _OSI list\n"},
254 {1, " Quit or Exit", "Exit this command\n"},
255 {8, " Stats <SubCommand>", "Display namespace and memory statistics\n"},
256 {1, " Allocations", "Display list of current memory allocations\n"},
257 {1, " Memory", "Dump internal memory lists\n"},
258 {1, " Misc", "Namespace search and mutex stats\n"},
259 {1, " Objects", "Summary of namespace objects\n"},
260 {1, " Sizes", "Sizes for each of the internal objects\n"},
261 {1, " Stack", "Display CPU stack usage\n"},
262 {1, " Tables", "Info about current ACPI table(s)\n"},
263 {1, " Tables", "Display info about loaded ACPI tables\n"},
264 {1, " ! <CommandNumber>", "Execute command from history buffer\n"},
265 {1, " !!", "Execute last command again\n"},
267 {0, "\nNamespace Access Commands:", "\n"},
268 {1, " Businfo", "Display system bus info\n"},
269 {1, " Disassemble <Method>", "Disassemble a control method\n"},
270 {1, " Find <AcpiName> (? is wildcard)", "Find ACPI name(s) with wildcards\n"},
271 {1, " Integrity", "Validate namespace integrity\n"},
272 {1, " Methods", "Display list of loaded control methods\n"},
273 {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"},
274 {1, " Notify <Object> <Value>", "Send a notification on Object\n"},
275 {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"},
276 {1, " Owner <OwnerId> [Depth]", "Display loaded namespace by object owner\n"},
277 {1, " Paths", "Display full pathnames of namespace objects\n"},
278 {1, " Predefined", "Check all predefined names\n"},
279 {1, " Prefix [<Namepath>]", "Set or Get current execution prefix\n"},
280 {1, " References <Addr>", "Find all references to object at addr\n"},
281 {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"},
282 {1, " Set N <NamedObject> <Value>", "Set value for named integer\n"},
283 {1, " Template <Object>", "Format/dump a Buffer/ResourceTemplate\n"},
284 {1, " Type <Object>", "Display object type\n"},
286 {0, "\nControl Method Execution Commands:","\n"},
287 {1, " Arguments (or Args)", "Display method arguments\n"},
288 {1, " Breakpoint <AmlOffset>", "Set an AML execution breakpoint\n"},
289 {1, " Call", "Run to next control method invocation\n"},
290 {1, " Debug <Namepath> [Arguments]", "Single Step a control method\n"},
291 {6, " Evaluate", "Synonym for Execute\n"},
292 {5, " Execute <Namepath> [Arguments]", "Execute control method\n"},
293 {1, " Hex Integer", "Integer method argument\n"},
294 {1, " \"Ascii String\"", "String method argument\n"},
295 {1, " (Hex Byte List)", "Buffer method argument\n"},
296 {1, " [Package Element List]", "Package method argument\n"},
297 {5, " Execute predefined", "Execute all predefined (public) methods\n"},
298 {1, " Go", "Allow method to run to completion\n"},
299 {1, " Information", "Display info about the current method\n"},
300 {1, " Into", "Step into (not over) a method call\n"},
301 {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"},
302 {1, " Locals", "Display method local variables\n"},
303 {1, " Results", "Display method result stack\n"},
304 {1, " Set <A|L> <#> <Value>", "Set method data (Arguments/Locals)\n"},
305 {1, " Stop", "Terminate control method\n"},
306 {5, " Trace <State> [<Namepath>] [Once]", "Trace control method execution\n"},
307 {1, " Enable", "Enable all messages\n"},
308 {1, " Disable", "Disable tracing\n"},
309 {1, " Method", "Enable method execution messages\n"},
310 {1, " Opcode", "Enable opcode execution messages\n"},
311 {1, " Tree", "Display control method calling tree\n"},
312 {1, " <Enter>", "Single step next AML opcode (over calls)\n"},
314 #ifdef ACPI_APPLICATION
315 {0, "\nHardware Simulation Commands:", "\n"},
316 {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"},
317 {1, " Event <F|G> <Value>", "Generate AcpiEvent (Fixed/GPE)\n"},
318 {1, " Gpe <GpeNum> [GpeBlockDevice]", "Simulate a GPE\n"},
319 {1, " Gpes", "Display info on all GPE devices\n"},
320 {1, " Sci", "Generate an SCI\n"},
321 {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"},
323 {0, "\nFile I/O Commands:", "\n"},
324 {1, " Close", "Close debug output file\n"},
325 {1, " Load <Input Filename>", "Load ACPI table from a file\n"},
326 {1, " Open <Output Filename>", "Open a file for debug output\n"},
327 {1, " Unload <Namepath>", "Unload an ACPI table via namespace object\n"},
329 {0, "\nUser Space Commands:", "\n"},
330 {1, " Terminate", "Delete namespace and all internal objects\n"},
331 {1, " Thread <Threads><Loops><NamePath>", "Spawn threads to execute method(s)\n"},
333 {0, "\nDebug Test Commands:", "\n"},
334 {3, " Test <TestName>", "Invoke a debug test\n"},
335 {1, " Objects", "Read/write/compare all namespace data objects\n"},
336 {1, " Predefined", "Execute all ACPI predefined names (_STA, etc.)\n"},
342 /*******************************************************************************
344 * FUNCTION: AcpiDbMatchCommandHelp
346 * PARAMETERS: Command - Command string to match
347 * Help - Help table entry to attempt match
349 * RETURN: TRUE if command matched, FALSE otherwise
351 * DESCRIPTION: Attempt to match a command in the help table in order to
352 * print help information for a single command.
354 ******************************************************************************/
357 AcpiDbMatchCommandHelp (
359 const ACPI_DB_COMMAND_HELP *Help)
361 char *Invocation = Help->Invocation;
365 /* Valid commands in the help table begin with a couple of spaces */
367 if (*Invocation != ' ')
372 while (*Invocation == ' ')
377 /* Match command name (full command or substring) */
379 while ((*Command) && (*Invocation) && (*Invocation != ' '))
381 if (tolower ((int) *Command) != tolower ((int) *Invocation))
390 /* Print the appropriate number of help lines */
392 LineCount = Help->LineCount;
395 AcpiOsPrintf ("%-38s : %s", Help->Invocation, Help->Description);
404 /*******************************************************************************
406 * FUNCTION: AcpiDbDisplayCommandInfo
408 * PARAMETERS: Command - Command string to match
409 * DisplayAll - Display all matching commands, or just
410 * the first one (substring match)
414 * DESCRIPTION: Display help information for a Debugger command.
416 ******************************************************************************/
419 AcpiDbDisplayCommandInfo (
423 const ACPI_DB_COMMAND_HELP *Next;
427 Next = AcpiGbl_DbCommandHelp;
428 while (Next->Invocation)
430 Matched = AcpiDbMatchCommandHelp (Command, Next);
431 if (!DisplayAll && Matched)
441 /*******************************************************************************
443 * FUNCTION: AcpiDbDisplayHelp
445 * PARAMETERS: Command - Optional command string to display help.
446 * if not specified, all debugger command
447 * help strings are displayed
451 * DESCRIPTION: Display help for a single debugger command, or all of them.
453 ******************************************************************************/
459 const ACPI_DB_COMMAND_HELP *Next = AcpiGbl_DbCommandHelp;
464 /* No argument to help, display help for all commands */
466 while (Next->Invocation)
468 AcpiOsPrintf ("%-38s%s", Next->Invocation, Next->Description);
474 /* Display help for all commands that match the subtring */
476 AcpiDbDisplayCommandInfo (Command, TRUE);
481 /*******************************************************************************
483 * FUNCTION: AcpiDbGetNextToken
485 * PARAMETERS: String - Command buffer
486 * Next - Return value, end of next token
488 * RETURN: Pointer to the start of the next token.
490 * DESCRIPTION: Command line parsing. Get the next token on the command line
492 ******************************************************************************/
498 ACPI_OBJECT_TYPE *ReturnType)
502 ACPI_OBJECT_TYPE Type = ACPI_TYPE_INTEGER;
505 /* At end of buffer? */
507 if (!String || !(*String))
512 /* Remove any spaces at the beginning */
516 while (*String && (*String == ' '))
531 /* This is a quoted string, scan until closing quote */
535 Type = ACPI_TYPE_STRING;
537 /* Find end of string */
539 while (*String && (*String != '"'))
547 /* This is the start of a buffer, scan until closing paren */
551 Type = ACPI_TYPE_BUFFER;
553 /* Find end of buffer */
555 while (*String && (*String != ')'))
563 /* This is the start of a package, scan until closing bracket */
568 Type = ACPI_TYPE_PACKAGE;
570 /* Find end of package (closing bracket) */
574 /* Handle String package elements */
578 /* Find end of string */
581 while (*String && (*String != '"'))
590 else if (*String == '[')
592 Depth++; /* A nested package declaration */
594 else if (*String == ']')
597 if (Depth == 0) /* Found final package closing bracket */
611 /* Find end of token */
613 while (*String && (*String != ' '))
635 /*******************************************************************************
637 * FUNCTION: AcpiDbGetLine
639 * PARAMETERS: InputBuffer - Command line buffer
641 * RETURN: Count of arguments to the command
643 * DESCRIPTION: Get the next command line from the user. Gets entire line
644 * up to the next newline
646 ******************************************************************************/
658 if (AcpiUtSafeStrcpy (AcpiGbl_DbParsedBuf, sizeof (AcpiGbl_DbParsedBuf),
662 "Buffer overflow while parsing input line (max %u characters)\n",
663 sizeof (AcpiGbl_DbParsedBuf));
667 This = AcpiGbl_DbParsedBuf;
668 for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
670 AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
671 &AcpiGbl_DbArgTypes[i]);
672 if (!AcpiGbl_DbArgs[i])
680 /* Uppercase the actual command */
682 AcpiUtStrupr (AcpiGbl_DbArgs[0]);
687 Count--; /* Number of args only */
694 /*******************************************************************************
696 * FUNCTION: AcpiDbMatchCommand
698 * PARAMETERS: UserCommand - User command line
700 * RETURN: Index into command array, -1 if not found
702 * DESCRIPTION: Search command array for a command match
704 ******************************************************************************/
713 if (!UserCommand || UserCommand[0] == 0)
718 for (i = CMD_FIRST_VALID; AcpiGbl_DbCommands[i].Name; i++)
721 ACPI_CAST_PTR (char, AcpiGbl_DbCommands[i].Name), UserCommand) ==
722 AcpiGbl_DbCommands[i].Name)
728 /* Command not recognized */
730 return (CMD_NOT_FOUND);
734 /*******************************************************************************
736 * FUNCTION: AcpiDbCommandDispatch
738 * PARAMETERS: InputBuffer - Command line buffer
739 * WalkState - Current walk
740 * Op - Current (executing) parse op
744 * DESCRIPTION: Command dispatcher.
746 ******************************************************************************/
749 AcpiDbCommandDispatch (
751 ACPI_WALK_STATE *WalkState,
752 ACPI_PARSE_OBJECT *Op)
758 ACPI_STATUS Status = AE_CTRL_TRUE;
761 /* If AcpiTerminate has been called, terminate this thread */
763 if (AcpiGbl_DbTerminateLoop)
765 return (AE_CTRL_TERMINATE);
768 /* Find command and add to the history buffer */
770 ParamCount = AcpiDbGetLine (InputBuffer);
771 CommandIndex = AcpiDbMatchCommand (AcpiGbl_DbArgs[0]);
775 * We don't want to add the !! command to the history buffer. It
776 * would cause an infinite loop because it would always be the
779 if (CommandIndex != CMD_HISTORY_LAST)
781 AcpiDbAddToHistory (InputBuffer);
784 /* Verify that we have the minimum number of params */
786 if (ParamCount < AcpiGbl_DbCommands[CommandIndex].MinArgs)
788 AcpiOsPrintf ("%u parameters entered, [%s] requires %u parameters\n",
789 ParamCount, AcpiGbl_DbCommands[CommandIndex].Name,
790 AcpiGbl_DbCommands[CommandIndex].MinArgs);
792 AcpiDbDisplayCommandInfo (
793 AcpiGbl_DbCommands[CommandIndex].Name, FALSE);
794 return (AE_CTRL_TRUE);
797 /* Decode and dispatch the command */
799 switch (CommandIndex)
809 case CMD_ALLOCATIONS:
811 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
812 AcpiUtDumpAllocations ((UINT32) -1, NULL);
819 AcpiDbDisplayArguments ();
824 AcpiDbSetMethodBreakpoint (AcpiGbl_DbArgs[1], WalkState, Op);
834 AcpiDbSetMethodCallBreakpoint (Op);
840 AcpiDbExecute (AcpiGbl_DbArgs[1],
841 &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_SINGLE_STEP);
844 case CMD_DISASSEMBLE:
847 (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]);
852 AcpiDbDecodeAndDisplayObject (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
858 AcpiDbExecute (AcpiGbl_DbArgs[1],
859 &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP);
864 Status = AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]);
869 AcpiGbl_CmSingleStep = FALSE;
874 AcpiDbDisplayHandlers ();
880 AcpiDbDisplayHelp (AcpiGbl_DbArgs[1]);
885 AcpiDbDisplayHistory ();
888 case CMD_HISTORY_EXE: /* ! command */
890 CommandLine = AcpiDbGetFromHistory (AcpiGbl_DbArgs[1]);
893 return (AE_CTRL_TRUE);
896 Status = AcpiDbCommandDispatch (CommandLine, WalkState, Op);
899 case CMD_HISTORY_LAST: /* !! command */
901 CommandLine = AcpiDbGetFromHistory (NULL);
904 return (AE_CTRL_TRUE);
907 Status = AcpiDbCommandDispatch (CommandLine, WalkState, Op);
910 case CMD_INFORMATION:
912 AcpiDbDisplayMethodInfo (Op);
917 AcpiDbCheckIntegrity ();
924 AcpiGbl_CmSingleStep = TRUE;
934 "Current debug level for file output is: %8.8lX\n",
935 AcpiGbl_DbDebugLevel);
937 "Current debug level for console output is: %8.8lX\n",
938 AcpiGbl_DbConsoleDebugLevel);
940 else if (ParamCount == 2)
942 Temp = AcpiGbl_DbConsoleDebugLevel;
943 AcpiGbl_DbConsoleDebugLevel =
944 strtoul (AcpiGbl_DbArgs[1], NULL, 16);
946 "Debug Level for console output was %8.8lX, now %8.8lX\n",
947 Temp, AcpiGbl_DbConsoleDebugLevel);
951 Temp = AcpiGbl_DbDebugLevel;
952 AcpiGbl_DbDebugLevel = strtoul (AcpiGbl_DbArgs[1], NULL, 16);
954 "Debug Level for file output was %8.8lX, now %8.8lX\n",
955 Temp, AcpiGbl_DbDebugLevel);
961 AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op);
966 AcpiDbDisplayLocks ();
971 AcpiDbDisplayLocals ();
976 Status = AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]);
981 AcpiDbDumpNamespace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
986 Temp = strtoul (AcpiGbl_DbArgs[2], NULL, 0);
987 AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp);
992 AcpiUtStrupr (AcpiGbl_DbArgs[1]);
993 Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
998 AcpiDbDisplayInterfaces (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
1003 AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
1008 AcpiDbDumpNamespacePaths ();
1013 AcpiDbSetScope (AcpiGbl_DbArgs[1]);
1016 case CMD_REFERENCES:
1018 AcpiDbFindReferences (AcpiGbl_DbArgs[1]);
1023 AcpiDbDisplayResources (AcpiGbl_DbArgs[1]);
1028 AcpiDbDisplayResults ();
1033 AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
1039 Status = AcpiDbDisplayStatistics (AcpiGbl_DbArgs[1]);
1044 return (AE_NOT_IMPLEMENTED);
1048 AcpiDbDisplayTableInfo (AcpiGbl_DbArgs[1]);
1053 AcpiDbDisplayTemplate (AcpiGbl_DbArgs[1]);
1058 AcpiDbTrace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]);
1063 AcpiDbDisplayCallingTree ();
1068 AcpiDbDisplayObjectType (AcpiGbl_DbArgs[1]);
1071 #ifdef ACPI_APPLICATION
1073 /* Hardware simulation commands. */
1075 case CMD_ENABLEACPI:
1076 #if (!ACPI_REDUCED_HARDWARE)
1078 Status = AcpiEnable();
1079 if (ACPI_FAILURE(Status))
1081 AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status);
1084 #endif /* !ACPI_REDUCED_HARDWARE */
1089 AcpiOsPrintf ("Event command not implemented\n");
1094 AcpiDbGenerateGpe (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
1099 AcpiDbDisplayGpes ();
1104 AcpiDbGenerateSci ();
1109 Status = AcpiDbSleep (AcpiGbl_DbArgs[1]);
1112 /* File I/O commands. */
1116 AcpiDbCloseDebugFile ();
1121 ACPI_NEW_TABLE_DESC *ListHead = NULL;
1123 Status = AcGetAllTablesFromFile (AcpiGbl_DbArgs[1],
1124 ACPI_GET_ALL_TABLES, &ListHead);
1125 if (ACPI_SUCCESS (Status))
1127 AcpiDbLoadTables (ListHead);
1134 AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]);
1137 /* User space commands. */
1141 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1142 AcpiUtSubsystemShutdown ();
1145 * TBD: [Restructure] Need some way to re-initialize without
1146 * re-creating the semaphores!
1149 AcpiGbl_DbTerminateLoop = TRUE;
1150 /* AcpiInitialize (NULL); */
1155 AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
1159 /* Debug test commands. */
1161 case CMD_PREDEFINED:
1163 AcpiDbCheckPredefinedNames ();
1168 AcpiDbExecuteTest (AcpiGbl_DbArgs[1]);
1173 AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]);
1182 AcpiOsPrintf ("Method execution terminated\n");
1183 return (AE_CTRL_TERMINATE);
1186 if (!AcpiGbl_DbOutputToFile)
1188 AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
1191 #ifdef ACPI_APPLICATION
1192 AcpiDbCloseDebugFile ();
1194 AcpiGbl_DbTerminateLoop = TRUE;
1195 return (AE_CTRL_TERMINATE);
1200 AcpiOsPrintf ("%s: unknown command\n", AcpiGbl_DbArgs[0]);
1201 return (AE_CTRL_TRUE);
1204 if (ACPI_SUCCESS (Status))
1206 Status = AE_CTRL_TRUE;
1213 /*******************************************************************************
1215 * FUNCTION: AcpiDbExecuteThread
1217 * PARAMETERS: Context - Not used
1221 * DESCRIPTION: Debugger execute thread. Waits for a command line, then
1222 * simply dispatches it.
1224 ******************************************************************************/
1226 void ACPI_SYSTEM_XFACE
1227 AcpiDbExecuteThread (
1231 (void) AcpiDbUserCommands ();
1232 AcpiGbl_DbThreadsTerminated = TRUE;
1236 /*******************************************************************************
1238 * FUNCTION: AcpiDbUserCommands
1244 * DESCRIPTION: Command line execution for the AML debugger. Commands are
1245 * matched and dispatched here.
1247 ******************************************************************************/
1250 AcpiDbUserCommands (
1253 ACPI_STATUS Status = AE_OK;
1256 AcpiOsPrintf ("\n");
1258 /* TBD: [Restructure] Need a separate command line buffer for step mode */
1260 while (!AcpiGbl_DbTerminateLoop)
1262 /* Wait the readiness of the command */
1264 Status = AcpiOsWaitCommandReady ();
1265 if (ACPI_FAILURE (Status))
1270 /* Just call to the command line interpreter */
1272 AcpiGbl_MethodExecuting = FALSE;
1273 AcpiGbl_StepToNextCall = FALSE;
1275 (void) AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL);
1277 /* Notify the completion of the command */
1279 Status = AcpiOsNotifyCommandComplete ();
1280 if (ACPI_FAILURE (Status))
1286 if (ACPI_FAILURE (Status) && Status != AE_CTRL_TERMINATE)
1288 ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));