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 <acpi/acpi.h>
48 #ifdef ACPI_APPLICATION
52 #define _COMPONENT ACPI_CA_DEBUGGER
53 ACPI_MODULE_NAME("dbinput")
55 /* Local prototypes */
56 static u32
acpi_db_get_line(char *input_buffer
);
58 static u32
acpi_db_match_command(char *user_command
);
60 static void acpi_db_display_command_info(char *command
, u8 display_all
);
62 static void acpi_db_display_help(char *command
);
65 acpi_db_match_command_help(char *command
,
66 const struct acpi_db_command_help
*help
);
69 * Top-level debugger commands.
71 * This list of commands must match the string table below it
73 enum acpi_ex_debugger_commands
{
125 #ifdef ACPI_APPLICATION
145 #define CMD_FIRST_VALID 2
147 /* Second parameter is the required argument count */
149 static const struct acpi_db_command_info acpi_gbl_db_commands
[] = {
201 #ifdef ACPI_APPLICATION
223 * Help for all debugger commands. First argument is the number of lines
224 * of help to output for the command.
226 static const struct acpi_db_command_help acpi_gbl_db_command_help
[] = {
227 {0, "\nGeneral-Purpose Commands:", "\n"},
228 {1, " Allocations", "Display list of current memory allocations\n"},
229 {2, " Dump <Address>|<Namepath>", "\n"},
230 {0, " [Byte|Word|Dword|Qword]",
231 "Display ACPI objects or memory\n"},
232 {1, " Handlers", "Info about global handlers\n"},
233 {1, " Help [Command]", "This help screen or individual command\n"},
234 {1, " History", "Display command history buffer\n"},
235 {1, " Level <DebugLevel>] [console]",
236 "Get/Set debug level for file or console\n"},
237 {1, " Locks", "Current status of internal mutexes\n"},
238 {1, " Osi [Install|Remove <name>]",
239 "Display or modify global _OSI list\n"},
240 {1, " Quit or Exit", "Exit this command\n"},
241 {8, " Stats <SubCommand>",
242 "Display namespace and memory statistics\n"},
243 {1, " Allocations", "Display list of current memory allocations\n"},
244 {1, " Memory", "Dump internal memory lists\n"},
245 {1, " Misc", "Namespace search and mutex stats\n"},
246 {1, " Objects", "Summary of namespace objects\n"},
247 {1, " Sizes", "Sizes for each of the internal objects\n"},
248 {1, " Stack", "Display CPU stack usage\n"},
249 {1, " Tables", "Info about current ACPI table(s)\n"},
250 {1, " Tables", "Display info about loaded ACPI tables\n"},
251 {1, " ! <CommandNumber>", "Execute command from history buffer\n"},
252 {1, " !!", "Execute last command again\n"},
254 {0, "\nNamespace Access Commands:", "\n"},
255 {1, " Businfo", "Display system bus info\n"},
256 {1, " Disassemble <Method>", "Disassemble a control method\n"},
257 {1, " Find <AcpiName> (? is wildcard)",
258 "Find ACPI name(s) with wildcards\n"},
259 {1, " Integrity", "Validate namespace integrity\n"},
260 {1, " Methods", "Display list of loaded control methods\n"},
261 {1, " Namespace [Object] [Depth]",
262 "Display loaded namespace tree/subtree\n"},
263 {1, " Notify <Object> <Value>", "Send a notification on Object\n"},
264 {1, " Objects [ObjectType]",
265 "Display summary of all objects or just given type\n"},
266 {1, " Owner <OwnerId> [Depth]",
267 "Display loaded namespace by object owner\n"},
268 {1, " Paths", "Display full pathnames of namespace objects\n"},
269 {1, " Predefined", "Check all predefined names\n"},
270 {1, " Prefix [<Namepath>]", "Set or Get current execution prefix\n"},
271 {1, " References <Addr>", "Find all references to object at addr\n"},
272 {1, " Resources [DeviceName]",
273 "Display Device resources (no arg = all devices)\n"},
274 {1, " Set N <NamedObject> <Value>", "Set value for named integer\n"},
275 {1, " Template <Object>", "Format/dump a Buffer/ResourceTemplate\n"},
276 {1, " Type <Object>", "Display object type\n"},
278 {0, "\nControl Method Execution Commands:", "\n"},
279 {1, " Arguments (or Args)", "Display method arguments\n"},
280 {1, " Breakpoint <AmlOffset>", "Set an AML execution breakpoint\n"},
281 {1, " Call", "Run to next control method invocation\n"},
282 {1, " Debug <Namepath> [Arguments]", "Single Step a control method\n"},
283 {6, " Evaluate", "Synonym for Execute\n"},
284 {5, " Execute <Namepath> [Arguments]", "Execute control method\n"},
285 {1, " Hex Integer", "Integer method argument\n"},
286 {1, " \"Ascii String\"", "String method argument\n"},
287 {1, " (Hex Byte List)", "Buffer method argument\n"},
288 {1, " [Package Element List]", "Package method argument\n"},
289 {1, " Go", "Allow method to run to completion\n"},
290 {1, " Information", "Display info about the current method\n"},
291 {1, " Into", "Step into (not over) a method call\n"},
292 {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"},
293 {1, " Locals", "Display method local variables\n"},
294 {1, " Results", "Display method result stack\n"},
295 {1, " Set <A|L> <#> <Value>", "Set method data (Arguments/Locals)\n"},
296 {1, " Stop", "Terminate control method\n"},
297 {5, " Trace <State> [<Namepath>] [Once]",
298 "Trace control method execution\n"},
299 {1, " Enable", "Enable all messages\n"},
300 {1, " Disable", "Disable tracing\n"},
301 {1, " Method", "Enable method execution messages\n"},
302 {1, " Opcode", "Enable opcode execution messages\n"},
303 {1, " Tree", "Display control method calling tree\n"},
304 {1, " <Enter>", "Single step next AML opcode (over calls)\n"},
306 #ifdef ACPI_APPLICATION
307 {0, "\nHardware Simulation Commands:", "\n"},
308 {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"},
309 {1, " Event <F|G> <Value>", "Generate AcpiEvent (Fixed/GPE)\n"},
310 {1, " Gpe <GpeNum> [GpeBlockDevice]", "Simulate a GPE\n"},
311 {1, " Gpes", "Display info on all GPE devices\n"},
312 {1, " Sci", "Generate an SCI\n"},
313 {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"},
315 {0, "\nFile I/O Commands:", "\n"},
316 {1, " Close", "Close debug output file\n"},
317 {1, " Load <Input Filename>", "Load ACPI table from a file\n"},
318 {1, " Open <Output Filename>", "Open a file for debug output\n"},
319 {1, " Unload <Namepath>",
320 "Unload an ACPI table via namespace object\n"},
322 {0, "\nUser Space Commands:", "\n"},
323 {1, " Terminate", "Delete namespace and all internal objects\n"},
324 {1, " Thread <Threads><Loops><NamePath>",
325 "Spawn threads to execute method(s)\n"},
327 {0, "\nDebug Test Commands:", "\n"},
328 {3, " Test <TestName>", "Invoke a debug test\n"},
329 {1, " Objects", "Read/write/compare all namespace data objects\n"},
331 "Execute all ACPI predefined names (_STA, etc.)\n"},
336 /*******************************************************************************
338 * FUNCTION: acpi_db_match_command_help
340 * PARAMETERS: command - Command string to match
341 * help - Help table entry to attempt match
343 * RETURN: TRUE if command matched, FALSE otherwise
345 * DESCRIPTION: Attempt to match a command in the help table in order to
346 * print help information for a single command.
348 ******************************************************************************/
351 acpi_db_match_command_help(char *command
,
352 const struct acpi_db_command_help
*help
)
354 char *invocation
= help
->invocation
;
357 /* Valid commands in the help table begin with a couple of spaces */
359 if (*invocation
!= ' ') {
363 while (*invocation
== ' ') {
367 /* Match command name (full command or substring) */
369 while ((*command
) && (*invocation
) && (*invocation
!= ' ')) {
370 if (tolower((int)*command
) != tolower((int)*invocation
)) {
378 /* Print the appropriate number of help lines */
380 line_count
= help
->line_count
;
382 acpi_os_printf("%-38s : %s", help
->invocation
,
391 /*******************************************************************************
393 * FUNCTION: acpi_db_display_command_info
395 * PARAMETERS: command - Command string to match
396 * display_all - Display all matching commands, or just
397 * the first one (substring match)
401 * DESCRIPTION: Display help information for a Debugger command.
403 ******************************************************************************/
405 static void acpi_db_display_command_info(char *command
, u8 display_all
)
407 const struct acpi_db_command_help
*next
;
410 next
= acpi_gbl_db_command_help
;
411 while (next
->invocation
) {
412 matched
= acpi_db_match_command_help(command
, next
);
413 if (!display_all
&& matched
) {
421 /*******************************************************************************
423 * FUNCTION: acpi_db_display_help
425 * PARAMETERS: command - Optional command string to display help.
426 * if not specified, all debugger command
427 * help strings are displayed
431 * DESCRIPTION: Display help for a single debugger command, or all of them.
433 ******************************************************************************/
435 static void acpi_db_display_help(char *command
)
437 const struct acpi_db_command_help
*next
= acpi_gbl_db_command_help
;
441 /* No argument to help, display help for all commands */
443 while (next
->invocation
) {
444 acpi_os_printf("%-38s%s", next
->invocation
,
449 /* Display help for all commands that match the subtring */
451 acpi_db_display_command_info(command
, TRUE
);
455 /*******************************************************************************
457 * FUNCTION: acpi_db_get_next_token
459 * PARAMETERS: string - Command buffer
460 * next - Return value, end of next token
462 * RETURN: Pointer to the start of the next token.
464 * DESCRIPTION: Command line parsing. Get the next token on the command line
466 ******************************************************************************/
468 char *acpi_db_get_next_token(char *string
,
469 char **next
, acpi_object_type
* return_type
)
473 acpi_object_type type
= ACPI_TYPE_INTEGER
;
475 /* At end of buffer? */
477 if (!string
|| !(*string
)) {
481 /* Remove any spaces at the beginning */
483 if (*string
== ' ') {
484 while (*string
&& (*string
== ' ')) {
496 /* This is a quoted string, scan until closing quote */
500 type
= ACPI_TYPE_STRING
;
502 /* Find end of string */
504 while (*string
&& (*string
!= '"')) {
511 /* This is the start of a buffer, scan until closing paren */
515 type
= ACPI_TYPE_BUFFER
;
517 /* Find end of buffer */
519 while (*string
&& (*string
!= ')')) {
526 /* This is the start of a package, scan until closing bracket */
531 type
= ACPI_TYPE_PACKAGE
;
533 /* Find end of package (closing bracket) */
537 /* Handle String package elements */
539 if (*string
== '"') {
540 /* Find end of string */
543 while (*string
&& (*string
!= '"')) {
549 } else if (*string
== '[') {
550 depth
++; /* A nested package declaration */
551 } else if (*string
== ']') {
553 if (depth
== 0) { /* Found final package closing bracket */
566 /* Find end of token */
568 while (*string
&& (*string
!= ' ')) {
585 /*******************************************************************************
587 * FUNCTION: acpi_db_get_line
589 * PARAMETERS: input_buffer - Command line buffer
591 * RETURN: Count of arguments to the command
593 * DESCRIPTION: Get the next command line from the user. Gets entire line
594 * up to the next newline
596 ******************************************************************************/
598 static u32
acpi_db_get_line(char *input_buffer
)
605 if (acpi_ut_safe_strcpy
606 (acpi_gbl_db_parsed_buf
, sizeof(acpi_gbl_db_parsed_buf
),
609 ("Buffer overflow while parsing input line (max %u characters)\n",
610 sizeof(acpi_gbl_db_parsed_buf
));
614 this = acpi_gbl_db_parsed_buf
;
615 for (i
= 0; i
< ACPI_DEBUGGER_MAX_ARGS
; i
++) {
616 acpi_gbl_db_args
[i
] = acpi_db_get_next_token(this, &next
,
617 &acpi_gbl_db_arg_types
619 if (!acpi_gbl_db_args
[i
]) {
626 /* Uppercase the actual command */
628 acpi_ut_strupr(acpi_gbl_db_args
[0]);
632 count
--; /* Number of args only */
638 /*******************************************************************************
640 * FUNCTION: acpi_db_match_command
642 * PARAMETERS: user_command - User command line
644 * RETURN: Index into command array, -1 if not found
646 * DESCRIPTION: Search command array for a command match
648 ******************************************************************************/
650 static u32
acpi_db_match_command(char *user_command
)
654 if (!user_command
|| user_command
[0] == 0) {
658 for (i
= CMD_FIRST_VALID
; acpi_gbl_db_commands
[i
].name
; i
++) {
659 if (strstr(acpi_gbl_db_commands
[i
].name
, user_command
) ==
660 acpi_gbl_db_commands
[i
].name
) {
665 /* Command not recognized */
667 return (CMD_NOT_FOUND
);
670 /*******************************************************************************
672 * FUNCTION: acpi_db_command_dispatch
674 * PARAMETERS: input_buffer - Command line buffer
675 * walk_state - Current walk
676 * op - Current (executing) parse op
680 * DESCRIPTION: Command dispatcher.
682 ******************************************************************************/
685 acpi_db_command_dispatch(char *input_buffer
,
686 struct acpi_walk_state
* walk_state
,
687 union acpi_parse_object
* op
)
693 acpi_status status
= AE_CTRL_TRUE
;
695 /* If acpi_terminate has been called, terminate this thread */
697 if (acpi_gbl_db_terminate_loop
) {
698 return (AE_CTRL_TERMINATE
);
701 /* Find command and add to the history buffer */
703 param_count
= acpi_db_get_line(input_buffer
);
704 command_index
= acpi_db_match_command(acpi_gbl_db_args
[0]);
708 * We don't want to add the !! command to the history buffer. It
709 * would cause an infinite loop because it would always be the
712 if (command_index
!= CMD_HISTORY_LAST
) {
713 acpi_db_add_to_history(input_buffer
);
716 /* Verify that we have the minimum number of params */
718 if (param_count
< acpi_gbl_db_commands
[command_index
].min_args
) {
720 ("%u parameters entered, [%s] requires %u parameters\n",
721 param_count
, acpi_gbl_db_commands
[command_index
].name
,
722 acpi_gbl_db_commands
[command_index
].min_args
);
724 acpi_db_display_command_info(acpi_gbl_db_commands
725 [command_index
].name
, FALSE
);
726 return (AE_CTRL_TRUE
);
729 /* Decode and dispatch the command */
731 switch (command_index
) {
739 case CMD_ALLOCATIONS
:
741 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
742 acpi_ut_dump_allocations((u32
)-1, NULL
);
749 acpi_db_display_arguments();
754 acpi_db_set_method_breakpoint(acpi_gbl_db_args
[1], walk_state
,
760 acpi_db_get_bus_info();
765 acpi_db_set_method_call_breakpoint(op
);
771 acpi_db_execute(acpi_gbl_db_args
[1],
772 &acpi_gbl_db_args
[2], &acpi_gbl_db_arg_types
[2],
776 case CMD_DISASSEMBLE
:
779 (void)acpi_db_disassemble_method(acpi_gbl_db_args
[1]);
784 acpi_db_decode_and_display_object(acpi_gbl_db_args
[1],
785 acpi_gbl_db_args
[2]);
791 acpi_db_execute(acpi_gbl_db_args
[1],
792 &acpi_gbl_db_args
[2], &acpi_gbl_db_arg_types
[2],
798 status
= acpi_db_find_name_in_namespace(acpi_gbl_db_args
[1]);
803 acpi_gbl_cm_single_step
= FALSE
;
808 acpi_db_display_handlers();
814 acpi_db_display_help(acpi_gbl_db_args
[1]);
819 acpi_db_display_history();
822 case CMD_HISTORY_EXE
: /* ! command */
824 command_line
= acpi_db_get_from_history(acpi_gbl_db_args
[1]);
826 return (AE_CTRL_TRUE
);
829 status
= acpi_db_command_dispatch(command_line
, walk_state
, op
);
832 case CMD_HISTORY_LAST
: /* !! command */
834 command_line
= acpi_db_get_from_history(NULL
);
836 return (AE_CTRL_TRUE
);
839 status
= acpi_db_command_dispatch(command_line
, walk_state
, op
);
842 case CMD_INFORMATION
:
844 acpi_db_display_method_info(op
);
849 acpi_db_check_integrity();
855 acpi_gbl_cm_single_step
= TRUE
;
862 if (param_count
== 0) {
864 ("Current debug level for file output is: %8.8lX\n",
865 acpi_gbl_db_debug_level
);
867 ("Current debug level for console output is: %8.8lX\n",
868 acpi_gbl_db_console_debug_level
);
869 } else if (param_count
== 2) {
870 temp
= acpi_gbl_db_console_debug_level
;
871 acpi_gbl_db_console_debug_level
=
872 strtoul(acpi_gbl_db_args
[1], NULL
, 16);
874 ("Debug Level for console output was %8.8lX, now %8.8lX\n",
875 temp
, acpi_gbl_db_console_debug_level
);
877 temp
= acpi_gbl_db_debug_level
;
878 acpi_gbl_db_debug_level
=
879 strtoul(acpi_gbl_db_args
[1], NULL
, 16);
881 ("Debug Level for file output was %8.8lX, now %8.8lX\n",
882 temp
, acpi_gbl_db_debug_level
);
888 acpi_db_disassemble_aml(acpi_gbl_db_args
[1], op
);
893 acpi_db_display_locks();
898 acpi_db_display_locals();
903 status
= acpi_db_display_objects("METHOD", acpi_gbl_db_args
[1]);
908 acpi_db_dump_namespace(acpi_gbl_db_args
[1],
909 acpi_gbl_db_args
[2]);
914 temp
= strtoul(acpi_gbl_db_args
[2], NULL
, 0);
915 acpi_db_send_notify(acpi_gbl_db_args
[1], temp
);
920 acpi_ut_strupr(acpi_gbl_db_args
[1]);
922 acpi_db_display_objects(acpi_gbl_db_args
[1],
923 acpi_gbl_db_args
[2]);
928 acpi_db_display_interfaces(acpi_gbl_db_args
[1],
929 acpi_gbl_db_args
[2]);
934 acpi_db_dump_namespace_by_owner(acpi_gbl_db_args
[1],
935 acpi_gbl_db_args
[2]);
940 acpi_db_dump_namespace_paths();
945 acpi_db_set_scope(acpi_gbl_db_args
[1]);
950 acpi_db_find_references(acpi_gbl_db_args
[1]);
955 acpi_db_display_resources(acpi_gbl_db_args
[1]);
960 acpi_db_display_results();
965 acpi_db_set_method_data(acpi_gbl_db_args
[1],
967 acpi_gbl_db_args
[3]);
972 status
= acpi_db_display_statistics(acpi_gbl_db_args
[1]);
977 return (AE_NOT_IMPLEMENTED
);
981 acpi_db_display_table_info(acpi_gbl_db_args
[1]);
986 acpi_db_display_template(acpi_gbl_db_args
[1]);
991 acpi_db_trace(acpi_gbl_db_args
[1], acpi_gbl_db_args
[2],
992 acpi_gbl_db_args
[3]);
997 acpi_db_display_calling_tree();
1002 acpi_db_display_object_type(acpi_gbl_db_args
[1]);
1005 #ifdef ACPI_APPLICATION
1007 /* Hardware simulation commands. */
1009 case CMD_ENABLEACPI
:
1010 #if (!ACPI_REDUCED_HARDWARE)
1012 status
= acpi_enable();
1013 if (ACPI_FAILURE(status
)) {
1014 acpi_os_printf("AcpiEnable failed (Status=%X)\n",
1018 #endif /* !ACPI_REDUCED_HARDWARE */
1023 acpi_os_printf("Event command not implemented\n");
1028 acpi_db_generate_gpe(acpi_gbl_db_args
[1], acpi_gbl_db_args
[2]);
1033 acpi_db_display_gpes();
1038 acpi_db_generate_sci();
1043 status
= acpi_db_sleep(acpi_gbl_db_args
[1]);
1046 /* File I/O commands. */
1050 acpi_db_close_debug_file();
1054 struct acpi_new_table_desc
*list_head
= NULL
;
1057 ac_get_all_tables_from_file(acpi_gbl_db_args
[1],
1058 ACPI_GET_ALL_TABLES
,
1060 if (ACPI_SUCCESS(status
)) {
1061 acpi_db_load_tables(list_head
);
1068 acpi_db_open_debug_file(acpi_gbl_db_args
[1]);
1071 /* User space commands. */
1075 acpi_db_set_output_destination(ACPI_DB_REDIRECTABLE_OUTPUT
);
1076 acpi_ut_subsystem_shutdown();
1079 * TBD: [Restructure] Need some way to re-initialize without
1080 * re-creating the semaphores!
1083 acpi_gbl_db_terminate_loop
= TRUE
;
1084 /* acpi_initialize (NULL); */
1089 acpi_db_create_execution_threads(acpi_gbl_db_args
[1],
1090 acpi_gbl_db_args
[2],
1091 acpi_gbl_db_args
[3]);
1094 /* Debug test commands. */
1096 case CMD_PREDEFINED
:
1098 acpi_db_check_predefined_names();
1103 acpi_db_execute_test(acpi_gbl_db_args
[1]);
1108 acpi_db_unload_acpi_table(acpi_gbl_db_args
[1]);
1116 acpi_os_printf("Method execution terminated\n");
1117 return (AE_CTRL_TERMINATE
);
1120 if (!acpi_gbl_db_output_to_file
) {
1121 acpi_dbg_level
= ACPI_DEBUG_DEFAULT
;
1123 #ifdef ACPI_APPLICATION
1124 acpi_db_close_debug_file();
1126 acpi_gbl_db_terminate_loop
= TRUE
;
1127 return (AE_CTRL_TERMINATE
);
1132 acpi_os_printf("%s: unknown command\n", acpi_gbl_db_args
[0]);
1133 return (AE_CTRL_TRUE
);
1136 if (ACPI_SUCCESS(status
)) {
1137 status
= AE_CTRL_TRUE
;
1143 /*******************************************************************************
1145 * FUNCTION: acpi_db_execute_thread
1147 * PARAMETERS: context - Not used
1151 * DESCRIPTION: Debugger execute thread. Waits for a command line, then
1152 * simply dispatches it.
1154 ******************************************************************************/
1156 void ACPI_SYSTEM_XFACE
acpi_db_execute_thread(void *context
)
1159 (void)acpi_db_user_commands();
1160 acpi_gbl_db_threads_terminated
= TRUE
;
1163 /*******************************************************************************
1165 * FUNCTION: acpi_db_user_commands
1171 * DESCRIPTION: Command line execution for the AML debugger. Commands are
1172 * matched and dispatched here.
1174 ******************************************************************************/
1176 acpi_status
acpi_db_user_commands(void)
1178 acpi_status status
= AE_OK
;
1180 acpi_os_printf("\n");
1182 /* TBD: [Restructure] Need a separate command line buffer for step mode */
1184 while (!acpi_gbl_db_terminate_loop
) {
1186 /* Wait the readiness of the command */
1188 status
= acpi_os_wait_command_ready();
1189 if (ACPI_FAILURE(status
)) {
1193 /* Just call to the command line interpreter */
1195 acpi_gbl_method_executing
= FALSE
;
1196 acpi_gbl_step_to_next_call
= FALSE
;
1198 (void)acpi_db_command_dispatch(acpi_gbl_db_line_buf
, NULL
,
1201 /* Notify the completion of the command */
1203 status
= acpi_os_notify_command_complete();
1204 if (ACPI_FAILURE(status
)) {
1209 if (ACPI_FAILURE(status
) && status
!= AE_CTRL_TERMINATE
) {
1210 ACPI_EXCEPTION((AE_INFO
, status
, "While parsing command line"));