1 /******************************************************************************
3 * Name: acdebug.h - ACPI/AML debugger
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2004, R. Byron Moore
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.
48 #define ACPI_DEBUG_BUFFER_SIZE 4196
52 char *name; /* Command Name */
53 u8 min_args; /* Minimum arguments required */
59 char *name; /* Argument Name */
63 #define PARAM_LIST(pl) pl
65 #define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
67 #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
68 acpi_os_printf PARAM_LIST(fp);}
70 #define EX_NO_SINGLE_STEP 1
71 #define EX_SINGLE_STEP 2
78 * dbxface - external debugger interfaces
91 struct acpi_walk_state *walk_state,
92 union acpi_parse_object *op,
96 acpi_db_start_command (
97 struct acpi_walk_state *walk_state,
98 union acpi_parse_object *op);
102 struct acpi_walk_state *walk_state);
106 * dbcmds - debug commands and output routines
110 acpi_db_display_table_info (
114 acpi_db_unload_acpi_table (
119 acpi_db_set_method_breakpoint (
121 struct acpi_walk_state *walk_state,
122 union acpi_parse_object *op);
125 acpi_db_set_method_call_breakpoint (
126 union acpi_parse_object *op);
129 acpi_db_disassemble_aml (
131 union acpi_parse_object *op);
134 acpi_db_dump_namespace (
139 acpi_db_dump_namespace_by_owner (
144 acpi_db_send_notify (
149 acpi_db_set_method_data (
155 acpi_db_display_objects (
157 char *display_count_arg);
160 acpi_db_find_name_in_namespace (
168 acpi_db_find_references (
172 acpi_db_display_locks (void);
176 acpi_db_display_resources (
180 acpi_db_display_gpes (void);
183 acpi_db_check_integrity (
187 acpi_db_integrity_walk (
188 acpi_handle obj_handle,
191 void **return_value);
194 acpi_db_walk_and_match_name (
195 acpi_handle obj_handle,
198 void **return_value);
201 acpi_db_walk_for_references (
202 acpi_handle obj_handle,
205 void **return_value);
208 acpi_db_walk_for_specific_objects (
209 acpi_handle obj_handle,
212 void **return_value);
215 acpi_db_generate_gpe (
220 * dbdisply - debug display commands
224 acpi_db_display_method_info (
225 union acpi_parse_object *op);
228 acpi_db_decode_and_display_object (
233 acpi_db_display_result_object (
234 union acpi_operand_object *obj_desc,
235 struct acpi_walk_state *walk_state);
238 acpi_db_display_all_methods (
239 char *display_count_arg);
242 acpi_db_display_arguments (
246 acpi_db_display_locals (
250 acpi_db_display_results (
254 acpi_db_display_calling_tree (
258 acpi_db_display_object_type (
262 acpi_db_display_argument_object (
263 union acpi_operand_object *obj_desc,
264 struct acpi_walk_state *walk_state);
267 acpi_db_dump_parser_descriptor (
268 union acpi_parse_object *op);
271 acpi_db_get_pointer (
276 * dbexec - debugger control method execution
286 acpi_db_create_execution_threads (
287 char *num_threads_arg,
289 char *method_name_arg);
292 acpi_db_execute_method (
293 struct acpi_db_method_info *info,
294 struct acpi_buffer *return_obj);
297 acpi_db_execute_setup (
298 struct acpi_db_method_info *info);
301 acpi_db_get_outstanding_allocations (
304 void ACPI_SYSTEM_XFACE
305 acpi_db_method_thread (
309 acpi_db_execution_walk (
310 acpi_handle obj_handle,
313 void **return_value);
317 * dbfileio - Debugger file I/O commands
321 acpi_db_match_argument (
323 struct argument_info *arguments);
326 ae_local_load_table (
327 struct acpi_table_header *table_ptr);
330 acpi_db_close_debug_file (
334 acpi_db_open_debug_file (
338 acpi_db_load_acpi_table (
342 acpi_db_get_table_from_file (
344 struct acpi_table_header **table);
347 acpi_db_read_table_from_file (
349 struct acpi_table_header **table);
352 * dbhistry - debugger HISTORY command
356 acpi_db_add_to_history (
360 acpi_db_display_history (void);
363 acpi_db_get_from_history (
364 char *command_num_arg);
368 * dbinput - user front-end to the AML debugger
372 acpi_db_command_dispatch (
374 struct acpi_walk_state *walk_state,
375 union acpi_parse_object *op);
377 void ACPI_SYSTEM_XFACE
378 acpi_db_execute_thread (
382 acpi_db_user_commands (
384 union acpi_parse_object *op);
387 acpi_db_display_help (
391 acpi_db_get_next_token (
400 acpi_db_match_command (
404 acpi_db_single_thread (
409 * dbstats - Generation and display of ACPI table statistics
413 acpi_db_generate_statistics (
414 union acpi_parse_object *root,
419 acpi_db_display_statistics (
423 acpi_db_classify_one_object (
424 acpi_handle obj_handle,
427 void **return_value);
430 acpi_db_count_namespace_objects (
434 acpi_db_enumerate_object (
435 union acpi_operand_object *obj_desc);
439 * dbutils - AML debugger utilities
443 acpi_db_set_output_destination (
447 acpi_db_dump_buffer (
451 acpi_db_dump_object (
452 union acpi_object *obj_desc,
456 acpi_db_prep_namestring (
461 acpi_db_second_pass_parse (
462 union acpi_parse_object *root);
464 struct acpi_namespace_node *
465 acpi_db_local_ns_lookup (
469 #endif /* __ACDEBUG_H__ */